Whamcloud - gitweb
LU-8378 all: remove set but unused variables 21/23221/2
authorYang Sheng <yang.sheng@intel.com>
Tue, 18 Oct 2016 04:50:22 +0000 (12:50 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 25 Oct 2016 02:25:00 +0000 (02:25 +0000)
Remove set but unused variables as report list.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Change-Id: If9120ec088a2dd0b65564330bc295c08a1e579b7
Reviewed-on: http://review.whamcloud.com/23221
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
15 files changed:
lnet/lnet/nidstrings.c
lustre/fid/lproc_fid.c
lustre/mdd/mdd_dir.c
lustre/mdt/mdt_hsm_cdt_actions.c
lustre/mgs/lproc_mgs.c
lustre/mgs/mgs_handler.c
lustre/ofd/ofd_grant.c
lustre/ofd/ofd_obd.c
lustre/osc/osc_request.c
lustre/osd-ldiskfs/osd_iam.c
lustre/osd-ldiskfs/osd_iam_lfix.c
lustre/osd-ldiskfs/osd_iam_lvar.c
lustre/quota/qmt_lock.c
lustre/quota/qsd_lock.c
lustre/quota/qsd_request.c

index 6ad1079..1d292fb 100644 (file)
@@ -245,10 +245,8 @@ parse_nidrange(struct cfs_lstr *src, struct list_head *nidlist)
 {
        struct cfs_lstr addrrange;
        struct cfs_lstr net;
 {
        struct cfs_lstr addrrange;
        struct cfs_lstr net;
-       struct cfs_lstr tmp;
        struct nidrange *nr;
 
        struct nidrange *nr;
 
-       tmp = *src;
        if (cfs_gettok(src, '@', &addrrange) == 0)
                goto failed;
 
        if (cfs_gettok(src, '@', &addrrange) == 0)
                goto failed;
 
index 6f3be62..9ce5a45 100644 (file)
@@ -64,7 +64,6 @@ lprocfs_fid_write_common(const char __user *buffer, size_t count,
                                struct lu_seq_range *range)
 {
        struct lu_seq_range tmp = { 0, };
                                struct lu_seq_range *range)
 {
        struct lu_seq_range tmp = { 0, };
-       int rc;
        char kernbuf[MAX_FID_RANGE_STRLEN];
        ENTRY;
 
        char kernbuf[MAX_FID_RANGE_STRLEN];
        ENTRY;
 
@@ -84,9 +83,9 @@ lprocfs_fid_write_common(const char __user *buffer, size_t count,
        }
 
        /* of the form "[0x0000000240000400 - 0x000000028000400]" */
        }
 
        /* of the form "[0x0000000240000400 - 0x000000028000400]" */
-       rc = sscanf(kernbuf, "[%llx - %llx]\n",
-                   (long long unsigned *)&tmp.lsr_start,
-                   (long long unsigned *)&tmp.lsr_end);
+       sscanf(kernbuf, "[%llx - %llx]\n",
+              (long long unsigned *)&tmp.lsr_start,
+              (long long unsigned *)&tmp.lsr_end);
        if (!lu_seq_range_is_sane(&tmp) || lu_seq_range_is_zero(&tmp) ||
            tmp.lsr_start < range->lsr_start || tmp.lsr_end > range->lsr_end)
                RETURN(-EINVAL);
        if (!lu_seq_range_is_sane(&tmp) || lu_seq_range_is_zero(&tmp) ||
            tmp.lsr_start < range->lsr_start || tmp.lsr_end > range->lsr_end)
                RETURN(-EINVAL);
index b711f14..975c1cb 100644 (file)
@@ -3643,7 +3643,6 @@ static int mdd_migrate_entries(const struct lu_env *env,
                struct mdd_object       *child;
                char                    *name = mdd_env_info(env)->mti_key;
                int                     len;
                struct mdd_object       *child;
                char                    *name = mdd_env_info(env)->mti_key;
                int                     len;
-               int                     recsize;
                int                     is_dir;
                bool                    target_exist = false;
 
                int                     is_dir;
                bool                    target_exist = false;
 
@@ -3661,7 +3660,6 @@ static int mdd_migrate_entries(const struct lu_env *env,
                }
 
                fid_le_to_cpu(&ent->lde_fid, &ent->lde_fid);
                }
 
                fid_le_to_cpu(&ent->lde_fid, &ent->lde_fid);
-               recsize = le16_to_cpu(ent->lde_reclen);
 
                /* Insert new fid with target name into target dir */
                if ((ent->lde_namelen == 1 && ent->lde_name[0] == '.') ||
 
                /* Insert new fid with target name into target dir */
                if ((ent->lde_namelen == 1 && ent->lde_name[0] == '.') ||
index 14b08f9..7e9b9e9 100644 (file)
@@ -365,7 +365,6 @@ static int hsm_actions_show_cb(const struct lu_env *env,
        struct seq_file              *s = data;
        struct agent_action_iterator *aai;
        int                           sz;
        struct seq_file              *s = data;
        struct agent_action_iterator *aai;
        int                           sz;
-       size_t                        count;
        char                          buf[12];
        ENTRY;
 
        char                          buf[12];
        ENTRY;
 
@@ -381,7 +380,6 @@ static int hsm_actions_show_cb(const struct lu_env *env,
                     hdr->lrh_index <= aai->aai_index))
                RETURN(0);
 
                     hdr->lrh_index <= aai->aai_index))
                RETURN(0);
 
-       count = s->count;
        sz = larr->arr_hai.hai_len - sizeof(larr->arr_hai);
        seq_printf(s, "lrh=[type=%X len=%d idx=%d/%d] fid="DFID
                   " dfid="DFID" compound/cookie=%#llx/%#llx"
        sz = larr->arr_hai.hai_len - sizeof(larr->arr_hai);
        seq_printf(s, "lrh=[type=%X len=%d idx=%d/%d] fid="DFID
                   " dfid="DFID" compound/cookie=%#llx/%#llx"
index a23ac2b..134c829 100644 (file)
@@ -174,14 +174,10 @@ LPROC_SEQ_FOPS(mgs_live);
 
 int lproc_mgs_add_live(struct mgs_device *mgs, struct fs_db *fsdb)
 {
 
 int lproc_mgs_add_live(struct mgs_device *mgs, struct fs_db *fsdb)
 {
-       int rc;
-
        if (!mgs->mgs_proc_live)
                return 0;
        if (!mgs->mgs_proc_live)
                return 0;
-       rc = lprocfs_seq_create(mgs->mgs_proc_live, fsdb->fsdb_name, 0644,
-                               &mgs_live_fops, fsdb);
-
-       return 0;
+       return lprocfs_seq_create(mgs->mgs_proc_live, fsdb->fsdb_name, 0644,
+                                 &mgs_live_fops, fsdb);
 }
 
 int lproc_mgs_del_live(struct mgs_device *mgs, struct fs_db *fsdb)
 }
 
 int lproc_mgs_del_live(struct mgs_device *mgs, struct fs_db *fsdb)
index 22c4744..2859cab 100644 (file)
@@ -1311,7 +1311,7 @@ static int mgs_object_init(const struct lu_env *env, struct lu_object *o,
        else
                rc = -ENOMEM;
 
        else
                rc = -ENOMEM;
 
-       return 0;
+       return rc;
 }
 
 static void mgs_object_free(const struct lu_env *env, struct lu_object *o)
 }
 
 static void mgs_object_free(const struct lu_env *env, struct lu_object *o)
index a08a5d5..ed92f14 100644 (file)
@@ -1075,7 +1075,6 @@ void ofd_grant_prepare_write(const struct lu_env *env,
        int                      from_cache;
        int                      force = 0; /* can use cached data intially */
        long                     chunk = ofd_grant_chunk(exp, ofd, NULL);
        int                      from_cache;
        int                      force = 0; /* can use cached data intially */
        long                     chunk = ofd_grant_chunk(exp, ofd, NULL);
-       int                      rc;
 
        ENTRY;
 
 
        ENTRY;
 
@@ -1117,7 +1116,7 @@ refresh:
                         * space on the server */
                        spin_unlock(&ofd->ofd_grant_lock);
                        /* discard errors, at least we tried ... */
                         * space on the server */
                        spin_unlock(&ofd->ofd_grant_lock);
                        /* discard errors, at least we tried ... */
-                       rc = dt_sync(env, ofd->ofd_osd);
+                       dt_sync(env, ofd->ofd_osd);
                        force = 2;
                        goto refresh;
                }
                        force = 2;
                        goto refresh;
                }
index 9e010b5..957aac5 100644 (file)
@@ -1098,7 +1098,6 @@ static int ofd_echo_create(const struct lu_env *env, struct obd_export *exp,
                           struct obdo *oa)
 {
        struct ofd_device       *ofd = ofd_exp(exp);
                           struct obdo *oa)
 {
        struct ofd_device       *ofd = ofd_exp(exp);
-       struct ofd_thread_info  *info;
        u64                      seq = ostid_seq(&oa->o_oi);
        struct ofd_seq          *oseq;
        int                      rc = 0, diff = 1;
        u64                      seq = ostid_seq(&oa->o_oi);
        struct ofd_seq          *oseq;
        int                      rc = 0, diff = 1;
@@ -1108,7 +1107,7 @@ static int ofd_echo_create(const struct lu_env *env, struct obd_export *exp,
 
        ENTRY;
 
 
        ENTRY;
 
-       info = ofd_info_init(env, exp);
+       ofd_info_init(env, exp);
 
        LASSERT(seq == FID_SEQ_ECHO);
        LASSERT(oa->o_valid & OBD_MD_FLGROUP);
 
        LASSERT(seq == FID_SEQ_ECHO);
        LASSERT(oa->o_valid & OBD_MD_FLGROUP);
index fb3657e..c59c281 100644 (file)
@@ -1061,7 +1061,6 @@ static u32 osc_checksum_bulk(int nob, size_t pg_count,
        int                             i = 0;
        struct cfs_crypto_hash_desc     *hdesc;
        unsigned int                    bufsize;
        int                             i = 0;
        struct cfs_crypto_hash_desc     *hdesc;
        unsigned int                    bufsize;
-       int                             err;
        unsigned char                   cfs_alg = cksum_obd2cfs(cksum_type);
 
        LASSERT(pg_count > 0);
        unsigned char                   cfs_alg = cksum_obd2cfs(cksum_type);
 
        LASSERT(pg_count > 0);
@@ -1098,7 +1097,7 @@ static u32 osc_checksum_bulk(int nob, size_t pg_count,
        }
 
        bufsize = sizeof(cksum);
        }
 
        bufsize = sizeof(cksum);
-       err = cfs_crypto_hash_final(hdesc, (unsigned char *)&cksum, &bufsize);
+       cfs_crypto_hash_final(hdesc, (unsigned char *)&cksum, &bufsize);
 
        /* For sending we only compute the wrong checksum instead
         * of corrupting the data so it is still correct on a redo */
 
        /* For sending we only compute the wrong checksum instead
         * of corrupting the data so it is still correct on a redo */
index c197e35..eafe494 100644 (file)
@@ -1023,11 +1023,9 @@ static int iam_lookup_lock(struct iam_path *path,
  */
 static int iam_path_lookup(struct iam_path *path, int index)
 {
  */
 static int iam_path_lookup(struct iam_path *path, int index)
 {
-        struct iam_container *c;
         struct iam_leaf  *leaf;
         int result;
 
         struct iam_leaf  *leaf;
         int result;
 
-        c = path->ip_container;
         leaf = &path->ip_leaf;
         result = iam_lookup_lock(path, &leaf->il_lock, DLT_WRITE);
         assert_inv(iam_path_check(path));
         leaf = &path->ip_leaf;
         result = iam_lookup_lock(path, &leaf->il_lock, DLT_WRITE);
         assert_inv(iam_path_check(path));
@@ -1363,13 +1361,11 @@ int iam_index_next(struct iam_container *c, struct iam_path *path)
         iam_ptr_t cursor;
        struct dynlock_handle *lh[DX_MAX_TREE_HEIGHT] = { NULL, };
         int result;
         iam_ptr_t cursor;
        struct dynlock_handle *lh[DX_MAX_TREE_HEIGHT] = { NULL, };
         int result;
-        struct inode *object;
 
         /*
          * Locking for iam_index_next()... is to be described.
          */
 
 
         /*
          * Locking for iam_index_next()... is to be described.
          */
 
-        object = c->ic_object;
         cursor = path->ip_frame->leaf;
 
         while (1) {
         cursor = path->ip_frame->leaf;
 
         while (1) {
index cab8575..9be85c1 100644 (file)
@@ -485,13 +485,12 @@ static void iam_lfix_split(struct iam_leaf *l, struct buffer_head **bh,
                  * insertion point moves into new leaf.
                  */
                 int shift;
                  * insertion point moves into new leaf.
                  */
                 int shift;
-                int result;
 
                 shift = iam_lfix_diff(l, l->il_at, start);
                 *bh = l->il_bh;
                 l->il_bh = new_leaf;
                 l->il_curidx = new_blknr;
 
                 shift = iam_lfix_diff(l, l->il_at, start);
                 *bh = l->il_bh;
                 l->il_bh = new_leaf;
                 l->il_curidx = new_blknr;
-                result = iam_lfix_init(l);
+                iam_lfix_init(l);
                 /*
                  * init cannot fail, as node was just initialized.
                  */
                 /*
                  * init cannot fail, as node was just initialized.
                  */
index be7ed47..abcee4f 100644 (file)
@@ -725,7 +725,6 @@ static void lvar_split(struct iam_leaf *leaf, struct buffer_head **bh,
                  * insertion point moves into new leaf.
                  */
                 ptrdiff_t shift;
                  * insertion point moves into new leaf.
                  */
                 ptrdiff_t shift;
-                int result;
 
                 shift = PDIFF(leaf->il_at, first_to_move);
                 *bh = leaf->il_bh;
 
                 shift = PDIFF(leaf->il_at, first_to_move);
                 *bh = leaf->il_bh;
@@ -733,7 +732,7 @@ static void lvar_split(struct iam_leaf *leaf, struct buffer_head **bh,
                 leaf->il_curidx = new_blknr;
 
                 assert_corr(iam_leaf_is_locked(leaf));
                 leaf->il_curidx = new_blknr;
 
                 assert_corr(iam_leaf_is_locked(leaf));
-                result = lvar_init(leaf);
+                lvar_init(leaf);
                 /*
                  * init cannot fail, as node was just initialized.
                  */
                 /*
                  * init cannot fail, as node was just initialized.
                  */
index 1020ede..b5849aa 100644 (file)
@@ -542,7 +542,6 @@ void qmt_glb_lock_notify(const struct lu_env *env, struct lquota_entry *lqe,
        struct qmt_thread_info  *qti = qmt_info(env);
        struct qmt_pool_info    *pool = lqe2qpi(lqe);
        struct ldlm_resource    *res = NULL;
        struct qmt_thread_info  *qti = qmt_info(env);
        struct qmt_pool_info    *pool = lqe2qpi(lqe);
        struct ldlm_resource    *res = NULL;
-       int                      rc;
        ENTRY;
 
        lquota_generate_fid(&qti->qti_fid, pool->qpi_key & 0x0000ffff,
        ENTRY;
 
        lquota_generate_fid(&qti->qti_fid, pool->qpi_key & 0x0000ffff,
@@ -568,8 +567,8 @@ void qmt_glb_lock_notify(const struct lu_env *env, struct lquota_entry *lqe,
                RETURN_EXIT;
        }
 
                RETURN_EXIT;
        }
 
-       rc = qmt_glimpse_lock(env, pool->qpi_qmt, res, &qti->qti_gl_desc,
-                             NULL, NULL);
+       qmt_glimpse_lock(env, pool->qpi_qmt, res, &qti->qti_gl_desc,
+                        NULL, NULL);
        ldlm_resource_putref(res);
        EXIT;
 }
        ldlm_resource_putref(res);
        EXIT;
 }
@@ -602,7 +601,6 @@ static void qmt_id_lock_glimpse(const struct lu_env *env,
        struct qmt_thread_info  *qti = qmt_info(env);
        struct qmt_pool_info    *pool = lqe2qpi(lqe);
        struct ldlm_resource    *res = NULL;
        struct qmt_thread_info  *qti = qmt_info(env);
        struct qmt_pool_info    *pool = lqe2qpi(lqe);
        struct ldlm_resource    *res = NULL;
-       int                      rc;
        ENTRY;
 
        if (!lqe->lqe_enforced)
        ENTRY;
 
        if (!lqe->lqe_enforced)
@@ -652,8 +650,8 @@ static void qmt_id_lock_glimpse(const struct lu_env *env,
        lqe_write_unlock(lqe);
 
        /* issue glimpse callback to slaves */
        lqe_write_unlock(lqe);
 
        /* issue glimpse callback to slaves */
-       rc = qmt_glimpse_lock(env, qmt, res, &qti->qti_gl_desc,
-                             uuid ? qmt_id_lock_cb : NULL, (void *)uuid);
+       qmt_glimpse_lock(env, qmt, res, &qti->qti_gl_desc,
+                        uuid ? qmt_id_lock_cb : NULL, (void *)uuid);
 
        lqe_write_lock(lqe);
        if (lqe->lqe_revoke_time == 0 &&
 
        lqe_write_lock(lqe);
        if (lqe->lqe_revoke_time == 0 &&
index 673b668..11978ac 100644 (file)
@@ -379,7 +379,6 @@ static int qsd_id_glimpse_ast(struct ldlm_lock *lock, void *data)
 {
        struct ptlrpc_request           *req = data;
        struct lquota_entry             *lqe;
 {
        struct ptlrpc_request           *req = data;
        struct lquota_entry             *lqe;
-       struct qsd_instance             *qsd;
        struct ldlm_gl_lquota_desc      *desc;
        struct lquota_lvb               *lvb;
        int                              rc;
        struct ldlm_gl_lquota_desc      *desc;
        struct lquota_lvb               *lvb;
        int                              rc;
@@ -398,8 +397,6 @@ static int qsd_id_glimpse_ast(struct ldlm_lock *lock, void *data)
        LQUOTA_DEBUG(lqe, "glimpse on quota locks, new qunit:%llu",
                     desc->gl_qunit);
 
        LQUOTA_DEBUG(lqe, "glimpse on quota locks, new qunit:%llu",
                     desc->gl_qunit);
 
-       qsd = lqe2qqi(lqe)->qqi_qsd;
-
        lqe_write_lock(lqe);
        lvb->lvb_id_rel = 0;
        if (desc->gl_qunit != 0 && desc->gl_qunit != lqe->lqe_qunit) {
        lqe_write_lock(lqe);
        lvb->lvb_id_rel = 0;
        if (desc->gl_qunit != 0 && desc->gl_qunit != lqe->lqe_qunit) {
index 7c382f5..1eb59b2 100644 (file)
@@ -158,7 +158,6 @@ static int qsd_intent_interpret(const struct lu_env *env,
 {
        struct lustre_handle     *lockh;
        struct quota_body        *rep_qbody = NULL, *req_qbody;
 {
        struct lustre_handle     *lockh;
        struct quota_body        *rep_qbody = NULL, *req_qbody;
-       struct ldlm_intent       *lit;
        struct qsd_async_args    *aa = (struct qsd_async_args *)arg;
        __u64                     flags = LDLM_FL_HAS_INTENT;
        ENTRY;
        struct qsd_async_args    *aa = (struct qsd_async_args *)arg;
        __u64                     flags = LDLM_FL_HAS_INTENT;
        ENTRY;
@@ -166,7 +165,7 @@ static int qsd_intent_interpret(const struct lu_env *env,
        LASSERT(aa->aa_exp);
        lockh = &aa->aa_lockh;
        req_qbody = req_capsule_client_get(&req->rq_pill, &RMF_QUOTA_BODY);
        LASSERT(aa->aa_exp);
        lockh = &aa->aa_lockh;
        req_qbody = req_capsule_client_get(&req->rq_pill, &RMF_QUOTA_BODY);
-       lit = req_capsule_client_get(&req->rq_pill, &RMF_LDLM_INTENT);
+       req_capsule_client_get(&req->rq_pill, &RMF_LDLM_INTENT);
 
        rc = ldlm_cli_enqueue_fini(aa->aa_exp, req, LDLM_PLAIN, 0, LCK_CR,
                                   &flags, (void *)aa->aa_lvb,
 
        rc = ldlm_cli_enqueue_fini(aa->aa_exp, req, LDLM_PLAIN, 0, LCK_CR,
                                   &flags, (void *)aa->aa_lvb,