From: Eric Biggers <ebiggers3@gmail.com>
To: linux-fsdevel@vger.kernel.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Eric Biggers <ebiggers@google.com>
Subject: [PATCH] fs/open.c: use ->f_mapping instead of ->f_mapping->host->i_mapping
Date: Sat, 25 Mar 2017 20:21:28 -0700 [thread overview]
Message-ID: <20170326032128.32721-1-ebiggers3@gmail.com> (raw)
From: Eric Biggers <ebiggers@google.com>
In do_dentry_open(), initialize the readahead state using ->f_mapping
instead of ->f_mapping->host->i_mapping. This is equivalent, even for
block device files; we don't need the extra indirection because
->f_mapping already represents the data read/written by the file (which
for block device nodes is the underlying block device mapping).
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
fs/open.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/open.c b/fs/open.c
index 949cef29c3bb..32e19fda24d2 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -763,7 +763,7 @@ static int do_dentry_open(struct file *f,
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
- file_ra_state_init(&f->f_ra, f->f_mapping->host->i_mapping);
+ file_ra_state_init(&f->f_ra, f->f_mapping);
return 0;
--
2.12.1
next reply other threads:[~2017-03-26 3:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-26 3:21 Eric Biggers [this message]
2017-03-26 10:03 ` [PATCH] fs/open.c: use ->f_mapping instead of ->f_mapping->host->i_mapping Jeff Layton
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=20170326032128.32721-1-ebiggers3@gmail.com \
--to=ebiggers3@gmail.com \
--cc=ebiggers@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).