imx: exit functions can/should be void
[safe/jmp/linux-2.6] / fs / gfs2 / acl.c
index 3908992..fa881bd 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/posix_acl.h>
 #include <linux/posix_acl_xattr.h>
 #include <linux/gfs2_ondisk.h>
-#include <linux/lm_interface.h>
 
 #include "gfs2.h"
 #include "incore.h"
@@ -74,7 +73,7 @@ int gfs2_acl_validate_remove(struct gfs2_inode *ip, int access)
 {
        if (!GFS2_SB(&ip->i_inode)->sd_args.ar_posix_acl)
                return -EOPNOTSUPP;
-       if (current->fsuid != ip->i_inode.i_uid && !capable(CAP_FOWNER))
+       if (!is_owner_or_cap(&ip->i_inode))
                return -EPERM;
        if (S_ISLNK(ip->i_inode.i_mode))
                return -EOPNOTSUPP;
@@ -91,7 +90,7 @@ static int acl_get(struct gfs2_inode *ip, int access, struct posix_acl **acl,
        struct gfs2_ea_location el_this;
        int error;
 
-       if (!ip->i_di.di_eattr)
+       if (!ip->i_eattr)
                return 0;
 
        memset(&er, 0, sizeof(struct gfs2_ea_request));
@@ -116,7 +115,7 @@ static int acl_get(struct gfs2_inode *ip, int access, struct posix_acl **acl,
                goto out;
 
        er.er_data_len = GFS2_EA_DATA_LEN(el->el_ea);
-       er.er_data = kmalloc(er.er_data_len, GFP_KERNEL);
+       er.er_data = kmalloc(er.er_data_len, GFP_NOFS);
        error = -ENOMEM;
        if (!er.er_data)
                goto out;
@@ -145,14 +144,14 @@ out:
 }
 
 /**
- * gfs2_check_acl_locked - Check an ACL to see if we're allowed to do something
+ * gfs2_check_acl - Check an ACL to see if we're allowed to do something
  * @inode: the file we want to do something to
  * @mask: what we want to do
  *
  * Returns: errno
  */
 
-int gfs2_check_acl_locked(struct inode *inode, int mask)
+int gfs2_check_acl(struct inode *inode, int mask)
 {
        struct posix_acl *acl = NULL;
        int error;
@@ -170,21 +169,6 @@ int gfs2_check_acl_locked(struct inode *inode, int mask)
        return -EAGAIN;
 }
 
-int gfs2_check_acl(struct inode *inode, int mask)
-{
-       struct gfs2_inode *ip = GFS2_I(inode);
-       struct gfs2_holder i_gh;
-       int error;
-
-       error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
-       if (!error) {
-               error = gfs2_check_acl_locked(inode, mask);
-               gfs2_glock_dq_uninit(&i_gh);
-       }
-
-       return error;
-}
-
 static int munge_mode(struct gfs2_inode *ip, mode_t mode)
 {
        struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
@@ -231,13 +215,13 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip)
        if (error)
                return error;
        if (!acl) {
-               mode &= ~current->fs->umask;
+               mode &= ~current_umask();
                if (mode != ip->i_inode.i_mode)
                        error = munge_mode(ip, mode);
                return error;
        }
 
-       clone = posix_acl_clone(acl, GFP_KERNEL);
+       clone = posix_acl_clone(acl, GFP_NOFS);
        error = -ENOMEM;
        if (!clone)
                goto out;
@@ -287,7 +271,7 @@ int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr)
        if (!acl)
                return gfs2_setattr_simple(ip, attr);
 
-       clone = posix_acl_clone(acl, GFP_KERNEL);
+       clone = posix_acl_clone(acl, GFP_NOFS);
        error = -ENOMEM;
        if (!clone)
                goto out;