Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169183
b: refs/heads/master
c: 69dca42
h: refs/heads/master
i:
  169181: 62e7cdb
  169179: 2d6c64a
  169175: 4ad1e56
  169167: 41e53aa
  169151: 45e5d50
v: v3
  • Loading branch information
Steven Whitehouse committed Dec 3, 2009
1 parent dceab0a commit beba2d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c65f7fb5342ecb8cb85e9b676327b3a43a5a4735
refs/heads/master: 69dca42464962d8d0989b7e09877ba644c9cba66
46 changes: 11 additions & 35 deletions trunk/fs/gfs2/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,29 +104,20 @@ int gfs2_check_acl(struct inode *inode, int mask)
return -EAGAIN;
}

static int munge_mode(struct gfs2_inode *ip, mode_t mode)
static int gfs2_set_mode(struct inode *inode, mode_t mode)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct buffer_head *dibh;
int error;
int error = 0;

error = gfs2_trans_begin(sdp, RES_DINODE, 0);
if (error)
return error;
if (mode != inode->i_mode) {
struct iattr iattr;

error = gfs2_meta_inode_buffer(ip, &dibh);
if (!error) {
gfs2_assert_withdraw(sdp,
(ip->i_inode.i_mode & S_IFMT) == (mode & S_IFMT));
ip->i_inode.i_mode = mode;
gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(ip, dibh->b_data);
brelse(dibh);
}
iattr.ia_valid = ATTR_MODE;
iattr.ia_mode = mode;

gfs2_trans_end(sdp);
error = gfs2_setattr_simple(GFS2_I(inode), &iattr);
}

return 0;
return error;
}

int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip)
Expand All @@ -151,7 +142,7 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip)
if (!acl) {
mode &= ~current_umask();
if (mode != ip->i_inode.i_mode)
error = munge_mode(ip, mode);
error = gfs2_set_mode(&ip->i_inode, mode);
return error;
}

Expand Down Expand Up @@ -181,7 +172,7 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip)
if (error)
goto out;
munge:
error = munge_mode(ip, mode);
error = gfs2_set_mode(&ip->i_inode, mode);
out:
posix_acl_release(acl);
kfree(data);
Expand Down Expand Up @@ -244,21 +235,6 @@ static int gfs2_xattr_system_get(struct inode *inode, const char *name,
return gfs2_xattr_get(inode, GFS2_EATYPE_SYS, name, buffer, size);
}

static int gfs2_set_mode(struct inode *inode, mode_t mode)
{
int error = 0;

if (mode != inode->i_mode) {
struct iattr iattr;

iattr.ia_valid = ATTR_MODE;
iattr.ia_mode = mode;

error = gfs2_setattr_simple(GFS2_I(inode), &iattr);
}

return error;
}

static int gfs2_xattr_system_set(struct inode *inode, const char *name,
const void *value, size_t size, int flags)
Expand Down

0 comments on commit beba2d1

Please sign in to comment.