Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124914
b: refs/heads/master
c: 2ee4fa5
h: refs/heads/master
v: v3
  • Loading branch information
sandeen@sandeen.net authored and Lachlan McIlroy committed Dec 2, 2008
1 parent 5e1122c commit 62f1dce
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 471d59103167c84f17b9bcfee22ed10b44ff206e
refs/heads/master: 2ee4fa5cb716eba104a4ef8efe159e1007a2aef6
36 changes: 24 additions & 12 deletions trunk/fs/xfs/linux-2.6/xfs_ioctl32.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,30 @@ xfs_bulkstat_one_fmt_compat(
return sizeof(*p32);
}

STATIC int
xfs_bulkstat_one_compat(
xfs_mount_t *mp, /* mount point for filesystem */
xfs_ino_t ino, /* inode number to get data for */
void __user *buffer, /* buffer to place output in */
int ubsize, /* size of buffer */
void *private_data, /* my private data */
xfs_daddr_t bno, /* starting bno of inode cluster */
int *ubused, /* bytes used by me */
void *dibuff, /* on-disk inode buffer */
int *stat) /* BULKSTAT_RV_... */
{
return xfs_bulkstat_one_int(mp, ino, buffer, ubsize,
xfs_bulkstat_one_fmt_compat, bno,
ubused, dibuff, stat);
}

/* copied from xfs_ioctl.c */
STATIC int
xfs_ioc_bulkstat_compat(
xfs_mount_t *mp,
unsigned int cmd,
void __user *arg)
xfs_compat_ioc_bulkstat(
xfs_mount_t *mp,
unsigned int cmd,
compat_xfs_fsop_bulkreq_t __user *p32)
{
compat_xfs_fsop_bulkreq_t __user *p32 = (void __user *)arg;
u32 addr;
xfs_fsop_bulkreq_t bulkreq;
int count; /* # of records returned */
Expand Down Expand Up @@ -267,14 +283,12 @@ xfs_ioc_bulkstat_compat(
if (bulkreq.ubuffer == NULL)
return -XFS_ERROR(EINVAL);

if (cmd == XFS_IOC_FSINUMBERS)
if (cmd == XFS_IOC_FSINUMBERS_32)
error = xfs_inumbers(mp, &inlast, &count,
bulkreq.ubuffer, xfs_inumbers_fmt_compat);
else {
/* declare a var to get a warning in case the type changes */
bulkstat_one_fmt_pf formatter = xfs_bulkstat_one_fmt_compat;
error = xfs_bulkstat(mp, &inlast, &count,
xfs_bulkstat_one, formatter,
xfs_bulkstat_one_compat, NULL,
sizeof(compat_xfs_bstat_t), bulkreq.ubuffer,
BULKSTAT_FG_QUICK, &done);
}
Expand Down Expand Up @@ -422,9 +436,7 @@ xfs_compat_ioctl(
case XFS_IOC_FSBULKSTAT_32:
case XFS_IOC_FSBULKSTAT_SINGLE_32:
case XFS_IOC_FSINUMBERS_32:
cmd = _NATIVE_IOC(cmd, struct xfs_fsop_bulkreq);
return xfs_ioc_bulkstat_compat(XFS_I(inode)->i_mount,
cmd, (void __user*)arg);
return xfs_compat_ioc_bulkstat(mp, cmd, arg);
case XFS_IOC_FD_TO_HANDLE_32:
case XFS_IOC_PATH_TO_HANDLE_32:
case XFS_IOC_PATH_TO_FSHANDLE_32: {
Expand Down
24 changes: 20 additions & 4 deletions trunk/fs/xfs/xfs_itable.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ xfs_bulkstat_one_fmt(
* Return stat information for one inode.
* Return 0 if ok, else errno.
*/
int /* error status */
xfs_bulkstat_one(
int /* error status */
xfs_bulkstat_one_int(
xfs_mount_t *mp, /* mount point for filesystem */
xfs_ino_t ino, /* inode number to get data for */
void __user *buffer, /* buffer to place output in */
int ubsize, /* size of buffer */
void *private_data, /* my private data */
bulkstat_one_fmt_pf formatter, /* formatter, copy to user */
xfs_daddr_t bno, /* starting bno of inode cluster */
int *ubused, /* bytes used by me */
void *dibuff, /* on-disk inode buffer */
Expand All @@ -217,7 +217,6 @@ xfs_bulkstat_one(
xfs_bstat_t *buf; /* return buffer */
int error = 0; /* error value */
xfs_dinode_t *dip; /* dinode inode pointer */
bulkstat_one_fmt_pf formatter = private_data ? : xfs_bulkstat_one_fmt;

dip = (xfs_dinode_t *)dibuff;
*stat = BULKSTAT_RV_NOTHING;
Expand Down Expand Up @@ -255,6 +254,23 @@ xfs_bulkstat_one(
return error;
}

int
xfs_bulkstat_one(
xfs_mount_t *mp, /* mount point for filesystem */
xfs_ino_t ino, /* inode number to get data for */
void __user *buffer, /* buffer to place output in */
int ubsize, /* size of buffer */
void *private_data, /* my private data */
xfs_daddr_t bno, /* starting bno of inode cluster */
int *ubused, /* bytes used by me */
void *dibuff, /* on-disk inode buffer */
int *stat) /* BULKSTAT_RV_... */
{
return xfs_bulkstat_one_int(mp, ino, buffer, ubsize,
xfs_bulkstat_one_fmt, bno,
ubused, dibuff, stat);
}

/*
* Test to see whether we can use the ondisk inode directly, based
* on the given bulkstat flags, filling in dipp accordingly.
Expand Down
12 changes: 12 additions & 0 deletions trunk/fs/xfs/xfs_itable.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ typedef int (*bulkstat_one_fmt_pf)( /* used size in bytes or negative error */
void __user *ubuffer, /* buffer to write to */
const xfs_bstat_t *buffer); /* buffer to read from */

int
xfs_bulkstat_one_int(
xfs_mount_t *mp,
xfs_ino_t ino,
void __user *buffer,
int ubsize,
bulkstat_one_fmt_pf formatter,
xfs_daddr_t bno,
int *ubused,
void *dibuff,
int *stat);

int
xfs_bulkstat_one(
xfs_mount_t *mp,
Expand Down

0 comments on commit 62f1dce

Please sign in to comment.