From 94aa8ce7dd1ba2e05139b1a1af10667e068dbd05 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Mon, 24 Feb 2025 01:38:13 -0500 Subject: [PATCH] LU-16518 mdt: fix unused-but-set-variable warnings 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 Change-Id: I2c42e9ce86ac854a49f8b12f5325ce1f34b8ecc3 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58184 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Max Wang Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_handler.c | 18 +++++------------- lustre/mdt/mdt_io.c | 6 ++---- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 91f69c8..37f91e1 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -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 diff --git a/lustre/mdt/mdt_io.c b/lustre/mdt/mdt_io.c index 1b90f6e..9e0aeac 100644 --- a/lustre/mdt/mdt_io.c +++ b/lustre/mdt/mdt_io.c @@ -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); -- 1.8.3.1