Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38648
b: refs/heads/master
c: 55eccc6
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Apr 4, 2006
1 parent 9c14369 commit 907e318
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 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: 76467874b83835129dc454e3a7a8e5d1186101b0
refs/heads/master: 55eccc6d00cea224bf634d44e9871cfe83200ff2
4 changes: 0 additions & 4 deletions trunk/fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,8 @@ enum {

struct gfs2_file {
unsigned long f_flags; /* GFF_... */

struct mutex f_fl_mutex;
struct gfs2_holder f_fl_gh;

struct gfs2_inode *f_inode;
struct file *f_vfile;
};

struct gfs2_revoke {
Expand Down
22 changes: 13 additions & 9 deletions trunk/fs/gfs2/ops_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ static int gfs2_get_flags(struct inode *inode, u32 __user *ptr)
error = gfs2_glock_nq_m_atime(1, &gh);
if (error)
return error;

iflags = iflags_cvt(gfs2_to_iflags, ip->i_di.di_flags);
if (put_user(iflags, ptr))
error = -EFAULT;
Expand Down Expand Up @@ -600,20 +600,22 @@ static int gfs2_get_flags(struct inode *inode, u32 __user *ptr)
* @mask: Indicates which flags are valid
*
*/
static int do_gfs2_set_flags(struct inode *inode, u32 flags, u32 mask)
static int do_gfs2_set_flags(struct inode *inode, u32 reqflags, u32 mask)
{
struct gfs2_inode *ip = inode->u.generic_ip;
struct gfs2_sbd *sdp = ip->i_sbd;
struct buffer_head *bh;
struct gfs2_holder gh;
int error;
u32 new_flags;
u32 new_flags, flags;

gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
if (error)
return error;

new_flags = (ip->i_di.di_flags & ~mask) | (flags & mask);
flags = ip->i_di.di_flags;
new_flags = (flags & ~mask) | (reqflags & mask);
if ((new_flags ^ flags) == 0)
goto out;

Expand All @@ -640,13 +642,18 @@ static int do_gfs2_set_flags(struct inode *inode, u32 flags, u32 mask)
if (error)
goto out;

error = gfs2_meta_inode_buffer(ip, &bh);
error = gfs2_trans_begin(sdp, RES_DINODE, 0);
if (error)
goto out;
error = gfs2_meta_inode_buffer(ip, &bh);
if (error)
goto out_trans_end;
gfs2_trans_add_bh(ip->i_gl, bh, 1);
ip->i_di.di_flags = new_flags;
gfs2_dinode_out(&ip->i_di, bh->b_data);
brelse(bh);
out_trans_end:
gfs2_trans_end(sdp);
out:
gfs2_glock_dq_uninit(&gh);
return error;
Expand Down Expand Up @@ -730,9 +737,6 @@ static int gfs2_open(struct inode *inode, struct file *file)

mutex_init(&fp->f_fl_mutex);

fp->f_inode = ip;
fp->f_vfile = file;

gfs2_assert_warn(ip->i_sbd, !file->private_data);
file->private_data = fp;

Expand Down Expand Up @@ -875,7 +879,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl)
{
struct gfs2_file *fp = file->private_data;
struct gfs2_holder *fl_gh = &fp->f_fl_gh;
struct gfs2_inode *ip = fp->f_inode;
struct gfs2_inode *ip = file->f_dentry->d_inode->u.generic_ip;
struct gfs2_glock *gl;
unsigned int state;
int flags;
Expand Down

0 comments on commit 907e318

Please sign in to comment.