Commit f37ea149 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Tim Shimmin

[XFS] pass inode to xfs_ioc_space(), simplify some code. There is trivial

"inode => vnode => inode" conversion, but only flags and mode of final
inode are looked at. Pass original inode instead.

SGI-PV: 904196
SGI-Modid: xfs-linux-melb:xfs-kern:26395a
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent a77c64c1
...@@ -653,7 +653,7 @@ xfs_attrmulti_by_handle( ...@@ -653,7 +653,7 @@ xfs_attrmulti_by_handle(
STATIC int STATIC int
xfs_ioc_space( xfs_ioc_space(
bhv_desc_t *bdp, bhv_desc_t *bdp,
bhv_vnode_t *vp, struct inode *inode,
struct file *filp, struct file *filp,
int flags, int flags,
unsigned int cmd, unsigned int cmd,
...@@ -735,7 +735,7 @@ xfs_ioctl( ...@@ -735,7 +735,7 @@ xfs_ioctl(
!capable(CAP_SYS_ADMIN)) !capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
return xfs_ioc_space(bdp, vp, filp, ioflags, cmd, arg); return xfs_ioc_space(bdp, inode, filp, ioflags, cmd, arg);
case XFS_IOC_DIOINFO: { case XFS_IOC_DIOINFO: {
struct dioattr da; struct dioattr da;
...@@ -957,7 +957,7 @@ xfs_ioctl( ...@@ -957,7 +957,7 @@ xfs_ioctl(
STATIC int STATIC int
xfs_ioc_space( xfs_ioc_space(
bhv_desc_t *bdp, bhv_desc_t *bdp,
bhv_vnode_t *vp, struct inode *inode,
struct file *filp, struct file *filp,
int ioflags, int ioflags,
unsigned int cmd, unsigned int cmd,
...@@ -967,13 +967,13 @@ xfs_ioc_space( ...@@ -967,13 +967,13 @@ xfs_ioc_space(
int attr_flags = 0; int attr_flags = 0;
int error; int error;
if (vp->v_inode.i_flags & (S_IMMUTABLE|S_APPEND)) if (inode->i_flags & (S_IMMUTABLE|S_APPEND))
return -XFS_ERROR(EPERM); return -XFS_ERROR(EPERM);
if (!(filp->f_mode & FMODE_WRITE)) if (!(filp->f_mode & FMODE_WRITE))
return -XFS_ERROR(EBADF); return -XFS_ERROR(EBADF);
if (!VN_ISREG(vp)) if (!S_ISREG(inode->i_mode))
return -XFS_ERROR(EINVAL); return -XFS_ERROR(EINVAL);
if (copy_from_user(&bf, arg, sizeof(bf))) if (copy_from_user(&bf, arg, sizeof(bf)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment