From: Matthew Wilcox (Oracle) Date: Tue, 20 Aug 2024 04:10:11 +0000 (+0100) Subject: bcachefs: Do not check folio_has_private() X-Git-Tag: v6.12~281^2~81 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8cdf0ff46643305be6ae2d580d140bb3832af39;p=platform%2Fkernel%2Flinux-amlogic.git 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) Signed-off-by: Kent Overstreet --- 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)