* Return the address of the start of the given block number's data
* in a log buffer. The buffer covers a log sector-aligned region.
*/
-STATIC char *
+static inline unsigned int
xlog_align(
struct xlog *log,
- xfs_daddr_t blk_no,
- int nbblks,
- struct xfs_buf *bp)
+ xfs_daddr_t blk_no)
{
- xfs_daddr_t offset = blk_no & ((xfs_daddr_t)log->l_sectBBsize - 1);
-
- ASSERT(offset + nbblks <= bp->b_length);
- return bp->b_addr + BBTOB(offset);
+ return BBTOB(blk_no & ((xfs_daddr_t)log->l_sectBBsize - 1));
}
-
/*
* nbblks should be uint, but oh well. Just want to catch that 32-bit length.
*/
if (error)
return error;
- *offset = xlog_align(log, blk_no, nbblks, bp);
+ *offset = bp->b_addr + xlog_align(log, blk_no);
return 0;
}
}
- offset = xlog_align(log, start_block, endcount, bp);
+ offset = bp->b_addr + xlog_align(log, start_block);
for (; j < endcount; j++) {
xlog_add_record(log, offset, cycle, i+j,
tail_cycle, tail_block);