[LU-2798] error: variable ‘site’ set but not used Created: 12/Feb/13  Updated: 15/Feb/13  Resolved: 15/Feb/13

Status: Closed
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Dmitry Eremin (Inactive) Assignee: WC Triage
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates LU-2810 cl_lock.c:308:34: error: variable ‘si... Resolved
Severity: 3
Rank (Obsolete): 6774

 Description   

$ /usr/linux-k1om-4.7/bin/x86_64-k1om-linux-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/linux-k1om-4.7/bin/x86_64-k1om-linux-gcc
COLLECT_LTO_WRAPPER=/usr/linux-k1om-4.7/libexec/gcc/x86_64-k1om-linux/4.7.0/lto-wrapper
Target: x86_64-k1om-linux
Configured with: ../../gcc-4.7/configure --target=x86_64-k1om-linux --enable-languages=c,c++,fortran --disable-multilib --with-demangler-in-ld --with-sysroot=/usr/linux-k1om-4.7/linux-k1om --prefix=/usr/linux-k1om-4.7 --with-local-prefix=/usr/local --with-gmp-lib=/usr/local/lib
Thread model: posix
gcc version 4.7.0 20110509 (experimental) 4.7.0 (GCC)

cl_lock.c: In function ‘cl_lock_put’:
cl_lock.c:308:34: error: variable ‘site’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

lmv_obd.c: In function ‘lmv_connect_mdc’:
lmv_obd.c:347:34: error: variable ‘mdc_data’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors



 Comments   
Comment by Dmitry Eremin (Inactive) [ 13/Feb/13 ]

The first variable was not not removed after following commit:

variable ‘site’ set but not used

commit 5cae09a2409dcd396a1ee7be1eca7d3bbf77365e
Author: Jinshan Xiong <jinshan.xiong@intel.com>
Date: Fri Dec 7 10:01:53 2012 -0800

LU-744 obdclass: revise stats for cl_object cache

It turns out that atomic doesn't scale well for highly contented
cl_page stats. Enable it only when CONFIG_DEBUG_PAGESTATE_TRACKING
is turned on.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I0163f65557135759f100fddde70c7e3ee2e45aed
Reviewed-on: http://review.whamcloud.com/4519
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>

diff --git a/lustre/obdclass/cl_lock.c b/lustre/obdclass/cl_lock.c

+#ifdef CONFIG_DEBUG_PAGESTATE_TRACKING
+#define CS_LOCK_INC(o, item) \
+       cfs_atomic_inc(&cl_object_site(o)->cs_locks.cs_stats[CS_##item])
+#define CS_LOCK_DEC(o, item) \
+       cfs_atomic_dec(&cl_object_site(o)->cs_locks.cs_stats[CS_##item])
+#define CS_LOCKSTATE_INC(o, state) \
+        cfs_atomic_inc(&cl_object_site(o)->cs_locks_state[state])
+#define CS_LOCKSTATE_DEC(o, state) \
+        cfs_atomic_dec(&cl_object_site(o)->cs_locks_state[state])
+#else
+#define CS_LOCK_INC(o, item)
+#define CS_LOCK_DEC(o, item)
+#define CS_LOCKSTATE_INC(o, state)
+#define CS_LOCKSTATE_DEC(o, state)
+#endif
[...]
@@ -269,8 +285,8 @@ static void cl_lock_free(const struct lu_env *env, struct cl
                 cfs_list_del_init(lock->cll_layers.next);
                 slice->cls_ops->clo_fini(env, slice);
         }
-        cfs_atomic_dec(&cl_object_site(obj)->cs_locks.cs_total);
-        cfs_atomic_dec(&cl_object_site(obj)->cs_locks_state[lock->cll_state]);
+       CS_LOCK_DEC(obj, total);
+       CS_LOCKSTATE_DEC(obj, lock->cll_state);
         lu_object_ref_del_at(&obj->co_lu, lock->cll_obj_ref, "cl_lock", lock);
         cl_object_put(env, obj);
         lu_ref_fini(&lock->cll_reference);
@@ -308,7 +324,7 @@ void cl_lock_put(const struct lu_env *env, struct cl_lock *l
                         LASSERT(cfs_list_empty(&lock->cll_linkage));
                         cl_lock_free(env, lock);
                 }
-                cfs_atomic_dec(&site->cs_locks.cs_busy);
+               CS_LOCK_DEC(obj, busy);
         }
         EXIT;
 }

The second variable was not not removed after following commit:

variable ‘mdc_data’ set but not used

commit b3a53261ee18bf0c00e509208a5729890347d582
Author: wangdi <di.wang@whamcloud.com>
Date: Fri Nov 1 05:50:24 2013 -0700

LU-1187 lmv: allocate lmv tgts array by index

Allocate lmv tgts array by MDT index, which is similar as lov
tgts arrary, so the index of tgts will be decided by MDT index,
instead of mount sequence in current implementation.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: If4903553251e1dba653aa79fb02bce581580629f
Reviewed-on: http://review.whamcloud.com/4936
Tested-by: Hudson
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c

-        /*
-         * Copy connect data, it may be used later.
-         */
-        lmv->datas[tgt->ltd_idx] = *mdc_data;
-
Comment by Jodi Levi (Inactive) [ 15/Feb/13 ]

duplicate of LU-2810

Generated at Sat Feb 10 01:28:17 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.