summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fs-io-pagecache.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-08-20 05:10:11 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2024-09-09 09:41:49 -0400
commita8cdf0ff46643305be6ae2d580d140bb3832af39 (patch)
treeb1fc47fa68060b760529b7e5b5b7ecb5f416eccf /fs/bcachefs/fs-io-pagecache.h
parentfdbc9c390ade238383f5a24e4b32e49550dc90e4 (diff)
downloadlwn-a8cdf0ff46643305be6ae2d580d140bb3832af39.tar.gz
lwn-a8cdf0ff46643305be6ae2d580d140bb3832af39.zip
bcachefs: Do not check folio_has_private()
folio_has_private() is an attractive nuisance; filesystem authors generally don't realise that it actually checks two flags (one of which is never set by bcachefs). There's no need to check the private flag at all; for folios owned by bcachefs, we know that folio->private is NULL when the private flag is clear and non-NULL when the private flag is set. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs-io-pagecache.h')
-rw-r--r--fs/bcachefs/fs-io-pagecache.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/bcachefs/fs-io-pagecache.h b/fs/bcachefs/fs-io-pagecache.h
index fd7d692c087e..fad911cf5068 100644
--- a/fs/bcachefs/fs-io-pagecache.h
+++ b/fs/bcachefs/fs-io-pagecache.h
@@ -99,9 +99,7 @@ static inline void bch2_folio_release(struct folio *folio)
static inline struct bch_folio *__bch2_folio(struct folio *folio)
{
- return folio_has_private(folio)
- ? (struct bch_folio *) folio_get_private(folio)
- : NULL;
+ return folio_get_private(folio);
}
static inline struct bch_folio *bch2_folio(struct folio *folio)