diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-04-18 14:18:09 +0100 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-04-20 09:01:37 +0100 |
commit | 4667a0ec32867865fd4deccf834594b3ea831baf (patch) | |
tree | bff74fb13700e4087972fce94e45fd69dae7939b /fs/gfs2/super.c | |
parent | f42ab0852946c1fb5103682c5897eb3da908e4b0 (diff) | |
download | linux-4667a0ec32867865fd4deccf834594b3ea831baf.tar.bz2 |
GFS2: Make writeback more responsive to system conditions
This patch adds writeback_control to writing back the AIL
list. This means that we can then take advantage of the
information we get in ->write_inode() in order to set off
some pre-emptive writeback.
In addition, the AIL code is cleaned up a bit to make it
a bit simpler to understand.
There is still more which can usefully be done in this area,
but this is a good start at least.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r-- | fs/gfs2/super.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 215c37bfc2a4..58fe3a4ac829 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -23,6 +23,7 @@ #include <linux/time.h> #include <linux/wait.h> #include <linux/writeback.h> +#include <linux/backing-dev.h> #include "gfs2.h" #include "incore.h" @@ -714,6 +715,7 @@ static int gfs2_write_inode(struct inode *inode, struct writeback_control *wbc) struct gfs2_inode *ip = GFS2_I(inode); struct gfs2_sbd *sdp = GFS2_SB(inode); struct address_space *metamapping = gfs2_glock2aspace(ip->i_gl); + struct backing_dev_info *bdi = metamapping->backing_dev_info; struct gfs2_holder gh; struct buffer_head *bh; struct timespec atime; @@ -747,6 +749,8 @@ do_flush: if (wbc->sync_mode == WB_SYNC_ALL) gfs2_log_flush(GFS2_SB(inode), ip->i_gl); filemap_fdatawrite(metamapping); + if (bdi->dirty_exceeded) + gfs2_ail1_flush(sdp, wbc); if (!ret && (wbc->sync_mode == WB_SYNC_ALL)) ret = filemap_fdatawait(metamapping); if (ret) @@ -1366,7 +1370,8 @@ static int gfs2_dinode_dealloc(struct gfs2_inode *ip) if (error) goto out_rindex_relse; - error = gfs2_trans_begin(sdp, RES_RG_BIT + RES_STATFS + RES_QUOTA, 1); + error = gfs2_trans_begin(sdp, RES_RG_BIT + RES_STATFS + RES_QUOTA, + sdp->sd_jdesc->jd_blocks); if (error) goto out_rg_gunlock; |