[PATCH 2/8] quota: Fold quota_read_all_dquots() into quota_update_limits()
From: Jan Kara <jack@suse.cz>
Date: 2021-08-23 15:41:54
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
There's just one caller of quota_read_all_dquots(), fold it into its caller quota_update_limits(). No functional changes. Signed-off-by: Jan Kara <jack@suse.cz> --- lib/support/mkquota.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c
index fbc3833aee98..8e5c61a601cc 100644
--- a/lib/support/mkquota.c
+++ b/lib/support/mkquota.c@@ -564,23 +564,6 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data) return 0; } -/* - * Read all dquots from quota file into memory - */ -static errcode_t quota_read_all_dquots(struct quota_handle *qh, - quota_ctx_t qctx, - int update_limits EXT2FS_ATTR((unused))) -{ - struct scan_dquots_data scan_data; - - scan_data.quota_dict = qctx->quota_dict[qh->qh_type]; - scan_data.check_consistency = 0; - scan_data.update_limits = 0; - scan_data.update_usage = 1; - - return qh->qh_ops->scan_dquots(qh, scan_dquots_callback, &scan_data); -} - /* * Write all memory dquots into quota file */
@@ -607,6 +590,7 @@ static errcode_t quota_write_all_dquots(struct quota_handle *qh, errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino, enum quota_type qtype) { + struct scan_dquots_data scan_data; struct quota_handle *qh; errcode_t err;
@@ -625,7 +609,11 @@ errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino, goto out; } - quota_read_all_dquots(qh, qctx, 1); + scan_data.quota_dict = qctx->quota_dict[qh->qh_type]; + scan_data.check_consistency = 0; + scan_data.update_limits = 0; + scan_data.update_usage = 1; + qh->qh_ops->scan_dquots(qh, scan_dquots_callback, &scan_data); err = quota_file_close(qctx, qh); if (err) {
--
2.26.2