2020-09-11 04:45:51

by Tetsuhiro Kohada

[permalink] [raw]
Subject: [PATCH 1/3] exfat: remove useless directory scan in exfat_add_entry()

There is nothing in directory just created, so there is no need to scan.

Signed-off-by: Tetsuhiro Kohada <[email protected]>
---
fs/exfat/namei.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
index b966b9120c9c..803748946ddb 100644
--- a/fs/exfat/namei.c
+++ b/fs/exfat/namei.c
@@ -530,19 +530,10 @@ static int exfat_add_entry(struct inode *inode, const char *path,
info->size = 0;
info->num_subdirs = 0;
} else {
- int count;
- struct exfat_chain cdir;
-
info->attr = ATTR_SUBDIR;
info->start_clu = start_clu;
info->size = clu_size;
-
- exfat_chain_set(&cdir, info->start_clu,
- EXFAT_B_TO_CLU(info->size, sbi), info->flags);
- count = exfat_count_dir_entries(sb, &cdir);
- if (count < 0)
- return -EIO;
- info->num_subdirs = count + EXFAT_MIN_SUBDIR;
+ info->num_subdirs = EXFAT_MIN_SUBDIR;
}
memset(&info->crtime, 0, sizeof(info->crtime));
memset(&info->mtime, 0, sizeof(info->mtime));
--
2.25.1


2020-09-16 02:23:23

by Sungjong Seo

[permalink] [raw]
Subject: RE: [PATCH 1/3] exfat: remove useless directory scan in exfat_add_entry()

> There is nothing in directory just created, so there is no need to scan.
>
> Signed-off-by: Tetsuhiro Kohada <[email protected]>

Acked-by: Sungjong Seo <[email protected]>

> ---
> fs/exfat/namei.c | 11 +----------
> 1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index
> b966b9120c9c..803748946ddb 100644
> --- a/fs/exfat/namei.c
> +++ b/fs/exfat/namei.c
> @@ -530,19 +530,10 @@ static int exfat_add_entry(struct inode *inode,
> const char *path,
> info->size = 0;
> info->num_subdirs = 0;
> } else {
> - int count;
> - struct exfat_chain cdir;
> -
> info->attr = ATTR_SUBDIR;
> info->start_clu = start_clu;
> info->size = clu_size;
> -
> - exfat_chain_set(&cdir, info->start_clu,
> - EXFAT_B_TO_CLU(info->size, sbi), info->flags);
> - count = exfat_count_dir_entries(sb, &cdir);
> - if (count < 0)
> - return -EIO;
> - info->num_subdirs = count + EXFAT_MIN_SUBDIR;
> + info->num_subdirs = EXFAT_MIN_SUBDIR;
> }
> memset(&info->crtime, 0, sizeof(info->crtime));
> memset(&info->mtime, 0, sizeof(info->mtime));
> --
> 2.25.1


2020-09-21 05:54:16

by Namjae Jeon

[permalink] [raw]
Subject: Re: [PATCH 1/3] exfat: remove useless directory scan in exfat_add_entry()

2020-09-15 19:22 GMT-07:00, Sungjong Seo <[email protected]>:
>> There is nothing in directory just created, so there is no need to scan.
>>
>> Signed-off-by: Tetsuhiro Kohada <[email protected]>
>
> Acked-by: Sungjong Seo <[email protected]>
Applied. Thanks for your patch!