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-7988 hsm: update many cookie status at once
[fs/lustre-release.git]
/
lustre
/
quota
/
qmt_handler.c
diff --git
a/lustre/quota/qmt_handler.c
b/lustre/quota/qmt_handler.c
index
948e398
..
e0c99ad
100644
(file)
--- a/
lustre/quota/qmt_handler.c
+++ b/
lustre/quota/qmt_handler.c
@@
-21,17
+21,13
@@
* GPL HEADER END
*/
/*
* GPL HEADER END
*/
/*
- * Copyright (c) 2012
Intel, Inc
.
+ * Copyright (c) 2012
, Intel Corporation
.
* Use is subject to license terms.
*
* Author: Johann Lombardi <johann.lombardi@intel.com>
* Author: Niu Yawei <yawei.niu@intel.com>
*/
* Use is subject to license terms.
*
* Author: Johann Lombardi <johann.lombardi@intel.com>
* Author: Niu Yawei <yawei.niu@intel.com>
*/
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-
#define DEBUG_SUBSYSTEM S_LQUOTA
#include <obd_class.h>
#define DEBUG_SUBSYSTEM S_LQUOTA
#include <obd_class.h>
@@
-103,7
+99,8
@@
static int qmt_set(const struct lu_env *env, struct qmt_device *qmt,
struct qmt_thread_info *qti = qmt_info(env);
struct lquota_entry *lqe;
struct thandle *th = NULL;
struct qmt_thread_info *qti = qmt_info(env);
struct lquota_entry *lqe;
struct thandle *th = NULL;
- __u64 ver, now;
+ time64_t now;
+ __u64 ver;
bool dirtied = false;
int rc = 0;
ENTRY;
bool dirtied = false;
int rc = 0;
ENTRY;
@@
-119,11
+116,11
@@
static int qmt_set(const struct lu_env *env, struct qmt_device *qmt,
if (IS_ERR(th))
GOTO(out_nolock, rc = PTR_ERR(th));
if (IS_ERR(th))
GOTO(out_nolock, rc = PTR_ERR(th));
- now =
cfs_time_current_sec
();
+ now =
ktime_get_real_seconds
();
lqe_write_lock(lqe);
lqe_write_lock(lqe);
- LQUOTA_DEBUG(lqe, "changing quota settings valid:%x hard:
"LPU64"
soft:"
-
LPU64" time:"LPU64
, valid, hard, soft, time);
+ LQUOTA_DEBUG(lqe, "changing quota settings valid:%x hard:
%llu
soft:"
+
"%llu time:%llu"
, valid, hard, soft, time);
if ((valid & QIF_TIMES) != 0 && lqe->lqe_gracetime != time) {
/* change time settings */
if ((valid & QIF_TIMES) != 0 && lqe->lqe_gracetime != time) {
/* change time settings */
@@
-213,7
+210,7
@@
static int qmt_quotactl(const struct lu_env *env, struct lu_device *ld,
LASSERT(qmt != NULL);
LASSERT(qmt != NULL);
- if (oqctl->qc_type >= MAXQUOTAS)
+ if (oqctl->qc_type >=
LL_
MAXQUOTAS)
/* invalid quota type */
RETURN(-EINVAL);
/* invalid quota type */
RETURN(-EINVAL);
@@
-316,13
+313,6
@@
static int qmt_quotactl(const struct lu_env *env, struct lu_device *ld,
dqb->dqb_valid & QIF_BFLAGS);
break;
dqb->dqb_valid & QIF_BFLAGS);
break;
- case Q_QUOTAON:
- case Q_QUOTAOFF: /* quota is always turned on on the master */
- RETURN(0);
-
- case LUSTRE_Q_INVALIDATE: /* not supported any more */
- RETURN(-ENOTSUPP);
-
default:
CERROR("%s: unsupported quotactl command: %d\n",
qmt->qmt_svname, oqctl->qc_cmd);
default:
CERROR("%s: unsupported quotactl command: %d\n",
qmt->qmt_svname, oqctl->qc_cmd);
@@
-389,8
+379,8
@@
int qmt_dqacq0(const struct lu_env *env, struct lquota_entry *lqe,
GOTO(out, rc = PTR_ERR(th));
lqe_write_lock(lqe);
GOTO(out, rc = PTR_ERR(th));
lqe_write_lock(lqe);
- LQUOTA_DEBUG(lqe, "dqacq starts uuid:%s flags:0x%x wanted:
"LPU64
- " usage:
"LPU64
, obd_uuid2str(uuid), qb_flags, qb_count,
+ LQUOTA_DEBUG(lqe, "dqacq starts uuid:%s flags:0x%x wanted:
%llu"
+ " usage:
%llu"
, obd_uuid2str(uuid), qb_flags, qb_count,
qb_usage);
/* Legal race, limits have been removed on master, but slave didn't
qb_usage);
/* Legal race, limits have been removed on master, but slave didn't
@@
-418,7
+408,7
@@
int qmt_dqacq0(const struct lu_env *env, struct lquota_entry *lqe,
slv_granted_bck = slv_granted;
/* record current time for soft limit & grace time management */
slv_granted_bck = slv_granted;
/* record current time for soft limit & grace time management */
- now =
(__u64)cfs_time_current_sec
();
+ now =
ktime_get_real_seconds
();
if (req_is_rel(qb_flags)) {
/* Slave would like to release quota space */
if (req_is_rel(qb_flags)) {
/* Slave would like to release quota space */
@@
-426,7
+416,7
@@
int qmt_dqacq0(const struct lu_env *env, struct lquota_entry *lqe,
lqe->lqe_granted < qb_count) {
/* can't release more than granted */
LQUOTA_ERROR(lqe, "Release too much! uuid:%s release:"
lqe->lqe_granted < qb_count) {
/* can't release more than granted */
LQUOTA_ERROR(lqe, "Release too much! uuid:%s release:"
-
LPU64" granted:"LPU64", total:"LPU64
,
+
"%llu granted:%llu, total:%llu"
,
obd_uuid2str(uuid), qb_count,
slv_granted, lqe->lqe_granted);
GOTO(out_locked, rc = -EINVAL);
obd_uuid2str(uuid), qb_count,
slv_granted, lqe->lqe_granted);
GOTO(out_locked, rc = -EINVAL);
@@
-560,7
+550,7
@@
out_write:
/* clear/set edquot flag and notify slaves via glimpse if needed */
qmt_adjust_edquot(lqe, now);
out_locked:
/* clear/set edquot flag and notify slaves via glimpse if needed */
qmt_adjust_edquot(lqe, now);
out_locked:
- LQUOTA_DEBUG(lqe, "dqacq ends count:
"LPU64" ver:"LPU64"
rc:%d",
+ LQUOTA_DEBUG(lqe, "dqacq ends count:
%llu ver:%llu
rc:%d",
repbody->qb_count, repbody->qb_slv_ver, rc);
lqe_write_unlock(lqe);
out:
repbody->qb_count, repbody->qb_slv_ver, rc);
lqe_write_unlock(lqe);
out:
@@
-568,7
+558,7
@@
out:
dt_trans_stop(env, qmt->qmt_child, th);
if (slv_obj != NULL && !IS_ERR(slv_obj))
dt_trans_stop(env, qmt->qmt_child, th);
if (slv_obj != NULL && !IS_ERR(slv_obj))
-
lu_object_put(env, &slv_obj->do_lu
);
+
dt_object_put(env, slv_obj
);
if ((req_is_acq(qb_flags) || req_is_preacq(qb_flags)) &&
OBD_FAIL_CHECK(OBD_FAIL_QUOTA_EDQUOT)) {
if ((req_is_acq(qb_flags) || req_is_preacq(qb_flags)) &&
OBD_FAIL_CHECK(OBD_FAIL_QUOTA_EDQUOT)) {
@@
-647,13
+637,13
@@
static int qmt_dqacq(const struct lu_env *env, struct lu_device *ld,
RETURN(-ENOLCK);
}
RETURN(-ENOLCK);
}
- if (
(lock->l_flags & LDLM_FL_AST_SENT) != 0
) {
+ if (
ldlm_is_ast_sent(lock)
) {
struct ptlrpc_service_part *svc;
unsigned int timeout;
svc = req->rq_rqbd->rqbd_svcpt;
timeout = at_est2timeout(at_get(&svc->scp_at_estimate));
struct ptlrpc_service_part *svc;
unsigned int timeout;
svc = req->rq_rqbd->rqbd_svcpt;
timeout = at_est2timeout(at_get(&svc->scp_at_estimate));
- timeout
= max(timeout, ldlm_timeout
);
+ timeout
+= (ldlm_bl_timeout(lock) >> 1
);
/* lock is being cancelled, prolong timeout */
ldlm_refresh_waiting_lock(lock, timeout);
/* lock is being cancelled, prolong timeout */
ldlm_refresh_waiting_lock(lock, timeout);