diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 03:04:13 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-10-30 03:04:13 -0400 |
commit | c679eef0520eb3c2c731fce505e61b8ef9469aac (patch) | |
tree | 6a3cdcb882282d10dac7bb45e194fc473dd3940d /fs/xfs/xfs_inode.c | |
parent | 455486b9ccdd0a1d7432a03302f549b1c917c181 (diff) |
[XFS] stop using xfs_itobp in xfs_bulkstat
xfs_bulkstat only wants the dinode, offset and buffer from a given inode
number. Instead of using xfs_itobp on a fake inode which is complicated
and currently leads to leaks of the security data just use xfs_inotobp
which is designed to do exactly the kind of lookup xfs_bulkstat wants. The
only thing that's missing in xfs_inotobp is a flags paramter that let's us
pass down XFS_IMAP_BULKSTAT, but that can easily added.
SGI-PV: 987246
SGI-Modid: xfs-linux-melb:xfs-kern:32397a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: David Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index c83f6998f95e..35e419191abf 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -222,25 +222,26 @@ xfs_imap_to_bp( | |||
222 | * Use xfs_imap() to determine the size and location of the | 222 | * Use xfs_imap() to determine the size and location of the |
223 | * buffer to read from disk. | 223 | * buffer to read from disk. |
224 | */ | 224 | */ |
225 | STATIC int | 225 | int |
226 | xfs_inotobp( | 226 | xfs_inotobp( |
227 | xfs_mount_t *mp, | 227 | xfs_mount_t *mp, |
228 | xfs_trans_t *tp, | 228 | xfs_trans_t *tp, |
229 | xfs_ino_t ino, | 229 | xfs_ino_t ino, |
230 | xfs_dinode_t **dipp, | 230 | xfs_dinode_t **dipp, |
231 | xfs_buf_t **bpp, | 231 | xfs_buf_t **bpp, |
232 | int *offset) | 232 | int *offset, |
233 | uint imap_flags) | ||
233 | { | 234 | { |
234 | xfs_imap_t imap; | 235 | xfs_imap_t imap; |
235 | xfs_buf_t *bp; | 236 | xfs_buf_t *bp; |
236 | int error; | 237 | int error; |
237 | 238 | ||
238 | imap.im_blkno = 0; | 239 | imap.im_blkno = 0; |
239 | error = xfs_imap(mp, tp, ino, &imap, XFS_IMAP_LOOKUP); | 240 | error = xfs_imap(mp, tp, ino, &imap, imap_flags | XFS_IMAP_LOOKUP); |
240 | if (error) | 241 | if (error) |
241 | return error; | 242 | return error; |
242 | 243 | ||
243 | error = xfs_imap_to_bp(mp, tp, &imap, &bp, XFS_BUF_LOCK, 0); | 244 | error = xfs_imap_to_bp(mp, tp, &imap, &bp, XFS_BUF_LOCK, imap_flags); |
244 | if (error) | 245 | if (error) |
245 | return error; | 246 | return error; |
246 | 247 | ||
@@ -792,7 +793,7 @@ xfs_dic2xflags( | |||
792 | /* | 793 | /* |
793 | * Allocate and initialise an xfs_inode. | 794 | * Allocate and initialise an xfs_inode. |
794 | */ | 795 | */ |
795 | struct xfs_inode * | 796 | STATIC struct xfs_inode * |
796 | xfs_inode_alloc( | 797 | xfs_inode_alloc( |
797 | struct xfs_mount *mp, | 798 | struct xfs_mount *mp, |
798 | xfs_ino_t ino) | 799 | xfs_ino_t ino) |
@@ -2046,7 +2047,7 @@ xfs_iunlink_remove( | |||
2046 | } | 2047 | } |
2047 | next_ino = XFS_AGINO_TO_INO(mp, agno, next_agino); | 2048 | next_ino = XFS_AGINO_TO_INO(mp, agno, next_agino); |
2048 | error = xfs_inotobp(mp, tp, next_ino, &last_dip, | 2049 | error = xfs_inotobp(mp, tp, next_ino, &last_dip, |
2049 | &last_ibp, &last_offset); | 2050 | &last_ibp, &last_offset, 0); |
2050 | if (error) { | 2051 | if (error) { |
2051 | cmn_err(CE_WARN, | 2052 | cmn_err(CE_WARN, |
2052 | "xfs_iunlink_remove: xfs_inotobp() returned an error %d on %s. Returning error.", | 2053 | "xfs_iunlink_remove: xfs_inotobp() returned an error %d on %s. Returning error.", |