X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Flustre_quota.h;h=1e128589d53c570607a908f79ae48e4c37880977;hb=864c1cef52710ce1980f32592bd1af364c6a75ed;hp=f9d1e15ef141194d45948c4524b5241b71acd281;hpb=45c495867c903379ec9e9acf01d3d49caffa36e4;p=fs%2Flustre-release.git diff --git a/lustre/include/lustre_quota.h b/lustre/include/lustre_quota.h index f9d1e15..1e12858 100644 --- a/lustre/include/lustre_quota.h +++ b/lustre/include/lustre_quota.h @@ -26,7 +26,7 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* @@ -162,10 +162,6 @@ struct lustre_quota_info { lustre_quota_version_t qi_version; }; -#define DQ_STATUS_AVAIL 0x0 /* Available dquot */ -#define DQ_STATUS_SET 0x01 /* Sombody is setting dquot */ -#define DQ_STATUS_RECOVERY 0x02 /* dquot is in recovery */ - struct lustre_mem_dqblk { __u64 dqb_bhardlimit; /**< absolute limit on disk blks alloc */ __u64 dqb_bsoftlimit; /**< preferred limit on disk blks */ @@ -183,7 +179,7 @@ struct lustre_dquot { /** Protect the data in lustre_dquot */ cfs_semaphore_t dq_sem; /** Use count */ - int dq_refcnt; + cfs_atomic_t dq_refcnt; /** Pointer of quota info it belongs to */ struct lustre_quota_info *dq_info; /** Offset of dquot on disk */ @@ -192,8 +188,6 @@ struct lustre_dquot { unsigned int dq_id; /** Type fo quota (USRQUOTA, GRPQUOUTA) */ int dq_type; - /** See DQ_STATUS_ */ - unsigned short dq_status; /** See DQ_ in quota.h */ unsigned long dq_flags; /** Diskquota usage */ @@ -381,13 +375,20 @@ struct lustre_qunit_size { struct lustre_quota_ctxt *lqs_ctxt; /** quota ctxt */ }; -#define LQS_IS_GRP(lqs) ((lqs)->lqs_flags & LQUOTA_FLAGS_GRP) -#define LQS_IS_ADJBLK(lqs) ((lqs)->lqs_flags & LQUOTA_FLAGS_ADJBLK) -#define LQS_IS_ADJINO(lqs) ((lqs)->lqs_flags & LQUOTA_FLAGS_ADJINO) +#define LQS_IS_GRP(lqs) ((lqs)->lqs_flags & LQUOTA_FLAGS_GRP) +#define LQS_IS_ADJBLK(lqs) ((lqs)->lqs_flags & LQUOTA_FLAGS_ADJBLK) +#define LQS_IS_ADJINO(lqs) ((lqs)->lqs_flags & LQUOTA_FLAGS_ADJINO) +#define LQS_IS_RECOVERY(lqs) ((lqs)->lqs_flags & LQUOTA_FLAGS_RECOVERY) +#define LQS_IS_SETQUOTA(lqs) ((lqs)->lqs_flags & LQUOTA_FLAGS_SETQUOTA) + +#define LQS_SET_GRP(lqs) ((lqs)->lqs_flags |= LQUOTA_FLAGS_GRP) +#define LQS_SET_ADJBLK(lqs) ((lqs)->lqs_flags |= LQUOTA_FLAGS_ADJBLK) +#define LQS_SET_ADJINO(lqs) ((lqs)->lqs_flags |= LQUOTA_FLAGS_ADJINO) +#define LQS_SET_RECOVERY(lqs) ((lqs)->lqs_flags |= LQUOTA_FLAGS_RECOVERY) +#define LQS_SET_SETQUOTA(lqs) ((lqs)->lqs_flags |= LQUOTA_FLAGS_SETQUOTA) -#define LQS_SET_GRP(lqs) ((lqs)->lqs_flags |= LQUOTA_FLAGS_GRP) -#define LQS_SET_ADJBLK(lqs) ((lqs)->lqs_flags |= LQUOTA_FLAGS_ADJBLK) -#define LQS_SET_ADJINO(lqs) ((lqs)->lqs_flags |= LQUOTA_FLAGS_ADJINO) +#define LQS_CLEAR_RECOVERY(lqs) ((lqs)->lqs_flags &= ~LQUOTA_FLAGS_RECOVERY) +#define LQS_CLEAR_SETQUOTA(lqs) ((lqs)->lqs_flags &= ~LQUOTA_FLAGS_SETQUOTA) /* 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, @@ -446,7 +447,7 @@ struct lustre_quota_ctxt { #else -#define LL_DQUOT_OFF(sb, remount) do {} while(0) +#define LL_DQUOT_OFF(sb) do {} while(0) struct lustre_quota_info { }; @@ -559,7 +560,8 @@ typedef struct { */ int (*quota_adjust_qunit) (struct obd_export *exp, struct quota_adjust_qunit *oqaq, - struct lustre_quota_ctxt *qctxt); + struct lustre_quota_ctxt *qctxt, + struct ptlrpc_request_set *rqset); } quota_interface_t;