Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247945
b: refs/heads/master
c: 26b06a6
h: refs/heads/master
i:
  247943: 8d93e55
v: v3
  • Loading branch information
Steven Whitehouse committed May 21, 2011
1 parent b802db4 commit f8e4147
Show file tree
Hide file tree
Showing 2 changed files with 27 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: 6d3117b41295150d4ac70622055dd8f5529d86b2
refs/heads/master: 26b06a6958df0f12f1a654db8598433eb89cc024
29 changes: 26 additions & 3 deletions trunk/fs/gfs2/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,27 @@ static int gfs2_ail1_empty(struct gfs2_sbd *sdp)
return ret;
}

static void gfs2_ail1_wait(struct gfs2_sbd *sdp)
{
struct gfs2_ail *ai;
struct gfs2_bufdata *bd;
struct buffer_head *bh;

spin_lock(&sdp->sd_ail_lock);
list_for_each_entry_reverse(ai, &sdp->sd_ail1_list, ai_list) {
list_for_each_entry(bd, &ai->ai_ail1_list, bd_ail_st_list) {
bh = bd->bd_bh;
if (!buffer_locked(bh))
continue;
get_bh(bh);
spin_unlock(&sdp->sd_ail_lock);
wait_on_buffer(bh);
brelse(bh);
return;
}
}
spin_unlock(&sdp->sd_ail_lock);
}

/**
* gfs2_ail2_empty_one - Check whether or not a trans in the AIL has been synced
Expand Down Expand Up @@ -878,9 +899,9 @@ void gfs2_meta_syncfs(struct gfs2_sbd *sdp)
gfs2_log_flush(sdp, NULL);
for (;;) {
gfs2_ail1_start(sdp);
gfs2_ail1_wait(sdp);
if (gfs2_ail1_empty(sdp))
break;
msleep(10);
}
}

Expand Down Expand Up @@ -920,12 +941,14 @@ int gfs2_logd(void *data)

if (gfs2_ail_flush_reqd(sdp)) {
gfs2_ail1_start(sdp);
io_schedule();
gfs2_ail1_wait(sdp);
gfs2_ail1_empty(sdp);
gfs2_log_flush(sdp, NULL);
}

wake_up(&sdp->sd_log_waitq);
if (!gfs2_ail_flush_reqd(sdp))
wake_up(&sdp->sd_log_waitq);

t = gfs2_tune_get(sdp, gt_logd_secs) * HZ;
if (freezing(current))
refrigerator();
Expand Down

0 comments on commit f8e4147

Please sign in to comment.