diff options
| author | Christoph Hellwig <hch@lst.de> | 2025-10-27 08:05:48 +0100 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2025-11-12 11:09:25 +0100 |
| commit | 74d975ed6c9f8ba44179502a8ad5a839b38e8630 (patch) | |
| tree | 6008d8d8904813e77922059b7720d2a3cf308f28 /fs/xfs/xfs_log.c | |
| parent | 6a7bb6ccd00580461f01e86f592c7d8c7bb54793 (diff) | |
xfs: add a XLOG_CYCLE_DATA_SIZE constant
The XLOG_HEADER_CYCLE_SIZE / BBSIZE expression is used a lot
in the log code, give it a symbolic name.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_log.c')
| -rw-r--r-- | fs/xfs/xfs_log.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 603e85c1ab4c..e09e5f71ed8c 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1533,7 +1533,7 @@ xlog_pack_data( dp = iclog->ic_datap; for (i = 0; i < BTOBB(size); i++) { - if (i >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) + if (i >= XLOG_CYCLE_DATA_SIZE) break; iclog->ic_header.h_cycle_data[i] = *(__be32 *)dp; *(__be32 *)dp = cycle_lsn; @@ -1544,8 +1544,8 @@ xlog_pack_data( xlog_in_core_2_t *xhdr = iclog->ic_data; for ( ; i < BTOBB(size); i++) { - j = i / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); - k = i % (XLOG_HEADER_CYCLE_SIZE / BBSIZE); + j = i / XLOG_CYCLE_DATA_SIZE; + k = i % XLOG_CYCLE_DATA_SIZE; xhdr[j].hic_xheader.xh_cycle_data[k] = *(__be32 *)dp; *(__be32 *)dp = cycle_lsn; dp += BBSIZE; @@ -3368,9 +3368,9 @@ xlog_verify_iclog( clientid = ophead->oh_clientid; } else { idx = BTOBBT((void *)&ophead->oh_clientid - iclog->ic_datap); - if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) { - j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); - k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE); + if (idx >= XLOG_CYCLE_DATA_SIZE) { + j = idx / XLOG_CYCLE_DATA_SIZE; + k = idx % XLOG_CYCLE_DATA_SIZE; clientid = xlog_get_client_id( xhdr[j].hic_xheader.xh_cycle_data[k]); } else { @@ -3392,9 +3392,9 @@ xlog_verify_iclog( op_len = be32_to_cpu(ophead->oh_len); } else { idx = BTOBBT((void *)&ophead->oh_len - iclog->ic_datap); - if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) { - j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); - k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE); + if (idx >= XLOG_CYCLE_DATA_SIZE) { + j = idx / XLOG_CYCLE_DATA_SIZE; + k = idx % XLOG_CYCLE_DATA_SIZE; op_len = be32_to_cpu(xhdr[j].hic_xheader.xh_cycle_data[k]); } else { op_len = be32_to_cpu(iclog->ic_header.h_cycle_data[idx]); |
