lkml.org 
[lkml]   [2020]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] exfat: remove 'rwoffset' in exfat_inode_info
From
Date


On 2020/09/12 14:01, Sungjong Seo wrote:
>> Remove 'rwoffset' in exfat_inode_info and replace it with the
>> parameter(cpos) of exfat_readdir.
>> Since rwoffset of is referenced only by exfat_readdir, it is not
>> necessary a exfat_inode_info's member.
>>
>> Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
>> ---
>> fs/exfat/dir.c | 16 ++++++----------
>> fs/exfat/exfat_fs.h | 2 --
>> fs/exfat/file.c | 2 --
>> fs/exfat/inode.c | 3 ---
>> fs/exfat/super.c | 1 -
>> 5 files changed, 6 insertions(+), 18 deletions(-)
>>
>> diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index
>> a9b13ae3f325..fa5bb72aa295 100644
>> --- a/fs/exfat/dir.c
>> +++ b/fs/exfat/dir.c
> [snip]
>> sector @@ -262,13 +260,11 @@ static int exfat_iterate(struct file *filp,
>> struct dir_context *ctx)
>> goto end_of_dir;
>> }
>>
>> - cpos = EXFAT_DEN_TO_B(ei->rwoffset);
>> -
>> if (!nb->lfn[0])
>> goto end_of_dir;
>>
>> i_pos = ((loff_t)ei->start_clu << 32) |
>> - ((ei->rwoffset - 1) & 0xffffffff);
>> + (EXFAT_B_TO_DEN(cpos-1) & 0xffffffff);
>
> Need to fix the above line to be:
> (EXFAT_B_TO_DEN(cpos)-1)) & 0xffffffff);


Here, we simply converted so that the calculation results would be the same.
But after reading it carefully again, I noticed.
- Why use the previous entry?
- Why does cpos point to stream dir-entry in entry-set?

For the former, there is no need to "++dentry" in exfat_readdir().
For the latter, I think cpos should point to the next to current entry-set.

I'll make V2 considering these.
How do you think?

BR
---
Tetsuhiro Kohada <kohada.t2@gmail.com>

\
 
 \ /
  Last update: 2020-09-16 07:36    [W:0.331 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site