Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752100AbdI0UOi (ORCPT ); Wed, 27 Sep 2017 16:14:38 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:49888 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbdI0UOb (ORCPT ); Wed, 27 Sep 2017 16:14:31 -0400 X-Google-Smtp-Source: AOwi7QA3j4O7CWUgyx2Mka64KkbfYKcADUTMku3LhGiYS74E3SY76CYLceRblNEinSgWD3vsj347hg== From: Jens Axboe To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: hannes@cmpxchg.org, jack@suse.cz, torvalds@linux-foundation.org, Jens Axboe Subject: [PATCH 12/12] writeback: kill off ->range_cycle option Date: Wed, 27 Sep 2017 14:13:59 -0600 Message-Id: <1506543239-31470-13-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506543239-31470-1-git-send-email-axboe@kernel.dk> References: <1506543239-31470-1-git-send-email-axboe@kernel.dk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 21273 Lines: 645 All types of writeback are now range cyclic. Kill off the member from struct wb_writeback_work and struct writeback_control. Remove the various checks for whether or not this is range cyclic writeback or not in the writeback code and file systems. For tracing, we leave the member there, and just always set it to 1. Signed-off-by: Jens Axboe --- drivers/staging/lustre/lustre/llite/rw.c | 25 +++++++------------------ fs/afs/write.c | 25 ++++++------------------- fs/btrfs/extent_io.c | 31 +++++++------------------------ fs/ceph/addr.c | 26 ++++++++------------------ fs/cifs/file.c | 20 +++++--------------- fs/ext4/inode.c | 26 ++++++++++---------------- fs/f2fs/data.c | 26 ++++++++------------------ fs/fs-writeback.c | 12 ++---------- fs/gfs2/aops.c | 27 ++++++++------------------- include/linux/writeback.h | 1 - include/trace/events/btrfs.h | 2 +- include/trace/events/ext4.h | 2 +- include/trace/events/f2fs.h | 2 +- include/trace/events/writeback.h | 4 ++-- mm/page-writeback.c | 27 ++++++++------------------- 15 files changed, 74 insertions(+), 182 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index e72090572bcc..d5960dd20405 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -1002,18 +1002,8 @@ int ll_writepages(struct address_space *mapping, struct writeback_control *wbc) int result; int ignore_layout = 0; - if (wbc->range_cyclic) { - start = mapping->writeback_index << PAGE_SHIFT; - end = OBD_OBJECT_EOF; - } else { - start = wbc->range_start; - end = wbc->range_end; - if (end == LLONG_MAX) { - end = OBD_OBJECT_EOF; - range_whole = start == 0; - } - } - + start = mapping->writeback_index << PAGE_SHIFT; + end = OBD_OBJECT_EOF; mode = CL_FSYNC_NONE; if (wbc->sync_mode == WB_SYNC_ALL) mode = CL_FSYNC_LOCAL; @@ -1034,12 +1024,11 @@ int ll_writepages(struct address_space *mapping, struct writeback_control *wbc) result = 0; } - if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) { - if (end == OBD_OBJECT_EOF) - mapping->writeback_index = 0; - else - mapping->writeback_index = (end >> PAGE_SHIFT) + 1; - } + if (end == OBD_OBJECT_EOF) + mapping->writeback_index = 0; + else + mapping->writeback_index = (end >> PAGE_SHIFT) + 1; + return result; } diff --git a/fs/afs/write.c b/fs/afs/write.c index 106e43db1115..2e21c197173f 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -570,24 +570,12 @@ int afs_writepages(struct address_space *mapping, _enter(""); - if (wbc->range_cyclic) { - start = mapping->writeback_index; - end = -1; - ret = afs_writepages_region(mapping, wbc, start, end, &next); - if (start > 0 && wbc->nr_to_write > 0 && ret == 0) - ret = afs_writepages_region(mapping, wbc, 0, start, - &next); - mapping->writeback_index = next; - } else if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) { - end = (pgoff_t)(LLONG_MAX >> PAGE_SHIFT); - ret = afs_writepages_region(mapping, wbc, 0, end, &next); - if (wbc->nr_to_write > 0) - mapping->writeback_index = next; - } else { - start = wbc->range_start >> PAGE_SHIFT; - end = wbc->range_end >> PAGE_SHIFT; - ret = afs_writepages_region(mapping, wbc, start, end, &next); - } + start = mapping->writeback_index; + end = -1; + ret = afs_writepages_region(mapping, wbc, start, end, &next); + if (start > 0 && wbc->nr_to_write > 0 && ret == 0) + ret = afs_writepages_region(mapping, wbc, 0, start, &next); + mapping->writeback_index = next; _leave(" = %d", ret); return ret; @@ -685,7 +673,6 @@ int afs_writeback_all(struct afs_vnode *vnode) struct writeback_control wbc = { .sync_mode = WB_SYNC_ALL, .nr_to_write = LONG_MAX, - .range_cyclic = 1, }; int ret; diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 3e5bb0cdd3cd..5c3bd7d50435 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3803,14 +3803,8 @@ int btree_write_cache_pages(struct address_space *mapping, int tag; pagevec_init(&pvec, 0); - if (wbc->range_cyclic) { - index = mapping->writeback_index; /* Start from prev offset */ - end = -1; - } else { - index = wbc->range_start >> PAGE_SHIFT; - end = wbc->range_end >> PAGE_SHIFT; - scanned = 1; - } + index = mapping->writeback_index; /* Start from prev offset */ + end = -1; if (wbc->sync_mode == WB_SYNC_ALL) tag = PAGECACHE_TAG_TOWRITE; else @@ -3830,7 +3824,7 @@ int btree_write_cache_pages(struct address_space *mapping, if (!PagePrivate(page)) continue; - if (!wbc->range_cyclic && page->index > end) { + if (page->index > end) { done = 1; break; } @@ -3930,7 +3924,6 @@ static int extent_write_cache_pages(struct address_space *mapping, pgoff_t index; pgoff_t end; /* Inclusive */ pgoff_t done_index; - int range_whole = 0; int scanned = 0; int tag; @@ -3947,16 +3940,8 @@ static int extent_write_cache_pages(struct address_space *mapping, return 0; pagevec_init(&pvec, 0); - if (wbc->range_cyclic) { - index = mapping->writeback_index; /* Start from prev offset */ - end = -1; - } else { - index = wbc->range_start >> PAGE_SHIFT; - end = wbc->range_end >> PAGE_SHIFT; - if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) - range_whole = 1; - scanned = 1; - } + index = mapping->writeback_index; /* Start from prev offset */ + end = -1; if (wbc->sync_mode == WB_SYNC_ALL) tag = PAGECACHE_TAG_TOWRITE; else @@ -3992,7 +3977,7 @@ static int extent_write_cache_pages(struct address_space *mapping, continue; } - if (!wbc->range_cyclic && page->index > end) { + if (page->index > end) { done = 1; unlock_page(page); continue; @@ -4051,9 +4036,7 @@ static int extent_write_cache_pages(struct address_space *mapping, goto retry; } - if (wbc->range_cyclic || (wbc->nr_to_write > 0 && range_whole)) - mapping->writeback_index = done_index; - + mapping->writeback_index = done_index; btrfs_add_delayed_iput(inode); return ret; } diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index b3e3edc09d80..5aa5a901c448 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -791,7 +791,7 @@ static int ceph_writepages_start(struct address_space *mapping, unsigned int wsize = i_blocksize(inode); struct ceph_osd_request *req = NULL; struct ceph_writeback_ctl ceph_wbc; - bool should_loop, range_whole = false; + bool should_loop; bool stop, done = false; dout("writepages_start %p (mode=%s)\n", inode, @@ -812,7 +812,7 @@ static int ceph_writepages_start(struct address_space *mapping, pagevec_init(&pvec, 0); - start_index = wbc->range_cyclic ? mapping->writeback_index : 0; + start_index = mapping->writeback_index; index = start_index; retry: @@ -830,19 +830,11 @@ static int ceph_writepages_start(struct address_space *mapping, should_loop = false; if (ceph_wbc.head_snapc && snapc != last_snapc) { /* where to start/end? */ - if (wbc->range_cyclic) { - index = start_index; - end = -1; - if (index > 0) - should_loop = true; - dout(" cyclic, start at %lu\n", index); - } else { - index = wbc->range_start >> PAGE_SHIFT; - end = wbc->range_end >> PAGE_SHIFT; - if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) - range_whole = true; - dout(" not cyclic, %lu to %lu\n", index, end); - } + index = start_index; + end = -1; + if (index > 0) + should_loop = true; + dout(" cyclic, start at %lu\n", index); } else if (!ceph_wbc.head_snapc) { /* Do not respect wbc->range_{start,end}. Dirty pages * in that range can be associated with newer snapc. @@ -1194,9 +1186,7 @@ static int ceph_writepages_start(struct address_space *mapping, goto retry; } - if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) - mapping->writeback_index = index; - + mapping->writeback_index = index; out: ceph_osdc_put_request(req); ceph_put_snap_context(last_snapc); diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 92fdf9c35de2..98498afc3f87 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2021,7 +2021,7 @@ wdata_prepare_pages(struct cifs_writedata *wdata, unsigned int found_pages, break; } - if (!wbc->range_cyclic && page->index > end) { + if (page->index > end) { *done = true; unlock_page(page); break; @@ -2112,7 +2112,7 @@ static int cifs_writepages(struct address_space *mapping, { struct cifs_sb_info *cifs_sb = CIFS_SB(mapping->host->i_sb); struct TCP_Server_Info *server; - bool done = false, scanned = false, range_whole = false; + bool done = false, scanned = false; pgoff_t end, index; struct cifs_writedata *wdata; int rc = 0; @@ -2124,16 +2124,8 @@ static int cifs_writepages(struct address_space *mapping, if (cifs_sb->wsize < PAGE_SIZE) return generic_writepages(mapping, wbc); - if (wbc->range_cyclic) { - index = mapping->writeback_index; /* Start from prev offset */ - end = -1; - } else { - index = wbc->range_start >> PAGE_SHIFT; - end = wbc->range_end >> PAGE_SHIFT; - if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) - range_whole = true; - scanned = true; - } + index = mapping->writeback_index; /* Start from prev offset */ + end = -1; server = cifs_sb_master_tcon(cifs_sb)->ses->server; retry: while (!done && index <= end) { @@ -2214,9 +2206,7 @@ static int cifs_writepages(struct address_space *mapping, goto retry; } - if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) - mapping->writeback_index = index; - + mapping->writeback_index = index; return rc; } diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 31db875bc7a1..f33f700b110c 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2792,16 +2792,11 @@ static int ext4_writepages(struct address_space *mapping, if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) range_whole = 1; - if (wbc->range_cyclic) { - writeback_index = mapping->writeback_index; - if (writeback_index) - cycled = 0; - mpd.first_page = writeback_index; - mpd.last_page = -1; - } else { - mpd.first_page = wbc->range_start >> PAGE_SHIFT; - mpd.last_page = wbc->range_end >> PAGE_SHIFT; - } + writeback_index = mapping->writeback_index; + if (writeback_index) + cycled = 0; + mpd.first_page = writeback_index; + mpd.last_page = -1; mpd.inode = inode; mpd.wbc = wbc; @@ -2940,12 +2935,11 @@ static int ext4_writepages(struct address_space *mapping, } /* Update index */ - if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) - /* - * Set the writeback_index so that range_cyclic - * mode will write it back later - */ - mapping->writeback_index = mpd.first_page; + /* + * Set the writeback_index so that range_cyclic + * mode will write it back later + */ + mapping->writeback_index = mpd.first_page; out_writepages: trace_ext4_writepages_result(inode, wbc, ret, diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 36b535207c88..05edac5fdf2e 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1632,7 +1632,6 @@ static int f2fs_write_cache_pages(struct address_space *mapping, pgoff_t done_index; pgoff_t last_idx = ULONG_MAX; int cycled; - int range_whole = 0; int tag; pagevec_init(&pvec, 0); @@ -1643,21 +1642,13 @@ static int f2fs_write_cache_pages(struct address_space *mapping, else clear_inode_flag(mapping->host, FI_HOT_DATA); - if (wbc->range_cyclic) { - writeback_index = mapping->writeback_index; /* prev offset */ - index = writeback_index; - if (index == 0) - cycled = 1; - else - cycled = 0; - end = -1; - } else { - index = wbc->range_start >> PAGE_SHIFT; - end = wbc->range_end >> PAGE_SHIFT; - if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) - range_whole = 1; - cycled = 1; /* ignore range_cyclic tests */ - } + writeback_index = mapping->writeback_index; /* prev offset */ + index = writeback_index; + if (index == 0) + cycled = 1; + else + cycled = 0; + end = -1; if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages) tag = PAGECACHE_TAG_TOWRITE; else @@ -1755,8 +1746,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping, end = writeback_index - 1; goto retry; } - if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) - mapping->writeback_index = done_index; + mapping->writeback_index = done_index; if (last_idx != ULONG_MAX) f2fs_submit_merged_write_cond(F2FS_M_SB(mapping), mapping->host, diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 686d510e618c..65bbc627addf 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -49,7 +49,6 @@ struct wb_writeback_work { enum writeback_sync_modes sync_mode; unsigned int tagged_writepages:1; unsigned int for_kupdate:1; - unsigned int range_cyclic:1; unsigned int for_background:1; unsigned int for_sync:1; /* sync(2) WB_SYNC_ALL writeback */ unsigned int auto_free:1; /* free on completion */ @@ -945,8 +944,7 @@ static unsigned long get_nr_dirty_pages(void) get_nr_dirty_inodes(); } -static void wb_start_writeback(struct bdi_writeback *wb, bool range_cyclic, - enum wb_reason reason) +static void wb_start_writeback(struct bdi_writeback *wb, enum wb_reason reason) { struct wb_writeback_work *work; @@ -982,7 +980,6 @@ static void wb_start_writeback(struct bdi_writeback *wb, bool range_cyclic, work->sync_mode = WB_SYNC_NONE; work->nr_pages = wb_split_bdi_pages(wb, get_nr_dirty_pages()); - work->range_cyclic = range_cyclic; work->reason = reason; work->auto_free = 1; work->start_all = 1; @@ -1526,7 +1523,6 @@ static long writeback_sb_inodes(struct super_block *sb, .for_kupdate = work->for_kupdate, .for_background = work->for_background, .for_sync = work->for_sync, - .range_cyclic = work->range_cyclic, .range_start = 0, .range_end = LLONG_MAX, }; @@ -1698,7 +1694,6 @@ static long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, struct wb_writeback_work work = { .nr_pages = nr_pages, .sync_mode = WB_SYNC_NONE, - .range_cyclic = 1, .reason = reason, }; struct blk_plug plug; @@ -1858,7 +1853,6 @@ static long wb_check_background_flush(struct bdi_writeback *wb) .nr_pages = LONG_MAX, .sync_mode = WB_SYNC_NONE, .for_background = 1, - .range_cyclic = 1, .reason = WB_REASON_BACKGROUND, }; @@ -1892,7 +1886,6 @@ static long wb_check_old_data_flush(struct bdi_writeback *wb) .nr_pages = nr_pages, .sync_mode = WB_SYNC_NONE, .for_kupdate = 1, - .range_cyclic = 1, .reason = WB_REASON_PERIODIC, }; @@ -1984,7 +1977,7 @@ static void __wakeup_flusher_threads_bdi(struct backing_dev_info *bdi, return; list_for_each_entry_rcu(wb, &bdi->wb_list, bdi_node) - wb_start_writeback(wb, true, reason); + wb_start_writeback(wb, reason); } void wakeup_flusher_threads_bdi(struct backing_dev_info *bdi, @@ -2428,7 +2421,6 @@ void sync_inodes_sb(struct super_block *sb) .sb = sb, .sync_mode = WB_SYNC_ALL, .nr_pages = LONG_MAX, - .range_cyclic = 1, .done = &done, .reason = WB_REASON_SYNC, .for_sync = 1, diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 68ed06962537..4e9d86dd7413 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -384,25 +384,16 @@ static int gfs2_write_cache_jdata(struct address_space *mapping, pgoff_t end; pgoff_t done_index; int cycled; - int range_whole = 0; int tag; pagevec_init(&pvec, 0); - if (wbc->range_cyclic) { - writeback_index = mapping->writeback_index; /* prev offset */ - index = writeback_index; - if (index == 0) - cycled = 1; - else - cycled = 0; - end = -1; - } else { - index = wbc->range_start >> PAGE_SHIFT; - end = wbc->range_end >> PAGE_SHIFT; - if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) - range_whole = 1; - cycled = 1; /* ignore range_cyclic tests */ - } + writeback_index = mapping->writeback_index; /* prev offset */ + index = writeback_index; + if (index == 0) + cycled = 1; + else + cycled = 0; + end = -1; if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages) tag = PAGECACHE_TAG_TOWRITE; else @@ -439,9 +430,7 @@ static int gfs2_write_cache_jdata(struct address_space *mapping, goto retry; } - if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) - mapping->writeback_index = done_index; - + mapping->writeback_index = done_index; return ret; } diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 9c0091678af4..52319fbf300f 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -87,7 +87,6 @@ struct writeback_control { unsigned for_background:1; /* A background writeback */ unsigned tagged_writepages:1; /* tag-and-write to avoid livelock */ unsigned for_reclaim:1; /* Invoked from the page allocator */ - unsigned range_cyclic:1; /* range_start is cyclic */ unsigned for_sync:1; /* sync(2) WB_SYNC_ALL writeback */ #ifdef CONFIG_CGROUP_WRITEBACK struct bdi_writeback *wb; /* wb this writeback is issued under */ diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index dc1d0df91e0b..734349288fec 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -502,7 +502,7 @@ DECLARE_EVENT_CLASS(btrfs__writepage, __entry->range_end = wbc->range_end; __entry->for_kupdate = wbc->for_kupdate; __entry->for_reclaim = wbc->for_reclaim; - __entry->range_cyclic = wbc->range_cyclic; + __entry->range_cyclic = 1; __entry->writeback_index = inode->i_mapping->writeback_index; __entry->root_objectid = BTRFS_I(inode)->root->root_key.objectid; diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 9c3bc3883d2f..e1de610895f1 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h @@ -394,7 +394,7 @@ TRACE_EVENT(ext4_writepages, __entry->writeback_index = inode->i_mapping->writeback_index; __entry->sync_mode = wbc->sync_mode; __entry->for_kupdate = wbc->for_kupdate; - __entry->range_cyclic = wbc->range_cyclic; + __entry->range_cyclic = 1; ), TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld " diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 5d216f7fb05a..e291e4717bf7 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -1174,7 +1174,7 @@ TRACE_EVENT(f2fs_writepages, __entry->for_background = wbc->for_background; __entry->tagged_writepages = wbc->tagged_writepages; __entry->for_reclaim = wbc->for_reclaim; - __entry->range_cyclic = wbc->range_cyclic; + __entry->range_cyclic = 1; __entry->for_sync = wbc->for_sync; ), diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 9b57f014d79d..22e40e54943f 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h @@ -225,7 +225,7 @@ DECLARE_EVENT_CLASS(writeback_work_class, __entry->sb_dev = work->sb ? work->sb->s_dev : 0; __entry->sync_mode = work->sync_mode; __entry->for_kupdate = work->for_kupdate; - __entry->range_cyclic = work->range_cyclic; + __entry->range_cyclic = 1; __entry->for_background = work->for_background; __entry->reason = work->reason; __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); @@ -328,7 +328,7 @@ DECLARE_EVENT_CLASS(wbc_class, __entry->for_kupdate = wbc->for_kupdate; __entry->for_background = wbc->for_background; __entry->for_reclaim = wbc->for_reclaim; - __entry->range_cyclic = wbc->range_cyclic; + __entry->range_cyclic = 1; __entry->range_start = (long)wbc->range_start; __entry->range_end = (long)wbc->range_end; __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc); diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 8d1fc593bce8..507c18eb33fa 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2149,25 +2149,16 @@ int write_cache_pages(struct address_space *mapping, pgoff_t end; /* Inclusive */ pgoff_t done_index; int cycled; - int range_whole = 0; int tag; pagevec_init(&pvec, 0); - if (wbc->range_cyclic) { - writeback_index = mapping->writeback_index; /* prev offset */ - index = writeback_index; - if (index == 0) - cycled = 1; - else - cycled = 0; - end = -1; - } else { - index = wbc->range_start >> PAGE_SHIFT; - end = wbc->range_end >> PAGE_SHIFT; - if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) - range_whole = 1; - cycled = 1; /* ignore range_cyclic tests */ - } + writeback_index = mapping->writeback_index; /* prev offset */ + index = writeback_index; + if (index == 0) + cycled = 1; + else + cycled = 0; + end = -1; if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages) tag = PAGECACHE_TAG_TOWRITE; else @@ -2285,9 +2276,7 @@ int write_cache_pages(struct address_space *mapping, end = writeback_index - 1; goto retry; } - if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) - mapping->writeback_index = done_index; - + mapping->writeback_index = done_index; return ret; } EXPORT_SYMBOL(write_cache_pages); -- 2.7.4