Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-9019 mdt: use ktime_t for calculating elapsed time
[fs/lustre-release.git]
/
lustre
/
quota
/
qsd_internal.h
diff --git
a/lustre/quota/qsd_internal.h
b/lustre/quota/qsd_internal.h
index
a518f4a
..
9b1d6b2
100644
(file)
--- a/
lustre/quota/qsd_internal.h
+++ b/
lustre/quota/qsd_internal.h
@@
-21,7
+21,7
@@
* GPL HEADER END
*/
/*
* GPL HEADER END
*/
/*
- * Copyright (c) 2012, 201
3
, Intel Corporation.
+ * Copyright (c) 2012, 201
4
, Intel Corporation.
* Use is subject to license terms.
*/
* Use is subject to license terms.
*/
@@
-53,7
+53,7
@@
struct qsd_instance {
/* procfs directory where information related to the underlying slaves
* are exported */
/* 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;
/* export used for the connection to quota master */
struct obd_export *qsd_exp;
@@
-70,16
+70,16
@@
struct qsd_instance {
*
* This will have to be revisited if new quota types are added in the
* future. For the time being, we can just use an array. */
*
* This will have to be revisited if new quota types are added in the
* future. For the time being, we can just use an array. */
- struct qsd_qtype_info *qsd_type_array[MAXQUOTAS];
+ struct qsd_qtype_info *qsd_type_array[
LL_
MAXQUOTAS];
/* per-filesystem quota information */
struct qsd_fsinfo *qsd_fsinfo;
/* link into qfs_qsd_list of qfs_fsinfo */
/* per-filesystem quota information */
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 */
/* 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 */
spinlock_t qsd_adjust_lock;
/* lock protecting adjust list */
spinlock_t qsd_adjust_lock;
@@
-88,7
+88,7
@@
struct qsd_instance {
struct ptlrpc_thread qsd_upd_thread;
/* list of update tasks */
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
/* r/w spinlock protecting:
* - the state flags
@@
-124,7
+124,7
@@
struct qsd_instance {
*/
struct qsd_qtype_info {
/* reference count incremented by each user of this structure */
*/
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. */
/* quota type, either USRQUOTA or GRPQUOTA
* immutable after creation. */
@@
-163,9
+163,9
@@
struct qsd_qtype_info {
struct lprocfs_stats *qqi_stats;
/* deferred update for the global index copy */
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 */
/* 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. */
/* Various flags representing the current state of the slave for this
* quota type. */
@@
-191,11
+191,11
@@
struct qsd_fsinfo {
unsigned int qfs_enabled[LQUOTA_NR_RES];
/* list of all qsd_instance for this fs */
unsigned int qfs_enabled[LQUOTA_NR_RES];
/* list of all qsd_instance for this fs */
-
cfs_list_t
qfs_qsd_list;
- struct
semaphore qfs_sem
;
+
struct list_head
qfs_qsd_list;
+ struct
mutex qfs_mutex
;
/* link to the global quota fsinfo list. */
/* link to the global quota fsinfo list. */
-
cfs_list_t
qfs_link;
+
struct list_head
qfs_link;
/* reference count */
int qfs_ref;
/* reference count */
int qfs_ref;
@@
-215,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)
{
/* 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)
{
}
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 {
}
#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;
union lquota_id qur_qid;
union lquota_rec qur_rec;
struct qsd_qtype_info *qur_qqi;
@@
-277,7
+277,7
@@
static inline int qsd_type_enabled(struct qsd_instance *qsd, int type)
int enabled, pool;
LASSERT(qsd != NULL);
int enabled, pool;
LASSERT(qsd != NULL);
- LASSERT(type < MAXQUOTAS);
+ LASSERT(type <
LL_
MAXQUOTAS);
if (qsd->qsd_fsinfo == NULL)
return 0;
if (qsd->qsd_fsinfo == NULL)
return 0;
@@
-317,6
+317,14
@@
static inline void qsd_set_qunit(struct lquota_entry *lqe, __u64 qunit)
lqe->lqe_nopreacq = false;
}
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
#define QSD_WB_INTERVAL 60 /* 60 seconds */
/* helper function calculating how long a service thread should be waiting for