[GFS2] Change argument of gfs2_dinode_out
[deliverable/linux.git] / fs / gfs2 / acl.c
index e9d05fe9435728c0a8a3075a94ebbc9c325e86ce..906e403b054fd590eb044434ee00e0708fb44df0 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2005 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU General Public License v.2.
+ * of the GNU General Public License version 2.
  */
 
 #include <linux/sched.h>
 #include <linux/buffer_head.h>
 #include <linux/posix_acl.h>
 #include <linux/posix_acl_xattr.h>
-#include <asm/semaphore.h>
 #include <linux/gfs2_ondisk.h>
+#include <linux/lm_interface.h>
 
 #include "gfs2.h"
-#include "lm_interface.h"
 #include "incore.h"
 #include "acl.h"
 #include "eaops.h"
@@ -66,15 +65,14 @@ int gfs2_acl_validate_set(struct gfs2_inode *ip, int access,
                        error = 0;
        }
 
- out:
+out:
        posix_acl_release(acl);
-
        return error;
 }
 
 int gfs2_acl_validate_remove(struct gfs2_inode *ip, int access)
 {
-       if (!ip->i_sbd->sd_args.ar_posix_acl)
+       if (!GFS2_SB(&ip->i_inode)->sd_args.ar_posix_acl)
                return -EOPNOTSUPP;
        if (current->fsuid != ip->i_di.di_uid && !capable(CAP_FOWNER))
                return -EPERM;
@@ -133,18 +131,16 @@ static int acl_get(struct gfs2_inode *ip, int access, struct posix_acl **acl,
                        error = PTR_ERR(*acl);
        }
 
- out_kfree:
+out_kfree:
        if (error || !data)
                kfree(er.er_data);
        else {
                *data = er.er_data;
                *len = er.er_data_len;
        }
-
- out:
+out:
        if (error || el == &el_this)
                brelse(el->el_bh);
-
        return error;
 }
 
@@ -161,7 +157,7 @@ int gfs2_check_acl_locked(struct inode *inode, int mask)
        struct posix_acl *acl = NULL;
        int error;
 
-       error = acl_get(inode->u.generic_ip, ACL_ACCESS, &acl, NULL, NULL, NULL);
+       error = acl_get(GFS2_I(inode), ACL_ACCESS, &acl, NULL, NULL, NULL);
        if (error)
                return error;
 
@@ -176,24 +172,22 @@ int gfs2_check_acl_locked(struct inode *inode, int mask)
 
 int gfs2_check_acl(struct inode *inode, int mask)
 {
-       struct gfs2_inode *ip = inode->u.generic_ip;
+       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);
+       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 = ip->i_sbd;
+       struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
        struct buffer_head *dibh;
        int error;
 
@@ -207,7 +201,7 @@ static int munge_mode(struct gfs2_inode *ip, mode_t mode)
                                (ip->i_di.di_mode & S_IFMT) == (mode & S_IFMT));
                ip->i_di.di_mode = mode;
                gfs2_trans_add_bh(ip->i_gl, dibh, 1);
-               gfs2_dinode_out(&ip->i_di, dibh->b_data);
+               gfs2_dinode_out(ip, dibh->b_data);
                brelse(dibh);
        }
 
@@ -218,7 +212,7 @@ static int munge_mode(struct gfs2_inode *ip, mode_t mode)
 
 int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip)
 {
-       struct gfs2_sbd *sdp = dip->i_sbd;
+       struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
        struct posix_acl *acl = NULL, *clone;
        struct gfs2_ea_request er;
        mode_t mode = ip->i_di.di_mode;
@@ -273,7 +267,7 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip)
        } else
                munge_mode(ip, mode);
 
- out:
+out:
        posix_acl_release(acl);
        kfree(er.er_data);
        return error;
@@ -306,11 +300,10 @@ int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr)
                error = gfs2_ea_acl_chmod(ip, &el, attr, data);
        }
 
- out:
+out:
        posix_acl_release(acl);
        brelse(el.el_bh);
        kfree(data);
-
        return error;
 }
 
This page took 0.027026 seconds and 5 git commands to generate.