Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218890
b: refs/heads/master
c: 72f84e6
h: refs/heads/master
v: v3
  • Loading branch information
Eric Sandeen authored and Theodore Ts'o committed Oct 28, 2010
1 parent ee17f50 commit fa49755
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 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: 5b41d92437f1ae19b3f3ffa3b16589fd5df50ac0
refs/heads/master: 72f84e6560d18d60a091df27edf81409be6641cb
14 changes: 9 additions & 5 deletions trunk/fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2800,12 +2800,13 @@ static int ext4_da_writepages_trans_blocks(struct inode *inode)
*/
static int write_cache_pages_da(struct address_space *mapping,
struct writeback_control *wbc,
struct mpage_da_data *mpd)
struct mpage_da_data *mpd,
pgoff_t *done_index)
{
int ret = 0;
int done = 0;
struct pagevec pvec;
int nr_pages;
unsigned nr_pages;
pgoff_t index;
pgoff_t end; /* Inclusive */
long nr_to_write = wbc->nr_to_write;
Expand All @@ -2820,6 +2821,7 @@ static int write_cache_pages_da(struct address_space *mapping,
else
tag = PAGECACHE_TAG_DIRTY;

*done_index = index;
while (!done && (index <= end)) {
int i;

Expand All @@ -2843,6 +2845,8 @@ static int write_cache_pages_da(struct address_space *mapping,
break;
}

*done_index = page->index + 1;

lock_page(page);

/*
Expand Down Expand Up @@ -2928,6 +2932,7 @@ static int ext4_da_writepages(struct address_space *mapping,
long desired_nr_to_write, nr_to_writebump = 0;
loff_t range_start = wbc->range_start;
struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb);
pgoff_t done_index = 0;
pgoff_t end;

trace_ext4_da_writepages(inode, wbc);
Expand Down Expand Up @@ -3050,7 +3055,7 @@ static int ext4_da_writepages(struct address_space *mapping,
mpd.io_done = 0;
mpd.pages_written = 0;
mpd.retval = 0;
ret = write_cache_pages_da(mapping, wbc, &mpd);
ret = write_cache_pages_da(mapping, wbc, &mpd, &done_index);
/*
* If we have a contiguous extent of pages and we
* haven't done the I/O yet, map the blocks and submit
Expand Down Expand Up @@ -3104,14 +3109,13 @@ static int ext4_da_writepages(struct address_space *mapping,
__func__, wbc->nr_to_write, ret);

/* Update index */
index += pages_written;
wbc->range_cyclic = range_cyclic;
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 = index;
mapping->writeback_index = done_index;

out_writepages:
wbc->nr_to_write -= nr_to_writebump;
Expand Down

0 comments on commit fa49755

Please sign in to comment.