aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_address.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2007-09-17 05:59:52 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2007-10-10 03:56:24 -0400
commit16615be18cadf53ee6f8a4f0bdd647f0753421b1 (patch)
tree670c75e931e6d606211f338ee5e8b1d603c96521 /fs/gfs2/ops_address.c
parent55c0c4ac0be144014651b19e77c9b77f367955de (diff)
[GFS2] Clean up journaled data writing
This patch cleans up the code for writing journaled data into the log. It also removes the need to allocate a small "tag" structure for each block written into the log. Instead we just keep count of the outstanding I/O so that we can be sure that its all been written at the correct time. Another result of this patch is that a number of ll_rw_block() calls have become submit_bh() calls, closing some races at the same time. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_address.c')
-rw-r--r--fs/gfs2/ops_address.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index dd1ea491ddcb..b7baf1831912 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -414,7 +414,8 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
414 if (ind_blocks || data_blocks) 414 if (ind_blocks || data_blocks)
415 rblocks += RES_STATFS + RES_QUOTA; 415 rblocks += RES_STATFS + RES_QUOTA;
416 416
417 error = gfs2_trans_begin(sdp, rblocks, 0); 417 error = gfs2_trans_begin(sdp, rblocks,
418 PAGE_CACHE_SIZE/sdp->sd_sb.sb_bsize);
418 if (error) 419 if (error)
419 goto out_trans_fail; 420 goto out_trans_fail;
420 421
@@ -625,10 +626,10 @@ static void gfs2_discard(struct gfs2_sbd *sdp, struct buffer_head *bh)
625 clear_buffer_dirty(bh); 626 clear_buffer_dirty(bh);
626 bd = bh->b_private; 627 bd = bh->b_private;
627 if (bd) { 628 if (bd) {
628 if (!list_empty(&bd->bd_le.le_list)) { 629 if (!list_empty(&bd->bd_le.le_list) && !buffer_pinned(bh))
629 if (!buffer_pinned(bh)) 630 list_del_init(&bd->bd_le.le_list);
630 list_del_init(&bd->bd_le.le_list); 631 else
631 } 632 gfs2_remove_from_journal(bh, current->journal_info, 0);
632 } 633 }
633 bh->b_bdev = NULL; 634 bh->b_bdev = NULL;
634 clear_buffer_mapped(bh); 635 clear_buffer_mapped(bh);