Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Abhi Das and committed by
Bob Peterson
1f23bc78 588bff95

+5 -2
+5 -2
fs/gfs2/log.c
··· 538 538 list_sort(NULL, &sdp->sd_log_le_ordered, &ip_cmp); 539 539 while (!list_empty(&sdp->sd_log_le_ordered)) { 540 540 ip = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_inode, i_ordered); 541 - list_move(&ip->i_ordered, &written); 542 - if (ip->i_inode.i_mapping->nrpages == 0) 541 + 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 544 continue; 545 + } 546 + list_move(&ip->i_ordered, &written); 544 547 spin_unlock(&sdp->sd_ordered_lock); 545 548 filemap_fdatawrite(ip->i_inode.i_mapping); 546 549 spin_lock(&sdp->sd_ordered_lock);