X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fquota%2Fqsd_internal.h;h=518c525afa6c37114a086050494c719dfd11ac6b;hb=31832fab6d6da74e627133139b0c59c1dc07e62c;hp=c640a69df810d45da02f954c26988ea794df4717;hpb=e88b3bf26a477a2b42182c4b451bc2fe55fa88fa;p=fs%2Flustre-release.git diff --git a/lustre/quota/qsd_internal.h b/lustre/quota/qsd_internal.h index c640a69..518c525 100644 --- a/lustre/quota/qsd_internal.h +++ b/lustre/quota/qsd_internal.h @@ -21,7 +21,7 @@ * GPL HEADER END */ /* - * Copyright (c) 2012 Whamcloud, Inc. + * Copyright (c) 2012, 2013, Intel Corporation. * Use is subject to license terms. */ @@ -53,7 +53,7 @@ struct qsd_instance { /* procfs directory where information related to the underlying slaves * are exported */ - cfs_proc_dir_entry_t *qsd_proc; + struct proc_dir_entry *qsd_proc; /* export used for the connection to quota master */ struct obd_export *qsd_exp; @@ -76,26 +76,26 @@ struct qsd_instance { struct qsd_fsinfo *qsd_fsinfo; /* link into qfs_qsd_list of qfs_fsinfo */ - cfs_list_t qsd_link; + struct list_head qsd_link; /* list of lqe entry which might need quota space adjustment */ - cfs_list_t qsd_adjust_list; + struct list_head qsd_adjust_list; /* lock protecting adjust list */ - cfs_spinlock_t qsd_adjust_lock; + spinlock_t qsd_adjust_lock; /* dedicated thread for updating slave index files. */ struct ptlrpc_thread qsd_upd_thread; /* list of update tasks */ - cfs_list_t qsd_upd_list; + struct list_head qsd_upd_list; /* r/w spinlock protecting: * - the state flags * - the qsd update list * - the deferred list * - flags of the qsd_qtype_info */ - cfs_rwlock_t qsd_lock; + rwlock_t qsd_lock; /* Default quota settings which apply to all identifiers */ /* when blk qunit reaches this value, later write reqs from client @@ -112,7 +112,9 @@ struct qsd_instance { qsd_prepared:1, /* qsd_prepare() successfully * called */ qsd_exp_valid:1,/* qsd_exp is now valid */ - qsd_stopping:1; /* qsd_instance is stopping */ + qsd_stopping:1, /* qsd_instance is stopping */ + qsd_acct_failed:1; /* failed to set up acct + * for one quota type */ }; /* @@ -122,7 +124,7 @@ struct qsd_instance { */ struct qsd_qtype_info { /* reference count incremented by each user of this structure */ - cfs_atomic_t qqi_ref; + atomic_t qqi_ref; /* quota type, either USRQUOTA or GRPQUOTA * immutable after creation. */ @@ -161,9 +163,9 @@ struct qsd_qtype_info { struct lprocfs_stats *qqi_stats; /* deferred update for the global index copy */ - cfs_list_t qqi_deferred_glb; + struct list_head qqi_deferred_glb; /* deferred update for the slave index copy */ - cfs_list_t qqi_deferred_slv; + struct list_head qqi_deferred_slv; /* Various flags representing the current state of the slave for this * quota type. */ @@ -189,11 +191,11 @@ struct qsd_fsinfo { unsigned int qfs_enabled[LQUOTA_NR_RES]; /* list of all qsd_instance for this fs */ - cfs_list_t qfs_qsd_list; - cfs_semaphore_t qfs_sem; + struct list_head qfs_qsd_list; + struct mutex qfs_mutex; /* link to the global quota fsinfo list. */ - cfs_list_t qfs_link; + struct list_head qfs_link; /* reference count */ int qfs_ref; @@ -213,20 +215,20 @@ static inline struct qsd_qtype_info *lqe2qqi(struct lquota_entry *lqe) /* qqi_getref/putref is used to track users of a qqi structure */ static inline void qqi_getref(struct qsd_qtype_info *qqi) { - cfs_atomic_inc(&qqi->qqi_ref); + atomic_inc(&qqi->qqi_ref); } static inline void qqi_putref(struct qsd_qtype_info *qqi) { - LASSERT(cfs_atomic_read(&qqi->qqi_ref) > 0); - cfs_atomic_dec(&qqi->qqi_ref); + LASSERT(atomic_read(&qqi->qqi_ref) > 0); + atomic_dec(&qqi->qqi_ref); } #define QSD_RES_TYPE(qsd) ((qsd)->qsd_is_md ? LQUOTA_RES_MD : LQUOTA_RES_DT) /* udpate record for slave & global index copy */ struct qsd_upd_rec { - cfs_list_t qur_link; /* link into qsd_upd_list */ + struct list_head qur_link; /* link into qsd_upd_list */ union lquota_id qur_qid; union lquota_rec qur_rec; struct qsd_qtype_info *qur_qqi; @@ -245,7 +247,7 @@ struct qsd_thread_info { struct ldlm_enqueue_info qti_einfo; struct lustre_handle qti_lockh; __u64 qti_slv_ver; - union ldlm_wire_lvb qti_lvb; + struct lquota_lvb qti_lvb; union { struct quota_body qti_body; struct idx_info qti_ii; @@ -315,6 +317,14 @@ static inline void qsd_set_qunit(struct lquota_entry *lqe, __u64 qunit) lqe->lqe_nopreacq = false; } +/* helper function to set/clear edquot flag */ +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(); +} + #define QSD_WB_INTERVAL 60 /* 60 seconds */ /* helper function calculating how long a service thread should be waiting for @@ -351,16 +361,16 @@ typedef void (*qsd_req_completion_t) (const struct lu_env *, struct qsd_qtype_info *, struct quota_body *, struct quota_body *, struct lustre_handle *, - union ldlm_wire_lvb *, void *, int); + struct lquota_lvb *, void *, int); int qsd_send_dqacq(const struct lu_env *, struct obd_export *, struct quota_body *, bool, qsd_req_completion_t, struct qsd_qtype_info *, struct lustre_handle *, struct lquota_entry *); int qsd_intent_lock(const struct lu_env *, struct obd_export *, struct quota_body *, bool, int, qsd_req_completion_t, - struct qsd_qtype_info *, union ldlm_wire_lvb *, void *); + struct qsd_qtype_info *, struct lquota_lvb *, void *); int qsd_fetch_index(const struct lu_env *, struct obd_export *, - struct idx_info *, unsigned int, cfs_page_t **, bool *); + struct idx_info *, unsigned int, struct page **, bool *); /* qsd_writeback.c */ void qsd_bump_version(struct qsd_qtype_info *, __u64, bool);