mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
NFS: Fix up writeback_control->nr_to_write accounting
We're really accounting for the same page twice now: once in generic_writepages(), and once in nfs_scan_dirty(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
3925675cb3
commit
9cf85e0a24
1 changed files with 1 additions and 9 deletions
|
@ -288,11 +288,10 @@ long nfs_scan_dirty(struct address_space *mapping,
|
||||||
struct nfs_page *pgvec[NFS_SCAN_MAXENTRIES];
|
struct nfs_page *pgvec[NFS_SCAN_MAXENTRIES];
|
||||||
struct nfs_page *req;
|
struct nfs_page *req;
|
||||||
pgoff_t idx_start, idx_end;
|
pgoff_t idx_start, idx_end;
|
||||||
long count = wbc->nr_to_write;
|
|
||||||
long res = 0;
|
long res = 0;
|
||||||
int found, i;
|
int found, i;
|
||||||
|
|
||||||
if (nfsi->ndirty == 0 || count <= 0)
|
if (nfsi->ndirty == 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (wbc->range_cyclic) {
|
if (wbc->range_cyclic) {
|
||||||
idx_start = 0;
|
idx_start = 0;
|
||||||
|
@ -308,8 +307,6 @@ long nfs_scan_dirty(struct address_space *mapping,
|
||||||
for (;;) {
|
for (;;) {
|
||||||
unsigned int toscan = NFS_SCAN_MAXENTRIES;
|
unsigned int toscan = NFS_SCAN_MAXENTRIES;
|
||||||
|
|
||||||
if (toscan > count)
|
|
||||||
toscan = count;
|
|
||||||
found = radix_tree_gang_lookup_tag(&nfsi->nfs_page_tree,
|
found = radix_tree_gang_lookup_tag(&nfsi->nfs_page_tree,
|
||||||
(void **)&pgvec[0], idx_start, toscan,
|
(void **)&pgvec[0], idx_start, toscan,
|
||||||
NFS_PAGE_TAG_DIRTY);
|
NFS_PAGE_TAG_DIRTY);
|
||||||
|
@ -334,16 +331,11 @@ long nfs_scan_dirty(struct address_space *mapping,
|
||||||
res++;
|
res++;
|
||||||
if (res == LONG_MAX)
|
if (res == LONG_MAX)
|
||||||
goto out;
|
goto out;
|
||||||
count--;
|
|
||||||
if (count == 0)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
next:
|
next:
|
||||||
idx_start = req->wb_index + 1;
|
idx_start = req->wb_index + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
wbc->nr_to_write = count;
|
|
||||||
WARN_ON ((nfsi->ndirty == 0) != list_empty(&nfsi->dirty));
|
WARN_ON ((nfsi->ndirty == 0) != list_empty(&nfsi->dirty));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue