Whamcloud - gitweb
LU-4669 type: change "%llx" to "LPX64” 32/12432/2
authorJian Yu <jian.yu@intel.com>
Mon, 27 Oct 2014 07:44:44 +0000 (00:44 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 6 Nov 2014 18:41:25 +0000 (18:41 +0000)
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'

This patch is back-ported from the following one:
Lustre-commit: f1eaf5e99aa9093b7a0fac7ae11e741560f64c31
Lustre-change: http://review.whamcloud.com/9811

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I0637f2c0a1e57cf8ab89d8fe9c905145724fded3
Reviewed-on: http://review.whamcloud.com/12432
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/include/darwin/lustre_lite.h
lustre/ldlm/ldlm_flock.c
lustre/ldlm/ldlm_request.c
lustre/liblustre/super.c
lustre/osc/osc_lock.c
lustre/utils/lhsmtool_posix.c

index 243e23b..e88c8c2 100644 (file)
@@ -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;
index 7eca413..9db7aeb 100644 (file)
@@ -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 */
@@ -310,7 +310,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,
@@ -674,13 +674,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 &&
index a67cd22..560ff77 100644 (file)
@@ -609,20 +609,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)) {
@@ -920,9 +920,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;
index 9e6972f..39660c3 100644 (file)
@@ -1331,11 +1331,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;
index b915b80..c119d14 100644 (file)
@@ -1558,18 +1558,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,
@@ -1745,7 +1745,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;
index f08f49f..544ef38 100644 (file)
@@ -1704,7 +1704,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;
 }