diff options
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/lops.c | 14 | ||||
-rw-r--r-- | fs/gfs2/trans.c | 8 |
2 files changed, 10 insertions, 12 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 01e444b5b2bd..9ceccb1595a3 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -393,12 +393,10 @@ static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) | |||
393 | struct gfs2_meta_header *mh; | 393 | struct gfs2_meta_header *mh; |
394 | struct gfs2_trans *tr; | 394 | struct gfs2_trans *tr; |
395 | 395 | ||
396 | lock_buffer(bd->bd_bh); | ||
397 | gfs2_log_lock(sdp); | ||
398 | tr = current->journal_info; | 396 | tr = current->journal_info; |
399 | tr->tr_touched = 1; | 397 | tr->tr_touched = 1; |
400 | if (!list_empty(&bd->bd_list)) | 398 | if (!list_empty(&bd->bd_list)) |
401 | goto out; | 399 | return; |
402 | set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); | 400 | set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); |
403 | set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); | 401 | set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); |
404 | mh = (struct gfs2_meta_header *)bd->bd_bh->b_data; | 402 | mh = (struct gfs2_meta_header *)bd->bd_bh->b_data; |
@@ -414,9 +412,6 @@ static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) | |||
414 | sdp->sd_log_num_buf++; | 412 | sdp->sd_log_num_buf++; |
415 | list_add(&bd->bd_list, &sdp->sd_log_le_buf); | 413 | list_add(&bd->bd_list, &sdp->sd_log_le_buf); |
416 | tr->tr_num_buf_new++; | 414 | tr->tr_num_buf_new++; |
417 | out: | ||
418 | gfs2_log_unlock(sdp); | ||
419 | unlock_buffer(bd->bd_bh); | ||
420 | } | 415 | } |
421 | 416 | ||
422 | static void gfs2_check_magic(struct buffer_head *bh) | 417 | static void gfs2_check_magic(struct buffer_head *bh) |
@@ -775,12 +770,10 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) | |||
775 | struct address_space *mapping = bd->bd_bh->b_page->mapping; | 770 | struct address_space *mapping = bd->bd_bh->b_page->mapping; |
776 | struct gfs2_inode *ip = GFS2_I(mapping->host); | 771 | struct gfs2_inode *ip = GFS2_I(mapping->host); |
777 | 772 | ||
778 | lock_buffer(bd->bd_bh); | ||
779 | gfs2_log_lock(sdp); | ||
780 | if (tr) | 773 | if (tr) |
781 | tr->tr_touched = 1; | 774 | tr->tr_touched = 1; |
782 | if (!list_empty(&bd->bd_list)) | 775 | if (!list_empty(&bd->bd_list)) |
783 | goto out; | 776 | return; |
784 | set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); | 777 | set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); |
785 | set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); | 778 | set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); |
786 | if (gfs2_is_jdata(ip)) { | 779 | if (gfs2_is_jdata(ip)) { |
@@ -791,9 +784,6 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) | |||
791 | } else { | 784 | } else { |
792 | list_add_tail(&bd->bd_list, &sdp->sd_log_le_ordered); | 785 | list_add_tail(&bd->bd_list, &sdp->sd_log_le_ordered); |
793 | } | 786 | } |
794 | out: | ||
795 | gfs2_log_unlock(sdp); | ||
796 | unlock_buffer(bd->bd_bh); | ||
797 | } | 787 | } |
798 | 788 | ||
799 | /** | 789 | /** |
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index adbd27875ef9..413627072f36 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c | |||
@@ -155,14 +155,22 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta) | |||
155 | struct gfs2_sbd *sdp = gl->gl_sbd; | 155 | struct gfs2_sbd *sdp = gl->gl_sbd; |
156 | struct gfs2_bufdata *bd; | 156 | struct gfs2_bufdata *bd; |
157 | 157 | ||
158 | lock_buffer(bh); | ||
159 | gfs2_log_lock(sdp); | ||
158 | bd = bh->b_private; | 160 | bd = bh->b_private; |
159 | if (bd) | 161 | if (bd) |
160 | gfs2_assert(sdp, bd->bd_gl == gl); | 162 | gfs2_assert(sdp, bd->bd_gl == gl); |
161 | else { | 163 | else { |
164 | gfs2_log_unlock(sdp); | ||
165 | unlock_buffer(bh); | ||
162 | gfs2_attach_bufdata(gl, bh, meta); | 166 | gfs2_attach_bufdata(gl, bh, meta); |
163 | bd = bh->b_private; | 167 | bd = bh->b_private; |
168 | lock_buffer(bh); | ||
169 | gfs2_log_lock(sdp); | ||
164 | } | 170 | } |
165 | lops_add(sdp, bd); | 171 | lops_add(sdp, bd); |
172 | gfs2_log_unlock(sdp); | ||
173 | unlock_buffer(bh); | ||
166 | } | 174 | } |
167 | 175 | ||
168 | void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) | 176 | void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) |