Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43280
b: refs/heads/master
c: 7020933
h: refs/heads/master
v: v3
  • Loading branch information
Russell Cattelan authored and Steven Whitehouse committed Nov 30, 2006
1 parent 36ca3ca commit 7a6a20f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 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: 9e2dbdac3df300516ffdd9a8631f23164d068a50
refs/heads/master: 7020933156ac2a8a7386314933e49948bf0438f7
36 changes: 21 additions & 15 deletions trunk/fs/gfs2/lops.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
{
LIST_HEAD(started);
struct gfs2_bufdata *bd1 = NULL, *bd2, *bdt;
struct buffer_head *bh = NULL;
struct buffer_head *bh = NULL,*bh1 = NULL;
unsigned int offset = sizeof(struct gfs2_log_descriptor);
struct gfs2_log_descriptor *ld;
unsigned int limit;
Expand Down Expand Up @@ -537,8 +537,13 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
list_for_each_entry_safe_continue(bd1, bdt,
&sdp->sd_log_le_databuf,
bd_le.le_list) {
/* store off the buffer head in a local ptr since
* gfs2_bufdata might change when we drop the log lock
*/
bh1 = bd1->bd_bh;

/* An ordered write buffer */
if (bd1->bd_bh && !buffer_pinned(bd1->bd_bh)) {
if (bh1 && !buffer_pinned(bh1)) {
list_move(&bd1->bd_le.le_list, &started);
if (bd1 == bd2) {
bd2 = NULL;
Expand All @@ -547,20 +552,21 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
bd_le.le_list);
}
total_dbuf--;
if (bd1->bd_bh) {
get_bh(bd1->bd_bh);
if (buffer_dirty(bd1->bd_bh)) {
if (bh1) {
if (buffer_dirty(bh1)) {
get_bh(bh1);

gfs2_log_unlock(sdp);
wait_on_buffer(bd1->bd_bh);
ll_rw_block(WRITE, 1,
&bd1->bd_bh);

ll_rw_block(SWRITE, 1, &bh1);
brelse(bh1);

gfs2_log_lock(sdp);
}
brelse(bd1->bd_bh);
continue;
}
continue;
} else if (bd1->bd_bh) { /* A journaled buffer */
} else if (bh1) { /* A journaled buffer */
int magic;
gfs2_log_unlock(sdp);
if (!bh) {
Expand All @@ -582,16 +588,16 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
ld->ld_data2 = cpu_to_be32(0);
memset(ld->ld_reserved, 0, sizeof(ld->ld_reserved));
}
magic = gfs2_check_magic(bd1->bd_bh);
*ptr++ = cpu_to_be64(bd1->bd_bh->b_blocknr);
magic = gfs2_check_magic(bh1);
*ptr++ = cpu_to_be64(bh1->b_blocknr);
*ptr++ = cpu_to_be64((__u64)magic);
clear_buffer_escaped(bd1->bd_bh);
clear_buffer_escaped(bh1);
if (unlikely(magic != 0))
set_buffer_escaped(bd1->bd_bh);
set_buffer_escaped(bh1);
gfs2_log_lock(sdp);
if (n++ > num)
break;
} else if (!bd1->bd_bh) {
} else if (!bh1) {
total_dbuf--;
sdp->sd_log_num_databuf--;
list_del_init(&bd1->bd_le.le_list);
Expand Down

0 comments on commit 7a6a20f

Please sign in to comment.