Whamcloud - gitweb
LU-9010 ldlm: use static initializer macros where possible
[fs/lustre-release.git] / lustre / quota / qsd_internal.h
index 518c525..e6271c7 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
  * Use is subject to license terms.
  */
 
@@ -70,7 +70,7 @@ struct qsd_instance {
         *
         * This will have to be revisited if new quota types are added in the
         * future. For the time being, we can just use an array. */
-       struct qsd_qtype_info   *qsd_type_array[MAXQUOTAS];
+       struct qsd_qtype_info   *qsd_type_array[LL_MAXQUOTAS];
 
        /* per-filesystem quota information */
        struct qsd_fsinfo       *qsd_fsinfo;
@@ -107,14 +107,13 @@ struct qsd_instance {
         * enforced here (via procfs) */
        int                      qsd_timeout;
 
-       unsigned long            qsd_is_md:1,    /* managing quota for mdt */
-                                qsd_started:1,  /* instance is now started */
-                                qsd_prepared:1, /* qsd_prepare() successfully
+       unsigned long           qsd_is_md:1,    /* managing quota for mdt */
+                               qsd_started:1,  /* instance is now started */
+                               qsd_prepared:1, /* qsd_prepare() successfully
                                                  * called */
-                                qsd_exp_valid:1,/* qsd_exp is now valid */
-                                qsd_stopping:1, /* qsd_instance is stopping */
-                                qsd_acct_failed:1; /* failed to set up acct
-                                                    * for one quota type */
+                               qsd_exp_valid:1,/* qsd_exp is now valid */
+                               qsd_stopping:1; /* qsd_instance is stopping */
+
 };
 
 /*
@@ -169,11 +168,12 @@ struct qsd_qtype_info {
 
        /* Various flags representing the current state of the slave for this
         * quota type. */
-       unsigned long            qqi_glb_uptodate:1, /* global index uptodate
+       unsigned long           qqi_glb_uptodate:1, /* global index uptodate
                                                        with master */
-                                qqi_slv_uptodate:1, /* slave index uptodate
+                               qqi_slv_uptodate:1, /* slave index uptodate
                                                        with master */
-                                qqi_reint:1;    /* in reintegration or not */
+                               qqi_reint:1,    /* in reintegration or not */
+                               qqi_acct_failed:1; /* failed to setup acct */
 
        /* A list of references to this instance, for debugging */
        struct lu_ref            qqi_reference;
@@ -277,7 +277,7 @@ static inline int qsd_type_enabled(struct qsd_instance *qsd, int type)
        int     enabled, pool;
 
        LASSERT(qsd != NULL);
-       LASSERT(type < MAXQUOTAS);
+       LASSERT(type < LL_MAXQUOTAS);
 
        if (qsd->qsd_fsinfo == NULL)
                return 0;
@@ -322,7 +322,7 @@ static inline void qsd_set_edquot(struct lquota_entry *lqe, bool edquot)
 {
        lqe->lqe_edquot = edquot;
        if (edquot)
-               lqe->lqe_edquot_time = cfs_time_current_64();
+               lqe->lqe_edquot_time = ktime_get_seconds();
 }
 
 #define QSD_WB_INTERVAL        60 /* 60 seconds */