aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_ioctl.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 6e52a5dd38d8..a74f854d91e6 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -653,7 +653,7 @@ xfs_attrmulti_by_handle(
653STATIC int 653STATIC int
654xfs_ioc_space( 654xfs_ioc_space(
655 bhv_desc_t *bdp, 655 bhv_desc_t *bdp,
656 bhv_vnode_t *vp, 656 struct inode *inode,
657 struct file *filp, 657 struct file *filp,
658 int flags, 658 int flags,
659 unsigned int cmd, 659 unsigned int cmd,
@@ -735,7 +735,7 @@ xfs_ioctl(
735 !capable(CAP_SYS_ADMIN)) 735 !capable(CAP_SYS_ADMIN))
736 return -EPERM; 736 return -EPERM;
737 737
738 return xfs_ioc_space(bdp, vp, filp, ioflags, cmd, arg); 738 return xfs_ioc_space(bdp, inode, filp, ioflags, cmd, arg);
739 739
740 case XFS_IOC_DIOINFO: { 740 case XFS_IOC_DIOINFO: {
741 struct dioattr da; 741 struct dioattr da;
@@ -763,6 +763,8 @@ xfs_ioctl(
763 return xfs_ioc_fsgeometry(mp, arg); 763 return xfs_ioc_fsgeometry(mp, arg);
764 764
765 case XFS_IOC_GETVERSION: 765 case XFS_IOC_GETVERSION:
766 return put_user(inode->i_generation, (int __user *)arg);
767
766 case XFS_IOC_GETXFLAGS: 768 case XFS_IOC_GETXFLAGS:
767 case XFS_IOC_SETXFLAGS: 769 case XFS_IOC_SETXFLAGS:
768 case XFS_IOC_FSGETXATTR: 770 case XFS_IOC_FSGETXATTR:
@@ -957,7 +959,7 @@ xfs_ioctl(
957STATIC int 959STATIC int
958xfs_ioc_space( 960xfs_ioc_space(
959 bhv_desc_t *bdp, 961 bhv_desc_t *bdp,
960 bhv_vnode_t *vp, 962 struct inode *inode,
961 struct file *filp, 963 struct file *filp,
962 int ioflags, 964 int ioflags,
963 unsigned int cmd, 965 unsigned int cmd,
@@ -967,13 +969,13 @@ xfs_ioc_space(
967 int attr_flags = 0; 969 int attr_flags = 0;
968 int error; 970 int error;
969 971
970 if (vp->v_inode.i_flags & (S_IMMUTABLE|S_APPEND)) 972 if (inode->i_flags & (S_IMMUTABLE|S_APPEND))
971 return -XFS_ERROR(EPERM); 973 return -XFS_ERROR(EPERM);
972 974
973 if (!(filp->f_mode & FMODE_WRITE)) 975 if (!(filp->f_mode & FMODE_WRITE))
974 return -XFS_ERROR(EBADF); 976 return -XFS_ERROR(EBADF);
975 977
976 if (!VN_ISREG(vp)) 978 if (!S_ISREG(inode->i_mode))
977 return -XFS_ERROR(EINVAL); 979 return -XFS_ERROR(EINVAL);
978 980
979 if (copy_from_user(&bf, arg, sizeof(bf))) 981 if (copy_from_user(&bf, arg, sizeof(bf)))
@@ -1264,13 +1266,6 @@ xfs_ioc_xattr(
1264 break; 1266 break;
1265 } 1267 }
1266 1268
1267 case XFS_IOC_GETVERSION: {
1268 flags = vn_to_inode(vp)->i_generation;
1269 if (copy_to_user(arg, &flags, sizeof(flags)))
1270 error = -EFAULT;
1271 break;
1272 }
1273
1274 default: 1269 default:
1275 error = -ENOTTY; 1270 error = -ENOTTY;
1276 break; 1271 break;