Commit f15ab3f6 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: simplify xlog_recover_inode_ra_pass2

Don't bother to allocate memory and convert the log item when we
only need the block number and the length.  Just extract them directly
and call xlog_buf_readahead separately in each branch.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 7d4894b4
...@@ -3890,22 +3890,17 @@ xlog_recover_inode_ra_pass2( ...@@ -3890,22 +3890,17 @@ xlog_recover_inode_ra_pass2(
struct xlog *log, struct xlog *log,
struct xlog_recover_item *item) struct xlog_recover_item *item)
{ {
struct xfs_inode_log_format ilf_buf;
struct xfs_inode_log_format *ilfp;
int error;
if (item->ri_buf[0].i_len == sizeof(struct xfs_inode_log_format)) { if (item->ri_buf[0].i_len == sizeof(struct xfs_inode_log_format)) {
ilfp = item->ri_buf[0].i_addr; struct xfs_inode_log_format *ilfp = item->ri_buf[0].i_addr;
xlog_buf_readahead(log, ilfp->ilf_blkno, ilfp->ilf_len,
&xfs_inode_buf_ra_ops);
} else { } else {
ilfp = &ilf_buf; struct xfs_inode_log_format_32 *ilfp = item->ri_buf[0].i_addr;
memset(ilfp, 0, sizeof(*ilfp));
error = xfs_inode_item_format_convert(&item->ri_buf[0], ilfp);
if (error)
return;
}
xlog_buf_readahead(log, ilfp->ilf_blkno, ilfp->ilf_len, xlog_buf_readahead(log, ilfp->ilf_blkno, ilfp->ilf_len,
&xfs_inode_buf_ra_ops); &xfs_inode_buf_ra_ops);
}
} }
STATIC void STATIC void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment