Commit a1941895 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Niv Sardi

[XFS] remove dead code for old inode item recovery

We have removed the support for old-style inode items a while ago and
xlog_recover_do_inode_trans is now only called for XFS_LI_INODE items.
That means we can remove the call to xfs_imap there and with it the
XFS_IMAP_LOOKUP that is set by all other callers.  We can also mark
xfs_imap static now.

(First sent on October 21st)
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <david@fromorbit.com>
Signed-off-by: default avatarNiv Sardi <xaiki@sgi.com>
parent 76d8b277
...@@ -1262,8 +1262,7 @@ xfs_dilocate( ...@@ -1262,8 +1262,7 @@ xfs_dilocate(
#endif /* DEBUG */ #endif /* DEBUG */
return XFS_ERROR(EINVAL); return XFS_ERROR(EINVAL);
} }
if ((mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp)) || if ((mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp))) {
!(flags & XFS_IMAP_LOOKUP)) {
offset = XFS_INO_TO_OFFSET(mp, ino); offset = XFS_INO_TO_OFFSET(mp, ino);
ASSERT(offset < mp->m_sb.sb_inopblock); ASSERT(offset < mp->m_sb.sb_inopblock);
*bno = XFS_AGB_TO_FSB(mp, agno, agbno); *bno = XFS_AGB_TO_FSB(mp, agno, agbno);
......
...@@ -237,7 +237,7 @@ xfs_inotobp( ...@@ -237,7 +237,7 @@ xfs_inotobp(
int error; int error;
imap.im_blkno = 0; imap.im_blkno = 0;
error = xfs_imap(mp, tp, ino, &imap, imap_flags | XFS_IMAP_LOOKUP); error = xfs_imap(mp, tp, ino, &imap, imap_flags);
if (error) if (error)
return error; return error;
...@@ -868,8 +868,7 @@ xfs_iread( ...@@ -868,8 +868,7 @@ xfs_iread(
* Get pointers to the on-disk inode and the buffer containing it. * Get pointers to the on-disk inode and the buffer containing it.
*/ */
imap.im_blkno = bno; imap.im_blkno = bno;
error = xfs_imap(mp, tp, ip->i_ino, &imap, error = xfs_imap(mp, tp, ip->i_ino, &imap, imap_flags);
XFS_IMAP_LOOKUP | imap_flags);
if (error) if (error)
goto out_destroy_inode; goto out_destroy_inode;
......
...@@ -159,8 +159,7 @@ typedef struct xfs_icdinode { ...@@ -159,8 +159,7 @@ typedef struct xfs_icdinode {
/* /*
* Flags for xfs_inotobp, xfs_imap() and xfs_dilocate(). * Flags for xfs_inotobp, xfs_imap() and xfs_dilocate().
*/ */
#define XFS_IMAP_LOOKUP 0x1 #define XFS_IMAP_BULKSTAT 0x1
#define XFS_IMAP_BULKSTAT 0x2
/* /*
* Fork handling. * Fork handling.
......
...@@ -2245,7 +2245,6 @@ xlog_recover_do_inode_trans( ...@@ -2245,7 +2245,6 @@ xlog_recover_do_inode_trans(
xfs_inode_log_format_t *in_f; xfs_inode_log_format_t *in_f;
xfs_mount_t *mp; xfs_mount_t *mp;
xfs_buf_t *bp; xfs_buf_t *bp;
xfs_imap_t imap;
xfs_dinode_t *dip; xfs_dinode_t *dip;
xfs_ino_t ino; xfs_ino_t ino;
int len; int len;
...@@ -2273,48 +2272,29 @@ xlog_recover_do_inode_trans( ...@@ -2273,48 +2272,29 @@ xlog_recover_do_inode_trans(
} }
ino = in_f->ilf_ino; ino = in_f->ilf_ino;
mp = log->l_mp; mp = log->l_mp;
if (ITEM_TYPE(item) == XFS_LI_INODE) {
imap.im_blkno = (xfs_daddr_t)in_f->ilf_blkno;
imap.im_len = in_f->ilf_len;
imap.im_boffset = in_f->ilf_boffset;
} else {
/*
* It's an old inode format record. We don't know where
* its cluster is located on disk, and we can't allow
* xfs_imap() to figure it out because the inode btrees
* are not ready to be used. Therefore do not pass the
* XFS_IMAP_LOOKUP flag to xfs_imap(). This will give
* us only the single block in which the inode lives
* rather than its cluster, so we must make sure to
* invalidate the buffer when we write it out below.
*/
imap.im_blkno = 0;
error = xfs_imap(log->l_mp, NULL, ino, &imap, 0);
if (error)
goto error;
}
/* /*
* Inode buffers can be freed, look out for it, * Inode buffers can be freed, look out for it,
* and do not replay the inode. * and do not replay the inode.
*/ */
if (xlog_check_buffer_cancelled(log, imap.im_blkno, imap.im_len, 0)) { if (xlog_check_buffer_cancelled(log, in_f->ilf_blkno,
in_f->ilf_len, 0)) {
error = 0; error = 0;
goto error; goto error;
} }
bp = xfs_buf_read_flags(mp->m_ddev_targp, imap.im_blkno, imap.im_len, bp = xfs_buf_read_flags(mp->m_ddev_targp, in_f->ilf_blkno,
XFS_BUF_LOCK); in_f->ilf_len, XFS_BUF_LOCK);
if (XFS_BUF_ISERROR(bp)) { if (XFS_BUF_ISERROR(bp)) {
xfs_ioerror_alert("xlog_recover_do..(read#2)", mp, xfs_ioerror_alert("xlog_recover_do..(read#2)", mp,
bp, imap.im_blkno); bp, in_f->ilf_blkno);
error = XFS_BUF_GETERROR(bp); error = XFS_BUF_GETERROR(bp);
xfs_buf_relse(bp); xfs_buf_relse(bp);
goto error; goto error;
} }
error = 0; error = 0;
ASSERT(in_f->ilf_fields & XFS_ILOG_CORE); ASSERT(in_f->ilf_fields & XFS_ILOG_CORE);
dip = (xfs_dinode_t *)xfs_buf_offset(bp, imap.im_boffset); dip = (xfs_dinode_t *)xfs_buf_offset(bp, in_f->ilf_boffset);
/* /*
* Make sure the place we're flushing out to really looks * Make sure the place we're flushing out to really looks
......
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