Skip to content

Commit

Permalink
NFS: Fix up writeback_control->nr_to_write accounting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 6, 2006
1 parent 3925675 commit 9cf85e0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions fs/nfs/pagelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,10 @@ long nfs_scan_dirty(struct address_space *mapping,
struct nfs_page *pgvec[NFS_SCAN_MAXENTRIES];
struct nfs_page *req;
pgoff_t idx_start, idx_end;
long count = wbc->nr_to_write;
long res = 0;
int found, i;

if (nfsi->ndirty == 0 || count <= 0)
if (nfsi->ndirty == 0)
return 0;
if (wbc->range_cyclic) {
idx_start = 0;
Expand All @@ -308,8 +307,6 @@ long nfs_scan_dirty(struct address_space *mapping,
for (;;) {
unsigned int toscan = NFS_SCAN_MAXENTRIES;

if (toscan > count)
toscan = count;
found = radix_tree_gang_lookup_tag(&nfsi->nfs_page_tree,
(void **)&pgvec[0], idx_start, toscan,
NFS_PAGE_TAG_DIRTY);
Expand All @@ -334,16 +331,11 @@ long nfs_scan_dirty(struct address_space *mapping,
res++;
if (res == LONG_MAX)
goto out;
count--;
if (count == 0)
goto out;

next:
idx_start = req->wb_index + 1;
}
}
out:
wbc->nr_to_write = count;
WARN_ON ((nfsi->ndirty == 0) != list_empty(&nfsi->dirty));
return res;
}
Expand Down

0 comments on commit 9cf85e0

Please sign in to comment.