Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43277
b: refs/heads/master
c: 6b124d8
h: refs/heads/master
i:
  43275: 15125ca
v: v3
  • Loading branch information
Steven Whitehouse committed Nov 30, 2006
1 parent e6249eb commit 59bdb0f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 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: 2ca99501fa5422e84f18333918a503433449e2b5
refs/heads/master: 6b124d8dba1f46c5f2caf3b3159bbe627f75b9b6
11 changes: 1 addition & 10 deletions trunk/fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ void gfs2_inode_attr_in(struct gfs2_inode *ip)
i_size_write(inode, di->di_size);
inode->i_blocks = di->di_blocks <<
(GFS2_SB(inode)->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT);

if (di->di_flags & GFS2_DIF_IMMUTABLE)
inode->i_flags |= S_IMMUTABLE;
else
inode->i_flags &= ~S_IMMUTABLE;

if (di->di_flags & GFS2_DIF_APPENDONLY)
inode->i_flags |= S_APPEND;
else
inode->i_flags &= ~S_APPEND;
}

static int iget_test(struct inode *inode, void *opaque)
Expand Down Expand Up @@ -210,6 +200,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
di->di_generation = be64_to_cpu(str->di_generation);

di->di_flags = be32_to_cpu(str->di_flags);
gfs2_set_inode_flags(&ip->i_inode);
di->di_height = be16_to_cpu(str->di_height);

di->di_depth = be16_to_cpu(str->di_depth);
Expand Down
19 changes: 19 additions & 0 deletions trunk/fs/gfs2/ops_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,24 @@ static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
return error;
}

void gfs2_set_inode_flags(struct inode *inode)
{
struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_dinode_host *di = &ip->i_di;
unsigned int flags = inode->i_flags;

flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC);
if (di->di_flags & GFS2_DIF_IMMUTABLE)
flags |= S_IMMUTABLE;
if (di->di_flags & GFS2_DIF_APPENDONLY)
flags |= S_APPEND;
if (di->di_flags & GFS2_DIF_NOATIME)
flags |= S_NOATIME;
if (di->di_flags & GFS2_DIF_SYNC)
flags |= S_SYNC;
inode->i_flags = flags;
}

/* Flags that can be set by user space */
#define GFS2_FLAGS_USER_SET (GFS2_DIF_JDATA| \
GFS2_DIF_DIRECTIO| \
Expand Down Expand Up @@ -338,6 +356,7 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
ip->i_di.di_flags = new_flags;
gfs2_dinode_out(ip, bh->b_data);
brelse(bh);
gfs2_set_inode_flags(inode);
out_trans_end:
gfs2_trans_end(sdp);
out:
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/ops_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern struct file gfs2_internal_file_sentinel;
extern int gfs2_internal_read(struct gfs2_inode *ip,
struct file_ra_state *ra_state,
char *buf, loff_t *pos, unsigned size);

extern void gfs2_set_inode_flags(struct inode *inode);
extern const struct file_operations gfs2_file_fops;
extern const struct file_operations gfs2_dir_fops;

Expand Down

0 comments on commit 59bdb0f

Please sign in to comment.