linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ubifs: refactor ubifs_file_mmap()
       [not found] <53CDE6AB.2090703@huawei.com>
@ 2014-07-22  5:23 ` Zhang Zhen
  0 siblings, 0 replies; only message in thread
From: Zhang Zhen @ 2014-07-22  5:23 UTC (permalink / raw)
  To: Adrian Hunter, Artem Bityutskiy; +Cc: wangnan0, MTD Maling List, Hu Jianyang

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().

Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
---
 fs/ubifs/file.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index b5b593c..c7f1af6 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1540,11 +1540,9 @@ 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;
+	struct address_space *mapping = file->f_mapping;

-	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


.

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-22  5:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <53CDE6AB.2090703@huawei.com>
2014-07-22  5:23 ` [PATCH] ubifs: refactor ubifs_file_mmap() Zhang Zhen

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).