diff mbox series

[8/8] orangefs: use ->f_mapping

Message ID YwFCIkDT7sFO1D9N@ZenIV (mailing list archive)
State New, archived
Headers show
Series [1/8] ibmvmc: don't open-code file_inode() | expand

Commit Message

Al Viro Aug. 20, 2022, 8:20 p.m. UTC
... and don't check for impossible conditions - file_inode() is
never NULL in anything seen by ->release() and neither is its
->i_mapping.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/orangefs/file.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Mike Marshall Sept. 21, 2022, 7:30 p.m. UTC | #1
I added this patch to one of the 6.0 rc's that I've been
running through xfstests, no regressions... so...

You can add tested by me if you'd like...

Thanks!

-Mike


On Sat, Aug 20, 2022 at 4:20 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> ... and don't check for impossible conditions - file_inode() is
> never NULL in anything seen by ->release() and neither is its
> ->i_mapping.
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
>  fs/orangefs/file.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
> index 86810e5d7914..732661aa2680 100644
> --- a/fs/orangefs/file.c
> +++ b/fs/orangefs/file.c
> @@ -417,9 +417,7 @@ static int orangefs_file_release(struct inode *inode, struct file *file)
>          * readahead cache (if any); this forces an expensive refresh of
>          * data for the next caller of mmap (or 'get_block' accesses)
>          */
> -       if (file_inode(file) &&
> -           file_inode(file)->i_mapping &&
> -           mapping_nrpages(&file_inode(file)->i_data)) {
> +       if (mapping_nrpages(file->f_mapping)) {
>                 if (orangefs_features & ORANGEFS_FEATURE_READAHEAD) {
>                         gossip_debug(GOSSIP_INODE_DEBUG,
>                             "calling flush_racache on %pU\n",
> --
> 2.30.2
>
diff mbox series

Patch

diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index 86810e5d7914..732661aa2680 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -417,9 +417,7 @@  static int orangefs_file_release(struct inode *inode, struct file *file)
 	 * readahead cache (if any); this forces an expensive refresh of
 	 * data for the next caller of mmap (or 'get_block' accesses)
 	 */
-	if (file_inode(file) &&
-	    file_inode(file)->i_mapping &&
-	    mapping_nrpages(&file_inode(file)->i_data)) {
+	if (mapping_nrpages(file->f_mapping)) {
 		if (orangefs_features & ORANGEFS_FEATURE_READAHEAD) {
 			gossip_debug(GOSSIP_INODE_DEBUG,
 			    "calling flush_racache on %pU\n",