Skip to contentSkip to conversation

ubifs: refactor ubifs_file_mmap()

PATCH Superseded Zhang Zhen 1 participant 1 message Jul 22, 2014 1 message not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Zhang Zhen

author
#1 lore raw

PATCH 1/1 ubifs: refactor ubifs_file_mmap()

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

---
 fs/ubifs/file.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/ubifs/file.c +2 -4
index b5b593c..c7f1af6 100644
@@ -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;
 }
Signature · 4 lines
1.8.1.2


.