Whamcloud - gitweb
quota: Fold quota_read_all_dquots() into quota_update_limits()
authorJan Kara <jack@suse.cz>
Mon, 23 Aug 2021 15:41:22 +0000 (17:41 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 3 Sep 2021 18:34:58 +0000 (14:34 -0400)
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>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/support/mkquota.c

index ec932d1..7500cb2 100644 (file)
@@ -572,23 +572,6 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
 }
 
 /*
- * 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
  */
 #if 0 /* currently unused, but may be useful in the future? */
@@ -614,6 +597,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;
 
@@ -632,7 +616,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) {