nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-nvdimm@lists.01.org
Subject: Re: [PATCH 1/4] mm: Introduce and use page_cache_empty
Date: Fri, 7 Aug 2020 02:24:00 +0300	[thread overview]
Message-ID: <20200806232400.s7nhmnoi3tkk7p2r@box> (raw)
In-Reply-To: <20200804161755.10100-2-willy@infradead.org>

On Tue, Aug 04, 2020 at 05:17:52PM +0100, Matthew Wilcox (Oracle) wrote:
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 484a36185bb5..a474a92a2a72 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -18,6 +18,11 @@
>  
>  struct pagevec;
>  
> +static inline bool page_cache_empty(struct address_space *mapping)
> +{
> +	return xa_empty(&mapping->i_pages);

What about something like

	bool empty = xa_empty(&mapping->i_pages);
	VM_BUG_ON(empty && mapping->nrpages);
	return empty;

?

> +}
> +
>  /*
>   * Bits in mapping->flags.
>   */

-- 
 Kirill A. Shutemov
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  reply	other threads:[~2020-08-06 23:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 16:17 [PATCH 0/4] Remove nrexceptional tracking Matthew Wilcox (Oracle)
2020-08-04 16:17 ` [PATCH 1/4] mm: Introduce and use page_cache_empty Matthew Wilcox (Oracle)
2020-08-06 23:24   ` Kirill A. Shutemov [this message]
2020-08-16  1:48     ` Matthew Wilcox
2020-08-04 16:17 ` [PATCH 2/4] mm: Stop accounting shadow entries Matthew Wilcox (Oracle)
2020-08-04 16:17 ` [PATCH 3/4] dax: Account DAX entries as nrpages Matthew Wilcox (Oracle)
2020-08-04 16:17 ` [PATCH 4/4] mm: Remove nrexceptional from inode Matthew Wilcox (Oracle)
2020-08-06 19:44 ` [PATCH 0/4] Remove nrexceptional tracking Verma, Vishal L
2020-08-06 20:16   ` Verma, Vishal L
2020-10-08 19:33     ` Matthew Wilcox
2020-10-09 23:04       ` Verma, Vishal L

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=20200806232400.s7nhmnoi3tkk7p2r@box \
    --to=kirill@shutemov.name \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=willy@infradead.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).