X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Finclude%2Flustre_quota.h;h=838c460e20e3d7d906d70ad1c7e47661ab9c00ff;hp=9c6cd5d17dfde58a8e4a107ba303ec0c122a9f16;hb=222305972a5d38b0fe111966da775e98a0ec8269;hpb=3ba1cf51e65cb90c0a8746b6b93d93ffee9fef2f diff --git a/lustre/include/lustre_quota.h b/lustre/include/lustre_quota.h index 9c6cd5d..838c460 100644 --- a/lustre/include/lustre_quota.h +++ b/lustre/include/lustre_quota.h @@ -337,7 +337,7 @@ struct lustre_qunit_size { 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 */ + unsigned long long lqs_key; /** hash key */ struct lustre_quota_ctxt *lqs_ctxt; /** quota ctxt */ }; @@ -349,6 +349,13 @@ struct lustre_qunit_size { #define LQS_SET_ADJBLK(lqs) ((lqs)->lqs_flags |= LQUOTA_FLAGS_ADJBLK) #define LQS_SET_ADJINO(lqs) ((lqs)->lqs_flags |= LQUOTA_FLAGS_ADJINO) +/* In the hash for lustre_qunit_size, the key is decided by + * grp_or_usr and uid/gid, in here, I combine these two values, + * which will make comparing easier and more efficient */ +#define LQS_KEY(is_grp, id) ((is_grp ? 1ULL << 32: 0) + id) +#define LQS_KEY_ID(key) (key & 0xffffffff) +#define LQS_KEY_GRP(key) (key >> 32) + static inline void lqs_getref(struct lustre_qunit_size *lqs) { atomic_inc(&lqs->lqs_refcount);