aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_itable.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2010-06-23 21:35:17 -0400
committerDave Chinner <david@fromorbit.com>2010-06-23 21:35:17 -0400
commit7b6259e7a83647948fa33a736cc832310c8d85aa (patch)
tree99bb872b179a93f5e32b51f312029abb1237b055 /fs/xfs/xfs_itable.c
parent1920779e67cbf5ea8afef317777c5bf2b8096188 (diff)
xfs: remove block number from inode lookup code
The block number comes from bulkstat based inode lookups to shortcut the mapping calculations. We ar enot able to trust anything from bulkstat, so drop the block number as well so that the correct lookups and mappings are always done. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r--fs/xfs/xfs_itable.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index 2acd12fd3f25..2b86f8610512 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -60,7 +60,6 @@ xfs_bulkstat_one_int(
60 void __user *buffer, /* buffer to place output in */ 60 void __user *buffer, /* buffer to place output in */
61 int ubsize, /* size of buffer */ 61 int ubsize, /* size of buffer */
62 bulkstat_one_fmt_pf formatter, /* formatter, copy to user */ 62 bulkstat_one_fmt_pf formatter, /* formatter, copy to user */
63 xfs_daddr_t bno, /* starting bno of cluster */
64 int *ubused, /* bytes used by me */ 63 int *ubused, /* bytes used by me */
65 int *stat) /* BULKSTAT_RV_... */ 64 int *stat) /* BULKSTAT_RV_... */
66{ 65{
@@ -80,7 +79,7 @@ xfs_bulkstat_one_int(
80 return XFS_ERROR(ENOMEM); 79 return XFS_ERROR(ENOMEM);
81 80
82 error = xfs_iget(mp, NULL, ino, 81 error = xfs_iget(mp, NULL, ino,
83 XFS_IGET_UNTRUSTED, XFS_ILOCK_SHARED, &ip, bno); 82 XFS_IGET_UNTRUSTED, XFS_ILOCK_SHARED, &ip);
84 if (error) { 83 if (error) {
85 *stat = BULKSTAT_RV_NOTHING; 84 *stat = BULKSTAT_RV_NOTHING;
86 goto out_free; 85 goto out_free;
@@ -179,13 +178,11 @@ xfs_bulkstat_one(
179 xfs_ino_t ino, /* inode number to get data for */ 178 xfs_ino_t ino, /* inode number to get data for */
180 void __user *buffer, /* buffer to place output in */ 179 void __user *buffer, /* buffer to place output in */
181 int ubsize, /* size of buffer */ 180 int ubsize, /* size of buffer */
182 xfs_daddr_t bno, /* starting bno of inode cluster */
183 int *ubused, /* bytes used by me */ 181 int *ubused, /* bytes used by me */
184 int *stat) /* BULKSTAT_RV_... */ 182 int *stat) /* BULKSTAT_RV_... */
185{ 183{
186 return xfs_bulkstat_one_int(mp, ino, buffer, ubsize, 184 return xfs_bulkstat_one_int(mp, ino, buffer, ubsize,
187 xfs_bulkstat_one_fmt, bno, 185 xfs_bulkstat_one_fmt, ubused, stat);
188 ubused, stat);
189} 186}
190 187
191#define XFS_BULKSTAT_UBLEFT(ubleft) ((ubleft) >= statstruct_size) 188#define XFS_BULKSTAT_UBLEFT(ubleft) ((ubleft) >= statstruct_size)
@@ -485,7 +482,7 @@ xfs_bulkstat(
485 * Get the inode and fill in a single buffer. 482 * Get the inode and fill in a single buffer.
486 */ 483 */
487 ubused = statstruct_size; 484 ubused = statstruct_size;
488 error = formatter(mp, ino, ubufp, ubleft, bno, 485 error = formatter(mp, ino, ubufp, ubleft,
489 &ubused, &fmterror); 486 &ubused, &fmterror);
490 if (fmterror == BULKSTAT_RV_NOTHING) { 487 if (fmterror == BULKSTAT_RV_NOTHING) {
491 if (error && error != ENOENT && 488 if (error && error != ENOENT &&
@@ -578,8 +575,7 @@ xfs_bulkstat_single(
578 */ 575 */
579 576
580 ino = (xfs_ino_t)*lastinop; 577 ino = (xfs_ino_t)*lastinop;
581 error = xfs_bulkstat_one(mp, ino, buffer, sizeof(xfs_bstat_t), 578 error = xfs_bulkstat_one(mp, ino, buffer, sizeof(xfs_bstat_t), 0, &res);
582 0, NULL, &res);
583 if (error) { 579 if (error) {
584 /* 580 /*
585 * Special case way failed, do it the "long" way 581 * Special case way failed, do it the "long" way