aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_itable.c
diff options
context:
space:
mode:
authorsandeen@sandeen.net <sandeen@sandeen.net>2008-11-25 22:20:11 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-12-02 01:15:36 -0500
commit2ee4fa5cb716eba104a4ef8efe159e1007a2aef6 (patch)
tree943c9966c8daa913dff42216bcdc1cc4c1c835da /fs/xfs/xfs_itable.c
parent471d59103167c84f17b9bcfee22ed10b44ff206e (diff)
[XFS] Make the bulkstat_one compat ioctl handling more sane
Currently the compat formatter was handled by passing in "private_data" for the xfs_bulkstat_one formatter, which was really just another formatter... IMHO this got confusing. Instead, just make a new xfs_bulkstat_one_compat formatter for xfs_bulkstat, and call it via a wrapper. Also, don't translate the ioctl nrs into their native counterparts, that just clouds the issue; we're in a compat handler anyway, just switch on the 32-bit cmds. Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r--fs/xfs/xfs_itable.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index d4c0de860124..7bd49b87160c 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -202,13 +202,13 @@ xfs_bulkstat_one_fmt(
202 * Return stat information for one inode. 202 * Return stat information for one inode.
203 * Return 0 if ok, else errno. 203 * Return 0 if ok, else errno.
204 */ 204 */
205int /* error status */ 205int /* error status */
206xfs_bulkstat_one( 206xfs_bulkstat_one_int(
207 xfs_mount_t *mp, /* mount point for filesystem */ 207 xfs_mount_t *mp, /* mount point for filesystem */
208 xfs_ino_t ino, /* inode number to get data for */ 208 xfs_ino_t ino, /* inode number to get data for */
209 void __user *buffer, /* buffer to place output in */ 209 void __user *buffer, /* buffer to place output in */
210 int ubsize, /* size of buffer */ 210 int ubsize, /* size of buffer */
211 void *private_data, /* my private data */ 211 bulkstat_one_fmt_pf formatter, /* formatter, copy to user */
212 xfs_daddr_t bno, /* starting bno of inode cluster */ 212 xfs_daddr_t bno, /* starting bno of inode cluster */
213 int *ubused, /* bytes used by me */ 213 int *ubused, /* bytes used by me */
214 void *dibuff, /* on-disk inode buffer */ 214 void *dibuff, /* on-disk inode buffer */
@@ -217,7 +217,6 @@ xfs_bulkstat_one(
217 xfs_bstat_t *buf; /* return buffer */ 217 xfs_bstat_t *buf; /* return buffer */
218 int error = 0; /* error value */ 218 int error = 0; /* error value */
219 xfs_dinode_t *dip; /* dinode inode pointer */ 219 xfs_dinode_t *dip; /* dinode inode pointer */
220 bulkstat_one_fmt_pf formatter = private_data ? : xfs_bulkstat_one_fmt;
221 220
222 dip = (xfs_dinode_t *)dibuff; 221 dip = (xfs_dinode_t *)dibuff;
223 *stat = BULKSTAT_RV_NOTHING; 222 *stat = BULKSTAT_RV_NOTHING;
@@ -255,6 +254,23 @@ xfs_bulkstat_one(
255 return error; 254 return error;
256} 255}
257 256
257int
258xfs_bulkstat_one(
259 xfs_mount_t *mp, /* mount point for filesystem */
260 xfs_ino_t ino, /* inode number to get data for */
261 void __user *buffer, /* buffer to place output in */
262 int ubsize, /* size of buffer */
263 void *private_data, /* my private data */
264 xfs_daddr_t bno, /* starting bno of inode cluster */
265 int *ubused, /* bytes used by me */
266 void *dibuff, /* on-disk inode buffer */
267 int *stat) /* BULKSTAT_RV_... */
268{
269 return xfs_bulkstat_one_int(mp, ino, buffer, ubsize,
270 xfs_bulkstat_one_fmt, bno,
271 ubused, dibuff, stat);
272}
273
258/* 274/*
259 * Test to see whether we can use the ondisk inode directly, based 275 * Test to see whether we can use the ondisk inode directly, based
260 * on the given bulkstat flags, filling in dipp accordingly. 276 * on the given bulkstat flags, filling in dipp accordingly.