aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_ialloc.c3
-rw-r--r--fs/xfs/xfs_inode.c5
-rw-r--r--fs/xfs/xfs_inode.h3
-rw-r--r--fs/xfs/xfs_log_recover.c32
4 files changed, 10 insertions, 33 deletions
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index 16eda31fe797..0ce56d6a4922 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -1262,8 +1262,7 @@ xfs_dilocate(
1262#endif /* DEBUG */ 1262#endif /* DEBUG */
1263 return XFS_ERROR(EINVAL); 1263 return XFS_ERROR(EINVAL);
1264 } 1264 }
1265 if ((mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp)) || 1265 if ((mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp))) {
1266 !(flags & XFS_IMAP_LOOKUP)) {
1267 offset = XFS_INO_TO_OFFSET(mp, ino); 1266 offset = XFS_INO_TO_OFFSET(mp, ino);
1268 ASSERT(offset < mp->m_sb.sb_inopblock); 1267 ASSERT(offset < mp->m_sb.sb_inopblock);
1269 *bno = XFS_AGB_TO_FSB(mp, agno, agbno); 1268 *bno = XFS_AGB_TO_FSB(mp, agno, agbno);
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 1d5c28b144ae..663ff9e517fd 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -237,7 +237,7 @@ xfs_inotobp(
237 int error; 237 int error;
238 238
239 imap.im_blkno = 0; 239 imap.im_blkno = 0;
240 error = xfs_imap(mp, tp, ino, &imap, imap_flags | XFS_IMAP_LOOKUP); 240 error = xfs_imap(mp, tp, ino, &imap, imap_flags);
241 if (error) 241 if (error)
242 return error; 242 return error;
243 243
@@ -868,8 +868,7 @@ xfs_iread(
868 * Get pointers to the on-disk inode and the buffer containing it. 868 * Get pointers to the on-disk inode and the buffer containing it.
869 */ 869 */
870 imap.im_blkno = bno; 870 imap.im_blkno = bno;
871 error = xfs_imap(mp, tp, ip->i_ino, &imap, 871 error = xfs_imap(mp, tp, ip->i_ino, &imap, imap_flags);
872 XFS_IMAP_LOOKUP | imap_flags);
873 if (error) 872 if (error)
874 goto out_destroy_inode; 873 goto out_destroy_inode;
875 874
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index ec8b539439d3..db1f68840727 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -159,8 +159,7 @@ typedef struct xfs_icdinode {
159/* 159/*
160 * Flags for xfs_inotobp, xfs_imap() and xfs_dilocate(). 160 * Flags for xfs_inotobp, xfs_imap() and xfs_dilocate().
161 */ 161 */
162#define XFS_IMAP_LOOKUP 0x1 162#define XFS_IMAP_BULKSTAT 0x1
163#define XFS_IMAP_BULKSTAT 0x2
164 163
165/* 164/*
166 * Fork handling. 165 * Fork handling.
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 48bdfa4dc290..bf8573b5a7d8 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2245,7 +2245,6 @@ xlog_recover_do_inode_trans(
2245 xfs_inode_log_format_t *in_f; 2245 xfs_inode_log_format_t *in_f;
2246 xfs_mount_t *mp; 2246 xfs_mount_t *mp;
2247 xfs_buf_t *bp; 2247 xfs_buf_t *bp;
2248 xfs_imap_t imap;
2249 xfs_dinode_t *dip; 2248 xfs_dinode_t *dip;
2250 xfs_ino_t ino; 2249 xfs_ino_t ino;
2251 int len; 2250 int len;
@@ -2273,48 +2272,29 @@ xlog_recover_do_inode_trans(
2273 } 2272 }
2274 ino = in_f->ilf_ino; 2273 ino = in_f->ilf_ino;
2275 mp = log->l_mp; 2274 mp = log->l_mp;
2276 if (ITEM_TYPE(item) == XFS_LI_INODE) {
2277 imap.im_blkno = (xfs_daddr_t)in_f->ilf_blkno;
2278 imap.im_len = in_f->ilf_len;
2279 imap.im_boffset = in_f->ilf_boffset;
2280 } else {
2281 /*
2282 * It's an old inode format record. We don't know where
2283 * its cluster is located on disk, and we can't allow
2284 * xfs_imap() to figure it out because the inode btrees
2285 * are not ready to be used. Therefore do not pass the
2286 * XFS_IMAP_LOOKUP flag to xfs_imap(). This will give
2287 * us only the single block in which the inode lives
2288 * rather than its cluster, so we must make sure to
2289 * invalidate the buffer when we write it out below.
2290 */
2291 imap.im_blkno = 0;
2292 error = xfs_imap(log->l_mp, NULL, ino, &imap, 0);
2293 if (error)
2294 goto error;
2295 }
2296 2275
2297 /* 2276 /*
2298 * Inode buffers can be freed, look out for it, 2277 * Inode buffers can be freed, look out for it,
2299 * and do not replay the inode. 2278 * and do not replay the inode.
2300 */ 2279 */
2301 if (xlog_check_buffer_cancelled(log, imap.im_blkno, imap.im_len, 0)) { 2280 if (xlog_check_buffer_cancelled(log, in_f->ilf_blkno,
2281 in_f->ilf_len, 0)) {
2302 error = 0; 2282 error = 0;
2303 goto error; 2283 goto error;
2304 } 2284 }
2305 2285
2306 bp = xfs_buf_read_flags(mp->m_ddev_targp, imap.im_blkno, imap.im_len, 2286 bp = xfs_buf_read_flags(mp->m_ddev_targp, in_f->ilf_blkno,
2307 XFS_BUF_LOCK); 2287 in_f->ilf_len, XFS_BUF_LOCK);
2308 if (XFS_BUF_ISERROR(bp)) { 2288 if (XFS_BUF_ISERROR(bp)) {
2309 xfs_ioerror_alert("xlog_recover_do..(read#2)", mp, 2289 xfs_ioerror_alert("xlog_recover_do..(read#2)", mp,
2310 bp, imap.im_blkno); 2290 bp, in_f->ilf_blkno);
2311 error = XFS_BUF_GETERROR(bp); 2291 error = XFS_BUF_GETERROR(bp);
2312 xfs_buf_relse(bp); 2292 xfs_buf_relse(bp);
2313 goto error; 2293 goto error;
2314 } 2294 }
2315 error = 0; 2295 error = 0;
2316 ASSERT(in_f->ilf_fields & XFS_ILOG_CORE); 2296 ASSERT(in_f->ilf_fields & XFS_ILOG_CORE);
2317 dip = (xfs_dinode_t *)xfs_buf_offset(bp, imap.im_boffset); 2297 dip = (xfs_dinode_t *)xfs_buf_offset(bp, in_f->ilf_boffset);
2318 2298
2319 /* 2299 /*
2320 * Make sure the place we're flushing out to really looks 2300 * Make sure the place we're flushing out to really looks