Skip to content

Commit be5abd3

Browse files
Dave ChinnerChandan Babu R
authored andcommitted
xfs: collapse xlog_state_set_callback in caller
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 <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Chandan Babu R <[email protected]>
1 parent 0dcd5a1 commit be5abd3

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

fs/xfs/xfs_log.c

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,25 +2507,6 @@ xlog_get_lowest_lsn(
25072507
return lowest_lsn;
25082508
}
25092509

2510-
static void
2511-
xlog_state_set_callback(
2512-
struct xlog *log,
2513-
struct xlog_in_core *iclog,
2514-
xfs_lsn_t header_lsn)
2515-
{
2516-
/*
2517-
* If there are no callbacks on this iclog, we can mark it clean
2518-
* immediately and return. Otherwise we need to run the
2519-
* callbacks.
2520-
*/
2521-
if (list_empty(&iclog->ic_callbacks)) {
2522-
xlog_state_clean_iclog(log, iclog);
2523-
return;
2524-
}
2525-
trace_xlog_iclog_callback(iclog, _RET_IP_);
2526-
iclog->ic_state = XLOG_STATE_CALLBACK;
2527-
}
2528-
25292510
/*
25302511
* Return true if we need to stop processing, false to continue to the next
25312512
* iclog. The caller will need to run callbacks if the iclog is returned in the
@@ -2557,7 +2538,17 @@ xlog_state_iodone_process_iclog(
25572538
lowest_lsn = xlog_get_lowest_lsn(log);
25582539
if (lowest_lsn && XFS_LSN_CMP(lowest_lsn, header_lsn) < 0)
25592540
return false;
2560-
xlog_state_set_callback(log, iclog, header_lsn);
2541+
/*
2542+
* If there are no callbacks on this iclog, we can mark it clean
2543+
* immediately and return. Otherwise we need to run the
2544+
* callbacks.
2545+
*/
2546+
if (list_empty(&iclog->ic_callbacks)) {
2547+
xlog_state_clean_iclog(log, iclog);
2548+
return false;
2549+
}
2550+
trace_xlog_iclog_callback(iclog, _RET_IP_);
2551+
iclog->ic_state = XLOG_STATE_CALLBACK;
25612552
return false;
25622553
default:
25632554
/*

0 commit comments

Comments
 (0)