Skip to content

Commit

Permalink
[XFS] pass inode to xfs_ioc_space(), simplify some code. There is tri…
Browse files Browse the repository at this point in the history
…vial

"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: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
  • Loading branch information
Alexey Dobriyan authored and Tim Shimmin committed Sep 28, 2006
1 parent a77c64c commit f37ea14
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fs/xfs/linux-2.6/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ xfs_attrmulti_by_handle(
STATIC int
xfs_ioc_space(
bhv_desc_t *bdp,
bhv_vnode_t *vp,
struct inode *inode,
struct file *filp,
int flags,
unsigned int cmd,
Expand Down Expand Up @@ -735,7 +735,7 @@ xfs_ioctl(
!capable(CAP_SYS_ADMIN))
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: {
struct dioattr da;
Expand Down Expand Up @@ -957,7 +957,7 @@ xfs_ioctl(
STATIC int
xfs_ioc_space(
bhv_desc_t *bdp,
bhv_vnode_t *vp,
struct inode *inode,
struct file *filp,
int ioflags,
unsigned int cmd,
Expand All @@ -967,13 +967,13 @@ xfs_ioc_space(
int attr_flags = 0;
int error;

if (vp->v_inode.i_flags & (S_IMMUTABLE|S_APPEND))
if (inode->i_flags & (S_IMMUTABLE|S_APPEND))
return -XFS_ERROR(EPERM);

if (!(filp->f_mode & FMODE_WRITE))
return -XFS_ERROR(EBADF);

if (!VN_ISREG(vp))
if (!S_ISREG(inode->i_mode))
return -XFS_ERROR(EINVAL);

if (copy_from_user(&bf, arg, sizeof(bf)))
Expand Down

0 comments on commit f37ea14

Please sign in to comment.