aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/ldlm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lustre/ldlm')
-rw-r--r--drivers/staging/lustre/lustre/ldlm/interval_tree.c6
-rw-r--r--drivers/staging/lustre/lustre/ldlm/l_lock.c6
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_extent.c16
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_flock.c14
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c7
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_lib.c46
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_lock.c53
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c15
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_plain.c6
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_pool.c38
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_request.c38
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_resource.c39
12 files changed, 134 insertions, 150 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/interval_tree.c b/drivers/staging/lustre/lustre/ldlm/interval_tree.c
index 1de1d8eb9b41..a3d7a7292417 100644
--- a/drivers/staging/lustre/lustre/ldlm/interval_tree.c
+++ b/drivers/staging/lustre/lustre/ldlm/interval_tree.c
@@ -38,9 +38,9 @@
* Author: Huang Wei <huangwei@clusterfs.com>
* Author: Jay Xiong <jinshan.xiong@sun.com>
*/
-# include <lustre_dlm.h>
-#include <obd_support.h>
-#include <interval_tree.h>
+#include "../include/lustre_dlm.h"
+#include "../include/obd_support.h"
+#include "../include/interval_tree.h"
enum {
INTERVAL_RED = 0,
diff --git a/drivers/staging/lustre/lustre/ldlm/l_lock.c b/drivers/staging/lustre/lustre/ldlm/l_lock.c
index 32f4d52b5362..cd8ab40e3267 100644
--- a/drivers/staging/lustre/lustre/ldlm/l_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/l_lock.c
@@ -35,10 +35,10 @@
*/
#define DEBUG_SUBSYSTEM S_LDLM
-#include <linux/libcfs/libcfs.h>
+#include "../../include/linux/libcfs/libcfs.h"
-#include <lustre_dlm.h>
-#include <lustre_lib.h>
+#include "../include/lustre_dlm.h"
+#include "../include/lustre_lib.h"
/**
* Lock a lock and its resource.
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
index bde3a82ce0dd..0c09b611f4a6 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
@@ -50,14 +50,12 @@
*/
#define DEBUG_SUBSYSTEM S_LDLM
-# include <linux/libcfs/libcfs.h>
-
-#include <lustre_dlm.h>
-#include <obd_support.h>
-#include <obd.h>
-#include <obd_class.h>
-#include <lustre_lib.h>
-
+#include "../../include/linux/libcfs/libcfs.h"
+#include "../include/lustre_dlm.h"
+#include "../include/obd_support.h"
+#include "../include/obd.h"
+#include "../include/obd_class.h"
+#include "../include/lustre_lib.h"
#include "ldlm_internal.h"
@@ -92,7 +90,7 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)
if (lck->l_policy_data.l_extent.end + 1 > kms)
kms = lck->l_policy_data.l_extent.end + 1;
}
- LASSERTF(kms <= old_kms, "kms "LPU64" old_kms "LPU64"\n", kms, old_kms);
+ LASSERTF(kms <= old_kms, "kms %llu old_kms %llu\n", kms, old_kms);
return kms;
}
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
index 986bf384bff7..b798daa094bc 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
@@ -56,12 +56,11 @@
#define DEBUG_SUBSYSTEM S_LDLM
-#include <lustre_dlm.h>
-#include <obd_support.h>
-#include <obd_class.h>
-#include <lustre_lib.h>
+#include "../include/lustre_dlm.h"
+#include "../include/obd_support.h"
+#include "../include/obd_class.h"
+#include "../include/lustre_lib.h"
#include <linux/list.h>
-
#include "ldlm_internal.h"
int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
@@ -261,9 +260,8 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
int splitted = 0;
const struct ldlm_callback_suite null_cbs = { NULL };
- CDEBUG(D_DLMTRACE, "flags %#llx owner "LPU64" pid %u mode %u start "
- LPU64" end "LPU64"\n", *flags,
- new->l_policy_data.l_flock.owner,
+ CDEBUG(D_DLMTRACE, "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
+ *flags, new->l_policy_data.l_flock.owner,
new->l_policy_data.l_flock.pid, mode,
req->l_policy_data.l_flock.start,
req->l_policy_data.l_flock.end);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c b/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c
index 574b2ff43b74..40d3338506ae 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c
@@ -53,10 +53,9 @@
#define DEBUG_SUBSYSTEM S_LDLM
-#include <lustre_dlm.h>
-#include <obd_support.h>
-#include <lustre_lib.h>
-
+#include "../include/lustre_dlm.h"
+#include "../include/obd_support.h"
+#include "../include/lustre_lib.h"
#include "ldlm_internal.h"
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
index 8bb59155968f..fda9926bea3b 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
@@ -43,12 +43,12 @@
#define DEBUG_SUBSYSTEM S_LDLM
-# include <linux/libcfs/libcfs.h>
-#include <obd.h>
-#include <obd_class.h>
-#include <lustre_dlm.h>
-#include <lustre_net.h>
-#include <lustre_sec.h>
+#include "../../include/linux/libcfs/libcfs.h"
+#include "../include/obd.h"
+#include "../include/obd_class.h"
+#include "../include/lustre_dlm.h"
+#include "../include/lustre_net.h"
+#include "../include/lustre_sec.h"
#include "ldlm_internal.h"
/* @priority: If non-zero, move the selected connection to the list head.
@@ -74,9 +74,8 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid,
if (create) {
OBD_ALLOC(imp_conn, sizeof(*imp_conn));
- if (!imp_conn) {
+ if (!imp_conn)
GOTO(out_put, rc = -ENOMEM);
- }
}
spin_lock(&imp->imp_lock);
@@ -511,14 +510,14 @@ int client_connect_import(const struct lu_env *env,
rc = ptlrpc_connect_import(imp);
if (rc != 0) {
- LASSERT (imp->imp_state == LUSTRE_IMP_DISCON);
+ LASSERT(imp->imp_state == LUSTRE_IMP_DISCON);
GOTO(out_ldlm, rc);
}
LASSERT(*exp != NULL && (*exp)->exp_connection);
if (data) {
LASSERTF((ocd->ocd_connect_flags & data->ocd_connect_flags) ==
- ocd->ocd_connect_flags, "old "LPX64", new "LPX64"\n",
+ ocd->ocd_connect_flags, "old %#llx, new %#llx\n",
data->ocd_connect_flags, ocd->ocd_connect_flags);
data->ocd_connect_flags = ocd->ocd_connect_flags;
}
@@ -546,7 +545,7 @@ int client_disconnect_export(struct obd_export *exp)
int rc = 0, err;
if (!obd) {
- CERROR("invalid export for disconnect: exp %p cookie "LPX64"\n",
+ CERROR("invalid export for disconnect: exp %p cookie %#llx\n",
exp, exp ? exp->exp_handle.h_cookie : -1);
return -EINVAL;
}
@@ -662,33 +661,32 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)
struct ptlrpc_reply_state *rs;
struct obd_export *exp;
- if (req->rq_no_reply) {
+ if (req->rq_no_reply)
return;
- }
svcpt = req->rq_rqbd->rqbd_svcpt;
rs = req->rq_reply_state;
if (rs == NULL || !rs->rs_difficult) {
/* no notifiers */
- target_send_reply_msg (req, rc, fail_id);
+ target_send_reply_msg(req, rc, fail_id);
return;
}
/* must be an export if locks saved */
- LASSERT (req->rq_export != NULL);
+ LASSERT(req->rq_export != NULL);
/* req/reply consistent */
LASSERT(rs->rs_svcpt == svcpt);
/* "fresh" reply */
- LASSERT (!rs->rs_scheduled);
- LASSERT (!rs->rs_scheduled_ever);
- LASSERT (!rs->rs_handled);
- LASSERT (!rs->rs_on_net);
- LASSERT (rs->rs_export == NULL);
- LASSERT (list_empty(&rs->rs_obd_list));
- LASSERT (list_empty(&rs->rs_exp_list));
+ LASSERT(!rs->rs_scheduled);
+ LASSERT(!rs->rs_scheduled_ever);
+ LASSERT(!rs->rs_handled);
+ LASSERT(!rs->rs_on_net);
+ LASSERT(rs->rs_export == NULL);
+ LASSERT(list_empty(&rs->rs_obd_list));
+ LASSERT(list_empty(&rs->rs_exp_list));
- exp = class_export_get (req->rq_export);
+ exp = class_export_get(req->rq_export);
/* disable reply scheduling while I'm setting up */
rs->rs_scheduled = 1;
@@ -699,7 +697,7 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)
rs->rs_opc = lustre_msg_get_opc(req->rq_reqmsg);
spin_lock(&exp->exp_uncommitted_replies_lock);
- CDEBUG(D_NET, "rs transno = "LPU64", last committed = "LPU64"\n",
+ CDEBUG(D_NET, "rs transno = %llu, last committed = %llu\n",
rs->rs_transno, exp->exp_last_committed);
if (rs->rs_transno > exp->exp_last_committed) {
/* not committed already */
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 1b3f5c1eb808..d022666fb705 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -41,10 +41,9 @@
#define DEBUG_SUBSYSTEM S_LDLM
-# include <linux/libcfs/libcfs.h>
-# include <linux/lustre_intent.h>
-
-#include <obd_class.h>
+#include "../../include/linux/libcfs/libcfs.h"
+#include "../include/linux/lustre_intent.h"
+#include "../include/obd_class.h"
#include "ldlm_internal.h"
/* lock types */
@@ -625,8 +624,7 @@ void ldlm_lock2desc(struct ldlm_lock *lock, struct ldlm_lock_desc *desc)
LASSERTF(lock->l_policy_data.l_inodebits.bits ==
(MDS_INODELOCK_LOOKUP | MDS_INODELOCK_UPDATE |
MDS_INODELOCK_LAYOUT),
- "Inappropriate inode lock bits during "
- "conversion " LPU64 "\n",
+ "Inappropriate inode lock bits during conversion %llu\n",
lock->l_policy_data.l_inodebits.bits);
ldlm_res2desc(lock->l_resource, &desc->l_resource);
@@ -899,7 +897,7 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode)
void ldlm_lock_decref(struct lustre_handle *lockh, __u32 mode)
{
struct ldlm_lock *lock = __ldlm_handle2lock(lockh, 0);
- LASSERTF(lock != NULL, "Non-existing lock: "LPX64"\n", lockh->cookie);
+ LASSERTF(lock != NULL, "Non-existing lock: %#llx\n", lockh->cookie);
ldlm_lock_decref_internal(lock, mode);
LDLM_LOCK_PUT(lock);
}
@@ -1351,7 +1349,7 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
}
out2:
if (rc) {
- LDLM_DEBUG(lock, "matched ("LPU64" "LPU64")",
+ LDLM_DEBUG(lock, "matched (%llu %llu)",
(type == LDLM_PLAIN || type == LDLM_IBITS) ?
res_id->name[2] : policy->l_extent.start,
(type == LDLM_PLAIN || type == LDLM_IBITS) ?
@@ -1370,9 +1368,8 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
LDLM_LOCK_RELEASE(lock);
} else if (!(flags & LDLM_FL_TEST_LOCK)) {/*less verbose for test-only*/
- LDLM_DEBUG_NOLOCK("not matched ns %p type %u mode %u res "
- LPU64"/"LPU64" ("LPU64" "LPU64")", ns,
- type, mode, res_id->name[0], res_id->name[1],
+ LDLM_DEBUG_NOLOCK("not matched ns %p type %u mode %u res %llu/%llu (%llu %llu)",
+ ns, type, mode, res_id->name[0], res_id->name[1],
(type == LDLM_PLAIN || type == LDLM_IBITS) ?
res_id->name[2] :policy->l_extent.start,
(type == LDLM_PLAIN || type == LDLM_IBITS) ?
@@ -1595,7 +1592,7 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns,
ldlm_error_t rc = ELDLM_OK;
struct ldlm_interval *node = NULL;
- lock->l_last_activity = cfs_time_current_sec();
+ lock->l_last_activity = get_seconds();
/* policies are not executed on the client or during replay */
if ((*flags & (LDLM_FL_HAS_INTENT|LDLM_FL_REPLAY)) == LDLM_FL_HAS_INTENT
&& !local && ns->ns_policy) {
@@ -2258,9 +2255,9 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
if (resource == NULL) {
libcfs_debug_vmsg2(msgdata, fmt, args,
- " ns: \?\? lock: %p/"LPX64" lrc: %d/%d,%d mode: %s/%s "
- "res: \?\? rrc=\?\? type: \?\?\? flags: "LPX64" nid: %s "
- "remote: "LPX64" expref: %d pid: %u timeout: %lu "
+ " ns: \?\? lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
+ "res: \?\? rrc=\?\? type: \?\?\? flags: %#llx nid: %s "
+ "remote: %#llx expref: %d pid: %u timeout: %lu "
"lvb_type: %d\n",
lock,
lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
@@ -2277,10 +2274,10 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
switch (resource->lr_type) {
case LDLM_EXTENT:
libcfs_debug_vmsg2(msgdata, fmt, args,
- " ns: %s lock: %p/"LPX64" lrc: %d/%d,%d mode: %s/%s "
- "res: "DLDLMRES" rrc: %d type: %s ["LPU64"->"LPU64"] "
- "(req "LPU64"->"LPU64") flags: "LPX64" nid: %s remote: "
- LPX64" expref: %d pid: %u timeout: %lu lvb_type: %d\n",
+ " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
+ "res: "DLDLMRES" rrc: %d type: %s [%llu->%llu] "
+ "(req %llu->%llu) flags: %#llx nid: %s remote: "
+ "%#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n",
ldlm_lock_to_ns_name(lock), lock,
lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
lock->l_readers, lock->l_writers,
@@ -2300,10 +2297,10 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
case LDLM_FLOCK:
libcfs_debug_vmsg2(msgdata, fmt, args,
- " ns: %s lock: %p/"LPX64" lrc: %d/%d,%d mode: %s/%s "
+ " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
"res: "DLDLMRES" rrc: %d type: %s pid: %d "
- "["LPU64"->"LPU64"] flags: "LPX64" nid: %s "
- "remote: "LPX64" expref: %d pid: %u timeout: %lu\n",
+ "[%llu->%llu] flags: %#llx nid: %s "
+ "remote: %#llx expref: %d pid: %u timeout: %lu\n",
ldlm_lock_to_ns_name(lock), lock,
lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
lock->l_readers, lock->l_writers,
@@ -2322,9 +2319,9 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
case LDLM_IBITS:
libcfs_debug_vmsg2(msgdata, fmt, args,
- " ns: %s lock: %p/"LPX64" lrc: %d/%d,%d mode: %s/%s "
- "res: "DLDLMRES" bits "LPX64" rrc: %d type: %s "
- "flags: "LPX64" nid: %s remote: "LPX64" expref: %d "
+ " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
+ "res: "DLDLMRES" bits %#llx rrc: %d type: %s "
+ "flags: %#llx nid: %s remote: %#llx expref: %d "
"pid: %u timeout: %lu lvb_type: %d\n",
ldlm_lock_to_ns_name(lock),
lock, lock->l_handle.h_cookie,
@@ -2344,9 +2341,9 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
default:
libcfs_debug_vmsg2(msgdata, fmt, args,
- " ns: %s lock: %p/"LPX64" lrc: %d/%d,%d mode: %s/%s "
- "res: "DLDLMRES" rrc: %d type: %s flags: "LPX64" "
- "nid: %s remote: "LPX64" expref: %d pid: %u "
+ " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
+ "res: "DLDLMRES" rrc: %d type: %s flags: %#llx "
+ "nid: %s remote: %#llx expref: %d pid: %u "
"timeout: %lu lvb_type: %d\n",
ldlm_lock_to_ns_name(lock),
lock, lock->l_handle.h_cookie,
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index 7e63cf355cd9..952e10eb6178 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -41,10 +41,9 @@
#define DEBUG_SUBSYSTEM S_LDLM
-# include <linux/libcfs/libcfs.h>
-
-#include <lustre_dlm.h>
-#include <obd_class.h>
+#include "../../include/linux/libcfs/libcfs.h"
+#include "../include/lustre_dlm.h"
+#include "../include/obd_class.h"
#include <linux/list.h>
#include "ldlm_internal.h"
@@ -70,7 +69,7 @@ struct ldlm_cb_async_args {
static struct ldlm_state *ldlm_state;
-inline cfs_time_t round_timeout(cfs_time_t timeout)
+inline unsigned long round_timeout(unsigned long timeout)
{
return cfs_time_seconds((int)cfs_duration_sec(cfs_time_sub(timeout, 0)) + 1);
}
@@ -526,7 +525,7 @@ static inline void ldlm_callback_errmsg(struct ptlrpc_request *req,
struct lustre_handle *handle)
{
DEBUG_REQ((req->rq_no_reply || rc) ? D_WARNING : D_DLMTRACE, req,
- "%s: [nid %s] [rc %d] [lock "LPX64"]",
+ "%s: [nid %s] [rc %d] [lock %#llx]",
msg, libcfs_id2str(req->rq_peer), rc,
handle ? handle->cookie : 0);
if (req->rq_no_reply)
@@ -636,7 +635,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
lock = ldlm_handle2lock_long(&dlm_req->lock_handle[0], 0);
if (!lock) {
- CDEBUG(D_DLMTRACE, "callback on lock "LPX64" - lock "
+ CDEBUG(D_DLMTRACE, "callback on lock %#llx - lock "
"disappeared\n", dlm_req->lock_handle[0].cookie);
rc = ldlm_callback_reply(req, -EINVAL);
ldlm_callback_errmsg(req, "Operate with invalid parameter", rc,
@@ -661,7 +660,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
(lock->l_flags & LDLM_FL_BL_DONE)) ||
(lock->l_flags & LDLM_FL_FAILED)) {
LDLM_DEBUG(lock, "callback on lock "
- LPX64" - lock disappeared\n",
+ "%#llx - lock disappeared\n",
dlm_req->lock_handle[0].cookie);
unlock_res_and_lock(lock);
LDLM_LOCK_RELEASE(lock);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c b/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c
index ec29e28624fe..a1fe2c161e38 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c
@@ -52,9 +52,9 @@
#define DEBUG_SUBSYSTEM S_LDLM
-#include <lustre_dlm.h>
-#include <obd_support.h>
-#include <lustre_lib.h>
+#include "../include/lustre_dlm.h"
+#include "../include/obd_support.h"
+#include "../include/lustre_lib.h"
#include "ldlm_internal.h"
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index 2cc698179b63..db36b3f46e49 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -97,12 +97,10 @@
#define DEBUG_SUBSYSTEM S_LDLM
-# include <lustre_dlm.h>
-
-#include <cl_object.h>
-
-#include <obd_class.h>
-#include <obd_support.h>
+#include "../include/lustre_dlm.h"
+#include "../include/cl_object.h"
+#include "../include/obd_class.h"
+#include "../include/obd_support.h"
#include "ldlm_internal.h"
@@ -336,12 +334,12 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
{
time_t recalc_interval_sec;
- recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
+ recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period)
return 0;
spin_lock(&pl->pl_lock);
- recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
+ recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period) {
spin_unlock(&pl->pl_lock);
return 0;
@@ -362,7 +360,7 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
*/
ldlm_pool_recalc_grant_plan(pl);
- pl->pl_recalc_time = cfs_time_current_sec();
+ pl->pl_recalc_time = get_seconds();
lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT,
recalc_interval_sec);
spin_unlock(&pl->pl_lock);
@@ -473,7 +471,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
{
time_t recalc_interval_sec;
- recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
+ recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period)
return 0;
@@ -481,7 +479,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
/*
* Check if we need to recalc lists now.
*/
- recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
+ recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period) {
spin_unlock(&pl->pl_lock);
return 0;
@@ -492,7 +490,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
*/
ldlm_cli_pool_pop_slv(pl);
- pl->pl_recalc_time = cfs_time_current_sec();
+ pl->pl_recalc_time = get_seconds();
lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT,
recalc_interval_sec);
spin_unlock(&pl->pl_lock);
@@ -566,7 +564,7 @@ int ldlm_pool_recalc(struct ldlm_pool *pl)
time_t recalc_interval_sec;
int count;
- recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
+ recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
if (recalc_interval_sec <= 0)
goto recalc;
@@ -591,7 +589,7 @@ int ldlm_pool_recalc(struct ldlm_pool *pl)
lprocfs_counter_add(pl->pl_stats, LDLM_POOL_RECALC_STAT,
count);
}
- recalc_interval_sec = pl->pl_recalc_time - cfs_time_current_sec() +
+ recalc_interval_sec = pl->pl_recalc_time - get_seconds() +
pl->pl_recalc_period;
return recalc_interval_sec;
@@ -638,7 +636,7 @@ int ldlm_pool_setup(struct ldlm_pool *pl, int limit)
}
EXPORT_SYMBOL(ldlm_pool_setup);
-#ifdef LPROCFS
+#if defined (CONFIG_PROC_FS)
static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
{
int granted, grant_rate, cancel_rate, grant_step;
@@ -661,8 +659,8 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
spin_unlock(&pl->pl_lock);
seq_printf(m, "LDLM pool state (%s):\n"
- " SLV: "LPU64"\n"
- " CLV: "LPU64"\n"
+ " SLV: %llu\n"
+ " CLV: %llu\n"
" LVF: %d\n",
pl->pl_name, slv, clv, lvf);
@@ -823,14 +821,14 @@ static void ldlm_pool_proc_fini(struct ldlm_pool *pl)
pl->pl_proc_dir = NULL;
}
}
-#else /* !LPROCFS */
+#else /* !CONFIG_PROC_FS */
static int ldlm_pool_proc_init(struct ldlm_pool *pl)
{
return 0;
}
static void ldlm_pool_proc_fini(struct ldlm_pool *pl) {}
-#endif /* LPROCFS */
+#endif /* CONFIG_PROC_FS */
int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,
int idx, ldlm_side_t client)
@@ -839,7 +837,7 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,
spin_lock_init(&pl->pl_lock);
atomic_set(&pl->pl_granted, 0);
- pl->pl_recalc_time = cfs_time_current_sec();
+ pl->pl_recalc_time = get_seconds();
atomic_set(&pl->pl_lock_volume_factor, 1);
atomic_set(&pl->pl_grant_rate, 0);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index fcc7a99ce395..8867dc175325 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -61,9 +61,9 @@
#define DEBUG_SUBSYSTEM S_LDLM
-#include <lustre_dlm.h>
-#include <obd_class.h>
-#include <obd.h>
+#include "../include/lustre_dlm.h"
+#include "../include/obd_class.h"
+#include "../include/obd.h"
#include "ldlm_internal.h"
@@ -95,18 +95,18 @@ int ldlm_expired_completion_wait(void *data)
struct obd_device *obd;
if (lock->l_conn_export == NULL) {
- static cfs_time_t next_dump = 0, last_dump = 0;
+ static unsigned long next_dump = 0, last_dump = 0;
LCONSOLE_WARN("lock timed out (enqueued at "CFS_TIME_T", "
CFS_DURATION_T"s ago)\n",
lock->l_last_activity,
- cfs_time_sub(cfs_time_current_sec(),
+ cfs_time_sub(get_seconds(),
lock->l_last_activity));
LDLM_DEBUG(lock, "lock timed out (enqueued at "CFS_TIME_T", "
CFS_DURATION_T"s ago); not entering recovery in "
"server code, just going back to sleep",
lock->l_last_activity,
- cfs_time_sub(cfs_time_current_sec(),
+ cfs_time_sub(get_seconds(),
lock->l_last_activity));
if (cfs_time_after(cfs_time_current(), next_dump)) {
last_dump = next_dump;
@@ -125,7 +125,7 @@ int ldlm_expired_completion_wait(void *data)
LDLM_ERROR(lock, "lock timed out (enqueued at "CFS_TIME_T", "
CFS_DURATION_T"s ago), entering recovery for %s@%s",
lock->l_last_activity,
- cfs_time_sub(cfs_time_current_sec(), lock->l_last_activity),
+ cfs_time_sub(get_seconds(), lock->l_last_activity),
obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid);
return 0;
@@ -160,7 +160,7 @@ static int ldlm_completion_tail(struct ldlm_lock *lock)
LDLM_DEBUG(lock, "client-side enqueue: destroyed");
result = -EIO;
} else {
- delay = cfs_time_sub(cfs_time_current_sec(),
+ delay = cfs_time_sub(get_seconds(),
lock->l_last_activity);
LDLM_DEBUG(lock, "client-side enqueue: granted after "
CFS_DURATION_T"s", delay);
@@ -592,7 +592,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
LDLM_FL_NO_TIMEOUT);
unlock_res_and_lock(lock);
- CDEBUG(D_INFO, "local: %p, remote cookie: "LPX64", flags: 0x%llx\n",
+ CDEBUG(D_INFO, "local: %p, remote cookie: %#llx, flags: 0x%llx\n",
lock, reply->lock_handle.cookie, *flags);
/* If enqueue returned a blocked lock but the completion handler has
@@ -1276,8 +1276,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
* server-side namespace is not possible. */
if (lustre_msg_get_slv(req->rq_repmsg) == 0 ||
lustre_msg_get_limit(req->rq_repmsg) == 0) {
- DEBUG_REQ(D_HA, req, "Zero SLV or Limit found "
- "(SLV: "LPU64", Limit: %u)",
+ DEBUG_REQ(D_HA, req, "Zero SLV or Limit found (SLV: %llu, Limit: %u)",
lustre_msg_get_slv(req->rq_repmsg),
lustre_msg_get_limit(req->rq_repmsg));
return 0;
@@ -1447,10 +1446,10 @@ static ldlm_policy_res_t ldlm_cancel_lrur_policy(struct ldlm_namespace *ns,
int unused, int added,
int count)
{
- cfs_time_t cur = cfs_time_current();
+ unsigned long cur = cfs_time_current();
struct ldlm_pool *pl = &ns->ns_pool;
__u64 slv, lvf, lv;
- cfs_time_t la;
+ unsigned long la;
/* Stop LRU processing when we reach past @count or have checked all
* locks in LRU. */
@@ -1508,9 +1507,8 @@ static ldlm_policy_res_t ldlm_cancel_aged_policy(struct ldlm_namespace *ns,
{
/* Stop LRU processing if young lock is found and we reach past count */
return ((added >= count) &&
- cfs_time_before(cfs_time_current(),
- cfs_time_add(lock->l_last_used,
- ns->ns_max_age))) ?
+ time_before(cfs_time_current(),
+ cfs_time_add(lock->l_last_used, ns->ns_max_age))) ?
LDLM_POLICY_KEEP_LOCK : LDLM_POLICY_CANCEL_LOCK;
}
@@ -1768,7 +1766,7 @@ int ldlm_cancel_lru(struct ldlm_namespace *ns, int nr,
int ldlm_cancel_resource_local(struct ldlm_resource *res,
struct list_head *cancels,
ldlm_policy_data_t *policy,
- ldlm_mode_t mode, int lock_flags,
+ ldlm_mode_t mode, __u64 lock_flags,
ldlm_cancel_flags_t cancel_flags, void *opaque)
{
struct ldlm_lock *lock;
@@ -1894,7 +1892,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
res = ldlm_resource_get(ns, NULL, res_id, 0, 0);
if (res == NULL) {
/* This is not a problem. */
- CDEBUG(D_INFO, "No resource "LPU64"\n", res_id->name[0]);
+ CDEBUG(D_INFO, "No resource %llu\n", res_id->name[0]);
return 0;
}
@@ -2105,8 +2103,8 @@ static int replay_lock_interpret(const struct lu_env *env,
lock = ldlm_handle2lock(&aa->lock_handle);
if (!lock) {
- CERROR("received replay ack for unknown local cookie "LPX64
- " remote cookie "LPX64 " from server %s id %s\n",
+ CERROR("received replay ack for unknown local cookie %#llx"
+ " remote cookie %#llx from server %s id %s\n",
aa->lock_handle.cookie, reply->lock_handle.cookie,
req->rq_export->exp_client_uuid.uuid,
libcfs_id2str(req->rq_peer));
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index c55d72f79b26..efd45e513416 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -40,10 +40,9 @@
*/
#define DEBUG_SUBSYSTEM S_LDLM
-# include <lustre_dlm.h>
-
-#include <lustre_fid.h>
-#include <obd_class.h>
+#include "../include/lustre_dlm.h"
+#include "../include/lustre_fid.h"
+#include "../include/obd_class.h"
#include "ldlm_internal.h"
struct kmem_cache *ldlm_resource_slab, *ldlm_lock_slab;
@@ -72,7 +71,7 @@ extern unsigned int ldlm_cancel_unused_locks_before_replay;
* DDOS. */
unsigned int ldlm_dump_granted_max = 256;
-#ifdef LPROCFS
+#if defined (CONFIG_PROC_FS)
static ssize_t lprocfs_wr_dump_ns(struct file *file, const char *buffer,
size_t count, loff_t *off)
{
@@ -190,13 +189,15 @@ static int lprocfs_lru_size_seq_show(struct seq_file *m, void *v)
return lprocfs_rd_uint(m, nr);
}
-static ssize_t lprocfs_lru_size_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t lprocfs_lru_size_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
- char dummy[MAX_STRING_SIZE + 1], *end;
+ char dummy[MAX_STRING_SIZE + 1];
unsigned long tmp;
int lru_resize;
+ int err;
dummy[MAX_STRING_SIZE] = '\0';
if (copy_from_user(dummy, buffer, MAX_STRING_SIZE))
@@ -228,8 +229,8 @@ static ssize_t lprocfs_lru_size_seq_write(struct file *file, const char *buffer,
return count;
}
- tmp = simple_strtoul(dummy, &end, 0);
- if (dummy == end) {
+ err = kstrtoul(dummy, 10, &tmp);
+ if (err != 0) {
CERROR("invalid value written\n");
return -EINVAL;
}
@@ -382,12 +383,12 @@ int ldlm_namespace_proc_register(struct ldlm_namespace *ns)
return 0;
}
#undef MAX_STRING_SIZE
-#else /* LPROCFS */
+#else /* CONFIG_PROC_FS */
#define ldlm_namespace_proc_unregister(ns) ({;})
#define ldlm_namespace_proc_register(ns) ({0;})
-#endif /* LPROCFS */
+#endif /* CONFIG_PROC_FS */
static unsigned ldlm_res_hop_hash(struct cfs_hash *hs,
const void *key, unsigned mask)
@@ -854,9 +855,8 @@ void ldlm_namespace_free_prior(struct ldlm_namespace *ns,
{
int rc;
- if (!ns) {
+ if (!ns)
return;
- }
spin_lock(&ns->ns_lock);
ns->ns_stopping = 1;
@@ -888,9 +888,8 @@ void ldlm_namespace_free_prior(struct ldlm_namespace *ns,
*/
void ldlm_namespace_free_post(struct ldlm_namespace *ns)
{
- if (!ns) {
+ if (!ns)
return;
- }
/* Make sure that nobody can find this ns in its list. */
ldlm_namespace_unregister(ns, ns->ns_client);
@@ -1135,9 +1134,9 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent,
OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_CREATE_RESOURCE, 2);
rc = ns->ns_lvbo->lvbo_init(res);
if (rc < 0) {
- CERROR("%s: lvbo_init failed for resource "LPX64":"
- LPX64": rc = %d\n", ns->ns_obd->obd_name,
- name->name[0], name->name[1], rc);
+ CERROR("%s: lvbo_init failed for resource %#llx:%#llx: rc = %d\n",
+ ns->ns_obd->obd_name, name->name[0],
+ name->name[1], rc);
if (res->lr_lvb_data) {
OBD_FREE(res->lr_lvb_data, res->lr_lvb_len);
res->lr_lvb_data = NULL;
@@ -1371,7 +1370,7 @@ void ldlm_namespace_dump(int level, struct ldlm_namespace *ns)
ldlm_ns_name(ns), atomic_read(&ns->ns_bref),
ns_is_client(ns) ? "client" : "server");
- if (cfs_time_before(cfs_time_current(), ns->ns_next_dump))
+ if (time_before(cfs_time_current(), ns->ns_next_dump))
return;
cfs_hash_for_each_nolock(ns->ns_rs_hash,