aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-10-11 20:58:05 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-07 02:10:31 -0500
commit03bea6fe6c38c502c815432999eacfa2eccb0a12 (patch)
tree9800a1633a53dafdceb8799155a192d65be0b111 /fs/xfs/xfs_log.c
parent9909c4aa1a3e5b1f23cbc1bc2f0db025a7f75f85 (diff)
[XFS] clean up some xfs_log_priv.h macros
- the various assign lsn macros are replaced by a single inline, xlog_assign_lsn, which is equivalent to ASSIGN_ANY_LSN_HOST except for a more sane calling convention. ASSIGN_LSN_DISK is replaced by xlog_assign_lsn and a manual bytespap, and ASSIGN_LSN by the same, except we pass the cycle and block arguments explicitly instead of a log paramter. The latter two variants only had 2, respectively one user anyway. - the GET_CYCLE is replaced by a xlog_get_cycle inline with exactly the same calling conventions. - GET_CLIENT_ID is replaced by xlog_get_client_id which leaves away the unused arch argument. Instead of conditional defintions depending on host endianess we now do an unconditional swap and shift then, which generates equal code. - the unused XLOG_SET macro is removed. SGI-PV: 971186 SGI-Modid: xfs-linux-melb:xfs-kern:29819a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log.c')
-rw-r--r--fs/xfs/xfs_log.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 615638201284..90d96caf7200 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1161,7 +1161,7 @@ xlog_alloc_log(xfs_mount_t *mp,
1161 log->l_flags |= XLOG_ACTIVE_RECOVERY; 1161 log->l_flags |= XLOG_ACTIVE_RECOVERY;
1162 1162
1163 log->l_prev_block = -1; 1163 log->l_prev_block = -1;
1164 ASSIGN_ANY_LSN_HOST(log->l_tail_lsn, 1, 0); 1164 log->l_tail_lsn = xlog_assign_lsn(1, 0);
1165 /* log->l_tail_lsn = 0x100000000LL; cycle = 1; current block = 0 */ 1165 /* log->l_tail_lsn = 0x100000000LL; cycle = 1; current block = 0 */
1166 log->l_last_sync_lsn = log->l_tail_lsn; 1166 log->l_last_sync_lsn = log->l_tail_lsn;
1167 log->l_curr_cycle = 1; /* 0 is bad since this is initial value */ 1167 log->l_curr_cycle = 1; /* 0 is bad since this is initial value */
@@ -1326,8 +1326,7 @@ xlog_grant_push_ail(xfs_mount_t *mp,
1326 threshold_block -= log->l_logBBsize; 1326 threshold_block -= log->l_logBBsize;
1327 threshold_cycle += 1; 1327 threshold_cycle += 1;
1328 } 1328 }
1329 ASSIGN_ANY_LSN_HOST(threshold_lsn, threshold_cycle, 1329 threshold_lsn = xlog_assign_lsn(threshold_cycle, threshold_block);
1330 threshold_block);
1331 1330
1332 /* Don't pass in an lsn greater than the lsn of the last 1331 /* Don't pass in an lsn greater than the lsn of the last
1333 * log record known to be on disk. 1332 * log record known to be on disk.
@@ -2393,7 +2392,8 @@ restart:
2393 log->l_iclog_hsize, 2392 log->l_iclog_hsize,
2394 XLOG_REG_TYPE_LRHEADER); 2393 XLOG_REG_TYPE_LRHEADER);
2395 INT_SET(head->h_cycle, ARCH_CONVERT, log->l_curr_cycle); 2394 INT_SET(head->h_cycle, ARCH_CONVERT, log->l_curr_cycle);
2396 ASSIGN_LSN(head->h_lsn, log); 2395 INT_SET(head->h_lsn, ARCH_CONVERT,
2396 xlog_assign_lsn(log->l_curr_cycle, log->l_curr_block));
2397 ASSERT(log->l_curr_block >= 0); 2397 ASSERT(log->l_curr_block >= 0);
2398 } 2398 }
2399 2399
@@ -3488,9 +3488,11 @@ xlog_verify_iclog(xlog_t *log,
3488 if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) { 3488 if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
3489 j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); 3489 j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
3490 k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE); 3490 k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
3491 clientid = GET_CLIENT_ID(xhdr[j].hic_xheader.xh_cycle_data[k], ARCH_CONVERT); 3491 clientid = xlog_get_client_id(
3492 xhdr[j].hic_xheader.xh_cycle_data[k]);
3492 } else { 3493 } else {
3493 clientid = GET_CLIENT_ID(iclog->ic_header.h_cycle_data[idx], ARCH_CONVERT); 3494 clientid = xlog_get_client_id(
3495 iclog->ic_header.h_cycle_data[idx]);
3494 } 3496 }
3495 } 3497 }
3496 if (clientid != XFS_TRANSACTION && clientid != XFS_LOG) 3498 if (clientid != XFS_TRANSACTION && clientid != XFS_LOG)