Skip to content

Commit a8cdf0f

Browse files
Matthew Wilcox (Oracle)Kent Overstreet
authored andcommitted
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) <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
1 parent fdbc9c3 commit a8cdf0f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/bcachefs/fs-io-pagecache.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ static inline void bch2_folio_release(struct folio *folio)
9999

100100
static inline struct bch_folio *__bch2_folio(struct folio *folio)
101101
{
102-
return folio_has_private(folio)
103-
? (struct bch_folio *) folio_get_private(folio)
104-
: NULL;
102+
return folio_get_private(folio);
105103
}
106104

107105
static inline struct bch_folio *bch2_folio(struct folio *folio)

0 commit comments

Comments
 (0)