diff options
author | Abhi Das <adas@redhat.com> | 2017-12-22 08:55:31 -0500 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2017-12-22 08:55:31 -0500 |
commit | 1f23bc7869fffec40b8bd9333a74a18d1de54d98 (patch) | |
tree | dba105610679c53136d97e19600629b763206b16 | |
parent | 588bff95c94efc05f9e1a0b19015c9408ed7c0ef (diff) |
gfs2: Trim the ordered write list in gfs2_ordered_write()
We iterate through the entire ordered writes list in
gfs2_ordered_write() to write out inodes. It's a good
place to try and shrink the list by throwing out inodes
that don't have any pages.
Signed-off-by: Abhi Das <adas@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
-rw-r--r-- | fs/gfs2/log.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 27e97d3de1e0..b9889ae5fd7c 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c | |||
@@ -538,9 +538,12 @@ static void gfs2_ordered_write(struct gfs2_sbd *sdp) | |||
538 | list_sort(NULL, &sdp->sd_log_le_ordered, &ip_cmp); | 538 | list_sort(NULL, &sdp->sd_log_le_ordered, &ip_cmp); |
539 | while (!list_empty(&sdp->sd_log_le_ordered)) { | 539 | while (!list_empty(&sdp->sd_log_le_ordered)) { |
540 | ip = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_inode, i_ordered); | 540 | ip = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_inode, i_ordered); |
541 | list_move(&ip->i_ordered, &written); | 541 | if (ip->i_inode.i_mapping->nrpages == 0) { |
542 | if (ip->i_inode.i_mapping->nrpages == 0) | 542 | test_and_clear_bit(GIF_ORDERED, &ip->i_flags); |
543 | list_del(&ip->i_ordered); | ||
543 | continue; | 544 | continue; |
545 | } | ||
546 | list_move(&ip->i_ordered, &written); | ||
544 | spin_unlock(&sdp->sd_ordered_lock); | 547 | spin_unlock(&sdp->sd_ordered_lock); |
545 | filemap_fdatawrite(ip->i_inode.i_mapping); | 548 | filemap_fdatawrite(ip->i_inode.i_mapping); |
546 | spin_lock(&sdp->sd_ordered_lock); | 549 | spin_lock(&sdp->sd_ordered_lock); |