[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y6aodOf7Q016xSay@infradead.org>
Date: Fri, 23 Dec 2022 23:21:24 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Andreas Grünbacher
<andreas.gruenbacher@...il.com>
Cc: Christoph Hellwig <hch@...radead.org>,
Andreas Gruenbacher <agruenba@...hat.com>,
"Darrick J . Wong" <djwong@...nel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Matthew Wilcox <willy@...radead.org>,
linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org, cluster-devel@...hat.com
Subject: Re: [RFC v3 1/7] fs: Add folio_may_straddle_isize helper
On Fri, Dec 23, 2022 at 11:04:51PM +0100, Andreas Grünbacher wrote:
> > I find the naming very confusing. Any good reason to not follow
> > the naming of pagecache_isize_extended an call it
> > folio_isize_extended?
>
> A good reason for a different name is because
> folio_may_straddle_isize() requires a locked folio, while
> pagecache_isize_extended() will fail if the folio is still locked. So
> this doesn't follow the usual "replace 'page' with 'folio'" pattern.
pagecache also doesn't say page, it says pagecache. I'd still prepfer
to keep the postfix the same. And I think the fact that it needs
a locked folio should also have an assert, which both documents this
and catches errors. I think that's much better than an arbitrarily
different name.
> > Should pagecache_isize_extended be rewritten to use this helper,
> > i.e. turn this into a factoring out of a helper?
>
> I'm not really sure about that. The boundary conditions in the two
> functions are not identical. I think the logic in
> folio_may_straddle_isize() is sufficient for the
> extending-write-under-folio-lock case, but I'd still need confirmation
> for that. If the same logic would also be enough in
> pagecache_isize_extended() is more unclear to me.
That's another thing that really needs to into the commit log,
why is the condition different and pagecache_isize_extended can't
just be extended for it (if it really can't).
Powered by blists - more mailing lists