From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
Artem Bityutskiy <dedekind1@gmail.com>
Cc: wangnan0@huawei.com, MTD Maling List <linux-mtd@lists.infradead.org>
Subject: [PATCH v2] ubifs: refactor ubifs_file_mmap()
Date: Tue, 22 Jul 2014 14:28:43 +0800 [thread overview]
Message-ID: <53CE049B.7050801@huawei.com> (raw)
In-Reply-To: <1406010548-13996-1-git-send-email-zhenzhang.zhang@huawei.com>
generic_file_mmap() set vma->vm_ops = &generic_file_vm_ops,
then ubifs_file_mmap set vma->vm_ops = &ubifs_file_vm_ops.
So it is redundant.
And there is no kind of file does not supply page reading function
in ubifs. The readpage() check up for mmap file in generic_file_mmap()
is not needed.
So remove the call of generic_file_mmap().
Change v1 -> v2:
- deleted the mapping variable
Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
---
fs/ubifs/file.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index b5b593c..f7b6958 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1540,11 +1540,7 @@ static const struct vm_operations_struct ubifs_file_vm_ops = {
static int ubifs_file_mmap(struct file *file, struct vm_area_struct *vma)
{
- int err;
-
- err = generic_file_mmap(file, vma);
- if (err)
- return err;
+ file_accessed(file);
vma->vm_ops = &ubifs_file_vm_ops;
return 0;
}
--
1.8.1.2
.
next parent reply other threads:[~2014-07-22 6:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1406010548-13996-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-07-22 6:28 ` Zhang Zhen [this message]
2014-07-28 16:25 ` [PATCH v2] ubifs: refactor ubifs_file_mmap() Artem Bityutskiy
2014-07-29 3:50 ` Zhang Zhen
2014-07-29 7:20 ` Artem Bityutskiy
2014-07-29 7:33 ` Zhang Zhen
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=53CE049B.7050801@huawei.com \
--to=zhenzhang.zhang@huawei.com \
--cc=adrian.hunter@intel.com \
--cc=dedekind1@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=wangnan0@huawei.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