Whamcloud - gitweb
LU-506 kernel: FC15 - fix GCC 'set-but-unused' warnings
authoryangsheng <ys@whamcloud.com>
Thu, 8 Sep 2011 17:33:25 +0000 (01:33 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 29 Dec 2011 16:02:33 +0000 (11:02 -0500)
Eliminate a number of unused variables in the code that
caused GCC-4.6.0 to warn about "set-but-unused variables".
In some cases the variables are only used in
conditionally-compiled code, so they are used in some way
just to quiet the compiler.

Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: I8b9b744c787fff4057722420866adea86d8240f5
Reviewed-on: http://review.whamcloud.com/1330
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
45 files changed:
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/libcfs.h
libcfs/include/libcfs/libcfs_fail.h
libcfs/include/libcfs/libcfs_private.h
libcfs/libcfs/nidstrings.c
libcfs/libcfs/workitem.c
lnet/lnet/api-ni.c
lnet/lnet/router.c
lnet/selftest/conrpc.c
lnet/selftest/timer.c
lnet/utils/debug.c
lustre/autoconf/lustre-core.m4
lustre/fid/fid_store.c
lustre/fld/fld_index.c
lustre/include/lustre_lib.h
lustre/ldlm/ldlm_flock.c
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_request.c
lustre/liblustre/dir.c
lustre/liblustre/file.c
lustre/liblustre/llite_cl.c
lustre/liblustre/namei.c
lustre/llite/dcache.c
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/rw.c
lustre/lmv/lmv_obd.c
lustre/lov/lov_qos.c
lustre/lov/lovsub_lock.c
lustre/lvfs/lvfs_linux.c
lustre/mdc/mdc_locks.c
lustre/obdclass/cl_lock.c
lustre/osc/osc_request.c
lustre/ptlrpc/llog_server.c
lustre/ptlrpc/pinger.c
lustre/ptlrpc/ptlrpcd.c
lustre/ptlrpc/sec_config.c
lustre/ptlrpc/sec_plain.c
lustre/ptlrpc/service.c
lustre/quota/lproc_quota.c
lustre/tests/writeme.c
lustre/utils/liblustreapi.c
lustre/utils/ll_decode_filter_fid.c

index bfdaea2..10a8583 100644 (file)
@@ -124,10 +124,9 @@ LB_LINUX_TRY_COMPILE([
        #include <linux/types.h>
        #include <linux/stddef.h>
 ],[
        #include <linux/types.h>
        #include <linux/stddef.h>
 ],[
-       unsigned long long *data1;
-       __u64 *data2 = NULL;
+       unsigned long long *data;
 
 
-       data1 = data2;
+       data = (__u64*)sizeof(data);
 ],[
        AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_KERN__U64_LONG_LONG, 1,
 ],[
        AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_KERN__U64_LONG_LONG, 1,
@@ -144,13 +143,10 @@ AC_DEFUN([LIBCFS_TASK_RCU],
 LB_LINUX_TRY_COMPILE([
        #include <linux/sched.h>
 ],[
 LB_LINUX_TRY_COMPILE([
        #include <linux/sched.h>
 ],[
-        struct task_struct tsk;
-
-        tsk.rcu.next = NULL;
+        memset(((struct task_struct *)0)->rcu.next, 0, 0);
 ],[
         AC_MSG_RESULT([yes])
 ],[
         AC_MSG_RESULT([yes])
-        AC_DEFINE(HAVE_TASK_RCU, 1,
-                  [task_struct has rcu field])
+        AC_DEFINE(HAVE_TASK_RCU, 1, [task_struct has rcu field])
 ],[
         AC_MSG_RESULT([no])
 ])
 ],[
         AC_MSG_RESULT([no])
 ])
@@ -482,11 +478,9 @@ AC_DEFUN([LIBCFS_FUNC_DUMP_TRACE],
        LB_LINUX_TRY_COMPILE([
                struct task_struct;
                struct pt_regs;
        LB_LINUX_TRY_COMPILE([
                struct task_struct;
                struct pt_regs;
-               void print_addr(void *data, unsigned long addr, int reliable);
                #include <asm/stacktrace.h>
        ],[
                #include <asm/stacktrace.h>
        ],[
-               struct stacktrace_ops ops;
-               ops.address = print_addr;
+               ((struct stacktrace_ops *)0)->address(NULL, 0, 0);
        ],[
                AC_MSG_RESULT(yes)
                AC_DEFINE(HAVE_TRACE_ADDRESS_RELIABLE, 1,
        ],[
                AC_MSG_RESULT(yes)
                AC_DEFINE(HAVE_TRACE_ADDRESS_RELIABLE, 1,
@@ -561,7 +555,7 @@ LB_LINUX_TRY_COMPILE([
 ],[
        uid_t uid;
 
 ],[
        uid_t uid;
 
-       uid = current_uid();
+       uid = current_uid() + sizeof(uid);
 ],[
        AC_MSG_RESULT([yes])
        AC_DEFINE(HAVE_CRED_WRAPPERS, 1, [task's cred wrappers found])
 ],[
        AC_MSG_RESULT([yes])
        AC_DEFINE(HAVE_CRED_WRAPPERS, 1, [task's cred wrappers found])
@@ -643,17 +637,8 @@ AC_DEFUN([LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK],
 [AC_MSG_CHECKING([if 'struct stacktrace_ops' has 'walk_stack' field])
 LB_LINUX_TRY_COMPILE([
         #include <asm/stacktrace.h>
 [AC_MSG_CHECKING([if 'struct stacktrace_ops' has 'walk_stack' field])
 LB_LINUX_TRY_COMPILE([
         #include <asm/stacktrace.h>
-       unsigned long walkstack(struct thread_info *tinfo,
-                                           unsigned long *stack,
-                                           unsigned long bp,
-                                           const struct stacktrace_ops *ops,
-                                           void *data,
-                                           unsigned long *end,
-                                           int *graph);
 ],[
 ],[
-        struct stacktrace_ops ops;
-
-       ops.walk_stack = walkstack;
+        ((struct stacktrace_ops *)0)->walk_stack(NULL, NULL, 0, NULL, NULL, NULL, NULL);
 ],[
         AC_MSG_RESULT([yes])
         AC_DEFINE(STACKTRACE_OPS_HAVE_WALK_STACK, 1, ['struct stacktrace_ops' has 'walk_stack' field])
 ],[
         AC_MSG_RESULT([yes])
         AC_DEFINE(STACKTRACE_OPS_HAVE_WALK_STACK, 1, ['struct stacktrace_ops' has 'walk_stack' field])
@@ -697,9 +682,7 @@ AC_DEFUN([LIBCFS_OOMADJ_IN_SIG],
 LB_LINUX_TRY_COMPILE([
         #include <linux/sched.h>
 ],[
 LB_LINUX_TRY_COMPILE([
         #include <linux/sched.h>
 ],[
-        struct signal_struct s;
-
-        s.oom_adj = 0;
+        ((struct signal_struct *)0)->oom_adj = 0;
 ],[
         AC_MSG_RESULT(yes)
         AC_DEFINE(HAVE_OOMADJ_IN_SIG, 1,
 ],[
         AC_MSG_RESULT(yes)
         AC_DEFINE(HAVE_OOMADJ_IN_SIG, 1,
index 863ca3a..1a47def 100644 (file)
@@ -328,6 +328,8 @@ static inline void *__container_of(void *ptr, unsigned long shift)
 #define container_of0(ptr, type, member) \
         ((type *)__container_of((void *)(ptr), offsetof(type, member)))
 
 #define container_of0(ptr, type, member) \
         ((type *)__container_of((void *)(ptr), offsetof(type, member)))
 
+#define SET_BUT_UNUSED(a) do { } while(sizeof(a) - sizeof(a))
+
 #define _LIBCFS_H
 
 #endif /* _LIBCFS_H */
 #define _LIBCFS_H
 
 #endif /* _LIBCFS_H */
index b9dcd6b..5edd20d 100644 (file)
@@ -127,14 +127,15 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set)
  * the first and continues. */
 static inline void cfs_race(__u32 id)
 {
  * the first and continues. */
 static inline void cfs_race(__u32 id)
 {
-        int rc;
 
         if (CFS_FAIL_PRECHECK(id)) {
                 if (unlikely(__cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET))) {
 
         if (CFS_FAIL_PRECHECK(id)) {
                 if (unlikely(__cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET))) {
+                        int rc;
                         cfs_race_state = 0;
                         CERROR("cfs_race id %x sleeping\n", id);
                         cfs_race_state = 0;
                         CERROR("cfs_race id %x sleeping\n", id);
-                        cfs_wait_event_interruptible(cfs_race_waitq, cfs_race_state != 0, rc);
-                        CERROR("cfs_fail_race id %x awake\n", id);
+                        cfs_wait_event_interruptible(cfs_race_waitq,
+                                                     cfs_race_state != 0, rc);
+                        CERROR("cfs_fail_race id %x awake, rc=%d\n", id, rc);
                 } else {
                         CERROR("cfs_fail_race id %x waking\n", id);
                         cfs_race_state = 1;
                 } else {
                         CERROR("cfs_fail_race id %x waking\n", id);
                         cfs_race_state = 1;
index 82810ad..b7ba6e6 100644 (file)
@@ -265,7 +265,7 @@ do {                                                                           \
 # else
 #  define LIBCFS_ALLOC(ptr, size) do { (ptr) = calloc(1,size); } while (0)
 # endif
 # else
 #  define LIBCFS_ALLOC(ptr, size) do { (ptr) = calloc(1,size); } while (0)
 # endif
-# define LIBCFS_FREE(a, b) do { free(a); } while (0)
+# define LIBCFS_FREE(ptr, size) do { free(ptr); } while((size) - (size))
 
 void libcfs_debug_dumplog(void);
 int libcfs_debug_init(unsigned long bufsize);
 
 void libcfs_debug_dumplog(void);
 int libcfs_debug_init(unsigned long bufsize);
index 681dcd1..9f75501 100644 (file)
@@ -78,8 +78,8 @@ void libcfs_init_nidstrings (void)
 # define NIDSTR_LOCK(f)   cfs_spin_lock_irqsave(&libcfs_nidstring_lock, f)
 # define NIDSTR_UNLOCK(f) cfs_spin_unlock_irqrestore(&libcfs_nidstring_lock, f)
 #else
 # define NIDSTR_LOCK(f)   cfs_spin_lock_irqsave(&libcfs_nidstring_lock, f)
 # define NIDSTR_UNLOCK(f) cfs_spin_unlock_irqrestore(&libcfs_nidstring_lock, f)
 #else
-# define NIDSTR_LOCK(f)   (f=0)                 /* avoid unused var warnings */
-# define NIDSTR_UNLOCK(f) (f=0)
+# define NIDSTR_LOCK(f)   (f=sizeof(f))  /* avoid set-but-unused warnings */
+# define NIDSTR_UNLOCK(f) (f=sizeof(f))
 #endif
 
 static char *
 #endif
 
 static char *
index d3bdf68..69bd052 100644 (file)
@@ -414,8 +414,7 @@ int
 cfs_wi_startup (void)
 {
         int i;
 cfs_wi_startup (void)
 {
         int i;
-        int n;
-        int rc;
+        int n, rc;
 
         cfs_wi_data.wi_nthreads = 0;
         cfs_wi_data.wi_nsched   = CFS_WI_NSCHED;
 
         cfs_wi_data.wi_nthreads = 0;
         cfs_wi_data.wi_nsched   = CFS_WI_NSCHED;
@@ -440,7 +439,8 @@ cfs_wi_startup (void)
                 }
         }
 #else
                 }
         }
 #else
-        n = rc = 0;
+        SET_BUT_UNUSED(rc);
+        SET_BUT_UNUSED(n);
 #endif
 
         return 0;
 #endif
 
         return 0;
index fc25673..4cf824e 100644 (file)
@@ -137,8 +137,8 @@ lnet_get_networks (void)
                 return (rc == 0) ? networks : NULL;
         }
 #else
                 return (rc == 0) ? networks : NULL;
         }
 #else
-        ip2nets = NULL;
-        rc = 0;
+        SET_BUT_UNUSED(ip2nets);
+        SET_BUT_UNUSED(rc);
 #endif
         if (networks != NULL)
                 return networks;
 #endif
         if (networks != NULL)
                 return networks;
index b7d6c85..c82ff8e 100644 (file)
@@ -1127,13 +1127,10 @@ lnet_router_checker(void *arg)
         int                rc;
         lnet_peer_t       *rtr;
         cfs_list_t        *entry;
         int                rc;
         lnet_peer_t       *rtr;
         cfs_list_t        *entry;
-        lnet_process_id_t  rtr_id;
 
         cfs_daemonize("router_checker");
         cfs_block_allsigs();
 
 
         cfs_daemonize("router_checker");
         cfs_block_allsigs();
 
-        rtr_id.pid = LUSTRE_SRV_LNET_PID;
-
         LASSERT (the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING);
 
         while (the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING) {
         LASSERT (the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING);
 
         while (the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING) {
index 94074ae..bd9aa92 100644 (file)
@@ -427,7 +427,6 @@ void
 lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat)
 {
         lstcon_rpc_t      *crpc;
 lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat)
 {
         lstcon_rpc_t      *crpc;
-        srpc_client_rpc_t *rpc;
         srpc_msg_t        *rep;
         int                error;
 
         srpc_msg_t        *rep;
         int                error;
 
@@ -439,8 +438,6 @@ lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat)
                                       lstcon_rpc_t, crp_link) {
                 lstcon_rpc_stat_total(stat, 1);
 
                                       lstcon_rpc_t, crp_link) {
                 lstcon_rpc_stat_total(stat, 1);
 
-                rpc = crpc->crp_rpc;
-
                 LASSERT (crpc->crp_stamp != 0);
 
                 error = lstcon_rpc_get_reply(crpc, &rep);
                 LASSERT (crpc->crp_stamp != 0);
 
                 error = lstcon_rpc_get_reply(crpc, &rep);
@@ -478,7 +475,6 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
         cfs_list_t           *next;
         lstcon_rpc_ent_t     *ent;
         srpc_generic_reply_t *rep;
         cfs_list_t           *next;
         lstcon_rpc_ent_t     *ent;
         srpc_generic_reply_t *rep;
-        srpc_client_rpc_t    *rpc;
         lstcon_rpc_t         *crpc;
         srpc_msg_t           *msg;
         lstcon_node_t        *nd;
         lstcon_rpc_t         *crpc;
         srpc_msg_t           *msg;
         lstcon_node_t        *nd;
@@ -503,8 +499,6 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
 
                 ent = cfs_list_entry(next, lstcon_rpc_ent_t, rpe_link);
 
 
                 ent = cfs_list_entry(next, lstcon_rpc_ent_t, rpe_link);
 
-                rpc = crpc->crp_rpc;
-
                 LASSERT (crpc->crp_stamp != 0);
 
                 error = lstcon_rpc_get_reply(crpc, &msg);
                 LASSERT (crpc->crp_stamp != 0);
 
                 error = lstcon_rpc_get_reply(crpc, &msg);
index 96240bb..c71fc0f 100644 (file)
@@ -181,6 +181,8 @@ stt_timer_main (void *arg)
         int rc = 0;
         UNUSED(arg);
 
         int rc = 0;
         UNUSED(arg);
 
+        SET_BUT_UNUSED(rc);
+
         cfs_daemonize("st_timer");
         cfs_block_allsigs();
 
         cfs_daemonize("st_timer");
         cfs_block_allsigs();
 
index 8aca02a..aab0c97 100644 (file)
@@ -909,7 +909,6 @@ static int jt_dbg_modules_2_5(int argc, char **argv)
 {
         struct mod_paths *mp;
         char *path = "";
 {
         struct mod_paths *mp;
         char *path = "";
-        char *kernel = "linux";
         const char *proc = "/proc/modules";
         char modname[128], buf[4096];
         long modaddr;
         const char *proc = "/proc/modules";
         char modname[128], buf[4096];
         long modaddr;
@@ -917,8 +916,6 @@ static int jt_dbg_modules_2_5(int argc, char **argv)
 
         if (argc >= 2)
                 path = argv[1];
 
         if (argc >= 2)
                 path = argv[1];
-        if (argc == 3)
-                kernel = argv[2];
         if (argc > 3) {
                 printf("%s [path] [kernel]\n", argv[0]);
                 return 0;
         if (argc > 3) {
                 printf("%s [path] [kernel]\n", argv[0]);
                 return 0;
index 455ec77..043d1db 100644 (file)
@@ -1220,34 +1220,6 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
 ])
 ])
 
-# LC_VFS_READDIR_U64_INO
-# 2.6.19 use u64 for inode number instead of inode_t
-AC_DEFUN([LC_VFS_READDIR_U64_INO],
-[AC_MSG_CHECKING([check vfs_readdir need 64bit inode number])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_LINUX_TRY_COMPILE([
-#include <linux/fs.h>
-       int fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
-                      u64 ino, unsigned int d_type)
-       {
-               return 0;
-       }
-],[
-       filldir_t filter;
-
-       filter = fillonedir;
-       return 1;
-],[
-        AC_MSG_RESULT(yes)
-        AC_DEFINE(HAVE_VFS_READDIR_U64_INO, 1,
-                [if vfs_readdir need 64bit inode number])
-],[
-        AC_MSG_RESULT(no)
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
 # LC_FILE_WRITEV
 # 2.6.19 replaced writev with aio_write
 AC_DEFUN([LC_FILE_WRITEV],
 # LC_FILE_WRITEV
 # 2.6.19 replaced writev with aio_write
 AC_DEFUN([LC_FILE_WRITEV],
@@ -1365,7 +1337,7 @@ LB_LINUX_TRY_COMPILE([
         #include <linux/crypto.h>
 ],[
         struct crypto_blkcipher *tfm;
         #include <linux/crypto.h>
 ],[
         struct crypto_blkcipher *tfm;
-        tfm = crypto_alloc_blkcipher("aes", 0, 0 );
+        tfm = crypto_alloc_blkcipher("aes", 0, sizeof(tfm) );
 ],[
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
 ],[
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
@@ -1570,15 +1542,13 @@ LB_LINUX_TRY_COMPILE([
 AC_DEFUN([LC_FH_TO_DENTRY],
 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
 LB_LINUX_TRY_COMPILE([
 AC_DEFUN([LC_FH_TO_DENTRY],
 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
 LB_LINUX_TRY_COMPILE([
+        #include <linux/fs.h>
 #ifdef HAVE_LINUX_EXPORTFS_H
         #include <linux/exportfs.h>
 #ifdef HAVE_LINUX_EXPORTFS_H
         #include <linux/exportfs.h>
-#else
-        #include <linux/fs.h>
 #endif
 ],[
         struct export_operations exp;
 #endif
 ],[
         struct export_operations exp;
-
-        exp.fh_to_dentry   = NULL;
+        memset(exp.fh_to_dentry, 0, sizeof(exp.fh_to_dentry));
 ], [
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
 ], [
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
@@ -1596,7 +1566,7 @@ LB_LINUX_TRY_COMPILE([
 ],[
         struct proc_dir_entry pde;
 
 ],[
         struct proc_dir_entry pde;
 
-        pde.deleted   = NULL;
+        pde.deleted = sizeof(pde);
 ], [
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_PROCFS_DELETED, 1,
 ], [
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_PROCFS_DELETED, 1,
@@ -1650,6 +1620,7 @@ LB_LINUX_TRY_COMPILE([
         struct fs_struct fs;
 
         fs.pwd = path;
         struct fs_struct fs;
 
         fs.pwd = path;
+        memset(&fs, 0, sizeof(fs));
 ], [
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
 ], [
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
@@ -1813,7 +1784,7 @@ LB_LINUX_TRY_COMPILE([
         #include <linux/bio.h>
 ],[
         struct bio io;
         #include <linux/bio.h>
 ],[
         struct bio io;
-        io.bi_hw_segments = 0;
+        io.bi_hw_segments = sizeof(io);
 ],[
         AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
                 [struct bio has a bi_hw_segments field])
 ],[
         AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
                 [struct bio has a bi_hw_segments field])
@@ -2254,7 +2225,6 @@ AC_DEFUN([LC_PROG_LINUX],
 
          # 2.6.19
          LC_INODE_BLKSIZE
 
          # 2.6.19
          LC_INODE_BLKSIZE
-         LC_VFS_READDIR_U64_INO
          LC_FILE_WRITEV
          LC_FILE_READV
 
          LC_FILE_WRITEV
          LC_FILE_READV
 
index 66ce462..c09cf0c 100644 (file)
@@ -113,12 +113,10 @@ int seq_store_write(struct lu_server_seq *seq,
 {
         struct dt_object *dt_obj = seq->lss_obj;
         struct seq_thread_info *info;
 {
         struct dt_object *dt_obj = seq->lss_obj;
         struct seq_thread_info *info;
-        struct dt_device *dt_dev;
         loff_t pos = 0;
         int rc;
         ENTRY;
 
         loff_t pos = 0;
         int rc;
         ENTRY;
 
-        dt_dev = lu2dt_dev(seq->lss_obj->do_lu.lo_dev);
         info = lu_context_key_get(&env->le_ctx, &seq_thread_key);
         LASSERT(info != NULL);
 
         info = lu_context_key_get(&env->le_ctx, &seq_thread_key);
         LASSERT(info != NULL);
 
index dd7b1de..997e781 100644 (file)
@@ -153,7 +153,6 @@ int fld_index_create(struct lu_server_fld *fld,
                      struct thandle *th)
 {
         struct dt_object *dt_obj = fld->lsf_obj;
                      struct thandle *th)
 {
         struct dt_object *dt_obj = fld->lsf_obj;
-        struct dt_device *dt_dev;
         seqno_t start;
         int rc;
 
         seqno_t start;
         int rc;
 
@@ -161,7 +160,6 @@ int fld_index_create(struct lu_server_fld *fld,
 
         start = range->lsr_start;
         LASSERT(range_is_sane(range));
 
         start = range->lsr_start;
         LASSERT(range_is_sane(range));
-        dt_dev = lu2dt_dev(fld->lsf_obj->do_lu.lo_dev);
 
         rc = dt_obj->do_index_ops->dio_insert(env, dt_obj,
                                               fld_rec(env, range),
 
         rc = dt_obj->do_index_ops->dio_insert(env, dt_obj,
                                               fld_rec(env, range),
@@ -189,13 +187,11 @@ int fld_index_delete(struct lu_server_fld *fld,
                      struct thandle   *th)
 {
         struct dt_object *dt_obj = fld->lsf_obj;
                      struct thandle   *th)
 {
         struct dt_object *dt_obj = fld->lsf_obj;
-        struct dt_device *dt_dev;
         seqno_t seq = range->lsr_start;
         int rc;
 
         ENTRY;
 
         seqno_t seq = range->lsr_start;
         int rc;
 
         ENTRY;
 
-        dt_dev = lu2dt_dev(fld->lsf_obj->do_lu.lo_dev);
         rc = dt_obj->do_index_ops->dio_delete(env, dt_obj,
                                               fld_key(env, seq), th,
                                               BYPASS_CAPA);
         rc = dt_obj->do_index_ops->dio_delete(env, dt_obj,
                                               fld_key(env, seq), th,
                                               BYPASS_CAPA);
index be0d684..499385d 100644 (file)
@@ -806,6 +806,7 @@ do {                                                                    \
                         }                                               \
                 }                                                       \
         }                                                               \
                         }                                               \
                 }                                                       \
         }                                                               \
+        SET_BUT_UNUSED(wq);                                             \
 } while (0)
 
 #endif /* __KERNEL__ */
 } while (0)
 
 #endif /* __KERNEL__ */
index 7e8a754..a3437b4 100644 (file)
@@ -653,14 +653,11 @@ EXPORT_SYMBOL(ldlm_flock_completion_ast);
 int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
                             void *data, int flag)
 {
 int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
                             void *data, int flag)
 {
-        struct ldlm_namespace *ns;
         ENTRY;
 
         LASSERT(lock);
         LASSERT(flag == LDLM_CB_CANCELING);
 
         ENTRY;
 
         LASSERT(lock);
         LASSERT(flag == LDLM_CB_CANCELING);
 
-        ns = ldlm_lock_to_ns(lock);
-
         /* take lock off the deadlock detection waitq. */
         cfs_spin_lock(&ldlm_flock_waitq_lock);
         cfs_list_del_init(&lock->l_flock_waitq);
         /* take lock off the deadlock detection waitq. */
         cfs_spin_lock(&ldlm_flock_waitq_lock);
         cfs_list_del_init(&lock->l_flock_waitq);
index 2821552..98629a6 100644 (file)
@@ -2211,7 +2211,6 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)
 {
         int                        netrc;
         struct ptlrpc_reply_state *rs;
 {
         int                        netrc;
         struct ptlrpc_reply_state *rs;
-        struct obd_device         *obd;
         struct obd_export         *exp;
         struct ptlrpc_service     *svc;
         ENTRY;
         struct obd_export         *exp;
         struct ptlrpc_service     *svc;
         ENTRY;
@@ -2245,7 +2244,6 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)
         LASSERT (cfs_list_empty(&rs->rs_exp_list));
 
         exp = class_export_get (req->rq_export);
         LASSERT (cfs_list_empty(&rs->rs_exp_list));
 
         exp = class_export_get (req->rq_export);
-        obd = exp->exp_obd;
 
         /* disable reply scheduling while I'm setting up */
         rs->rs_scheduled = 1;
 
         /* disable reply scheduling while I'm setting up */
         rs->rs_scheduled = 1;
index 1b80090..af7c6c4 100644 (file)
@@ -279,7 +279,7 @@ static int ldlm_lock_busy(struct ldlm_lock *lock)
 /* This is called from within a timer interrupt and cannot schedule */
 static void waiting_locks_callback(unsigned long unused)
 {
 /* This is called from within a timer interrupt and cannot schedule */
 static void waiting_locks_callback(unsigned long unused)
 {
-        struct ldlm_lock *lock, *last = NULL;
+        struct ldlm_lock *lock;
 
 repeat:
         cfs_spin_lock_bh(&waiting_locks_spinlock);
 
 repeat:
         cfs_spin_lock_bh(&waiting_locks_spinlock);
@@ -355,8 +355,6 @@ repeat:
                            libcfs_nid2str(
                                    lock->l_export->exp_connection->c_peer.nid));
 
                            libcfs_nid2str(
                                    lock->l_export->exp_connection->c_peer.nid));
 
-                last = lock;
-
                 /* no needs to take an extra ref on the lock since it was in
                  * the waiting_locks_list and ldlm_add_waiting_lock()
                  * already grabbed a ref */
                 /* no needs to take an extra ref on the lock since it was in
                  * the waiting_locks_list and ldlm_add_waiting_lock()
                  * already grabbed a ref */
index e73b91a..d95e6df 100644 (file)
@@ -703,7 +703,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req,
         struct ldlm_namespace   *ns = exp->exp_obd->obd_namespace;
         struct req_capsule      *pill = &req->rq_pill;
         struct ldlm_request     *dlm = NULL;
         struct ldlm_namespace   *ns = exp->exp_obd->obd_namespace;
         struct req_capsule      *pill = &req->rq_pill;
         struct ldlm_request     *dlm = NULL;
-        int flags, avail, to_free, bufcount, pack = 0;
+        int flags, avail, to_free, pack = 0;
         CFS_LIST_HEAD(head);
         int rc;
         ENTRY;
         CFS_LIST_HEAD(head);
         int rc;
         ENTRY;
@@ -712,7 +712,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req,
                 cancels = &head;
         if (exp_connect_cancelset(exp)) {
                 /* Estimate the amount of available space in the request. */
                 cancels = &head;
         if (exp_connect_cancelset(exp)) {
                 /* Estimate the amount of available space in the request. */
-                bufcount = req_capsule_filled_sizes(pill, RCL_CLIENT);
+                req_capsule_filled_sizes(pill, RCL_CLIENT);
                 avail = ldlm_capsule_handles_avail(pill, RCL_CLIENT, canceloff);
 
                 flags = ns_connect_lru_resize(ns) ?
                 avail = ldlm_capsule_handles_avail(pill, RCL_CLIENT, canceloff);
 
                 flags = ns_connect_lru_resize(ns) ?
@@ -1119,8 +1119,6 @@ int ldlm_cli_cancel_req(struct obd_export *exp, cfs_list_t *cancels,
                 count = free;
 
         while (1) {
                 count = free;
 
         while (1) {
-                int bufcount;
-
                 imp = class_exp2cliimp(exp);
                 if (imp == NULL || imp->imp_invalid) {
                         CDEBUG(D_DLMTRACE,
                 imp = class_exp2cliimp(exp);
                 if (imp == NULL || imp->imp_invalid) {
                         CDEBUG(D_DLMTRACE,
@@ -1132,7 +1130,7 @@ int ldlm_cli_cancel_req(struct obd_export *exp, cfs_list_t *cancels,
                 if (req == NULL)
                         GOTO(out, rc = -ENOMEM);
 
                 if (req == NULL)
                         GOTO(out, rc = -ENOMEM);
 
-                bufcount = req_capsule_filled_sizes(&req->rq_pill, RCL_CLIENT);
+                req_capsule_filled_sizes(&req->rq_pill, RCL_CLIENT);
                 req_capsule_set_size(&req->rq_pill, &RMF_DLM_REQ, RCL_CLIENT,
                                      ldlm_request_bufsize(count, LDLM_CANCEL));
 
                 req_capsule_set_size(&req->rq_pill, &RMF_DLM_REQ, RCL_CLIENT,
                                      ldlm_request_bufsize(count, LDLM_CANCEL));
 
@@ -1195,7 +1193,7 @@ static inline struct ldlm_pool *ldlm_imp2pl(struct obd_import *imp)
 int ldlm_cli_update_pool(struct ptlrpc_request *req)
 {
         struct obd_device *obd;
 int ldlm_cli_update_pool(struct ptlrpc_request *req)
 {
         struct obd_device *obd;
-        __u64 old_slv, new_slv;
+        __u64 new_slv;
         __u32 new_limit;
         ENTRY;
         if (unlikely(!req->rq_import || !req->rq_import->imp_obd ||
         __u32 new_limit;
         ENTRY;
         if (unlikely(!req->rq_import || !req->rq_import->imp_obd ||
@@ -1235,7 +1233,6 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
          * oops in that time.
          */
         cfs_write_lock(&obd->obd_pool_lock);
          * oops in that time.
          */
         cfs_write_lock(&obd->obd_pool_lock);
-        old_slv = obd->obd_pool_slv;
         obd->obd_pool_slv = new_slv;
         obd->obd_pool_limit = new_limit;
         cfs_write_unlock(&obd->obd_pool_lock);
         obd->obd_pool_slv = new_slv;
         obd->obd_pool_limit = new_limit;
         cfs_write_unlock(&obd->obd_pool_lock);
index 92414ab..846e228 100644 (file)
@@ -200,7 +200,6 @@ ssize_t llu_iop_filldirentries(struct inode *dir, _SYSIO_OFF_T *basep,
         int filled = 0;
         int rc;
         int done;
         int filled = 0;
         int rc;
         int done;
-        int shift;
         __u16 type;
         ENTRY;
 
         __u16 type;
         ENTRY;
 
@@ -219,7 +218,6 @@ ssize_t llu_iop_filldirentries(struct inode *dir, _SYSIO_OFF_T *basep,
 
         rc    = 0;
         done  = 0;
 
         rc    = 0;
         done  = 0;
-        shift = 0;
         ll_dir_chain_init(&chain);
 
         page = llu_dir_read_page(dir, pos, 0, &chain);
         ll_dir_chain_init(&chain);
 
         page = llu_dir_read_page(dir, pos, 0, &chain);
index aa56124..29d8247 100644 (file)
@@ -189,7 +189,6 @@ int llu_iop_open(struct pnode *pnode, int flags, mode_t mode)
         struct inode *inode = pnode->p_base->pb_ino;
         struct llu_inode_info *lli = llu_i2info(inode);
         struct intnl_stat *st = llu_i2stat(inode);
         struct inode *inode = pnode->p_base->pb_ino;
         struct llu_inode_info *lli = llu_i2info(inode);
         struct intnl_stat *st = llu_i2stat(inode);
-        struct ll_file_data *fd;
         struct ptlrpc_request *request;
         struct lookup_intent *it;
         struct lov_stripe_md *lsm;
         struct ptlrpc_request *request;
         struct lookup_intent *it;
         struct lov_stripe_md *lsm;
@@ -220,8 +219,6 @@ int llu_iop_open(struct pnode *pnode, int flags, mode_t mode)
         if (!S_ISREG(st->st_mode))
                 GOTO(out_release, rc = 0);
 
         if (!S_ISREG(st->st_mode))
                 GOTO(out_release, rc = 0);
 
-        fd = lli->lli_file_data;
-
         lsm = lli->lli_smd;
         if (lsm)
                 flags &= ~O_LOV_DELAY_CREATE;
         lsm = lli->lli_smd;
         if (lsm)
                 flags &= ~O_LOV_DELAY_CREATE;
index ed8c988..d553284 100644 (file)
@@ -488,7 +488,6 @@ static int llu_queue_pio(const struct lu_env *env, struct cl_io *io,
         struct obd_export *exp = llu_i2obdexp(inode);
         struct page *page;
         int  rc = 0, ret_bytes = 0;
         struct obd_export *exp = llu_i2obdexp(inode);
         struct page *page;
         int  rc = 0, ret_bytes = 0;
-        int local_lock;
         struct cl_page *clp;
         struct cl_2queue *queue;
         ENTRY;
         struct cl_page *clp;
         struct cl_2queue *queue;
         ENTRY;
@@ -496,8 +495,6 @@ static int llu_queue_pio(const struct lu_env *env, struct cl_io *io,
         if (!exp)
                 RETURN(-EINVAL);
 
         if (!exp)
                 RETURN(-EINVAL);
 
-        local_lock = group->lig_params->lrp_lock_mode != LCK_NL;
-
         queue = &io->ci_queue;
         cl_2queue_init(queue);
 
         queue = &io->ci_queue;
         cl_2queue_init(queue);
 
index 797e911..4805180 100644 (file)
@@ -208,7 +208,6 @@ static int llu_pb_revalidate(struct pnode *pnode, int flags,
                              struct lookup_intent *it)
 {
         struct pnode_base *pb = pnode->p_base;
                              struct lookup_intent *it)
 {
         struct pnode_base *pb = pnode->p_base;
-        struct it_cb_data icbd;
         struct md_op_data op_data = {{ 0 }};
         struct ptlrpc_request *req = NULL;
         struct lookup_intent lookup_it = { .it_op = IT_LOOKUP };
         struct md_op_data op_data = {{ 0 }};
         struct ptlrpc_request *req = NULL;
         struct lookup_intent lookup_it = { .it_op = IT_LOOKUP };
@@ -245,8 +244,6 @@ static int llu_pb_revalidate(struct pnode *pnode, int flags,
         }
 
         exp = llu_i2mdexp(pb->pb_ino);
         }
 
         exp = llu_i2mdexp(pb->pb_ino);
-        icbd.icbd_parent = pnode->p_parent->p_base->pb_ino;
-        icbd.icbd_child = pnode;
 
         if (!it) {
                 it = &lookup_it;
 
         if (!it) {
                 it = &lookup_it;
index 42c1bd4..0846247 100644 (file)
@@ -486,6 +486,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
                 if (*och_p) { /* Everything is open already, do nothing */
                         /*(*och_usecount)++;  Do not let them steal our open
                           handle from under us */
                 if (*och_p) { /* Everything is open already, do nothing */
                         /*(*och_usecount)++;  Do not let them steal our open
                           handle from under us */
+                        SET_BUT_UNUSED(och_usecount);
                         /* XXX The code above was my original idea, but in case
                            we have the handle, but we cannot use it due to later
                            checks (e.g. O_CREAT|O_EXCL flags set), nobody
                         /* XXX The code above was my original idea, but in case
                            we have the handle, but we cannot use it due to later
                            checks (e.g. O_CREAT|O_EXCL flags set), nobody
index ecb7571..b6c9b2f 100644 (file)
@@ -513,7 +513,6 @@ int ll_readdir(struct file *filp, void *cookie, filldir_t filldir)
         struct page          *page;
         struct ll_dir_chain   chain;
         int                   done;
         struct page          *page;
         struct ll_dir_chain   chain;
         int                   done;
-        int                   shift;
         int                   rc;
         ENTRY;
 
         int                   rc;
         ENTRY;
 
@@ -529,7 +528,6 @@ int ll_readdir(struct file *filp, void *cookie, filldir_t filldir)
 
         rc    = 0;
         done  = 0;
 
         rc    = 0;
         done  = 0;
-        shift = 0;
         ll_dir_chain_init(&chain);
 
         fd->fd_dir.lfd_next = pos;
         ll_dir_chain_init(&chain);
 
         fd->fd_dir.lfd_next = pos;
index d8ba5c9..78eb805 100644 (file)
@@ -1883,10 +1883,7 @@ loff_t ll_file_seek(struct file *file, loff_t offset, int origin)
         ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_LLSEEK, 1);
 
         if (origin == 2) { /* SEEK_END */
         ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_LLSEEK, 1);
 
         if (origin == 2) { /* SEEK_END */
-                int nonblock = 0, rc;
-
-                if (file->f_flags & O_NONBLOCK)
-                        nonblock = LDLM_FL_BLOCK_NOWAIT;
+                int rc;
 
                 rc = cl_glimpse_size(inode);
                 if (rc != 0)
 
                 rc = cl_glimpse_size(inode);
                 if (rc != 0)
@@ -2230,7 +2227,6 @@ int __ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
 {
         struct inode *inode = dentry->d_inode;
         struct ptlrpc_request *req = NULL;
 {
         struct inode *inode = dentry->d_inode;
         struct ptlrpc_request *req = NULL;
-        struct ll_sb_info *sbi;
         struct obd_export *exp;
         int rc = 0;
         ENTRY;
         struct obd_export *exp;
         int rc = 0;
         ENTRY;
@@ -2239,7 +2235,6 @@ int __ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
                 CERROR("REPORT THIS LINE TO PETER\n");
                 RETURN(0);
         }
                 CERROR("REPORT THIS LINE TO PETER\n");
                 RETURN(0);
         }
-        sbi = ll_i2sbi(inode);
 
         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),name=%s\n",
                inode->i_ino, inode->i_generation, inode, dentry->d_name.name);
 
         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),name=%s\n",
                inode->i_ino, inode->i_generation, inode, dentry->d_name.name);
index a3274ec..e24aa81 100644 (file)
@@ -1324,7 +1324,7 @@ struct ll_dio_pages {
 static inline void cl_stats_tally(struct cl_device *dev, enum cl_req_type crt,
                                   int rc)
 {
 static inline void cl_stats_tally(struct cl_device *dev, enum cl_req_type crt,
                                   int rc)
 {
-        int opc = (crt == CIT_READ) ? LPROC_LL_OSC_READ :
+        int opc = (crt == CRT_READ) ? LPROC_LL_OSC_READ :
                                       LPROC_LL_OSC_WRITE;
 
         ll_stats_ops_tally(ll_s2sbi(cl2ccc_dev(dev)->cdv_sb), opc, rc);
                                       LPROC_LL_OSC_WRITE;
 
         ll_stats_ops_tally(ll_s2sbi(cl2ccc_dev(dev)->cdv_sb), opc, rc);
index 2243aab..b8849a5 100644 (file)
@@ -148,7 +148,6 @@ static struct ll_cl_context *ll_cl_init(struct file *file,
         cio = ccc_env_io(env);
         io = cio->cui_cl.cis_io;
         if (io == NULL && create) {
         cio = ccc_env_io(env);
         io = cio->cui_cl.cis_io;
         if (io == NULL && create) {
-                struct vvp_io *vio;
                 loff_t pos;
 
                 /*
                 loff_t pos;
 
                 /*
@@ -156,9 +155,7 @@ static struct ll_cl_context *ll_cl_init(struct file *file,
                  * methods directly, bypassing file system ->write() operation,
                  * so cl_io has to be created here.
                  */
                  * methods directly, bypassing file system ->write() operation,
                  * so cl_io has to be created here.
                  */
-
                 io = ccc_env_thread_io(env);
                 io = ccc_env_thread_io(env);
-                vio = vvp_env_io(env);
                 ll_io_init(io, file, 1);
 
                 /* No lock at all for this kind of IO - we can't do it because
                 ll_io_init(io, file, 1);
 
                 /* No lock at all for this kind of IO - we can't do it because
index 3e765ba..88ffcc1 100644 (file)
@@ -2073,7 +2073,6 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
         struct obd_device       *obd = exp->exp_obd;
         struct lmv_obd          *lmv = &obd->u.lmv;
         struct lmv_tgt_desc     *src_tgt;
         struct obd_device       *obd = exp->exp_obd;
         struct lmv_obd          *lmv = &obd->u.lmv;
         struct lmv_tgt_desc     *src_tgt;
-        struct lmv_tgt_desc     *tgt_tgt;
         int                      rc;
         int                      sidx;
         int                      loop = 0;
         int                      rc;
         int                      sidx;
         int                      loop = 0;
@@ -2133,7 +2132,6 @@ repeat:
         op_data->op_cap = cfs_curproc_cap_pack();
 
         src_tgt = lmv_get_target(lmv, mds1);
         op_data->op_cap = cfs_curproc_cap_pack();
 
         src_tgt = lmv_get_target(lmv, mds1);
-        tgt_tgt = lmv_get_target(lmv, mds2);
 
         /*
          * LOOKUP lock on src child (fid3) should also be cancelled for
 
         /*
          * LOOKUP lock on src child (fid3) should also be cancelled for
@@ -2534,6 +2532,8 @@ repeat:
                 first->ldp_hash_end = hash_end;
                 first->ldp_flags &= ~cpu_to_le32(LDF_COLLIDE);
                 first->ldp_flags |= flags & cpu_to_le32(LDF_COLLIDE);
                 first->ldp_hash_end = hash_end;
                 first->ldp_flags &= ~cpu_to_le32(LDF_COLLIDE);
                 first->ldp_flags |= flags & cpu_to_le32(LDF_COLLIDE);
+#else
+                SET_BUT_UNUSED(tmp);
 #endif
                 cfs_kunmap(pages[i]);
         }
 #endif
                 cfs_kunmap(pages[i]);
         }
index 9180373..f454a59 100644 (file)
@@ -790,7 +790,6 @@ static int alloc_qos(struct obd_export *exp, int *idx_arr, int *stripe_cnt,
         int stripe_cnt_min = min_stripe_count(*stripe_cnt, flags);
         struct pool_desc *pool;
         struct ost_pool *osts;
         int stripe_cnt_min = min_stripe_count(*stripe_cnt, flags);
         struct pool_desc *pool;
         struct ost_pool *osts;
-        struct lov_qos_rr *lqr;
         ENTRY;
 
         if (stripe_cnt_min < 1)
         ENTRY;
 
         if (stripe_cnt_min < 1)
@@ -799,11 +798,9 @@ static int alloc_qos(struct obd_export *exp, int *idx_arr, int *stripe_cnt,
         pool = lov_find_pool(lov, poolname);
         if (pool == NULL) {
                 osts = &(lov->lov_packed);
         pool = lov_find_pool(lov, poolname);
         if (pool == NULL) {
                 osts = &(lov->lov_packed);
-                lqr = &(lov->lov_qos.lq_rr);
         } else {
                 cfs_down_read(&pool_tgt_rw_sem(pool));
                 osts = &(pool->pool_obds);
         } else {
                 cfs_down_read(&pool_tgt_rw_sem(pool));
                 osts = &(pool->pool_obds);
-                lqr = &(pool->pool_rr);
         }
 
         obd_getref(exp->exp_obd);
         }
 
         obd_getref(exp->exp_obd);
index 4810da4..263adff 100644 (file)
@@ -205,7 +205,6 @@ int lov_sublock_modify(const struct lu_env *env, struct lov_lock *lov,
                        const struct cl_lock_descr *d, int idx)
 {
         struct cl_lock       *parent;
                        const struct cl_lock_descr *d, int idx)
 {
         struct cl_lock       *parent;
-        struct cl_lock       *child;
         struct lovsub_object *subobj;
         struct cl_lock_descr *pd;
         struct cl_lock_descr *parent_descr;
         struct lovsub_object *subobj;
         struct cl_lock_descr *pd;
         struct cl_lock_descr *parent_descr;
@@ -215,7 +214,6 @@ int lov_sublock_modify(const struct lu_env *env, struct lov_lock *lov,
         parent_descr = &parent->cll_descr;
         LASSERT(cl_lock_mode_match(d->cld_mode, parent_descr->cld_mode));
 
         parent_descr = &parent->cll_descr;
         LASSERT(cl_lock_mode_match(d->cld_mode, parent_descr->cld_mode));
 
-        child  = sublock->lss_cl.cls_lock;
         subobj = cl2lovsub(sublock->lss_cl.cls_obj);
         pd     = &lov_env_info(env)->lti_ldescr;
 
         subobj = cl2lovsub(sublock->lss_cl.cls_obj);
         pd     = &lov_env_info(env)->lti_ldescr;
 
index 4269afe..af03ac7 100644 (file)
@@ -388,13 +388,8 @@ struct l_file *l_dentry_open(struct lvfs_run_ctxt *ctxt, struct l_dentry *de,
 }
 EXPORT_SYMBOL(l_dentry_open);
 
 }
 EXPORT_SYMBOL(l_dentry_open);
 
-#ifdef HAVE_VFS_READDIR_U64_INO
 static int l_filldir(void *__buf, const char *name, int namlen, loff_t offset,
                      u64 ino, unsigned int d_type)
 static int l_filldir(void *__buf, const char *name, int namlen, loff_t offset,
                      u64 ino, unsigned int d_type)
-#else
-static int l_filldir(void *__buf, const char *name, int namlen, loff_t offset,
-                     ino_t ino, unsigned int d_type)
-#endif
 {
         struct l_linux_dirent *dirent;
         struct l_readdir_callback *buf = (struct l_readdir_callback *)__buf;
 {
         struct l_linux_dirent *dirent;
         struct l_readdir_callback *buf = (struct l_readdir_callback *)__buf;
index 4fc9f6b..99c9c0c 100644 (file)
@@ -633,7 +633,6 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
 {
         struct obd_device     *obddev = class_exp2obd(exp);
         struct ptlrpc_request *req = NULL;
 {
         struct obd_device     *obddev = class_exp2obd(exp);
         struct ptlrpc_request *req = NULL;
-        struct req_capsule    *pill;
         int                    flags = extra_lock_flags;
         int                    rc;
         struct ldlm_res_id res_id;
         int                    flags = extra_lock_flags;
         int                    rc;
         struct ldlm_res_id res_id;
@@ -684,7 +683,6 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
 
         if (IS_ERR(req))
                 RETURN(PTR_ERR(req));
 
         if (IS_ERR(req))
                 RETURN(PTR_ERR(req));
-        pill = &req->rq_pill;
 
         /* It is important to obtain rpc_lock first (if applicable), so that
          * threads that are serialised with rpc_lock are not polluting our
 
         /* It is important to obtain rpc_lock first (if applicable), so that
          * threads that are serialised with rpc_lock are not polluting our
index 5aceee0..b8096b7 100644 (file)
@@ -298,14 +298,12 @@ static void cl_lock_free(const struct lu_env *env, struct cl_lock *lock)
 void cl_lock_put(const struct lu_env *env, struct cl_lock *lock)
 {
         struct cl_object        *obj;
 void cl_lock_put(const struct lu_env *env, struct cl_lock *lock)
 {
         struct cl_object        *obj;
-        struct cl_object_header *head;
         struct cl_site          *site;
 
         LINVRNT(cl_lock_invariant(env, lock));
         ENTRY;
         obj = lock->cll_descr.cld_obj;
         LINVRNT(obj != NULL);
         struct cl_site          *site;
 
         LINVRNT(cl_lock_invariant(env, lock));
         ENTRY;
         obj = lock->cll_descr.cld_obj;
         LINVRNT(obj != NULL);
-        head = cl_object_header(obj);
         site = cl_object_site(obj);
 
         CDEBUG(D_TRACE, "releasing reference: %d %p %lu\n",
         site = cl_object_site(obj);
 
         CDEBUG(D_TRACE, "releasing reference: %d %p %lu\n",
index 27fc136..4c82107 100644 (file)
@@ -2296,10 +2296,8 @@ static struct ptlrpc_request *osc_build_req(const struct lu_env *env,
         struct osc_brw_async_args *aa;
         struct obdo *oa = NULL;
         const struct obd_async_page_ops *ops = NULL;
         struct osc_brw_async_args *aa;
         struct obdo *oa = NULL;
         const struct obd_async_page_ops *ops = NULL;
-        void *caller_data = NULL;
         struct osc_async_page *oap;
         struct osc_async_page *tmp;
         struct osc_async_page *oap;
         struct osc_async_page *tmp;
-        struct ost_body *body;
         struct cl_req *clerq = NULL;
         enum cl_req_type crt = (cmd & OBD_BRW_WRITE) ? CRT_WRITE : CRT_READ;
         struct ldlm_lock *lock = NULL;
         struct cl_req *clerq = NULL;
         enum cl_req_type crt = (cmd & OBD_BRW_WRITE) ? CRT_WRITE : CRT_READ;
         struct ldlm_lock *lock = NULL;
@@ -2326,7 +2324,6 @@ static struct ptlrpc_request *osc_build_req(const struct lu_env *env,
                 struct cl_page *page = osc_oap2cl_page(oap);
                 if (ops == NULL) {
                         ops = oap->oap_caller_ops;
                 struct cl_page *page = osc_oap2cl_page(oap);
                 if (ops == NULL) {
                         ops = oap->oap_caller_ops;
-                        caller_data = oap->oap_caller_data;
 
                         clerq = cl_req_alloc(env, page, crt,
                                              1 /* only 1-object rpcs for
 
                         clerq = cl_req_alloc(env, page, crt,
                                              1 /* only 1-object rpcs for
@@ -2375,7 +2372,6 @@ static struct ptlrpc_request *osc_build_req(const struct lu_env *env,
          * later setattr before earlier BRW (as determined by the request xid),
          * the OST will not use BRW timestamps.  Sadly, there is no obvious
          * way to do this in a single call.  bug 10150 */
          * later setattr before earlier BRW (as determined by the request xid),
          * the OST will not use BRW timestamps.  Sadly, there is no obvious
          * way to do this in a single call.  bug 10150 */
-        body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
         cl_req_attr_set(env, clerq, &crattr,
                         OBD_MD_FLMTIME|OBD_MD_FLCTIME|OBD_MD_FLATIME);
 
         cl_req_attr_set(env, clerq, &crattr,
                         OBD_MD_FLMTIME|OBD_MD_FLCTIME|OBD_MD_FLATIME);
 
index 3929127..e673548 100644 (file)
@@ -127,7 +127,6 @@ int llog_origin_handle_destroy(struct ptlrpc_request *req)
         struct lvfs_run_ctxt  saved;
         struct llog_logid    *logid = NULL;
         struct llog_ctxt     *ctxt;
         struct lvfs_run_ctxt  saved;
         struct llog_logid    *logid = NULL;
         struct llog_ctxt     *ctxt;
-        __u32                 flags;
         int                   rc;
         ENTRY;
 
         int                   rc;
         ENTRY;
 
@@ -155,7 +154,6 @@ int llog_origin_handle_destroy(struct ptlrpc_request *req)
 
         body = req_capsule_server_get(&req->rq_pill, &RMF_LLOGD_BODY);
         body->lgd_logid = loghandle->lgh_id;
 
         body = req_capsule_server_get(&req->rq_pill, &RMF_LLOGD_BODY);
         body->lgd_logid = loghandle->lgh_id;
-        flags = body->lgd_llh_flags;
         rc = llog_init_handle(loghandle, LLOG_F_IS_PLAIN, NULL);
         if (rc)
                 GOTO(out_close, rc);
         rc = llog_init_handle(loghandle, LLOG_F_IS_PLAIN, NULL);
         if (rc)
                 GOTO(out_close, rc);
index b95f8ca..d91ac57 100644 (file)
@@ -163,9 +163,7 @@ cfs_duration_t pinger_check_timeout(cfs_time_t time)
                                          cfs_time_current());
 }
 
                                          cfs_time_current());
 }
 
-#ifdef __KERNEL__
 static cfs_waitq_t suspend_timeouts_waitq;
 static cfs_waitq_t suspend_timeouts_waitq;
-#endif
 
 cfs_time_t ptlrpc_suspend_wakeup_time(void)
 {
 
 cfs_time_t ptlrpc_suspend_wakeup_time(void)
 {
index e4c5e73..0616c04 100644 (file)
@@ -700,6 +700,8 @@ out:
                 if (env != 0)
                         lu_context_fini(&pc->pc_env.le_ctx);
                 cfs_clear_bit(LIOD_BIND, &pc->pc_flags);
                 if (env != 0)
                         lu_context_fini(&pc->pc_env.le_ctx);
                 cfs_clear_bit(LIOD_BIND, &pc->pc_flags);
+#else
+                SET_BUT_UNUSED(env);
 #endif
                 cfs_clear_bit(LIOD_START, &pc->pc_flags);
         }
 #endif
                 cfs_clear_bit(LIOD_START, &pc->pc_flags);
         }
index 5af3690..2e4791f 100644 (file)
@@ -795,14 +795,13 @@ EXPORT_SYMBOL(sptlrpc_conf_log_update_end);
 
 void sptlrpc_conf_log_start(const char *logname)
 {
 
 void sptlrpc_conf_log_start(const char *logname)
 {
-        struct sptlrpc_conf *conf;
         char                 fsname[16];
 
         if (logname2fsname(logname, fsname, sizeof(fsname)))
                 return;
 
         cfs_mutex_lock(&sptlrpc_conf_lock);
         char                 fsname[16];
 
         if (logname2fsname(logname, fsname, sizeof(fsname)))
                 return;
 
         cfs_mutex_lock(&sptlrpc_conf_lock);
-        conf = sptlrpc_conf_get(fsname, 1);
+        sptlrpc_conf_get(fsname, 1);
         cfs_mutex_unlock(&sptlrpc_conf_lock);
 }
 EXPORT_SYMBOL(sptlrpc_conf_log_start);
         cfs_mutex_unlock(&sptlrpc_conf_lock);
 }
 EXPORT_SYMBOL(sptlrpc_conf_log_start);
index b0b9035..283c489 100644 (file)
@@ -351,8 +351,8 @@ int plain_cli_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
                           struct ptlrpc_request *req,
                           struct ptlrpc_bulk_desc *desc)
 {
                           struct ptlrpc_request *req,
                           struct ptlrpc_bulk_desc *desc)
 {
-        struct ptlrpc_bulk_sec_desc *bsdr, *bsdv;
-        struct plain_bulk_token     *tokenr, *tokenv;
+        struct ptlrpc_bulk_sec_desc *bsdv;
+        struct plain_bulk_token     *tokenv;
         int                          rc;
 #ifdef __KERNEL__
         int                          i, nob;
         int                          rc;
 #ifdef __KERNEL__
         int                          i, nob;
@@ -362,8 +362,6 @@ int plain_cli_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
         LASSERT(req->rq_reqbuf->lm_bufcount == PLAIN_PACK_SEGMENTS);
         LASSERT(req->rq_repdata->lm_bufcount == PLAIN_PACK_SEGMENTS);
 
         LASSERT(req->rq_reqbuf->lm_bufcount == PLAIN_PACK_SEGMENTS);
         LASSERT(req->rq_repdata->lm_bufcount == PLAIN_PACK_SEGMENTS);
 
-        bsdr = lustre_msg_buf(req->rq_reqbuf, PLAIN_PACK_BULK_OFF, 0);
-        tokenr = (struct plain_bulk_token *) bsdr->bsd_data;
         bsdv = lustre_msg_buf(req->rq_repdata, PLAIN_PACK_BULK_OFF, 0);
         tokenv = (struct plain_bulk_token *) bsdv->bsd_data;
 
         bsdv = lustre_msg_buf(req->rq_repdata, PLAIN_PACK_BULK_OFF, 0);
         tokenv = (struct plain_bulk_token *) bsdv->bsd_data;
 
@@ -911,7 +909,7 @@ int plain_svc_unwrap_bulk(struct ptlrpc_request *req,
 {
         struct ptlrpc_reply_state   *rs = req->rq_reply_state;
         struct ptlrpc_bulk_sec_desc *bsdr, *bsdv;
 {
         struct ptlrpc_reply_state   *rs = req->rq_reply_state;
         struct ptlrpc_bulk_sec_desc *bsdr, *bsdv;
-        struct plain_bulk_token     *tokenr, *tokenv;
+        struct plain_bulk_token     *tokenr;
         int                          rc;
 
         LASSERT(req->rq_bulk_write);
         int                          rc;
 
         LASSERT(req->rq_bulk_write);
@@ -920,7 +918,6 @@ int plain_svc_unwrap_bulk(struct ptlrpc_request *req,
         bsdr = lustre_msg_buf(req->rq_reqbuf, PLAIN_PACK_BULK_OFF, 0);
         tokenr = (struct plain_bulk_token *) bsdr->bsd_data;
         bsdv = lustre_msg_buf(rs->rs_repbuf, PLAIN_PACK_BULK_OFF, 0);
         bsdr = lustre_msg_buf(req->rq_reqbuf, PLAIN_PACK_BULK_OFF, 0);
         tokenr = (struct plain_bulk_token *) bsdr->bsd_data;
         bsdv = lustre_msg_buf(rs->rs_repbuf, PLAIN_PACK_BULK_OFF, 0);
-        tokenv = (struct plain_bulk_token *) bsdv->bsd_data;
 
         bsdv->bsd_version = 0;
         bsdv->bsd_type = SPTLRPC_BULK_DEFAULT;
 
         bsdv->bsd_version = 0;
         bsdv->bsd_type = SPTLRPC_BULK_DEFAULT;
@@ -946,14 +943,13 @@ int plain_svc_wrap_bulk(struct ptlrpc_request *req,
 {
         struct ptlrpc_reply_state   *rs = req->rq_reply_state;
         struct ptlrpc_bulk_sec_desc *bsdr, *bsdv;
 {
         struct ptlrpc_reply_state   *rs = req->rq_reply_state;
         struct ptlrpc_bulk_sec_desc *bsdr, *bsdv;
-        struct plain_bulk_token     *tokenr, *tokenv;
+        struct plain_bulk_token     *tokenv;
         int                          rc;
 
         LASSERT(req->rq_bulk_read);
         LASSERT(req->rq_pack_bulk);
 
         bsdr = lustre_msg_buf(req->rq_reqbuf, PLAIN_PACK_BULK_OFF, 0);
         int                          rc;
 
         LASSERT(req->rq_bulk_read);
         LASSERT(req->rq_pack_bulk);
 
         bsdr = lustre_msg_buf(req->rq_reqbuf, PLAIN_PACK_BULK_OFF, 0);
-        tokenr = (struct plain_bulk_token *) bsdr->bsd_data;
         bsdv = lustre_msg_buf(rs->rs_repbuf, PLAIN_PACK_BULK_OFF, 0);
         tokenv = (struct plain_bulk_token *) bsdv->bsd_data;
 
         bsdv = lustre_msg_buf(rs->rs_repbuf, PLAIN_PACK_BULK_OFF, 0);
         tokenv = (struct plain_bulk_token *) bsdv->bsd_data;
 
index b4b036f..a36bc28 100644 (file)
@@ -1595,7 +1595,7 @@ ptlrpc_server_handle_request(struct ptlrpc_service *svc,
         struct timeval         work_start;
         struct timeval         work_end;
         long                   timediff;
         struct timeval         work_start;
         struct timeval         work_end;
         long                   timediff;
-        int                    opc, rc;
+        int                    rc;
         int                    fail_opc = 0;
         ENTRY;
 
         int                    fail_opc = 0;
         ENTRY;
 
@@ -1615,7 +1615,6 @@ ptlrpc_server_handle_request(struct ptlrpc_service *svc,
                 RETURN(0);
         }
 
                 RETURN(0);
         }
 
-        opc = lustre_msg_get_opc(request->rq_reqmsg);
         if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_HPREQ_NOTIMEOUT))
                 fail_opc = OBD_FAIL_PTLRPC_HPREQ_NOTIMEOUT;
         else if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_HPREQ_TIMEOUT))
         if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_HPREQ_NOTIMEOUT))
                 fail_opc = OBD_FAIL_PTLRPC_HPREQ_NOTIMEOUT;
         else if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_HPREQ_TIMEOUT))
@@ -1787,13 +1786,11 @@ ptlrpc_handle_rs (struct ptlrpc_reply_state *rs)
 {
         struct ptlrpc_service     *svc = rs->rs_service;
         struct obd_export         *exp;
 {
         struct ptlrpc_service     *svc = rs->rs_service;
         struct obd_export         *exp;
-        struct obd_device         *obd;
         int                        nlocks;
         int                        been_handled;
         ENTRY;
 
         exp = rs->rs_export;
         int                        nlocks;
         int                        been_handled;
         ENTRY;
 
         exp = rs->rs_export;
-        obd = exp->exp_obd;
 
         LASSERT (rs->rs_difficult);
         LASSERT (rs->rs_scheduled);
 
         LASSERT (rs->rs_difficult);
         LASSERT (rs->rs_scheduled);
index 828a7c1..df99540 100644 (file)
@@ -181,12 +181,9 @@ int lprocfs_quota_rd_type(char *page, char **start, off_t off, int count,
         struct obd_device *obd = (struct obd_device *)data;
         char stype[MAX_STYPE_SIZE + 1] = "";
         int oq_type;
         struct obd_device *obd = (struct obd_device *)data;
         char stype[MAX_STYPE_SIZE + 1] = "";
         int oq_type;
-        struct obd_device_target *obt;
 
         LASSERT(obd != NULL);
 
 
         LASSERT(obd != NULL);
 
-        obt = &obd->u.obt;
-
         /* Collect the needed information */
         oq_type = obd->u.obt.obt_qctxt.lqc_flags;
 
         /* Collect the needed information */
         oq_type = obd->u.obt.obt_qctxt.lqc_flags;
 
@@ -291,17 +288,12 @@ int lprocfs_quota_wr_type(struct file *file, const char *buffer,
                           unsigned long count, void *data)
 {
         struct obd_device *obd = (struct obd_device *)data;
                           unsigned long count, void *data)
 {
         struct obd_device *obd = (struct obd_device *)data;
-        struct obd_device_target *obt;
-        int type = 0, is_mds;
+        int type = 0;
         unsigned long i;
         char stype[MAX_STYPE_SIZE + 1] = "";
 
         LASSERT(obd != NULL);
 
         unsigned long i;
         char stype[MAX_STYPE_SIZE + 1] = "";
 
         LASSERT(obd != NULL);
 
-        obt = &obd->u.obt;
-
-        is_mds = !strcmp(obd->obd_type->typ_name, LUSTRE_MDS_NAME);
-
         if (count > MAX_STYPE_SIZE)
                 return -EINVAL;
 
         if (count > MAX_STYPE_SIZE)
                 return -EINVAL;
 
index 837552d..577fcfe 100644 (file)
@@ -48,9 +48,8 @@ void usage(char *prog)
 int main(int argc, char **argv)
 {
         int fd, rc;
 int main(int argc, char **argv)
 {
         int fd, rc;
-       int do_sync = 0;
-        int i = 0;
-       int file_arg = 1;
+        int do_sync = 0;
+        int file_arg = 1;
         char buf[4096];
 
         memset(buf, 0, 4096);
         char buf[4096];
 
         memset(buf, 0, 4096);
@@ -71,8 +70,8 @@ int main(int argc, char **argv)
                 exit(1);
         }
 
                 exit(1);
         }
 
-        while (1) {
-                sprintf(buf, "write %d\n", i);
+        for (rc = 0; ;) {
+                sprintf(buf, "write %d\n", rc);
                 rc = write(fd, buf, sizeof(buf));
                if (do_sync)
                        sync();
                 rc = write(fd, buf, sizeof(buf));
                if (do_sync)
                        sync();
index 999a2c3..88a0cd2 100644 (file)
@@ -2538,7 +2538,6 @@ int llapi_target_iterate(int type_num, char **obd_type,
                 char *obd_name = NULL;
                 char *obd_uuid = NULL;
                 char *bufp = buf;
                 char *obd_name = NULL;
                 char *obd_uuid = NULL;
                 char *bufp = buf;
-                struct obd_ioctl_data datal = { 0, };
                 struct obd_statfs osfs_buffer;
 
                 while(bufp[0] == ' ')
                 struct obd_statfs osfs_buffer;
 
                 while(bufp[0] == ' ')
@@ -2552,9 +2551,6 @@ int llapi_target_iterate(int type_num, char **obd_type,
 
                 memset(&osfs_buffer, 0, sizeof (osfs_buffer));
 
 
                 memset(&osfs_buffer, 0, sizeof (osfs_buffer));
 
-                datal.ioc_pbuf1 = (char *)&osfs_buffer;
-                datal.ioc_plen1 = sizeof(osfs_buffer);
-
                 for (i = 0; i < type_num; i++) {
                         if (strcmp(obd_type_name, obd_type[i]) != 0)
                                 continue;
                 for (i = 0; i < type_num; i++) {
                         if (strcmp(obd_type_name, obd_type[i]) != 0)
                                 continue;
index ac14f25..a394a4c 100644 (file)
 
 int main(int argc, char *argv[])
 {
 
 int main(int argc, char *argv[])
 {
-       char *prog;
        int rc = 0;
        int i;
 
        int rc = 0;
        int i;
 
-       prog = basename(argv[0]);
-
        for (i = 1; i < argc; i++) {
                char buf[1024]; /* allow xattr that may be larger */
                struct filter_fid *ff = (void *)buf;
        for (i = 1; i < argc; i++) {
                char buf[1024]; /* allow xattr that may be larger */
                struct filter_fid *ff = (void *)buf;