xfs: clean up calculation of LR header blocks
Let's use DIV_ROUND_UP() to calculate log record header blocks as what did in xlog_get_iclog_buffer_size() and wrap up a common helper for log recovery. Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Gao Xiang <hsiangkao@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:

committed by
Darrick J. Wong

parent
f692d09e9c
commit
0c771b99d6
@@ -1604,9 +1604,7 @@ xlog_cksum(
|
||||
int i;
|
||||
int xheads;
|
||||
|
||||
xheads = size / XLOG_HEADER_CYCLE_SIZE;
|
||||
if (size % XLOG_HEADER_CYCLE_SIZE)
|
||||
xheads++;
|
||||
xheads = DIV_ROUND_UP(size, XLOG_HEADER_CYCLE_SIZE);
|
||||
|
||||
for (i = 1; i < xheads; i++) {
|
||||
crc = crc32c(crc, &xhdr[i].hic_xheader,
|
||||
|
Reference in New Issue
Block a user