[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221121071704.GC23882@lst.de>
Date: Mon, 21 Nov 2022 08:17:04 +0100
From: Christoph Hellwig <hch@....de>
To: David Howells <dhowells@...hat.com>
Cc: linux-afs@...ts.infradead.org,
Marc Dionne <marc.dionne@...istor.com>,
Christoph Hellwig <hch@....de>,
Matthew Wilcox <willy@...radead.org>,
Theodore Ts'o <tytso@....edu>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] afs: Stop implementing ->writepage()
On Fri, Nov 18, 2022 at 10:37:35AM +0000, David Howells wrote:
> A hint flag is added to the writeback_control struct so that a filesystem
> can say that the write is triggered by write_begin seeing a conflicting
> write. This causes do_writepages() to do a single pass of the loop only.
Not a huge fan of that, especially as write_begin is not really a
method, but just an awkward hook in legacy write implementations.
I'd much rather have a private pointer in the writeback_control and
make the behavior implementation specific. It will need to be split
into a separate patch with proper documentation and a CC to linux-mm.
> (1) afs_write_back_from_locked_folio() could be called directly rather
> than calling filemap_fdatawrite_wbc(), but that would avoid the
> control group stuff that wbc_attach_and_unlock_inode() and co. seem to
> do. Do I actually need to do this?
That would be much preferred over the for_write_begin hack, given that
write_begin really isn't a well defined method but a hacky hook for
legacy write implementations.
> (2) afs_writepages_region() has a loop in it to generate multiple writes.
> do_writepages() also acquired a loop[2] which will also generate
> multiple writes. Should I remove the loop from
> afs_writepages_region() and leave it to the caller of ->writepages()?
Dropping out of ->writpages inside a page does seem a bit problematic,
so you probably want to keep the loop.
Powered by blists - more mailing lists