aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/meta_io.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2009-04-07 09:13:01 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2009-05-11 07:36:41 -0400
commitc969f58ca43fc403c75f5d3da4cf1e21de7afaa0 (patch)
treed38b579882f89c222937530c527224e2a77548b0 /fs/gfs2/meta_io.c
parenta4d7749be5de4a7261bcbe3c7d96c748792ec455 (diff)
GFS2: Update the rw flags
After Jens recent updates: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a1f242524c3c1f5d40f1c9c343427e34d1aadd6e et al. this is a patch to bring gfs2 uptodate with the core code. Also I've managed to squash another call to ll_rw_block() along the way. There is still one part of the GFS2 I/O paths which are not correctly annotated and that is due to the sharing of the writeback code between the data and metadata address spaces. I would like to change that too, but this patch is still worth doing on its own, I think. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/meta_io.c')
-rw-r--r--fs/gfs2/meta_io.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index 8d6f13256b26..75b2aec06f85 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -201,16 +201,32 @@ struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno)
201int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, 201int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
202 struct buffer_head **bhp) 202 struct buffer_head **bhp)
203{ 203{
204 *bhp = gfs2_getbuf(gl, blkno, CREATE); 204 struct gfs2_sbd *sdp = gl->gl_sbd;
205 if (!buffer_uptodate(*bhp)) { 205 struct buffer_head *bh;
206 ll_rw_block(READ_META, 1, bhp); 206
207 if (flags & DIO_WAIT) { 207 if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
208 int error = gfs2_meta_wait(gl->gl_sbd, *bhp); 208 return -EIO;
209 if (error) { 209
210 brelse(*bhp); 210 *bhp = bh = gfs2_getbuf(gl, blkno, CREATE);
211 return error; 211
212 } 212 lock_buffer(bh);
213 } 213 if (buffer_uptodate(bh)) {
214 unlock_buffer(bh);
215 return 0;
216 }
217 bh->b_end_io = end_buffer_read_sync;
218 get_bh(bh);
219 submit_bh(READ_SYNC | (1 << BIO_RW_META), bh);
220 if (!(flags & DIO_WAIT))
221 return 0;
222
223 wait_on_buffer(bh);
224 if (unlikely(!buffer_uptodate(bh))) {
225 struct gfs2_trans *tr = current->journal_info;
226 if (tr && tr->tr_touched)
227 gfs2_io_error_bh(sdp, bh);
228 brelse(bh);
229 return -EIO;
214 } 230 }
215 231
216 return 0; 232 return 0;
@@ -404,7 +420,7 @@ struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen)
404 if (buffer_uptodate(first_bh)) 420 if (buffer_uptodate(first_bh))
405 goto out; 421 goto out;
406 if (!buffer_locked(first_bh)) 422 if (!buffer_locked(first_bh))
407 ll_rw_block(READ_META, 1, &first_bh); 423 ll_rw_block(READ_SYNC | (1 << BIO_RW_META), 1, &first_bh);
408 424
409 dblock++; 425 dblock++;
410 extlen--; 426 extlen--;