]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: collapse xlog_state_set_callback in caller
authorDave Chinner <dchinner@redhat.com>
Thu, 20 Jun 2024 07:21:24 +0000 (09:21 +0200)
committerChandan Babu R <chandanbabu@kernel.org>
Thu, 4 Jul 2024 07:16:46 +0000 (12:46 +0530)
The function is called from a single place, and it isn't just
setting the iclog state to XLOG_STATE_CALLBACK - it can mark iclogs
clean, which moves them to states after CALLBACK. Hence the function
is now badly named, and should just be folded into the caller where
the iclog completion logic makes a whole lot more sense.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/xfs_log.c

index 1977afecd385d58c6d27734becb279fd61db1031..381d6143a787777bee484fb0192903ff198c15eb 100644 (file)
@@ -2507,25 +2507,6 @@ xlog_get_lowest_lsn(
        return lowest_lsn;
 }
 
-static void
-xlog_state_set_callback(
-       struct xlog             *log,
-       struct xlog_in_core     *iclog,
-       xfs_lsn_t               header_lsn)
-{
-       /*
-        * If there are no callbacks on this iclog, we can mark it clean
-        * immediately and return. Otherwise we need to run the
-        * callbacks.
-        */
-       if (list_empty(&iclog->ic_callbacks)) {
-               xlog_state_clean_iclog(log, iclog);
-               return;
-       }
-       trace_xlog_iclog_callback(iclog, _RET_IP_);
-       iclog->ic_state = XLOG_STATE_CALLBACK;
-}
-
 /*
  * Return true if we need to stop processing, false to continue to the next
  * iclog. The caller will need to run callbacks if the iclog is returned in the
@@ -2557,7 +2538,17 @@ xlog_state_iodone_process_iclog(
                lowest_lsn = xlog_get_lowest_lsn(log);
                if (lowest_lsn && XFS_LSN_CMP(lowest_lsn, header_lsn) < 0)
                        return false;
-               xlog_state_set_callback(log, iclog, header_lsn);
+               /*
+                * If there are no callbacks on this iclog, we can mark it clean
+                * immediately and return. Otherwise we need to run the
+                * callbacks.
+                */
+               if (list_empty(&iclog->ic_callbacks)) {
+                       xlog_state_clean_iclog(log, iclog);
+                       return false;
+               }
+               trace_xlog_iclog_callback(iclog, _RET_IP_);
+               iclog->ic_state = XLOG_STATE_CALLBACK;
                return false;
        default:
                /*