- struct super_block *lqc_sb; /* superblock this applies to */
- struct obd_import *lqc_import; /* import used to send dqacq/dqrel RPC */
- dqacq_handler_t lqc_handler; /* dqacq/dqrel RPC handler, only for quota master */
- unsigned long lqc_recovery:1, /* Doing recovery */
- lqc_atype:2, /* Turn on user/group quota at setup automatically,
- * 0: none, 1: user quota, 2: group quota, 3: both */
- lqc_status:1; /* Quota status. 0:Off, 1:On */
- unsigned long lqc_iunit_sz; /* Unit size of file quota */
- unsigned long lqc_itune_sz; /* Trigger dqacq when available file quota less than
- * this value, trigger dqrel when available file quota
- * more than this value + 1 iunit */
- unsigned long lqc_bunit_sz; /* Unit size of block quota */
- unsigned long lqc_btune_sz; /* See comment of lqc_itune_sz */
+ /** superblock this applies to */
+ struct super_block *lqc_sb;
+ /** obd_device_target for obt_rwsem */
+ struct obd_device_target *lqc_obt;
+ /** import used to send dqacq/dqrel RPC */
+ struct obd_import *lqc_import;
+ /** dqacq/dqrel RPC handler, only for quota master */
+ dqacq_handler_t lqc_handler;
+ /** quota flags */
+ unsigned long lqc_flags;
+ /** @{ */
+ unsigned long lqc_recovery:1, /** Doing recovery */
+ lqc_switch_qs:1, /**
+ * the function of change qunit size
+ * 0:Off, 1:On
+ */
+ lqc_valid:1, /** this qctxt is valid or not */
+ lqc_setup:1; /**
+ * tell whether of not quota_type has
+ * been processed, so that the master
+ * knows when it can start processing
+ * incoming acq/rel quota requests
+ */
+ /** }@ */
+ /**
+ * original unit size of file quota and
+ * upper limitation for adjust file qunit
+ */
+ unsigned long lqc_iunit_sz;
+ /**
+ * Trigger dqacq when available file
+ * quota less than this value, trigger
+ * dqrel when available file quota
+ * more than this value + 1 iunit
+ */
+ unsigned long lqc_itune_sz;
+ /**
+ * original unit size of block quota and
+ * upper limitation for adjust block qunit
+ */
+ unsigned long lqc_bunit_sz;
+ /** See comment of lqc_itune_sz */
+ unsigned long lqc_btune_sz;
+ /** all lustre_qunit_size structures */
+ struct lustre_hash *lqc_lqs_hash;
+
+ /** @{ */
+ /**
+ * the values below are relative to how master change its qunit sizes
+ */
+ /**
+ * this affects the boundary of
+ * shrinking and enlarging qunit size. default=4
+ */
+ unsigned long lqc_cqs_boundary_factor;
+ /** the least value of block qunit */
+ unsigned long lqc_cqs_least_bunit;
+ /** the least value of inode qunit */
+ unsigned long lqc_cqs_least_iunit;
+ /**
+ * when enlarging, qunit size will
+ * mutilple it; when shrinking,
+ * qunit size will divide it
+ */
+ unsigned long lqc_cqs_qs_factor;
+ /**
+ * avoid ping-pong effect of
+ * adjusting qunit size. How many
+ * seconds must be waited between
+ * enlarging and shinking qunit
+ */
+ /** }@ */
+ int lqc_switch_seconds;
+ /**
+ * when blk qunit reaches this value,
+ * later write reqs from client should be sync b=16642
+ */
+ int lqc_sync_blk;
+ /** guard lqc_imp_valid now */
+ spinlock_t lqc_lock;
+ /**
+ * when mds isn't connected, threads
+ * on osts who send the quota reqs
+ * with wait==1 will be put here b=14840
+ */
+ cfs_waitq_t lqc_wait_for_qmaster;
+ struct proc_dir_entry *lqc_proc_dir;
+ /** lquota statistics */
+ struct lprocfs_stats *lqc_stats;
+};
+
+#define QUOTA_MASTER_READY(qctxt) (qctxt)->lqc_setup = 1
+#define QUOTA_MASTER_UNREADY(qctxt) (qctxt)->lqc_setup = 0
+
+struct lustre_qunit_size {
+ struct hlist_node lqs_hash; /** the hash entry */
+ unsigned int lqs_id; /** id of user/group */
+ unsigned long lqs_flags; /** is user/group; FULLBUF or LESSBUF */
+ unsigned long lqs_iunit_sz; /** Unit size of file quota currently */
+ /**
+ * Trigger dqacq when available file quota
+ * less than this value, trigger dqrel
+ * when more than this value + 1 iunit
+ */
+ unsigned long lqs_itune_sz;
+ unsigned long lqs_bunit_sz; /** Unit size of block quota currently */
+ unsigned long lqs_btune_sz; /** See comment of lqs itune sz */
+ /** the blocks reached ost and don't finish */
+ unsigned long lqs_bwrite_pending;
+ /** the inodes reached mds and don't finish */
+ unsigned long lqs_iwrite_pending;
+ /** when inodes are allocated/released, this value will record it */
+ long long lqs_ino_rec;
+ /** when blocks are allocated/released, this value will record it */
+ long long lqs_blk_rec;
+ atomic_t lqs_refcount;
+ cfs_time_t lqs_last_bshrink; /** time of last block shrink */
+ cfs_time_t lqs_last_ishrink; /** time of last inode shrink */
+ spinlock_t lqs_lock;
+ struct quota_adjust_qunit lqs_key; /** hash key */
+ struct lustre_quota_ctxt *lqs_ctxt; /** quota ctxt */