2014-07-02 04:02:16

by Zhang Zhen

[permalink] [raw]
Subject: [PATCH] ext4: remove readpage() check up for mmap file

There is no kind of file does not supply page reading function.

Signed-off-by: Zhang Zhen <[email protected]>
---
fs/ext4/file.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 8695f70..f5c0a17 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -202,8 +202,6 @@ static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
{
struct address_space *mapping = file->f_mapping;

- if (!mapping->a_ops->readpage)
- return -ENOEXEC;
file_accessed(file);
vma->vm_ops = &ext4_file_vm_ops;
return 0;
--
1.8.1.2


.






2014-07-02 15:15:55

by Zwisler, Ross

[permalink] [raw]
Subject: Re: [PATCH] ext4: remove readpage() check up for mmap file

On Wed, 2014-07-02 at 12:01 +0800, Zhang Zhen wrote:
> There is no kind of file does not supply page reading function.
>
> Signed-off-by: Zhang Zhen <[email protected]>
> ---
> fs/ext4/file.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/ext4/file.c b/fs/ext4/file.c
> index 8695f70..f5c0a17 100644
> --- a/fs/ext4/file.c
> +++ b/fs/ext4/file.c
> @@ -202,8 +202,6 @@ static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
> {
> struct address_space *mapping = file->f_mapping;

Assuming this change is correct, the 'mapping' variable is now unused and can
also be deleted.

>
> - if (!mapping->a_ops->readpage)
> - return -ENOEXEC;
> file_accessed(file);
> vma->vm_ops = &ext4_file_vm_ops;
> return 0;

2014-07-03 01:37:34

by Zhang Zhen

[permalink] [raw]
Subject: Re: [PATCH] ext4: remove readpage() check up for mmap file

On 2014/7/2 23:15, Zwisler, Ross wrote:
> On Wed, 2014-07-02 at 12:01 +0800, Zhang Zhen wrote:
>> There is no kind of file does not supply page reading function.
>>
>> Signed-off-by: Zhang Zhen <[email protected]>
>> ---
>> fs/ext4/file.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/fs/ext4/file.c b/fs/ext4/file.c
>> index 8695f70..f5c0a17 100644
>> --- a/fs/ext4/file.c
>> +++ b/fs/ext4/file.c
>> @@ -202,8 +202,6 @@ static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
>> {
>> struct address_space *mapping = file->f_mapping;
>
> Assuming this change is correct, the 'mapping' variable is now unused and can
> also be deleted.
>
Hi,

Thank you for your correction, sorry for my mistake.
I will send a new patch.
>>
>> - if (!mapping->a_ops->readpage)
>> - return -ENOEXEC;
>> file_accessed(file);
>> vma->vm_ops = &ext4_file_vm_ops;
>> return 0;
>