aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-04-23 01:58:51 -0400
committerBen Myers <bpm@sgi.com>2012-05-14 17:20:47 -0400
commit4e94b71b7068b4bd9c615301197e09dbf0c3b770 (patch)
treefc441ec17202a749a6b1a3d5b70ba37101b595da /fs/xfs/xfs_log.c
parentde1cbee46269a3b707eb99b37f33afdd4cfaaea4 (diff)
xfs: use blocks for counting length of buffers
Now that we pass block counts everywhere, and index buffers by block number, track the length of the buffer in units of blocks rather than bytes. Convert the code to use block counts, and those that need byte counts get converted at the time of use. Also, remove the XFS_BUF_{SET_}SIZE() macros that are just wrappers around the buffer length. They only serve to make the code shouty loud and don't actually add any real value. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log.c')
-rw-r--r--fs/xfs/xfs_log.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 89900129a4a3..f9d8355ffae2 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1197,9 +1197,6 @@ xlog_alloc_log(xfs_mount_t *mp,
1197 spin_lock_init(&log->l_icloglock); 1197 spin_lock_init(&log->l_icloglock);
1198 init_waitqueue_head(&log->l_flush_wait); 1198 init_waitqueue_head(&log->l_flush_wait);
1199 1199
1200 /* log record size must be multiple of BBSIZE; see xlog_rec_header_t */
1201 ASSERT((XFS_BUF_SIZE(bp) & BBMASK) == 0);
1202
1203 iclogp = &log->l_iclog; 1200 iclogp = &log->l_iclog;
1204 /* 1201 /*
1205 * The amount of memory to allocate for the iclog structure is 1202 * The amount of memory to allocate for the iclog structure is
@@ -1239,7 +1236,7 @@ xlog_alloc_log(xfs_mount_t *mp,
1239 head->h_fmt = cpu_to_be32(XLOG_FMT); 1236 head->h_fmt = cpu_to_be32(XLOG_FMT);
1240 memcpy(&head->h_fs_uuid, &mp->m_sb.sb_uuid, sizeof(uuid_t)); 1237 memcpy(&head->h_fs_uuid, &mp->m_sb.sb_uuid, sizeof(uuid_t));
1241 1238
1242 iclog->ic_size = XFS_BUF_SIZE(bp) - log->l_iclog_hsize; 1239 iclog->ic_size = BBTOB(bp->b_length) - log->l_iclog_hsize;
1243 iclog->ic_state = XLOG_STATE_ACTIVE; 1240 iclog->ic_state = XLOG_STATE_ACTIVE;
1244 iclog->ic_log = log; 1241 iclog->ic_log = log;
1245 atomic_set(&iclog->ic_refcnt, 0); 1242 atomic_set(&iclog->ic_refcnt, 0);