Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / fs / xfs / linux-2.6 / xfs_ioctl.c
index 1d6ff3d..4bbd092 100644 (file)
@@ -23,7 +23,6 @@
 #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"
@@ -31,7 +30,6 @@
 #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"
@@ -78,7 +76,7 @@ xfs_find_handle(
        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);
@@ -192,7 +190,7 @@ xfs_vget_fsop_handlereq(
        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;
@@ -202,7 +200,7 @@ xfs_vget_fsop_handlereq(
        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;
@@ -277,7 +275,7 @@ xfs_open_by_handle(
        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))
@@ -362,7 +360,7 @@ xfs_readlink_by_handle(
        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))
@@ -393,9 +391,11 @@ xfs_readlink_by_handle(
        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);
+       if (error)
+               return -error;
+
        return (olen - auio.uio_resid);
 }
 
@@ -411,7 +411,7 @@ xfs_fssetdm_by_handle(
        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);
@@ -452,7 +452,7 @@ xfs_attrlist_by_handle(
        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))
@@ -472,8 +472,8 @@ xfs_attrlist_by_handle(
                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;
 
@@ -490,7 +490,7 @@ xfs_attrlist_by_handle(
 
 STATIC int
 xfs_attrmulti_attr_get(
-       struct vnode            *vp,
+       bhv_vnode_t             *vp,
        char                    *name,
        char                    __user *ubuf,
        __uint32_t              *len,
@@ -505,7 +505,7 @@ xfs_attrmulti_attr_get(
        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;
 
@@ -519,7 +519,7 @@ xfs_attrmulti_attr_get(
 
 STATIC int
 xfs_attrmulti_attr_set(
-       struct vnode            *vp,
+       bhv_vnode_t             *vp,
        char                    *name,
        const char              __user *ubuf,
        __uint32_t              len,
@@ -542,7 +542,7 @@ xfs_attrmulti_attr_set(
        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);
@@ -551,20 +551,15 @@ xfs_attrmulti_attr_set(
 
 STATIC int
 xfs_attrmulti_attr_remove(
-       struct vnode            *vp,
+       bhv_vnode_t             *vp,
        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;
-
-       VOP_ATTR_REMOVE(vp, name, flags, NULL, error);
-       return error;
+       return bhv_vop_attr_remove(vp, name, flags, NULL);
 }
 
 STATIC int
@@ -578,7 +573,7 @@ xfs_attrmulti_by_handle(
        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;
 
@@ -658,7 +653,7 @@ xfs_attrmulti_by_handle(
 STATIC int
 xfs_ioc_space(
        bhv_desc_t              *bdp,
-       vnode_t                 *vp,
+       bhv_vnode_t             *vp,
        struct file             *filp,
        int                     flags,
        unsigned int            cmd,
@@ -682,7 +677,7 @@ xfs_ioc_fsgeometry(
 
 STATIC int
 xfs_ioc_xattr(
-       vnode_t                 *vp,
+       bhv_vnode_t             *vp,
        xfs_inode_t             *ip,
        struct file             *filp,
        unsigned int            cmd,
@@ -711,7 +706,7 @@ xfs_ioctl(
        void                    __user *arg)
 {
        int                     error;
-       vnode_t                 *vp;
+       bhv_vnode_t             *vp;
        xfs_inode_t             *ip;
        xfs_mount_t             *mp;
 
@@ -962,7 +957,7 @@ xfs_ioctl(
 STATIC int
 xfs_ioc_space(
        bhv_desc_t              *bdp,
-       vnode_t                 *vp,
+       bhv_vnode_t             *vp,
        struct file             *filp,
        int                     ioflags,
        unsigned int            cmd,
@@ -1159,14 +1154,14 @@ xfs_di2lxflags(
 
 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;
-       struct vattr            *vattr;
+       struct bhv_vattr        *vattr;
        int                     error = 0;
        int                     attr_flags;
        unsigned int            flags;
@@ -1179,7 +1174,7 @@ xfs_ioc_xattr(
        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;
@@ -1212,7 +1207,7 @@ xfs_ioc_xattr(
                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;
@@ -1222,7 +1217,7 @@ xfs_ioc_xattr(
        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;
@@ -1268,7 +1263,7 @@ xfs_ioc_xattr(
                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;