Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[firefly-linux-kernel-4.4.55.git] / fs / nfs / pagelist.c
index e046c9b6a9dd201315b40e2e4532f414e906fdb4..ca4b1d4ff42b0f7d337ad01fa7c1675f959c4134 100644 (file)
 
 #define NFS_PARANOIA 1
 
-static kmem_cache_t *nfs_page_cachep;
+static struct kmem_cache *nfs_page_cachep;
 
 static inline struct nfs_page *
 nfs_page_alloc(void)
 {
        struct nfs_page *p;
-       p = kmem_cache_alloc(nfs_page_cachep, SLAB_KERNEL);
+       p = kmem_cache_alloc(nfs_page_cachep, GFP_KERNEL);
        if (p) {
                memset(p, 0, sizeof(*p));
                INIT_LIST_HEAD(&p->wb_list);
@@ -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;
@@ -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);
@@ -331,20 +328,14 @@ long nfs_scan_dirty(struct address_space *mapping,
                        nfsi->ndirty--;
                        nfs_list_remove_request(req);
                        nfs_list_add_request(req, dst);
-                       dec_zone_page_state(req->wb_page, NR_FILE_DIRTY);
                        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;
 }