summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_log.c
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@redhat.com>2020-09-22 19:41:06 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2020-09-23 19:24:17 +0300
commit0c771b99d6c9a0552fea5cc43669b726dad8f659 (patch)
tree8775cccc27bdeba0eedc87f82d99cd2ff44cac7f /fs/xfs/xfs_log.c
parentf692d09e9c8fd0f5557c2e87f796a16dd95222b8 (diff)
downloadlinux-0c771b99d6c9a0552fea5cc43669b726dad8f659.tar.xz
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>
Diffstat (limited to 'fs/xfs/xfs_log.c')
-rw-r--r--fs/xfs/xfs_log.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index ad0c69ee8947..7a4ba408a3a2 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -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,