Whamcloud - gitweb
libquota: remove flag argument to commit_dquot()
authorTheodore Ts'o <tytso@mit.edu>
Wed, 5 Oct 2011 17:26:59 +0000 (13:26 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 5 Oct 2011 17:26:59 +0000 (13:26 -0400)
The flag parameter wasn't being used, and using it meant that we had
to define the COMMIT_* flags, which relied on the QIF_* flags being
present.  Removing this allows for increased portability.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/quota/mkquota.c
lib/quota/quotaio.h
lib/quota/quotaio_v2.c

index 35cac66..5440003 100644 (file)
@@ -127,7 +127,7 @@ static void write_dquots(dict_t *dict, struct quota_handle *qh)
                if (dq) {
                        dq->dq_h = qh;
                        update_grace_times(dq);
-                       qh->qh_ops->commit_dquot(dq, COMMIT_ALL);
+                       qh->qh_ops->commit_dquot(dq);
                }
        }
 }
index 333a59f..282b543 100644 (file)
@@ -101,13 +101,6 @@ struct dquot {
        struct util_dqblk dq_dqb;       /* Parsed data of dquot */
 };
 
-/* Flags for commit function (have effect only when quota in kernel is
- * turned on) */
-#define COMMIT_USAGE QIF_USAGE
-#define COMMIT_LIMITS QIF_LIMITS
-#define COMMIT_TIMES QIF_TIMES
-#define COMMIT_ALL (COMMIT_USAGE | COMMIT_LIMITS | COMMIT_TIMES)
-
 /* Structure of quotafile operations */
 struct quotafile_ops {
        /* Check whether quotafile is in our format */
@@ -123,7 +116,7 @@ struct quotafile_ops {
        /* Read dquot into memory */
        struct dquot *(*read_dquot) (struct quota_handle *h, qid_t id);
        /* Write given dquot to disk */
-       int (*commit_dquot) (struct dquot *dquot, int flag);
+       int (*commit_dquot) (struct dquot *dquot);
        /* Scan quotafile and call callback on every structure */
        int (*scan_dquots) (struct quota_handle *h,
                            int (*process_dquot) (struct dquot *dquot,
index 35512c0..7c9e4f7 100644 (file)
@@ -25,7 +25,7 @@ static int v2_init_io(struct quota_handle *h);
 static int v2_new_io(struct quota_handle *h);
 static int v2_write_info(struct quota_handle *h);
 static struct dquot *v2_read_dquot(struct quota_handle *h, qid_t id);
-static int v2_commit_dquot(struct dquot *dquot, int flags);
+static int v2_commit_dquot(struct dquot *dquot);
 static int v2_scan_dquots(struct quota_handle *h,
                          int (*process_dquot) (struct dquot *dquot,
                                                char *dqname));
@@ -285,7 +285,7 @@ static struct dquot *v2_read_dquot(struct quota_handle *h, qid_t id)
  * became fake one and user has no blocks.
  * User can process use 'errno' to detect errstr.
  */
-static int v2_commit_dquot(struct dquot *dquot, int flags)
+static int v2_commit_dquot(struct dquot *dquot)
 {
        struct util_dqblk *b = &dquot->dq_dqb;