git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
fs
/
xfs
/
linux-2.6
/
xfs_ioctl.c
diff --git
a/fs/xfs/linux-2.6/xfs_ioctl.c
b/fs/xfs/linux-2.6/xfs_ioctl.c
index
1d6ff3d
..
0745d2b
100644
(file)
--- a/
fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/
fs/xfs/linux-2.6/xfs_ioctl.c
@@
-23,7
+23,6
@@
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
-#include "xfs_dir.h"
#include "xfs_dir2.h"
#include "xfs_alloc.h"
#include "xfs_dmapi.h"
#include "xfs_dir2.h"
#include "xfs_alloc.h"
#include "xfs_dmapi.h"
@@
-31,7
+30,6
@@
#include "xfs_bmap_btree.h"
#include "xfs_alloc_btree.h"
#include "xfs_ialloc_btree.h"
#include "xfs_bmap_btree.h"
#include "xfs_alloc_btree.h"
#include "xfs_ialloc_btree.h"
-#include "xfs_dir_sf.h"
#include "xfs_attr_sf.h"
#include "xfs_dir2_sf.h"
#include "xfs_dinode.h"
#include "xfs_attr_sf.h"
#include "xfs_dir2_sf.h"
#include "xfs_dinode.h"
@@
-78,7
+76,7
@@
xfs_find_handle(
xfs_handle_t handle;
xfs_fsop_handlereq_t hreq;
struct inode *inode;
xfs_handle_t handle;
xfs_fsop_handlereq_t hreq;
struct inode *inode;
-
struct vnode
*vp;
+
bhv_vnode_t
*vp;
if (copy_from_user(&hreq, arg, sizeof(hreq)))
return -XFS_ERROR(EFAULT);
if (copy_from_user(&hreq, arg, sizeof(hreq)))
return -XFS_ERROR(EFAULT);
@@
-109,9
+107,9
@@
xfs_find_handle(
if (!file)
return -EBADF;
if (!file)
return -EBADF;
- ASSERT(file->f_dentry);
- ASSERT(file->f_dentry->d_inode);
- inode = igrab(file->f_dentry->d_inode);
+ ASSERT(file->f_
path.
dentry);
+ ASSERT(file->f_
path.
dentry->d_inode);
+ inode = igrab(file->f_
path.
dentry->d_inode);
fput(file);
break;
}
fput(file);
break;
}
@@
-192,7
+190,7
@@
xfs_vget_fsop_handlereq(
xfs_mount_t *mp,
struct inode *parinode, /* parent inode pointer */
xfs_fsop_handlereq_t *hreq,
xfs_mount_t *mp,
struct inode *parinode, /* parent inode pointer */
xfs_fsop_handlereq_t *hreq,
-
vnode_t
**vp,
+
bhv_vnode_t
**vp,
struct inode **inode)
{
void __user *hanp;
struct inode **inode)
{
void __user *hanp;
@@
-202,7
+200,7
@@
xfs_vget_fsop_handlereq(
xfs_handle_t handle;
xfs_inode_t *ip;
struct inode *inodep;
xfs_handle_t handle;
xfs_inode_t *ip;
struct inode *inodep;
-
vnode_t
*vpp;
+
bhv_vnode_t
*vpp;
xfs_ino_t ino;
__u32 igen;
int error;
xfs_ino_t ino;
__u32 igen;
int error;
@@
-277,7
+275,7
@@
xfs_open_by_handle(
struct file *filp;
struct inode *inode;
struct dentry *dentry;
struct file *filp;
struct inode *inode;
struct dentry *dentry;
-
vnode_t
*vp;
+
bhv_vnode_t
*vp;
xfs_fsop_handlereq_t hreq;
if (!capable(CAP_SYS_ADMIN))
xfs_fsop_handlereq_t hreq;
if (!capable(CAP_SYS_ADMIN))
@@
-335,16
+333,19
@@
xfs_open_by_handle(
}
/* Ensure umount returns EBUSY on umounts while this file is open. */
}
/* Ensure umount returns EBUSY on umounts while this file is open. */
- mntget(parfilp->f_
vfs
mnt);
+ mntget(parfilp->f_
path.
mnt);
/* Create file pointer. */
/* Create file pointer. */
- filp = dentry_open(dentry, parfilp->f_
vfs
mnt, hreq.oflags);
+ filp = dentry_open(dentry, parfilp->f_
path.
mnt, hreq.oflags);
if (IS_ERR(filp)) {
put_unused_fd(new_fd);
return -XFS_ERROR(-PTR_ERR(filp));
}
if (IS_ERR(filp)) {
put_unused_fd(new_fd);
return -XFS_ERROR(-PTR_ERR(filp));
}
- if (inode->i_mode & S_IFREG)
+ if (inode->i_mode & S_IFREG) {
+ /* invisible operation should not change atime */
+ filp->f_flags |= O_NOATIME;
filp->f_op = &xfs_invis_file_operations;
filp->f_op = &xfs_invis_file_operations;
+ }
fd_install(new_fd, filp);
return new_fd;
fd_install(new_fd, filp);
return new_fd;
@@
-362,7
+363,7
@@
xfs_readlink_by_handle(
struct uio auio;
struct inode *inode;
xfs_fsop_handlereq_t hreq;
struct uio auio;
struct inode *inode;
xfs_fsop_handlereq_t hreq;
-
vnode_t
*vp;
+
bhv_vnode_t
*vp;
__u32 olen;
if (!capable(CAP_SYS_ADMIN))
__u32 olen;
if (!capable(CAP_SYS_ADMIN))
@@
-393,9
+394,11
@@
xfs_readlink_by_handle(
auio.uio_segflg = UIO_USERSPACE;
auio.uio_resid = olen;
auio.uio_segflg = UIO_USERSPACE;
auio.uio_resid = olen;
- VOP_READLINK(vp, &auio, IO_INVIS, NULL, error);
-
+ error = bhv_vop_readlink(vp, &auio, IO_INVIS, NULL);
VN_RELE(vp);
VN_RELE(vp);
+ if (error)
+ return -error;
+
return (olen - auio.uio_resid);
}
return (olen - auio.uio_resid);
}
@@
-411,7
+414,7
@@
xfs_fssetdm_by_handle(
xfs_fsop_setdm_handlereq_t dmhreq;
struct inode *inode;
bhv_desc_t *bdp;
xfs_fsop_setdm_handlereq_t dmhreq;
struct inode *inode;
bhv_desc_t *bdp;
-
vnode_t
*vp;
+
bhv_vnode_t
*vp;
if (!capable(CAP_MKNOD))
return -XFS_ERROR(EPERM);
if (!capable(CAP_MKNOD))
return -XFS_ERROR(EPERM);
@@
-452,7
+455,7
@@
xfs_attrlist_by_handle(
attrlist_cursor_kern_t *cursor;
xfs_fsop_attrlist_handlereq_t al_hreq;
struct inode *inode;
attrlist_cursor_kern_t *cursor;
xfs_fsop_attrlist_handlereq_t al_hreq;
struct inode *inode;
-
vnode_t
*vp;
+
bhv_vnode_t
*vp;
char *kbuf;
if (!capable(CAP_SYS_ADMIN))
char *kbuf;
if (!capable(CAP_SYS_ADMIN))
@@
-472,8
+475,8
@@
xfs_attrlist_by_handle(
goto out_vn_rele;
cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
goto out_vn_rele;
cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
-
VOP_ATTR_LIST
(vp, kbuf, al_hreq.buflen, al_hreq.flags,
-
cursor, NULL, error
);
+
error = bhv_vop_attr_list
(vp, kbuf, al_hreq.buflen, al_hreq.flags,
+
cursor, NULL
);
if (error)
goto out_kfree;
if (error)
goto out_kfree;
@@
-490,7
+493,7
@@
xfs_attrlist_by_handle(
STATIC int
xfs_attrmulti_attr_get(
STATIC int
xfs_attrmulti_attr_get(
-
struct vnode
*vp,
+
bhv_vnode_t
*vp,
char *name,
char __user *ubuf,
__uint32_t *len,
char *name,
char __user *ubuf,
__uint32_t *len,
@@
-505,7
+508,7
@@
xfs_attrmulti_attr_get(
if (!kbuf)
return ENOMEM;
if (!kbuf)
return ENOMEM;
-
VOP_ATTR_GET(vp, name, kbuf, len, flags, NULL, error
);
+
error = bhv_vop_attr_get(vp, name, kbuf, len, flags, NULL
);
if (error)
goto out_kfree;
if (error)
goto out_kfree;
@@
-519,7
+522,7
@@
xfs_attrmulti_attr_get(
STATIC int
xfs_attrmulti_attr_set(
STATIC int
xfs_attrmulti_attr_set(
-
struct vnode
*vp,
+
bhv_vnode_t
*vp,
char *name,
const char __user *ubuf,
__uint32_t len,
char *name,
const char __user *ubuf,
__uint32_t len,
@@
-542,7
+545,7
@@
xfs_attrmulti_attr_set(
if (copy_from_user(kbuf, ubuf, len))
goto out_kfree;
if (copy_from_user(kbuf, ubuf, len))
goto out_kfree;
-
VOP_ATTR_SET(vp, name, kbuf, len, flags, NULL, error
);
+
error = bhv_vop_attr_set(vp, name, kbuf, len, flags, NULL
);
out_kfree:
kfree(kbuf);
out_kfree:
kfree(kbuf);
@@
-551,20
+554,15
@@
xfs_attrmulti_attr_set(
STATIC int
xfs_attrmulti_attr_remove(
STATIC int
xfs_attrmulti_attr_remove(
-
struct vnode
*vp,
+
bhv_vnode_t
*vp,
char *name,
__uint32_t flags)
{
char *name,
__uint32_t flags)
{
- int error;
-
-
if (IS_RDONLY(&vp->v_inode))
return -EROFS;
if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode))
return EPERM;
if (IS_RDONLY(&vp->v_inode))
return -EROFS;
if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode))
return EPERM;
-
- VOP_ATTR_REMOVE(vp, name, flags, NULL, error);
- return error;
+ return bhv_vop_attr_remove(vp, name, flags, NULL);
}
STATIC int
}
STATIC int
@@
-578,7
+576,7
@@
xfs_attrmulti_by_handle(
xfs_attr_multiop_t *ops;
xfs_fsop_attrmulti_handlereq_t am_hreq;
struct inode *inode;
xfs_attr_multiop_t *ops;
xfs_fsop_attrmulti_handlereq_t am_hreq;
struct inode *inode;
-
vnode_t
*vp;
+
bhv_vnode_t
*vp;
unsigned int i, size;
char *attr_name;
unsigned int i, size;
char *attr_name;
@@
-658,7
+656,7
@@
xfs_attrmulti_by_handle(
STATIC int
xfs_ioc_space(
bhv_desc_t *bdp,
STATIC int
xfs_ioc_space(
bhv_desc_t *bdp,
-
vnode_t *vp
,
+
struct inode *inode
,
struct file *filp,
int flags,
unsigned int cmd,
struct file *filp,
int flags,
unsigned int cmd,
@@
-682,7
+680,7
@@
xfs_ioc_fsgeometry(
STATIC int
xfs_ioc_xattr(
STATIC int
xfs_ioc_xattr(
-
vnode_t
*vp,
+
bhv_vnode_t
*vp,
xfs_inode_t *ip,
struct file *filp,
unsigned int cmd,
xfs_inode_t *ip,
struct file *filp,
unsigned int cmd,
@@
-711,7
+709,7
@@
xfs_ioctl(
void __user *arg)
{
int error;
void __user *arg)
{
int error;
-
vnode_t
*vp;
+
bhv_vnode_t
*vp;
xfs_inode_t *ip;
xfs_mount_t *mp;
xfs_inode_t *ip;
xfs_mount_t *mp;
@@
-740,7
+738,7
@@
xfs_ioctl(
!capable(CAP_SYS_ADMIN))
return -EPERM;
!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;
case XFS_IOC_DIOINFO: {
struct dioattr da;
@@
-768,6
+766,8
@@
xfs_ioctl(
return xfs_ioc_fsgeometry(mp, arg);
case XFS_IOC_GETVERSION:
return xfs_ioc_fsgeometry(mp, arg);
case XFS_IOC_GETVERSION:
+ return put_user(inode->i_generation, (int __user *)arg);
+
case XFS_IOC_GETXFLAGS:
case XFS_IOC_SETXFLAGS:
case XFS_IOC_FSGETXATTR:
case XFS_IOC_GETXFLAGS:
case XFS_IOC_SETXFLAGS:
case XFS_IOC_FSGETXATTR:
@@
-962,7
+962,7
@@
xfs_ioctl(
STATIC int
xfs_ioc_space(
bhv_desc_t *bdp,
STATIC int
xfs_ioc_space(
bhv_desc_t *bdp,
-
vnode_t *vp
,
+
struct inode *inode
,
struct file *filp,
int ioflags,
unsigned int cmd,
struct file *filp,
int ioflags,
unsigned int cmd,
@@
-972,13
+972,13
@@
xfs_ioc_space(
int attr_flags = 0;
int error;
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);
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)))
return -XFS_ERROR(EINVAL);
if (copy_from_user(&bf, arg, sizeof(bf)))
@@
-1159,14
+1159,14
@@
xfs_di2lxflags(
STATIC int
xfs_ioc_xattr(
STATIC int
xfs_ioc_xattr(
-
vnode_t
*vp,
+
bhv_vnode_t
*vp,
xfs_inode_t *ip,
struct file *filp,
unsigned int cmd,
void __user *arg)
{
struct fsxattr fa;
xfs_inode_t *ip,
struct file *filp,
unsigned int cmd,
void __user *arg)
{
struct fsxattr fa;
- struct
vattr
*vattr;
+ struct
bhv_vattr
*vattr;
int error = 0;
int attr_flags;
unsigned int flags;
int error = 0;
int attr_flags;
unsigned int flags;
@@
-1179,7
+1179,7
@@
xfs_ioc_xattr(
case XFS_IOC_FSGETXATTR: {
vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
XFS_AT_NEXTENTS | XFS_AT_PROJID;
case XFS_IOC_FSGETXATTR: {
vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
XFS_AT_NEXTENTS | XFS_AT_PROJID;
-
VOP_GETATTR(vp, vattr, 0, NULL, error
);
+
error = bhv_vop_getattr(vp, vattr, 0, NULL
);
if (unlikely(error)) {
error = -error;
break;
if (unlikely(error)) {
error = -error;
break;
@@
-1212,7
+1212,7
@@
xfs_ioc_xattr(
vattr->va_extsize = fa.fsx_extsize;
vattr->va_projid = fa.fsx_projid;
vattr->va_extsize = fa.fsx_extsize;
vattr->va_projid = fa.fsx_projid;
-
VOP_SETATTR(vp, vattr, attr_flags, NULL, error
);
+
error = bhv_vop_setattr(vp, vattr, attr_flags, NULL
);
if (likely(!error))
__vn_revalidate(vp, vattr); /* update flags */
error = -error;
if (likely(!error))
__vn_revalidate(vp, vattr); /* update flags */
error = -error;
@@
-1222,7
+1222,7
@@
xfs_ioc_xattr(
case XFS_IOC_FSGETXATTRA: {
vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
XFS_AT_ANEXTENTS | XFS_AT_PROJID;
case XFS_IOC_FSGETXATTRA: {
vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
XFS_AT_ANEXTENTS | XFS_AT_PROJID;
-
VOP_GETATTR(vp, vattr, 0, NULL, error
);
+
error = bhv_vop_getattr(vp, vattr, 0, NULL
);
if (unlikely(error)) {
error = -error;
break;
if (unlikely(error)) {
error = -error;
break;
@@
-1268,20
+1268,13
@@
xfs_ioc_xattr(
vattr->va_xflags = xfs_merge_ioc_xflags(flags,
xfs_ip2xflags(ip));
vattr->va_xflags = xfs_merge_ioc_xflags(flags,
xfs_ip2xflags(ip));
-
VOP_SETATTR(vp, vattr, attr_flags, NULL, error
);
+
error = bhv_vop_setattr(vp, vattr, attr_flags, NULL
);
if (likely(!error))
__vn_revalidate(vp, vattr); /* update flags */
error = -error;
break;
}
if (likely(!error))
__vn_revalidate(vp, vattr); /* update flags */
error = -error;
break;
}
- case XFS_IOC_GETVERSION: {
- flags = vn_to_inode(vp)->i_generation;
- if (copy_to_user(arg, &flags, sizeof(flags)))
- error = -EFAULT;
- break;
- }
-
default:
error = -ENOTTY;
break;
default:
error = -ENOTTY;
break;