Whamcloud - gitweb
LU-16741 ptlrpc: ptlrpc: rename ptlrpc_req_finished 48/53648/7
authorPatrick Farrell <pfarrell@whamcloud.com>
Thu, 11 Jan 2024 10:51:11 +0000 (16:21 +0530)
committerOleg Drokin <green@whamcloud.com>
Tue, 2 Apr 2024 21:01:04 +0000 (21:01 +0000)
First series of patchs thats renames ptlrpc_req_finished
to ptlrpc_req_put

Change it as part of a general refactor of the ptlrpc
request put/freeing code.

Test-Parameters: trivial
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I3f897b74debe383c4efb25c9a0becc1c27faa3d9
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53648
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <patrick.farrell@oracle.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
contrib/scripts/spelling.txt
lustre/include/lustre_net.h
lustre/ptlrpc/client.c
lustre/ptlrpc/import.c

index eda5ee7..a2e5ddb 100644 (file)
@@ -132,6 +132,7 @@ PAGE_CACHE_SHIFT||PAGE_SHIFT
 PAGE_CACHE_SIZE||PAGE_SIZE
 prandom_u32||get_random_u32
 prandom_u32_max||get_random_u32_below
+ptlrpc_req_finished||ptlrpc_req_put
 return seq_printf||seq_printf
 setup_timer||cfs_timer_setup
 = seq_printf||seq_printf
index 5a52a50..7cdd4c6 100644 (file)
@@ -2125,8 +2125,9 @@ ptlrpc_request_alloc_pack(struct obd_import *imp,
 int ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
                             __u32 version, int opcode, char **bufs,
                             struct ptlrpc_cli_ctx *ctx);
-void ptlrpc_req_finished(struct ptlrpc_request *request);
-void ptlrpc_req_finished_with_imp_lock(struct ptlrpc_request *request);
+#define ptlrpc_req_finished(rq) ptlrpc_req_put(rq)
+void ptlrpc_req_put(struct ptlrpc_request *request);
+void ptlrpc_req_put_with_imp_lock(struct ptlrpc_request *request);
 struct ptlrpc_request *ptlrpc_request_addref(struct ptlrpc_request *req);
 struct ptlrpc_bulk_desc *ptlrpc_prep_bulk_imp(struct ptlrpc_request *req,
                                       unsigned int nfrags,
index 3cfcad6..6a9097d 100644 (file)
@@ -2707,17 +2707,6 @@ static void __ptlrpc_free_req(struct ptlrpc_request *request, int locked)
        EXIT;
 }
 
-static int __ptlrpc_req_finished(struct ptlrpc_request *request, int locked);
-/**
- * Drop one request reference. Must be called with import imp_lock held.
- * When reference count drops to zero, request is freed.
- */
-void ptlrpc_req_finished_with_imp_lock(struct ptlrpc_request *request)
-{
-       assert_spin_locked(&request->rq_import->imp_lock);
-       (void)__ptlrpc_req_finished(request, 1);
-}
-
 /**
  * Helper function
  * Drops one reference count for request \a request.
@@ -2727,7 +2716,7 @@ void ptlrpc_req_finished_with_imp_lock(struct ptlrpc_request *request)
  * \retval 1   the request is freed
  * \retval 0   some others still hold references on the request
  */
-static int __ptlrpc_req_finished(struct ptlrpc_request *request, int locked)
+static int __ptlrpc_req_put(struct ptlrpc_request *request, int locked)
 {
        int count;
 
@@ -2776,13 +2765,24 @@ static int __ptlrpc_req_finished(struct ptlrpc_request *request, int locked)
 }
 
 /**
+ * Drop one request reference. Must be called with import imp_lock held.
+ * When reference count drops to zero, request is freed.
+ */
+void ptlrpc_req_put_with_imp_lock(struct ptlrpc_request *request)
+{
+       assert_spin_locked(&request->rq_import->imp_lock);
+       (void)__ptlrpc_req_put(request, 1);
+}
+
+/**
  * Drops one reference count for a request.
  */
-void ptlrpc_req_finished(struct ptlrpc_request *request)
+void ptlrpc_req_put(struct ptlrpc_request *request)
 {
-       __ptlrpc_req_finished(request, 0);
+       __ptlrpc_req_put(request, 0);
 }
-EXPORT_SYMBOL(ptlrpc_req_finished);
+EXPORT_SYMBOL(ptlrpc_req_put);
+
 
 /**
  * Returns xid of a \a request
@@ -2888,7 +2888,7 @@ static void ptlrpc_free_request(struct ptlrpc_request *req)
                req->rq_commit_cb(req);
        list_del_init(&req->rq_replay_list);
 
-       __ptlrpc_req_finished(req, 1);
+       __ptlrpc_req_put(req, 1);
 }
 
 /**
index d89b3c2..4ec502f 100644 (file)
@@ -1740,7 +1740,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose)
 
        spin_lock(&imp->imp_lock);
        if (imp->imp_state != LUSTRE_IMP_FULL) {
-               ptlrpc_req_finished_with_imp_lock(req);
+               ptlrpc_req_put_with_imp_lock(req);
                GOTO(out, rc);
        }
        import_set_state_nolock(imp, LUSTRE_IMP_CONNECTING);
@@ -1875,7 +1875,7 @@ int ptlrpc_disconnect_and_idle_import(struct obd_import *imp)
 
        spin_lock(&imp->imp_lock);
        if (imp->imp_state != LUSTRE_IMP_FULL || !ptlrpc_can_idle(imp)) {
-               ptlrpc_req_finished_with_imp_lock(req);
+               ptlrpc_req_put_with_imp_lock(req);
                spin_unlock(&imp->imp_lock);
                RETURN(0);
        }