Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43276
b: refs/heads/master
c: 2ca9950
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Nov 30, 2006
1 parent 15125ca commit e6249eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 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: c594d8866460a2710c436839d79f334a0714a2a7
refs/heads/master: 2ca99501fa5422e84f18333918a503433449e2b5
1 change: 0 additions & 1 deletion trunk/fs/gfs2/glock.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#define GL_ATIME 0x00000200
#define GL_NOCACHE 0x00000400
#define GL_NOCANCEL 0x00001000
#define GL_AOP 0x00004000

#define GLR_TRYFAILED 13
#define GLR_CANCELED 14
Expand Down
13 changes: 9 additions & 4 deletions trunk/fs/gfs2/ops_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static int gfs2_readpage(struct file *file, struct page *page)
/* gfs2_sharewrite_nopage has grabbed the ip->i_gl already */
goto skip_lock;
}
gfs2_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME|GL_AOP, &gh);
gfs2_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME|LM_FLAG_TRY_1CB, &gh);
do_unlock = 1;
error = gfs2_glock_nq_m_atime(1, &gh);
if (unlikely(error))
Expand All @@ -254,6 +254,8 @@ static int gfs2_readpage(struct file *file, struct page *page)
out:
return error;
out_unlock:
if (error == GLR_TRYFAILED)
error = AOP_TRUNCATED_PAGE;
unlock_page(page);
if (do_unlock)
gfs2_holder_uninit(&gh);
Expand Down Expand Up @@ -293,7 +295,7 @@ static int gfs2_readpages(struct file *file, struct address_space *mapping,
goto skip_lock;
}
gfs2_holder_init(ip->i_gl, LM_ST_SHARED,
LM_FLAG_TRY_1CB|GL_ATIME|GL_AOP, &gh);
LM_FLAG_TRY_1CB|GL_ATIME, &gh);
do_unlock = 1;
ret = gfs2_glock_nq_m_atime(1, &gh);
if (ret == GLR_TRYFAILED)
Expand Down Expand Up @@ -366,10 +368,13 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
unsigned int write_len = to - from;


gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_ATIME|GL_AOP, &ip->i_gh);
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_ATIME|LM_FLAG_TRY_1CB, &ip->i_gh);
error = gfs2_glock_nq_m_atime(1, &ip->i_gh);
if (error)
if (unlikely(error)) {
if (error == GLR_TRYFAILED)
error = AOP_TRUNCATED_PAGE;
goto out_uninit;
}

gfs2_write_calc_reserv(ip, write_len, &data_blocks, &ind_blocks);

Expand Down

0 comments on commit e6249eb

Please sign in to comment.