From: Matthew Wilcox <willy@infradead.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/2] mm: move filemap_range_needs_writeback() into header
Date: Fri, 3 Dec 2021 16:16:53 +0000 [thread overview]
Message-ID: <YapC9cl6qsOAjzNj@casper.infradead.org> (raw)
In-Reply-To: <20211203153829.298893-2-axboe@kernel.dk>
On Fri, Dec 03, 2021 at 08:38:28AM -0700, Jens Axboe wrote:
> +++ b/include/linux/fs.h
fs.h is the wrong place for these functions; they're pagecache
functionality, so they should be in pagemap.h.
> +/* Returns true if writeback might be needed or already in progress. */
> +static inline bool mapping_needs_writeback(struct address_space *mapping)
> +{
> + return mapping->nrpages;
> +}
I don't like this function -- mapping_needs_writeback says to me that it
tests a flag in mapping->flags. Plus, it does exactly the same thing as
!mapping_empty(), so perhaps ...
> +static inline bool filemap_range_needs_writeback(struct address_space *mapping,
> + loff_t start_byte,
> + loff_t end_byte)
> +{
> + if (!mapping_needs_writeback(mapping))
> + return false;
just make this
if (mapping_empty(mapping))
return false;
Other than that, no objections to making this static inline.
next prev parent reply other threads:[~2021-12-03 16:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 15:38 [PATCHSET 0/2] Avoid unnecessary indirect calls for bdev dio Jens Axboe
2021-12-03 15:38 ` [PATCH 1/2] mm: move filemap_range_needs_writeback() into header Jens Axboe
2021-12-03 16:16 ` Matthew Wilcox [this message]
2021-12-03 16:24 ` Jens Axboe
2021-12-03 16:31 ` Jens Axboe
2021-12-03 16:35 ` Jens Axboe
2021-12-03 16:38 ` Jens Axboe
2021-12-03 17:46 ` Matthew Wilcox
2021-12-03 17:57 ` Jens Axboe
2021-12-03 18:01 ` Jens Axboe
2021-12-03 18:14 ` Matthew Wilcox
2021-12-03 19:09 ` Jens Axboe
2021-12-03 15:38 ` [PATCH 2/2] block: move direct_IO into our own read_iter handler Jens Axboe
2021-12-06 6:58 ` Christoph Hellwig
2021-12-06 16:33 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YapC9cl6qsOAjzNj@casper.infradead.org \
--to=willy@infradead.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).