X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fquota%2Fquota_internal.h;h=a96390dbfcf993072e4fcc4fd5273ccf988a5c97;hp=e9073bef40d1bc4c8e3cef584636ebbfe66c6526;hb=2f347eb0da65973bfc4acbd49ad48698bf71441f;hpb=cefa8cda2ba2d288ccaa4ec077a6c627592503ea diff --git a/lustre/quota/quota_internal.h b/lustre/quota/quota_internal.h index e9073be..a96390d 100644 --- a/lustre/quota/quota_internal.h +++ b/lustre/quota/quota_internal.h @@ -87,21 +87,21 @@ #define LQS_DEBUG(lqs, fmt, arg...) \ CDEBUG(D_QUOTA, "lqs(%p) id(%u) flag(%lu) type(%c) bunit(%lu) " \ "btune(%lu) iunit(%lu) itune(%lu) lqs_bwrite_pending(%lu) " \ - "lqs_iwrite_pending(%lu) ino_rec("LPD64") blk_rec("LPD64" ) " \ + "lqs_iwrite_pending(%lu) ino_rec(%lld) blk_rec(%lld) " \ "refcount(%d): " \ fmt, lqs, lqs->lqs_id, lqs->lqs_flags, \ LQS_IS_GRP(lqs) ? 'g' : 'u', \ lqs->lqs_bunit_sz, lqs->lqs_btune_sz, lqs->lqs_iunit_sz, \ lqs->lqs_itune_sz, lqs->lqs_bwrite_pending, \ lqs->lqs_iwrite_pending, lqs->lqs_ino_rec, \ - lqs->lqs_blk_rec, atomic_read(&lqs->lqs_refcount), ## arg); + lqs->lqs_blk_rec, cfs_atomic_read(&lqs->lqs_refcount), ## arg); /* quota_context.c */ void qunit_cache_cleanup(void); int qunit_cache_init(void); int qctxt_adjust_qunit(struct obd_device *obd, struct lustre_quota_ctxt *qctxt, - uid_t uid, gid_t gid, __u32 isblk, int wait, + const unsigned int id[], __u32 isblk, int wait, struct obd_trans_info *oti); int qctxt_wait_pending_dqacq(struct lustre_quota_ctxt *qctxt, unsigned int id, unsigned short type, int isblk); @@ -113,14 +113,20 @@ int compute_remquota(struct obd_device *obd, struct lustre_quota_ctxt *qctxt, struct qunit_data *qdata, int isblk); int check_qm(struct lustre_quota_ctxt *qctxt); +void dqacq_interrupt(struct lustre_quota_ctxt *qctxt); +int quota_is_on(struct lustre_quota_ctxt *qctxt, struct obd_quotactl *oqctl); +int quota_is_off(struct lustre_quota_ctxt *qctxt, struct obd_quotactl *oqctl); +void* quota_barrier(struct lustre_quota_ctxt *qctxt, + struct obd_quotactl *oqctl, int isblk); +void quota_unbarrier(void *handle); /* quota_master.c */ int lustre_dquot_init(void); void lustre_dquot_exit(void); int dqacq_handler(struct obd_device *obd, struct qunit_data *qdata, int opc); -int mds_quota_adjust(struct obd_device *obd, unsigned int qcids[], - unsigned int qpids[], int rc, int opc); -int filter_quota_adjust(struct obd_device *obd, unsigned int qcids[], - unsigned int qpids[], int rc, int opc); +int mds_quota_adjust(struct obd_device *obd, const unsigned int qcids[], + const unsigned int qpids[], int rc, int opc); +int filter_quota_adjust(struct obd_device *obd, const unsigned int qcids[], + const unsigned int qpids[], int rc, int opc); int init_admin_quotafiles(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_quota_get_version(struct obd_device *obd, lustre_quota_version_t *ver); int mds_quota_invalidate(struct obd_device *obd, struct obd_quotactl *oqctl); @@ -129,6 +135,7 @@ int mds_quota_finvalidate(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_admin_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl); +int do_mds_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_admin_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_set_dqinfo(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_get_dqinfo(struct obd_device *obd, struct obd_quotactl *oqctl); @@ -139,6 +146,7 @@ int mds_get_obd_quota(struct obd_device *obd, struct obd_quotactl *oqctl); int dquot_create_oqaq(struct lustre_quota_ctxt *qctxt, struct lustre_dquot *dquot, __u32 ost_num, __u32 mdt_num, int type, struct quota_adjust_qunit *oqaq); +int generic_quota_on(struct obd_device *, struct obd_quotactl *, int); #endif /* quota_ctl.c */ @@ -153,17 +161,11 @@ int target_quota_check(struct obd_device *obd, struct obd_export *exp, int quota_adjust_slave_lqs(struct quota_adjust_qunit *oqaq, struct lustre_quota_ctxt *qctxt); -void qdata_to_oqaq(struct qunit_data *qdata, - struct quota_adjust_qunit *oqaq); #ifdef __KERNEL__ -int quota_search_lqs(struct qunit_data *qdata, - struct quota_adjust_qunit *oqaq, - struct lustre_quota_ctxt *qctxt, - struct lustre_qunit_size **lqs_return); -int quota_create_lqs(struct qunit_data *qdata, - struct quota_adjust_qunit *oqaq, - struct lustre_quota_ctxt *qctxt, - struct lustre_qunit_size **lqs_return); +int quota_is_set(struct obd_device *obd, const unsigned int id[], int flag); +struct lustre_qunit_size *quota_search_lqs(unsigned long long lqs_key, + struct lustre_quota_ctxt *qctxt, + int create); void quota_compute_lqs(struct qunit_data *qdata, struct lustre_qunit_size *lqs, int is_chk, int is_acq); @@ -177,6 +179,7 @@ int filter_quota_adjust_qunit(struct obd_export *exp, struct lustre_quota_ctxt *qctxt); int lquota_proc_setup(struct obd_device *obd, int is_master); int lquota_proc_cleanup(struct lustre_quota_ctxt *qctxt); +void build_lqs(struct obd_device *obd); extern cfs_proc_dir_entry_t *lquota_type_proc_dir; #endif @@ -186,6 +189,8 @@ extern cfs_proc_dir_entry_t *lquota_type_proc_dir; #define LQS_INO_DECREASE 4 #define LQS_INO_INCREASE 8 +/* the return status of quota operation */ +#define QUOTA_REQ_RETURNED 1 #endif int client_quota_adjust_qunit(struct obd_export *exp, @@ -207,4 +212,5 @@ int lmv_quota_check(struct obd_device *unused, struct obd_export *exp, int lov_quota_check(struct obd_device *unused, struct obd_export *exp, struct obd_quotactl *oqctl); int client_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk); + #endif