aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-07-03 12:21:51 -0400
committerBen Myers <bpm@sgi.com>2012-07-22 11:55:36 -0400
commit129dbc9a2d93bab823e57fe47f53d098a0d350f3 (patch)
tree3fb2ffc63ab0b4042c5e2f00e877fa427a8674e0 /fs/xfs
parent475ee413f34165f8e6fcd7fbff3a4da1dce48c99 (diff)
xfs: remove xfs_inotobp
There is no need to keep this helper around, opencoding it in the only caller is just as clear. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_inode.c70
-rw-r--r--fs/xfs/xfs_inode.h3
2 files changed, 19 insertions, 54 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 34c985de5fa0..d48e406de078 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -216,47 +216,6 @@ xfs_imap_to_bp(
216} 216}
217 217
218/* 218/*
219 * This routine is called to map an inode number within a file
220 * system to the buffer containing the on-disk version of the
221 * inode. It returns a pointer to the buffer containing the
222 * on-disk inode in the bpp parameter, and in the dip parameter
223 * it returns a pointer to the on-disk inode within that buffer.
224 *
225 * If a non-zero error is returned, then the contents of bpp and
226 * dipp are undefined.
227 *
228 * Use xfs_imap() to determine the size and location of the
229 * buffer to read from disk.
230 */
231int
232xfs_inotobp(
233 xfs_mount_t *mp,
234 xfs_trans_t *tp,
235 xfs_ino_t ino,
236 xfs_dinode_t **dipp,
237 xfs_buf_t **bpp,
238 int *offset,
239 uint imap_flags)
240{
241 struct xfs_imap imap;
242 xfs_buf_t *bp;
243 int error;
244
245 imap.im_blkno = 0;
246 error = xfs_imap(mp, tp, ino, &imap, imap_flags);
247 if (error)
248 return error;
249
250 error = xfs_imap_to_bp(mp, tp, &imap, dipp, &bp, 0, imap_flags);
251 if (error)
252 return error;
253
254 *bpp = bp;
255 *offset = imap.im_boffset;
256 return 0;
257}
258
259/*
260 * Move inode type and inode format specific information from the 219 * Move inode type and inode format specific information from the
261 * on-disk inode to the in-core inode. For fifos, devs, and sockets 220 * on-disk inode to the in-core inode. For fifos, devs, and sockets
262 * this means set if_rdev to the proper value. For files, directories, 221 * this means set if_rdev to the proper value. For files, directories,
@@ -1431,23 +1390,32 @@ xfs_iunlink_remove(
1431 next_agino = be32_to_cpu(agi->agi_unlinked[bucket_index]); 1390 next_agino = be32_to_cpu(agi->agi_unlinked[bucket_index]);
1432 last_ibp = NULL; 1391 last_ibp = NULL;
1433 while (next_agino != agino) { 1392 while (next_agino != agino) {
1434 /* 1393 struct xfs_imap imap;
1435 * If the last inode wasn't the one pointing to 1394
1436 * us, then release its buffer since we're not 1395 if (last_ibp)
1437 * going to do anything with it.
1438 */
1439 if (last_ibp != NULL) {
1440 xfs_trans_brelse(tp, last_ibp); 1396 xfs_trans_brelse(tp, last_ibp);
1441 } 1397
1398 imap.im_blkno = 0;
1442 next_ino = XFS_AGINO_TO_INO(mp, agno, next_agino); 1399 next_ino = XFS_AGINO_TO_INO(mp, agno, next_agino);
1443 error = xfs_inotobp(mp, tp, next_ino, &last_dip, 1400
1444 &last_ibp, &last_offset, 0); 1401 error = xfs_imap(mp, tp, next_ino, &imap, 0);
1402 if (error) {
1403 xfs_warn(mp,
1404 "%s: xfs_imap returned error %d.",
1405 __func__, error);
1406 return error;
1407 }
1408
1409 error = xfs_imap_to_bp(mp, tp, &imap, &last_dip,
1410 &last_ibp, 0, 0);
1445 if (error) { 1411 if (error) {
1446 xfs_warn(mp, 1412 xfs_warn(mp,
1447 "%s: xfs_inotobp() returned error %d.", 1413 "%s: xfs_imap_to_bp returned error %d.",
1448 __func__, error); 1414 __func__, error);
1449 return error; 1415 return error;
1450 } 1416 }
1417
1418 last_offset = imap.im_boffset;
1451 next_agino = be32_to_cpu(last_dip->di_next_unlinked); 1419 next_agino = be32_to_cpu(last_dip->di_next_unlinked);
1452 ASSERT(next_agino != NULLAGINO); 1420 ASSERT(next_agino != NULLAGINO);
1453 ASSERT(next_agino != 0); 1421 ASSERT(next_agino != 0);
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 942fd7f9110b..c2e2da3abae2 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -557,9 +557,6 @@ do { \
557#define XFS_IGET_UNTRUSTED 0x2 557#define XFS_IGET_UNTRUSTED 0x2
558#define XFS_IGET_DONTCACHE 0x4 558#define XFS_IGET_DONTCACHE 0x4
559 559
560int xfs_inotobp(struct xfs_mount *, struct xfs_trans *,
561 xfs_ino_t, struct xfs_dinode **,
562 struct xfs_buf **, int *, uint);
563int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *, 560int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *,
564 struct xfs_imap *, struct xfs_dinode **, 561 struct xfs_imap *, struct xfs_dinode **,
565 struct xfs_buf **, uint, uint); 562 struct xfs_buf **, uint, uint);