]> err.no Git - linux-2.6/blobdiff - fs/nfs/nfs3acl.c
drm: merge in Linus mainline
[linux-2.6] / fs / nfs / nfs3acl.c
index 451112ff9aa47cda581abb6f4c028a5ca4379f77..6a5bbc0ae941aa690e1f73137cbce4af38902092 100644 (file)
@@ -2,7 +2,7 @@
 #include <linux/nfs.h>
 #include <linux/nfs3.h>
 #include <linux/nfs_fs.h>
-#include <linux/xattr_acl.h>
+#include <linux/posix_acl_xattr.h>
 #include <linux/nfsacl.h>
 
 #define NFSDBG_FACILITY        NFSDBG_PROC
@@ -53,9 +53,9 @@ ssize_t nfs3_getxattr(struct dentry *dentry, const char *name,
        struct posix_acl *acl;
        int type, error = 0;
 
-       if (strcmp(name, XATTR_NAME_ACL_ACCESS) == 0)
+       if (strcmp(name, POSIX_ACL_XATTR_ACCESS) == 0)
                type = ACL_TYPE_ACCESS;
-       else if (strcmp(name, XATTR_NAME_ACL_DEFAULT) == 0)
+       else if (strcmp(name, POSIX_ACL_XATTR_DEFAULT) == 0)
                type = ACL_TYPE_DEFAULT;
        else
                return -EOPNOTSUPP;
@@ -82,9 +82,9 @@ int nfs3_setxattr(struct dentry *dentry, const char *name,
        struct posix_acl *acl;
        int type, error;
 
-       if (strcmp(name, XATTR_NAME_ACL_ACCESS) == 0)
+       if (strcmp(name, POSIX_ACL_XATTR_ACCESS) == 0)
                type = ACL_TYPE_ACCESS;
-       else if (strcmp(name, XATTR_NAME_ACL_DEFAULT) == 0)
+       else if (strcmp(name, POSIX_ACL_XATTR_DEFAULT) == 0)
                type = ACL_TYPE_DEFAULT;
        else
                return -EOPNOTSUPP;
@@ -103,9 +103,9 @@ int nfs3_removexattr(struct dentry *dentry, const char *name)
        struct inode *inode = dentry->d_inode;
        int type;
 
-       if (strcmp(name, XATTR_NAME_ACL_ACCESS) == 0)
+       if (strcmp(name, POSIX_ACL_XATTR_ACCESS) == 0)
                type = ACL_TYPE_ACCESS;
-       else if (strcmp(name, XATTR_NAME_ACL_DEFAULT) == 0)
+       else if (strcmp(name, POSIX_ACL_XATTR_DEFAULT) == 0)
                type = ACL_TYPE_DEFAULT;
        else
                return -EOPNOTSUPP;
@@ -115,11 +115,11 @@ int nfs3_removexattr(struct dentry *dentry, const char *name)
 
 static void __nfs3_forget_cached_acls(struct nfs_inode *nfsi)
 {
-       if (nfsi->acl_access != ERR_PTR(-EAGAIN)) {
+       if (!IS_ERR(nfsi->acl_access)) {
                posix_acl_release(nfsi->acl_access);
                nfsi->acl_access = ERR_PTR(-EAGAIN);
        }
-       if (nfsi->acl_default != ERR_PTR(-EAGAIN)) {
+       if (!IS_ERR(nfsi->acl_default)) {
                posix_acl_release(nfsi->acl_default);
                nfsi->acl_default = ERR_PTR(-EAGAIN);
        }
@@ -137,7 +137,7 @@ void nfs3_forget_cached_acls(struct inode *inode)
 static struct posix_acl *nfs3_get_cached_acl(struct inode *inode, int type)
 {
        struct nfs_inode *nfsi = NFS_I(inode);
-       struct posix_acl *acl = ERR_PTR(-EAGAIN);
+       struct posix_acl *acl = ERR_PTR(-EINVAL);
 
        spin_lock(&inode->i_lock);
        switch(type) {
@@ -150,12 +150,13 @@ static struct posix_acl *nfs3_get_cached_acl(struct inode *inode, int type)
                        break;
 
                default:
-                       return ERR_PTR(-EINVAL);
+                       goto out;
        }
-       if (acl == ERR_PTR(-EAGAIN))
+       if (IS_ERR(acl))
                acl = ERR_PTR(-EAGAIN);
        else
                acl = posix_acl_dup(acl);
+out:
        spin_unlock(&inode->i_lock);
        dprintk("NFS: nfs3_get_cached_acl(%s/%ld, %d) = %p\n", inode->i_sb->s_id,
                inode->i_ino, type, acl);
@@ -307,7 +308,9 @@ static int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
        nfs_begin_data_update(inode);
        status = rpc_call(server->client_acl, ACLPROC3_SETACL,
                          &args, &fattr, 0);
-       NFS_FLAGS(inode) |= NFS_INO_INVALID_ACCESS;
+       spin_lock(&inode->i_lock);
+       NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ACCESS;
+       spin_unlock(&inode->i_lock);
        nfs_end_data_update(inode);
        dprintk("NFS reply setacl: %d\n", status);