10 #include <linux/sched.h>
11 #include <linux/slab.h>
15 #include <linux/xattr.h>
30 static const char *gfs2_acl_name(
int type)
52 acl = get_cached_acl(&ip->
i_inode, type);
56 name = gfs2_acl_name(type);
75 if (mode != inode->
i_mode) {
77 mark_inode_dirty(inode);
83 static int gfs2_acl_set(
struct inode *inode,
int type,
struct posix_acl *acl)
88 const char *
name = gfs2_acl_name(type);
102 set_cached_acl(inode, type, acl);
115 if (!sdp->
sd_args.ar_posix_acl)
125 return gfs2_set_mode(inode, mode);
145 error = gfs2_set_mode(inode, mode);
147 posix_acl_release(acl);
153 struct inode *inode = &ip->
i_inode;
180 posix_acl_release(acl);
184 static int gfs2_acl_type(
const char *name)
193 static int gfs2_xattr_system_get(
struct dentry *
dentry,
const char *name,
196 struct inode *inode = dentry->
d_inode;
197 struct gfs2_sbd *sdp = GFS2_SB(inode);
202 if (!sdp->
sd_args.ar_posix_acl)
205 type = gfs2_acl_type(name);
216 posix_acl_release(acl);
221 static int gfs2_xattr_system_set(
struct dentry *dentry,
const char *name,
225 struct inode *inode = dentry->
d_inode;
226 struct gfs2_sbd *sdp = GFS2_SB(inode);
230 if (!sdp->
sd_args.ar_posix_acl)
233 type = gfs2_acl_type(name);
239 return value ? -
EACCES : 0;
257 error = PTR_ERR(acl);
274 posix_acl_release(acl);
281 error = gfs2_set_mode(inode, mode);
290 set_cached_acl(inode, type, acl);
292 forget_cached_acl(inode, type);
295 posix_acl_release(acl);
303 .get = gfs2_xattr_system_get,
304 .set = gfs2_xattr_system_set,