kill I_LOCK
[safe/jmp/linux-2.6] / fs / xfs / linux-2.6 / xfs_iops.c
index cdf7114..2259460 100644 (file)
@@ -47,6 +47,7 @@
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
 #include "xfs_vnodeops.h"
+#include "xfs_trace.h"
 
 #include <linux/capability.h>
 #include <linux/xattr.h>
@@ -475,14 +476,6 @@ xfs_vn_put_link(
 }
 
 STATIC int
-xfs_vn_permission(
-       struct inode            *inode,
-       int                     mask)
-{
-       return generic_permission(inode, mask, xfs_check_acl);
-}
-
-STATIC int
 xfs_vn_getattr(
        struct vfsmount         *mnt,
        struct dentry           *dentry,
@@ -581,8 +574,8 @@ xfs_vn_fallocate(
        bf.l_len = len;
 
        xfs_ilock(ip, XFS_IOLOCK_EXCL);
-       error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
-                                     0, XFS_ATTR_NOLOCK);
+       error = -xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
+                                      0, XFS_ATTR_NOLOCK);
        if (!error && !(mode & FALLOC_FL_KEEP_SIZE) &&
            offset + len > i_size_read(inode))
                new_size = offset + len;
@@ -593,7 +586,7 @@ xfs_vn_fallocate(
 
                iattr.ia_valid = ATTR_SIZE;
                iattr.ia_size = new_size;
-               error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
+               error = -xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
        }
 
        xfs_iunlock(ip, XFS_IOLOCK_EXCL);
@@ -684,7 +677,7 @@ xfs_vn_fiemap(
 }
 
 static const struct inode_operations xfs_inode_operations = {
-       .permission             = xfs_vn_permission,
+       .check_acl              = xfs_check_acl,
        .truncate               = xfs_vn_truncate,
        .getattr                = xfs_vn_getattr,
        .setattr                = xfs_vn_setattr,
@@ -712,7 +705,7 @@ static const struct inode_operations xfs_dir_inode_operations = {
        .rmdir                  = xfs_vn_unlink,
        .mknod                  = xfs_vn_mknod,
        .rename                 = xfs_vn_rename,
-       .permission             = xfs_vn_permission,
+       .check_acl              = xfs_check_acl,
        .getattr                = xfs_vn_getattr,
        .setattr                = xfs_vn_setattr,
        .setxattr               = generic_setxattr,
@@ -737,7 +730,7 @@ static const struct inode_operations xfs_dir_ci_inode_operations = {
        .rmdir                  = xfs_vn_unlink,
        .mknod                  = xfs_vn_mknod,
        .rename                 = xfs_vn_rename,
-       .permission             = xfs_vn_permission,
+       .check_acl              = xfs_check_acl,
        .getattr                = xfs_vn_getattr,
        .setattr                = xfs_vn_setattr,
        .setxattr               = generic_setxattr,
@@ -750,7 +743,7 @@ static const struct inode_operations xfs_symlink_inode_operations = {
        .readlink               = generic_readlink,
        .follow_link            = xfs_vn_follow_link,
        .put_link               = xfs_vn_put_link,
-       .permission             = xfs_vn_permission,
+       .check_acl              = xfs_check_acl,
        .getattr                = xfs_vn_getattr,
        .setattr                = xfs_vn_setattr,
        .setxattr               = generic_setxattr,
@@ -801,7 +794,7 @@ xfs_setup_inode(
        struct inode            *inode = &ip->i_vnode;
 
        inode->i_ino = ip->i_ino;
-       inode->i_state = I_NEW|I_LOCK;
+       inode->i_state = I_NEW;
        inode_add_to_lists(ip->i_mount->m_super, inode);
 
        inode->i_mode   = ip->i_d.di_mode;