mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-14 06:24:53 +08:00
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: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
parent
7d4894b4ce
commit
f15ab3f60e
@ -3890,22 +3890,17 @@ xlog_recover_inode_ra_pass2(
|
||||
struct xlog *log,
|
||||
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)) {
|
||||
ilfp = item->ri_buf[0].i_addr;
|
||||
} else {
|
||||
ilfp = &ilf_buf;
|
||||
memset(ilfp, 0, sizeof(*ilfp));
|
||||
error = xfs_inode_item_format_convert(&item->ri_buf[0], ilfp);
|
||||
if (error)
|
||||
return;
|
||||
}
|
||||
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);
|
||||
xlog_buf_readahead(log, ilfp->ilf_blkno, ilfp->ilf_len,
|
||||
&xfs_inode_buf_ra_ops);
|
||||
} else {
|
||||
struct xfs_inode_log_format_32 *ilfp = item->ri_buf[0].i_addr;
|
||||
|
||||
xlog_buf_readahead(log, ilfp->ilf_blkno, ilfp->ilf_len,
|
||||
&xfs_inode_buf_ra_ops);
|
||||
}
|
||||
}
|
||||
|
||||
STATIC void
|
||||
|
Loading…
Reference in New Issue
Block a user