* [PATCH] quota: minor optimization for __dquot_initialize()
@ 2020-06-21 5:31 Chengguang Xu
0 siblings, 0 replies; only message in thread
From: Chengguang Xu @ 2020-06-21 5:31 UTC (permalink / raw)
To: jack; +Cc: linux-kernel, Chengguang Xu
Count the number of quotas which are needed to initialize,
instead of just setting to 1 so that we may avoid unnecessary
process in special case.
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
---
fs/quota/dquot.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 7b4bac91146b..f93bd60c3998 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1459,7 +1459,7 @@ static int __dquot_initialize(struct inode *inode, int type)
if (!sb_has_quota_active(sb, cnt))
continue;
- init_needed = 1;
+ init_needed++;
switch (cnt) {
case USRQUOTA:
@@ -1483,6 +1483,7 @@ static int __dquot_initialize(struct inode *inode, int type)
goto out_put;
}
dquot = NULL;
+ init_needed--;
}
got[cnt] = dquot;
}
--
2.17.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-06-21 5:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-21 5:31 [PATCH] quota: minor optimization for __dquot_initialize() Chengguang Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).