Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67649
b: refs/heads/master
c: 905d2ae
h: refs/heads/master
i:
  67647: ae00b6a
v: v3
  • Loading branch information
Bob Peterson authored and Steven Whitehouse committed Oct 10, 2007
1 parent d864dbd commit c0f6f9b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 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: 7b08fc620109c2f66575e9ae884f45c37933ea18
refs/heads/master: 905d2aefa9e06ebb995df96920d273a516fcd3f9
17 changes: 14 additions & 3 deletions trunk/fs/gfs2/lops.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static void buf_lo_before_commit(struct gfs2_sbd *sdp)
struct buffer_head *bh;
struct gfs2_log_descriptor *ld;
struct gfs2_bufdata *bd1 = NULL, *bd2;
unsigned int total = sdp->sd_log_num_buf;
unsigned int total;
unsigned int offset = BUF_OFFSET;
unsigned int limit;
unsigned int num;
Expand All @@ -127,12 +127,16 @@ static void buf_lo_before_commit(struct gfs2_sbd *sdp)
limit = buf_limit(sdp);
/* for 4k blocks, limit = 503 */

gfs2_log_lock(sdp);
total = sdp->sd_log_num_buf;
bd1 = bd2 = list_prepare_entry(bd1, &sdp->sd_log_le_buf, bd_le.le_list);
while(total) {
num = total;
if (total > limit)
num = limit;
gfs2_log_unlock(sdp);
bh = gfs2_log_get_buf(sdp);
gfs2_log_lock(sdp);
ld = (struct gfs2_log_descriptor *)bh->b_data;
ptr = (__be64 *)(bh->b_data + offset);
ld->ld_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
Expand All @@ -152,21 +156,27 @@ static void buf_lo_before_commit(struct gfs2_sbd *sdp)
break;
}

gfs2_log_unlock(sdp);
set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh);
gfs2_log_lock(sdp);

n = 0;
list_for_each_entry_continue(bd2, &sdp->sd_log_le_buf,
bd_le.le_list) {
gfs2_log_unlock(sdp);
bh = gfs2_log_fake_buf(sdp, bd2->bd_bh);
set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh);
gfs2_log_lock(sdp);
if (++n >= num)
break;
}

BUG_ON(total < num);
total -= num;
}
gfs2_log_unlock(sdp);
}

static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
Expand Down Expand Up @@ -524,7 +534,7 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
struct gfs2_log_descriptor *ld;
unsigned int limit;
unsigned int total_dbuf;
unsigned int total_jdata = sdp->sd_log_num_jdata;
unsigned int total_jdata;
unsigned int num, n;
__be64 *ptr = NULL;

Expand All @@ -536,6 +546,7 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
*/
gfs2_log_lock(sdp);
total_dbuf = sdp->sd_log_num_databuf;
total_jdata = sdp->sd_log_num_jdata;
bd2 = bd1 = list_prepare_entry(bd1, &sdp->sd_log_le_databuf,
bd_le.le_list);
while(total_dbuf) {
Expand Down Expand Up @@ -621,10 +632,10 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp)
}
gfs2_log_unlock(sdp);
if (bh) {
set_buffer_mapped(bh);
set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh);
bh = NULL;
ptr = NULL;
}
n = 0;
gfs2_log_lock(sdp);
Expand Down

0 comments on commit c0f6f9b

Please sign in to comment.