From: Matthew Wilcox <willy@infradead.org>
To: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Cc: linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
nvdimm@lists.linux.dev, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org, djwong@kernel.org,
dan.j.williams@intel.com, david@fromorbit.com, hch@infradead.org,
jane.chu@oracle.com
Subject: Re: [PATCH v9 2/3] fs: move drop_pagecache_sb() for others to use
Date: Sun, 5 Feb 2023 11:51:45 +0000 [thread overview]
Message-ID: <Y9+YUWUdMPKnJpyq@casper.infradead.org> (raw)
In-Reply-To: <1675522718-88-3-git-send-email-ruansy.fnst@fujitsu.com>
On Sat, Feb 04, 2023 at 02:58:37PM +0000, Shiyang Ruan wrote:
> @@ -678,6 +679,48 @@ void drop_super_exclusive(struct super_block *sb)
> }
> EXPORT_SYMBOL(drop_super_exclusive);
>
> +/*
You've gone to the trouble of writing kernel-doc, just add the extra '*'
and make it actually part of the documentation!
> + * super_drop_pagecache - drop all page caches of a filesystem
> + * @sb: superblock to invalidate
> + * @arg: invalidate method, such as invalidate_inode_pages(),
> + * invalidate_inode_pages2()
> + *
> + * Scans the inodes of a filesystem, drop all page caches.
> + */
> +++ b/include/linux/fs.h
> @@ -3308,6 +3308,7 @@ extern struct super_block *get_super(struct block_device *);
> extern struct super_block *get_active_super(struct block_device *bdev);
> extern void drop_super(struct super_block *sb);
> extern void drop_super_exclusive(struct super_block *sb);
> +void super_drop_pagecache(struct super_block *sb, void *unused);
But the arg isn't unused. Call it 'invalidator' here.
> +/**
> + * invalidate_inode_pages - Invalidate all clean, unlocked cache of one inode
> + * @mapping: the address_space which holds the cache to invalidate
> + *
> + * This function removes all pages that are clean, unmapped and unlocked,
> + * as well as shadow entries. It will not block on IO activity.
> + */
> +int invalidate_inode_pages(struct address_space *mapping)
> +{
> + invalidate_mapping_pages(mapping, 0, -1);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(invalidate_inode_pages);
I might make this a static function in super.c but maybe you need it
in the next patch.
next prev parent reply other threads:[~2023-02-05 11:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-04 14:58 [RESEND PATCH v9 0/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind Shiyang Ruan
2023-02-04 14:58 ` [PATCH v9 1/3] xfs: fix the calculation of length and end Shiyang Ruan
2023-02-05 11:42 ` Matthew Wilcox
2023-02-06 6:45 ` Shiyang Ruan
2023-02-04 14:58 ` [PATCH v9 2/3] fs: move drop_pagecache_sb() for others to use Shiyang Ruan
2023-02-05 11:51 ` Matthew Wilcox [this message]
2023-02-04 14:58 ` [PATCH v9 3/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind Shiyang Ruan
2023-02-05 21:10 ` Matthew Wilcox
2023-02-05 21:50 ` Dave Chinner
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=Y9+YUWUdMPKnJpyq@casper.infradead.org \
--to=willy@infradead.org \
--cc=dan.j.williams@intel.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=jane.chu@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=ruansy.fnst@fujitsu.com \
/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