From: Arshad Hussain Date: Thu, 19 Sep 2024 09:05:56 +0000 (-0400) Subject: LU-6142 ptlrpc: Fix style issues for recover.c X-Git-Tag: 2.16.52~110 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=033f45c410a17f464a30f0eeed24677b3df30007;p=fs%2Flustre-release.git LU-6142 ptlrpc: Fix style issues for recover.c This patch fixes issues reported by checkpatch for both files lustre/ptlrpc/recover.c Test-Parameters: trivial Signed-off-by: Arshad Hussain Change-Id: Ibfeb59ed4cfe01675c43934ffad898e03d130c2f Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56483 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Petros Koutoupis Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/recover.c b/lustre/ptlrpc/recover.c index ef5b4e7..2672815 100644 --- a/lustre/ptlrpc/recover.c +++ b/lustre/ptlrpc/recover.c @@ -55,8 +55,8 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight) int rc = 0; struct ptlrpc_request *req = NULL; __u64 last_transno; - ENTRY; + ENTRY; *inflight = 0; /* It might have committed some after we last spoke, so make sure we @@ -104,7 +104,8 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight) } /* All the requests in committed list have been replayed, let's replay - * the imp_replay_list */ + * the imp_replay_list + */ if (req == NULL) { struct ptlrpc_request *tmp; @@ -120,14 +121,16 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight) /* If need to resend the last sent transno (because a reconnect * has occurred), then stop on the matching req and send it again. * If, however, the last sent transno has been committed then we - * continue replay from the next request. */ + * continue replay from the next request. + */ if (req != NULL && imp->imp_resend_replay) lustre_msg_add_flags(req->rq_reqmsg, MSG_RESENT); /* ptlrpc_prepare_replay() may fail to add the reqeust into unreplied * list if the request hasn't been added to replay list then. Another * exception is that resend replay could have been removed from the - * unreplied list. */ + * unreplied list. + */ if (req != NULL && list_empty(&req->rq_unreplied_list)) { DEBUG_REQ(D_HA, req, "resend_replay=%d, last_transno=%llu", imp->imp_resend_replay, last_transno); @@ -160,19 +163,19 @@ int ptlrpc_resend(struct obd_import *imp) { struct ptlrpc_request *req; - ENTRY; + ENTRY; - /* As long as we're in recovery, nothing should be added to the sending - * list, so we don't need to hold the lock during this iteration and - * resend process. - */ - /* Well... what if lctl recover is called twice at the same time? - */ + /* As long as we're in recovery, nothing should be added to the sending + * list, so we don't need to hold the lock during this iteration and + * resend process. + * + * Well... what if lctl recover is called twice at the same time? + */ spin_lock(&imp->imp_lock); if (imp->imp_state != LUSTRE_IMP_RECOVER) { spin_unlock(&imp->imp_lock); - RETURN(-1); - } + RETURN(-1); + } list_for_each_entry(req, &imp->imp_sending_list, rq_list) { LASSERTF((long)req > PAGE_SIZE && req != LP_POISON, @@ -180,7 +183,8 @@ int ptlrpc_resend(struct obd_import *imp) LASSERTF(req->rq_type != LI_POISON, "req %px freed\n", req); /* If the request is allowed to be sent during replay and it - * is not timeout yet, then it does not need to be resent. */ + * is not timeout yet, then it does not need to be resent. + */ if (!ptlrpc_no_resend(req) && (req->rq_timedout || !req->rq_allow_replay)) ptlrpc_resend_req(req); @@ -211,8 +215,8 @@ void ptlrpc_request_handle_notconn(struct ptlrpc_request *failed_req) { struct obd_import *imp = failed_req->rq_import; int conn = lustre_msg_get_conn_cnt(failed_req->rq_reqmsg); - ENTRY; + ENTRY; CDEBUG(D_HA, "import %s of %s@%s abruptly disconnected: reconnecting\n", imp->imp_obd->obd_name, obd2cli_tgt(imp->imp_obd), imp->imp_connection->c_remote_uuid.uuid); @@ -223,8 +227,9 @@ void ptlrpc_request_handle_notconn(struct ptlrpc_request *failed_req) ptlrpc_connect_import(imp); } - /* Wait for recovery to complete and resend. If evicted, then - this request will be errored out later.*/ + /* Wait for recovery to complete and resend. If evicted, then this + * request will be errored out later + */ spin_lock(&failed_req->rq_lock); if (!failed_req->rq_no_resend) failed_req->rq_resend = 1; @@ -242,43 +247,43 @@ void ptlrpc_request_handle_notconn(struct ptlrpc_request *failed_req) */ int ptlrpc_set_import_active(struct obd_import *imp, int active) { - struct obd_device *obd = imp->imp_obd; - int rc = 0; + struct obd_device *obd = imp->imp_obd; + int rc = 0; - ENTRY; - LASSERT(obd); + ENTRY; + LASSERT(obd); - /* When deactivating, mark import invalid, and abort in-flight - * requests. */ - if (!active) { - LCONSOLE_WARN("setting import %s INACTIVE by administrator " - "request\n", obd2cli_tgt(imp->imp_obd)); + /* When deactivating, mark import invalid, & abort in-flight requests */ + if (!active) { + LCONSOLE_WARN("setting import %s INACTIVE by administrator request\n", + obd2cli_tgt(imp->imp_obd)); - /* set before invalidate to avoid messages about imp_inval - * set without imp_deactive in ptlrpc_import_delay_req */ + /* set before invalidate to avoid messages about imp_inval + * set without imp_deactive in ptlrpc_import_delay_req + */ spin_lock(&imp->imp_lock); imp->imp_deactive = 1; spin_unlock(&imp->imp_lock); - obd_import_event(imp->imp_obd, imp, IMP_EVENT_DEACTIVATE); + obd_import_event(imp->imp_obd, imp, IMP_EVENT_DEACTIVATE); - ptlrpc_invalidate_import(imp); - } + ptlrpc_invalidate_import(imp); + } - /* When activating, mark import valid, and attempt recovery */ - if (active) { - CDEBUG(D_HA, "setting import %s VALID\n", - obd2cli_tgt(imp->imp_obd)); + /* When activating, mark import valid, and attempt recovery */ + if (active) { + CDEBUG(D_HA, "setting import %s VALID\n", + obd2cli_tgt(imp->imp_obd)); spin_lock(&imp->imp_lock); imp->imp_deactive = 0; spin_unlock(&imp->imp_lock); - obd_import_event(imp->imp_obd, imp, IMP_EVENT_ACTIVATE); + obd_import_event(imp->imp_obd, imp, IMP_EVENT_ACTIVATE); - rc = ptlrpc_recover_import(imp, NULL, 0); - } + rc = ptlrpc_recover_import(imp, NULL, 0); + } - RETURN(rc); + RETURN(rc); } EXPORT_SYMBOL(ptlrpc_set_import_active); @@ -298,13 +303,12 @@ bool ptlrpc_import_in_recovery_disconnect(struct obd_import *imp, return in_recovery; } - /* Attempt to reconnect an import */ int ptlrpc_recover_import(struct obd_import *imp, char *new_uuid, int async) { int rc = 0; - ENTRY; + ENTRY; spin_lock(&imp->imp_lock); if (imp->imp_state == LUSTRE_IMP_NEW || imp->imp_deactive || atomic_read(&imp->imp_inval_count))