All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ubifs: refactor ubifs_file_mmap()
       [not found] <1406010548-13996-1-git-send-email-zhenzhang.zhang@huawei.com>
@ 2014-07-22  6:28 ` Zhang Zhen
  2014-07-28 16:25   ` Artem Bityutskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Zhang Zhen @ 2014-07-22  6:28 UTC (permalink / raw)
  To: Adrian Hunter, Artem Bityutskiy; +Cc: wangnan0, MTD Maling List

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


.

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] ubifs: refactor ubifs_file_mmap()
  2014-07-22  6:28 ` [PATCH v2] ubifs: refactor ubifs_file_mmap() Zhang Zhen
@ 2014-07-28 16:25   ` Artem Bityutskiy
  2014-07-29  3:50     ` Zhang Zhen
  0 siblings, 1 reply; 5+ messages in thread
From: Artem Bityutskiy @ 2014-07-28 16:25 UTC (permalink / raw)
  To: Zhang Zhen; +Cc: wangnan0, MTD Maling List, Adrian Hunter

On Tue, 2014-07-22 at 14:28 +0800, Zhang Zhen wrote:
> 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>

Hi, I am not sure about this patch. 'generic_file_mmap()' covers !
CONFIG_MMU case too, for example.

Thanks!

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] ubifs: refactor ubifs_file_mmap()
  2014-07-28 16:25   ` Artem Bityutskiy
@ 2014-07-29  3:50     ` Zhang Zhen
  2014-07-29  7:20       ` Artem Bityutskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Zhang Zhen @ 2014-07-29  3:50 UTC (permalink / raw)
  To: dedekind1; +Cc: wangnan0, MTD Maling List, Adrian Hunter

On 2014/7/29 0:25, Artem Bityutskiy wrote:
> On Tue, 2014-07-22 at 14:28 +0800, Zhang Zhen wrote:
>> 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>
> 
> Hi, I am not sure about this patch. 'generic_file_mmap()' covers !
> CONFIG_MMU case too, for example.
> 
Yes, I missed that. We can add #ifdef CONFIG_MMU in ubifs_file_mmap().
Considering the patch itself is not important changes, we can give up
this patch, remain the same.

What do you think?

Thanks for your comments!
> Thanks!
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] ubifs: refactor ubifs_file_mmap()
  2014-07-29  3:50     ` Zhang Zhen
@ 2014-07-29  7:20       ` Artem Bityutskiy
  2014-07-29  7:33         ` Zhang Zhen
  0 siblings, 1 reply; 5+ messages in thread
From: Artem Bityutskiy @ 2014-07-29  7:20 UTC (permalink / raw)
  To: Zhang Zhen; +Cc: wangnan0, MTD Maling List, Adrian Hunter

On Tue, 2014-07-29 at 11:50 +0800, Zhang Zhen wrote:
> On 2014/7/29 0:25, Artem Bityutskiy wrote:
> > On Tue, 2014-07-22 at 14:28 +0800, Zhang Zhen wrote:
> >> 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>
> > 
> > Hi, I am not sure about this patch. 'generic_file_mmap()' covers !
> > CONFIG_MMU case too, for example.
> > 
> Yes, I missed that. We can add #ifdef CONFIG_MMU in ubifs_file_mmap().
> Considering the patch itself is not important changes, we can give up
> this patch, remain the same.
> 
> What do you think?

I think it is better to leave it as it is, because that's not too bad
and works. Changing this has a risk of breaking something. UBIFS does
not enjoy a huge user base like, say, ext4, so the breakage could easily
go unnoticed for long time.

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] ubifs: refactor ubifs_file_mmap()
  2014-07-29  7:20       ` Artem Bityutskiy
@ 2014-07-29  7:33         ` Zhang Zhen
  0 siblings, 0 replies; 5+ messages in thread
From: Zhang Zhen @ 2014-07-29  7:33 UTC (permalink / raw)
  To: dedekind1; +Cc: wangnan0, MTD Maling List, Adrian Hunter

On 2014/7/29 15:20, Artem Bityutskiy wrote:
> On Tue, 2014-07-29 at 11:50 +0800, Zhang Zhen wrote:
>> On 2014/7/29 0:25, Artem Bityutskiy wrote:
>>> On Tue, 2014-07-22 at 14:28 +0800, Zhang Zhen wrote:
>>>> 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>
>>>
>>> Hi, I am not sure about this patch. 'generic_file_mmap()' covers !
>>> CONFIG_MMU case too, for example.
>>>
>> Yes, I missed that. We can add #ifdef CONFIG_MMU in ubifs_file_mmap().
>> Considering the patch itself is not important changes, we can give up
>> this patch, remain the same.
>>
>> What do you think?
> 
> I think it is better to leave it as it is, because that's not too bad
> and works. Changing this has a risk of breaking something. UBIFS does
> not enjoy a huge user base like, say, ext4, so the breakage could easily
> go unnoticed for long time.
> 
OK.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-29  7:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1406010548-13996-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-07-22  6:28 ` [PATCH v2] ubifs: refactor ubifs_file_mmap() Zhang Zhen
2014-07-28 16:25   ` Artem Bityutskiy
2014-07-29  3:50     ` Zhang Zhen
2014-07-29  7:20       ` Artem Bityutskiy
2014-07-29  7:33         ` Zhang Zhen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.