Blame SOURCES/0058-exfat-remove-useless-directory-scan-in-exfat_add_ent.patch

Kmods SIG 50e2b3
From 6c958a09555515684947d94bfcfa8e8a414f0572 Mon Sep 17 00:00:00 2001
Kmods SIG 50e2b3
From: Tetsuhiro Kohada <kohada.t2@gmail.com>
Kmods SIG 50e2b3
Date: Fri, 11 Sep 2020 13:44:39 +0900
Kmods SIG 50e2b3
Subject: [Backport 6c958a095555] exfat: remove useless directory scan in
Kmods SIG 50e2b3
 exfat_add_entry()
Kmods SIG 50e2b3
Kmods SIG 50e2b3
There is nothing in directory just created, so there is no need to scan.
Kmods SIG 50e2b3
Kmods SIG 50e2b3
Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Kmods SIG 50e2b3
Acked-by: Sungjong Seo <sj1557.seo@samsung.com>
Kmods SIG 50e2b3
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Kmods SIG 50e2b3
---
Kmods SIG 50e2b3
 src/namei.c | 11 +----------
Kmods SIG 50e2b3
 1 file changed, 1 insertion(+), 10 deletions(-)
Kmods SIG 50e2b3
Kmods SIG 50e2b3
diff --git a/src/namei.c b/src/namei.c
Kmods SIG 50e2b3
index b966b9120c9ca25e8519b05bdacc5e17ced0f9da..803748946ddbf409693ba0016628cb8d0d1dcf8c 100644
Kmods SIG 50e2b3
--- a/src/namei.c
Kmods SIG 50e2b3
+++ b/src/namei.c
Kmods SIG 50e2b3
@@ -530,19 +530,10 @@ static int exfat_add_entry(struct inode *inode, const char *path,
Kmods SIG 50e2b3
 		info->size = 0;
Kmods SIG 50e2b3
 		info->num_subdirs = 0;
Kmods SIG 50e2b3
 	} else {
Kmods SIG 50e2b3
-		int count;
Kmods SIG 50e2b3
-		struct exfat_chain cdir;
Kmods SIG 50e2b3
-
Kmods SIG 50e2b3
 		info->attr = ATTR_SUBDIR;
Kmods SIG 50e2b3
 		info->start_clu = start_clu;
Kmods SIG 50e2b3
 		info->size = clu_size;
Kmods SIG 50e2b3
-
Kmods SIG 50e2b3
-		exfat_chain_set(&cdir, info->start_clu,
Kmods SIG 50e2b3
-			EXFAT_B_TO_CLU(info->size, sbi), info->flags);
Kmods SIG 50e2b3
-		count = exfat_count_dir_entries(sb, &cdir);
Kmods SIG 50e2b3
-		if (count < 0)
Kmods SIG 50e2b3
-			return -EIO;
Kmods SIG 50e2b3
-		info->num_subdirs = count + EXFAT_MIN_SUBDIR;
Kmods SIG 50e2b3
+		info->num_subdirs = EXFAT_MIN_SUBDIR;
Kmods SIG 50e2b3
 	}
Kmods SIG 50e2b3
 	memset(&info->crtime, 0, sizeof(info->crtime));
Kmods SIG 50e2b3
 	memset(&info->mtime, 0, sizeof(info->mtime));
Kmods SIG 50e2b3
-- 
Kmods SIG 50e2b3
2.31.1
Kmods SIG 50e2b3