From f1eaf5e99aa9093b7a0fac7ae11e741560f64c31 Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Wed, 16 Apr 2014 16:04:57 +0800 Subject: [PATCH] =?utf8?q?LU-4669=20type:=20change=20"%llx"=20to=20"LPX64?= =?utf8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch fixes the following compile errors by using "LPX64”: error: format '%llx' expects type 'long long unsigned int', but argument 5 has type '__u64' error: format '%#llx' expects type 'long long unsigned int', but argument 3 has type '__u64' Signed-off-by: Jian Yu Change-Id: Ica703160923e5f2b987217d97e623fe16eb667ad Reviewed-on: http://review.whamcloud.com/9811 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond --- lustre/include/darwin/lustre_lite.h | 2 +- lustre/ldlm/ldlm_flock.c | 16 ++++++++-------- lustre/ldlm/ldlm_request.c | 32 ++++++++++++++++---------------- lustre/liblustre/super.c | 10 +++++----- lustre/osc/osc_lock.c | 22 +++++++++++----------- lustre/utils/lhsmtool_posix.c | 2 +- 6 files changed, 42 insertions(+), 42 deletions(-) diff --git a/lustre/include/darwin/lustre_lite.h b/lustre/include/darwin/lustre_lite.h index 243e23b..e88c8c2 100644 --- a/lustre/include/darwin/lustre_lite.h +++ b/lustre/include/darwin/lustre_lite.h @@ -79,8 +79,8 @@ struct lookup_intent { int it_magic; void (*it_op_release)(struct lookup_intent *); int it_op; - int it_flags; int it_create_mode; + __u64 it_flags; union { struct lustre_intent_data lustre; void *fs_data; diff --git a/lustre/ldlm/ldlm_flock.c b/lustre/ldlm/ldlm_flock.c index 26a1bf4..09655be 100644 --- a/lustre/ldlm/ldlm_flock.c +++ b/lustre/ldlm/ldlm_flock.c @@ -139,7 +139,7 @@ ldlm_flock_destroy(struct ldlm_lock *lock, ldlm_mode_t mode, __u64 flags) { ENTRY; - LDLM_DEBUG(lock, "ldlm_flock_destroy(mode: %d, flags: 0x%llx)", + LDLM_DEBUG(lock, "ldlm_flock_destroy(mode: %d, flags: "LPX64")", mode, flags); /* Safe to not lock here, since it should be empty anyway */ @@ -309,7 +309,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, const struct ldlm_callback_suite null_cbs = { NULL }; ENTRY; - CDEBUG(D_DLMTRACE, "flags %#llx owner "LPU64" pid %u mode %u start " + CDEBUG(D_DLMTRACE, "flags "LPX64" owner "LPU64" pid %u mode %u start " LPU64" end "LPU64"\n", *flags, new->l_policy_data.l_flock.owner, new->l_policy_data.l_flock.pid, mode, @@ -673,13 +673,13 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) int rc = 0; ENTRY; - CDEBUG(D_DLMTRACE, "flags: 0x%llx data: %p getlk: %p\n", - flags, data, getlk); + CDEBUG(D_DLMTRACE, "flags: "LPX64" data: %p getlk: %p\n", + flags, data, getlk); - /* Import invalidation. We need to actually release the lock - * references being held, so that it can go away. No point in - * holding the lock even if app still believes it has it, since - * server already dropped it anyway. Only for granted locks too. */ + /* Import invalidation. We need to actually release the lock + * references being held, so that it can go away. No point in + * holding the lock even if app still believes it has it, since + * server already dropped it anyway. Only for granted locks too. */ if ((lock->l_flags & (LDLM_FL_FAILED|LDLM_FL_LOCAL_ONLY)) == (LDLM_FL_FAILED|LDLM_FL_LOCAL_ONLY)) { if (lock->l_req_mode == lock->l_granted_mode && diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 972083b..d01c9d6 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -611,20 +611,20 @@ 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", - lock, reply->lock_handle.cookie, *flags); - - /* If enqueue returned a blocked lock but the completion handler has - * already run, then it fixed up the resource and we don't need to do it - * again. */ - if ((*flags) & LDLM_FL_LOCK_CHANGED) { - int newmode = reply->lock_desc.l_req_mode; - LASSERT(!is_replay); - if (newmode && newmode != lock->l_req_mode) { - LDLM_DEBUG(lock, "server returned different mode %s", - ldlm_lockname[newmode]); - lock->l_req_mode = newmode; - } + CDEBUG(D_INFO, "local: %p, remote cookie: "LPX64", flags: "LPX64"\n", + lock, reply->lock_handle.cookie, *flags); + + /* If enqueue returned a blocked lock but the completion handler has + * already run, then it fixed up the resource and we don't need to do it + * again. */ + if ((*flags) & LDLM_FL_LOCK_CHANGED) { + int newmode = reply->lock_desc.l_req_mode; + LASSERT(!is_replay); + if (newmode && newmode != lock->l_req_mode) { + LDLM_DEBUG(lock, "server returned different mode %s", + ldlm_lockname[newmode]); + lock->l_req_mode = newmode; + } if (!ldlm_res_eq(&reply->lock_desc.l_resource.lr_name, &lock->l_resource->lr_name)) { @@ -922,9 +922,9 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp, lock->l_req_extent = policy->l_extent; } - LDLM_DEBUG(lock, "client-side enqueue START, flags %llx\n", + LDLM_DEBUG(lock, "client-side enqueue START, flags "LPX64"\n", *flags); - } + } lock->l_conn_export = exp; lock->l_export = NULL; diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index 43aeeee..35fbb57 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -1298,11 +1298,11 @@ static int llu_file_flock(struct inode *ino, LBUG(); } - CDEBUG(D_DLMTRACE, "inode=%llu, pid=%u, cmd=%d, flags=%#llx, mode=%u, " - "start="LPX64", end="LPX64"\n", (unsigned long long)st->st_ino, - flock.l_flock.pid, cmd, flags, einfo.ei_mode, flock.l_flock.start, - flock.l_flock.end); - + CDEBUG(D_DLMTRACE, "inode=%llu, pid=%u, cmd=%d, flags="LPX64", " + "mode=%u, start="LPX64", end="LPX64"\n", + (unsigned long long)st->st_ino, + flock.l_flock.pid, cmd, flags, einfo.ei_mode, + flock.l_flock.start, flock.l_flock.end); { struct lmv_obd *lmv; struct obd_device *lmv_obd; diff --git a/lustre/osc/osc_lock.c b/lustre/osc/osc_lock.c index 3422d54..816cc78 100644 --- a/lustre/osc/osc_lock.c +++ b/lustre/osc/osc_lock.c @@ -1562,18 +1562,18 @@ static void osc_lock_state(const struct lu_env *env, } static int osc_lock_print(const struct lu_env *env, void *cookie, - lu_printer_t p, const struct cl_lock_slice *slice) + lu_printer_t p, const struct cl_lock_slice *slice) { - struct osc_lock *lock = cl2osc_lock(slice); + struct osc_lock *lock = cl2osc_lock(slice); - /* - * XXX print ldlm lock and einfo properly. - */ - (*p)(env, cookie, "%p %#16llx "LPX64" %d %p ", - lock->ols_lock, lock->ols_flags, lock->ols_handle.cookie, - lock->ols_state, lock->ols_owner); - osc_lvb_print(env, cookie, p, &lock->ols_lvb); - return 0; + /* + * XXX print ldlm lock and einfo properly. + */ + (*p)(env, cookie, "%p "LPX64" "LPX64" %d %p ", + lock->ols_lock, lock->ols_flags, lock->ols_handle.cookie, + lock->ols_state, lock->ols_owner); + osc_lvb_print(env, cookie, p, &lock->ols_lvb); + return 0; } static int osc_lock_fits_into(const struct lu_env *env, @@ -1749,7 +1749,7 @@ int osc_lock_init(const struct lu_env *env, if (clk->ols_locklessable && !(enqflags & CEF_DISCARD_DATA)) clk->ols_flags |= LDLM_FL_DENY_ON_CONTENTION; - LDLM_DEBUG_NOLOCK("lock %p, osc lock %p, flags %llx\n", + LDLM_DEBUG_NOLOCK("lock %p, osc lock %p, flags "LPX64"\n", lock, clk, clk->ols_flags); result = 0; diff --git a/lustre/utils/lhsmtool_posix.c b/lustre/utils/lhsmtool_posix.c index d90b725..36fe50f 100644 --- a/lustre/utils/lhsmtool_posix.c +++ b/lustre/utils/lhsmtool_posix.c @@ -1677,7 +1677,7 @@ static int ct_max_sequence(void) sprintf(path + strlen(path), "/%04x", subseq); } - printf("max_sequence: %016Lx\n", seq); + printf("max_sequence: "LPX64"\n", seq); return 0; } -- 1.8.3.1