Commit 2b17d725 authored by Trond Myklebust's avatar Trond Myklebust

NFS: Clean up writeback code

Now that the VM promises never to recurse back into the filesystem
layer on writeback, remove all the GFP_NOFS references etc from
the generic writeback code.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent c98ebe29
...@@ -77,7 +77,7 @@ void nfs_set_pgio_error(struct nfs_pgio_header *hdr, int error, loff_t pos) ...@@ -77,7 +77,7 @@ void nfs_set_pgio_error(struct nfs_pgio_header *hdr, int error, loff_t pos)
static inline struct nfs_page * static inline struct nfs_page *
nfs_page_alloc(void) nfs_page_alloc(void)
{ {
struct nfs_page *p = kmem_cache_zalloc(nfs_page_cachep, GFP_NOIO); struct nfs_page *p = kmem_cache_zalloc(nfs_page_cachep, GFP_KERNEL);
if (p) if (p)
INIT_LIST_HEAD(&p->wb_list); INIT_LIST_HEAD(&p->wb_list);
return p; return p;
...@@ -775,8 +775,6 @@ int nfs_generic_pgio(struct nfs_pageio_descriptor *desc, ...@@ -775,8 +775,6 @@ int nfs_generic_pgio(struct nfs_pageio_descriptor *desc,
if (pagecount <= ARRAY_SIZE(pg_array->page_array)) if (pagecount <= ARRAY_SIZE(pg_array->page_array))
pg_array->pagevec = pg_array->page_array; pg_array->pagevec = pg_array->page_array;
else { else {
if (hdr->rw_mode == FMODE_WRITE)
gfp_flags = GFP_NOIO;
pg_array->pagevec = kcalloc(pagecount, sizeof(struct page *), gfp_flags); pg_array->pagevec = kcalloc(pagecount, sizeof(struct page *), gfp_flags);
if (!pg_array->pagevec) { if (!pg_array->pagevec) {
pg_array->npages = 0; pg_array->npages = 0;
...@@ -851,7 +849,7 @@ nfs_pageio_alloc_mirrors(struct nfs_pageio_descriptor *desc, ...@@ -851,7 +849,7 @@ nfs_pageio_alloc_mirrors(struct nfs_pageio_descriptor *desc,
desc->pg_mirrors_dynamic = NULL; desc->pg_mirrors_dynamic = NULL;
if (mirror_count == 1) if (mirror_count == 1)
return desc->pg_mirrors_static; return desc->pg_mirrors_static;
ret = kmalloc_array(mirror_count, sizeof(*ret), GFP_NOFS); ret = kmalloc_array(mirror_count, sizeof(*ret), GFP_KERNEL);
if (ret != NULL) { if (ret != NULL) {
for (i = 0; i < mirror_count; i++) for (i = 0; i < mirror_count; i++)
nfs_pageio_mirror_init(&ret[i], desc->pg_bsize); nfs_pageio_mirror_init(&ret[i], desc->pg_bsize);
......
...@@ -2468,7 +2468,7 @@ pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, ...@@ -2468,7 +2468,7 @@ pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio,
wb_size, wb_size,
IOMODE_RW, IOMODE_RW,
false, false,
GFP_NOFS); GFP_KERNEL);
if (IS_ERR(pgio->pg_lseg)) { if (IS_ERR(pgio->pg_lseg)) {
pgio->pg_error = PTR_ERR(pgio->pg_lseg); pgio->pg_error = PTR_ERR(pgio->pg_lseg);
pgio->pg_lseg = NULL; pgio->pg_lseg = NULL;
......
...@@ -103,7 +103,7 @@ EXPORT_SYMBOL_GPL(nfs_commit_free); ...@@ -103,7 +103,7 @@ EXPORT_SYMBOL_GPL(nfs_commit_free);
static struct nfs_pgio_header *nfs_writehdr_alloc(void) static struct nfs_pgio_header *nfs_writehdr_alloc(void)
{ {
struct nfs_pgio_header *p = mempool_alloc(nfs_wdata_mempool, GFP_NOIO); struct nfs_pgio_header *p = mempool_alloc(nfs_wdata_mempool, GFP_KERNEL);
memset(p, 0, sizeof(*p)); memset(p, 0, sizeof(*p));
p->rw_mode = FMODE_WRITE; p->rw_mode = FMODE_WRITE;
...@@ -721,12 +721,11 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) ...@@ -721,12 +721,11 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc)
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
struct nfs_pageio_descriptor pgio; struct nfs_pageio_descriptor pgio;
struct nfs_io_completion *ioc; struct nfs_io_completion *ioc;
unsigned int pflags = memalloc_nofs_save();
int err; int err;
nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGES); nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGES);
ioc = nfs_io_completion_alloc(GFP_NOFS); ioc = nfs_io_completion_alloc(GFP_KERNEL);
if (ioc) if (ioc)
nfs_io_completion_init(ioc, nfs_io_completion_commit, inode); nfs_io_completion_init(ioc, nfs_io_completion_commit, inode);
...@@ -737,8 +736,6 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) ...@@ -737,8 +736,6 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc)
nfs_pageio_complete(&pgio); nfs_pageio_complete(&pgio);
nfs_io_completion_put(ioc); nfs_io_completion_put(ioc);
memalloc_nofs_restore(pflags);
if (err < 0) if (err < 0)
goto out_err; goto out_err;
err = pgio.pg_error; err = pgio.pg_error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment