Whamcloud - gitweb
LU-16518 mdt: fix unused-but-set-variable warnings 84/58184/2
authorTimothy Day <timday@amazon.com>
Mon, 24 Feb 2025 06:38:13 +0000 (01:38 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Mar 2025 08:09:14 +0000 (08:09 +0000)
Remove unused variables in various parts of the MDT code.
This silences the Clang compiler -Wunused-but-set-variable
warning.

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I2c42e9ce86ac854a49f8b12f5325ce1f34b8ecc3
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58184
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Max Wang <wamax@amazon.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_io.c

index 91f69c8..37f91e1 100644 (file)
@@ -2807,11 +2807,11 @@ static int mdt_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 
 int mdt_io_set_info(struct tgt_session_info *tsi)
 {
-       struct ptlrpc_request   *req = tgt_ses_req(tsi);
-       struct ost_body         *body = NULL, *repbody;
-       void                    *key, *val = NULL;
-       int                      keylen, vallen, rc = 0;
-       bool                     is_grant_shrink;
+       struct ptlrpc_request *req = tgt_ses_req(tsi);
+       struct ost_body *body = NULL, *repbody;
+       bool is_grant_shrink;
+       int keylen, rc = 0;
+       void *key;
 
        ENTRY;
 
@@ -2823,14 +2823,6 @@ int mdt_io_set_info(struct tgt_session_info *tsi)
        keylen = req_capsule_get_size(tsi->tsi_pill, &RMF_SETINFO_KEY,
                                      RCL_CLIENT);
 
-       val = req_capsule_client_get(tsi->tsi_pill, &RMF_SETINFO_VAL);
-       if (val == NULL) {
-               DEBUG_REQ(D_HA, req, "no set_info val");
-               RETURN(err_serious(-EFAULT));
-       }
-       vallen = req_capsule_get_size(tsi->tsi_pill, &RMF_SETINFO_VAL,
-                                     RCL_CLIENT);
-
        is_grant_shrink = KEY_IS(KEY_GRANT_SHRINK);
        if (is_grant_shrink)
                /* In this case the value is actually an RMF_OST_BODY, so we
index 1b90f6e..9e0aeac 100644 (file)
@@ -323,7 +323,7 @@ static int mdt_preprw_read(const struct lu_env *env, struct obd_export *exp,
                           struct niobuf_local *lnb)
 {
        struct dt_object *dob;
-       int i, j, rc, tot_bytes = 0;
+       int i, j, rc;
        int maxlnb = *nr_local;
        int level;
 
@@ -369,7 +369,6 @@ static int mdt_preprw_read(const struct lu_env *env, struct obd_export *exp,
                j += rc;
                maxlnb -= rc;
                *nr_local += rc;
-               tot_bytes += rnb[i].rnb_len;
        }
 
        rc = dt_attr_get(env, dob, la);
@@ -395,7 +394,7 @@ static int mdt_preprw_write(const struct lu_env *env, struct obd_export *exp,
                            struct niobuf_local *lnb)
 {
        struct dt_object *dob;
-       int i, j, k, rc = 0, tot_bytes = 0;
+       int i, j, k, rc = 0;
        int maxlnb = *nr_local;
 
        ENTRY;
@@ -446,7 +445,6 @@ static int mdt_preprw_write(const struct lu_env *env, struct obd_export *exp,
                j += rc;
                maxlnb -= rc;
                *nr_local += rc;
-               tot_bytes += rnb[i].rnb_len;
        }
 
        rc = dt_write_prep(env, dob, lnb, *nr_local);