Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218889
b: refs/heads/master
c: 5b41d92
h: refs/heads/master
i:
  218887: 6566c18
v: v3
  • Loading branch information
Eric Sandeen authored and Theodore Ts'o committed Oct 28, 2010
1 parent 5a2af25 commit ee17f50
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 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: bbd08344e3df8c7c1d7aa04bc0c8c9367806e12d
refs/heads/master: 5b41d92437f1ae19b3f3ffa3b16589fd5df50ac0
18 changes: 15 additions & 3 deletions trunk/fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2809,16 +2809,21 @@ static int write_cache_pages_da(struct address_space *mapping,
pgoff_t index;
pgoff_t end; /* Inclusive */
long nr_to_write = wbc->nr_to_write;
int tag;

pagevec_init(&pvec, 0);
index = wbc->range_start >> PAGE_CACHE_SHIFT;
end = wbc->range_end >> PAGE_CACHE_SHIFT;

if (wbc->sync_mode == WB_SYNC_ALL)
tag = PAGECACHE_TAG_TOWRITE;
else
tag = PAGECACHE_TAG_DIRTY;

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

nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
PAGECACHE_TAG_DIRTY,
nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, tag,
min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1);
if (nr_pages == 0)
break;
Expand Down Expand Up @@ -2923,6 +2928,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 end;

trace_ext4_da_writepages(inode, wbc);

Expand Down Expand Up @@ -2958,8 +2964,11 @@ static int ext4_da_writepages(struct address_space *mapping,
wbc->range_start = index << PAGE_CACHE_SHIFT;
wbc->range_end = LLONG_MAX;
wbc->range_cyclic = 0;
} else
end = -1;
} else {
index = wbc->range_start >> PAGE_CACHE_SHIFT;
end = wbc->range_end >> PAGE_CACHE_SHIFT;
}

/*
* This works around two forms of stupidity. The first is in
Expand Down Expand Up @@ -3000,6 +3009,9 @@ static int ext4_da_writepages(struct address_space *mapping,
pages_skipped = wbc->pages_skipped;

retry:
if (wbc->sync_mode == WB_SYNC_ALL)
tag_pages_for_writeback(mapping, index, end);

while (!ret && wbc->nr_to_write > 0) {

/*
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/writeback.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,

int generic_writepages(struct address_space *mapping,
struct writeback_control *wbc);
void tag_pages_for_writeback(struct address_space *mapping,
pgoff_t start, pgoff_t end);
int write_cache_pages(struct address_space *mapping,
struct writeback_control *wbc, writepage_t writepage,
void *data);
Expand Down

0 comments on commit ee17f50

Please sign in to comment.