Commit 823b0c9d authored by Weston Andros Adamson's avatar Weston Andros Adamson Committed by Trond Myklebust

nfs: rename members of nfs_pgio_data

Rename "verf" to "writeverf" and "pages" to "page_array" to prepare for
merge of nfs_pgio_data and nfs_pgio_header.
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarWeston Andros Adamson <dros@primarydata.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 1e7f3a48
...@@ -258,7 +258,8 @@ bl_read_pagelist(struct nfs_pgio_data *rdata) ...@@ -258,7 +258,8 @@ bl_read_pagelist(struct nfs_pgio_data *rdata)
const bool is_dio = (header->dreq != NULL); const bool is_dio = (header->dreq != NULL);
dprintk("%s enter nr_pages %u offset %lld count %u\n", __func__, dprintk("%s enter nr_pages %u offset %lld count %u\n", __func__,
rdata->pages.npages, f_offset, (unsigned int)rdata->args.count); rdata->page_array.npages, f_offset,
(unsigned int)rdata->args.count);
par = alloc_parallel(rdata); par = alloc_parallel(rdata);
if (!par) if (!par)
...@@ -268,7 +269,7 @@ bl_read_pagelist(struct nfs_pgio_data *rdata) ...@@ -268,7 +269,7 @@ bl_read_pagelist(struct nfs_pgio_data *rdata)
isect = (sector_t) (f_offset >> SECTOR_SHIFT); isect = (sector_t) (f_offset >> SECTOR_SHIFT);
/* Code assumes extents are page-aligned */ /* Code assumes extents are page-aligned */
for (i = pg_index; i < rdata->pages.npages; i++) { for (i = pg_index; i < rdata->page_array.npages; i++) {
if (!extent_length) { if (!extent_length) {
/* We've used up the previous extent */ /* We've used up the previous extent */
bl_put_extent(be); bl_put_extent(be);
...@@ -317,7 +318,8 @@ bl_read_pagelist(struct nfs_pgio_data *rdata) ...@@ -317,7 +318,8 @@ bl_read_pagelist(struct nfs_pgio_data *rdata)
struct pnfs_block_extent *be_read; struct pnfs_block_extent *be_read;
be_read = (hole && cow_read) ? cow_read : be; be_read = (hole && cow_read) ? cow_read : be;
bio = do_add_page_to_bio(bio, rdata->pages.npages - i, bio = do_add_page_to_bio(bio,
rdata->page_array.npages - i,
READ, READ,
isect, pages[i], be_read, isect, pages[i], be_read,
bl_end_io_read, par, bl_end_io_read, par,
...@@ -446,7 +448,7 @@ static void bl_end_par_io_write(void *data, int num_se) ...@@ -446,7 +448,7 @@ static void bl_end_par_io_write(void *data, int num_se)
} }
wdata->task.tk_status = wdata->header->pnfs_error; wdata->task.tk_status = wdata->header->pnfs_error;
wdata->verf.committed = NFS_FILE_SYNC; wdata->writeverf.committed = NFS_FILE_SYNC;
INIT_WORK(&wdata->task.u.tk_work, bl_write_cleanup); INIT_WORK(&wdata->task.u.tk_work, bl_write_cleanup);
schedule_work(&wdata->task.u.tk_work); schedule_work(&wdata->task.u.tk_work);
} }
...@@ -699,7 +701,7 @@ bl_write_pagelist(struct nfs_pgio_data *wdata, int sync) ...@@ -699,7 +701,7 @@ bl_write_pagelist(struct nfs_pgio_data *wdata, int sync)
dprintk("pnfsblock nonblock aligned DIO writes. Resend MDS\n"); dprintk("pnfsblock nonblock aligned DIO writes. Resend MDS\n");
goto out_mds; goto out_mds;
} }
/* At this point, wdata->pages is a (sequential) list of nfs_pages. /* At this point, wdata->page_aray is a (sequential) list of nfs_pages.
* We want to write each, and if there is an error set pnfs_error * We want to write each, and if there is an error set pnfs_error
* to have it redone using nfs. * to have it redone using nfs.
*/ */
...@@ -791,7 +793,7 @@ bl_write_pagelist(struct nfs_pgio_data *wdata, int sync) ...@@ -791,7 +793,7 @@ bl_write_pagelist(struct nfs_pgio_data *wdata, int sync)
/* Middle pages */ /* Middle pages */
pg_index = wdata->args.pgbase >> PAGE_CACHE_SHIFT; pg_index = wdata->args.pgbase >> PAGE_CACHE_SHIFT;
for (i = pg_index; i < wdata->pages.npages; i++) { for (i = pg_index; i < wdata->page_array.npages; i++) {
if (!extent_length) { if (!extent_length) {
/* We've used up the previous extent */ /* We've used up the previous extent */
bl_put_extent(be); bl_put_extent(be);
...@@ -862,7 +864,8 @@ bl_write_pagelist(struct nfs_pgio_data *wdata, int sync) ...@@ -862,7 +864,8 @@ bl_write_pagelist(struct nfs_pgio_data *wdata, int sync)
} }
bio = do_add_page_to_bio(bio, wdata->pages.npages - i, WRITE, bio = do_add_page_to_bio(bio, wdata->page_array.npages - i,
WRITE,
isect, pages[i], be, isect, pages[i], be,
bl_end_io_write, par, bl_end_io_write, par,
pg_offset, pg_len); pg_offset, pg_len);
......
...@@ -329,7 +329,7 @@ objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync) ...@@ -329,7 +329,7 @@ objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync)
oir->status = wdata->task.tk_status = status; oir->status = wdata->task.tk_status = status;
if (status >= 0) { if (status >= 0) {
wdata->res.count = status; wdata->res.count = status;
wdata->verf.committed = oir->committed; wdata->writeverf.committed = oir->committed;
} else { } else {
wdata->header->pnfs_error = status; wdata->header->pnfs_error = status;
} }
...@@ -337,7 +337,7 @@ objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync) ...@@ -337,7 +337,7 @@ objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync)
/* must not use oir after this point */ /* must not use oir after this point */
dprintk("%s: Return status %zd committed %d sync=%d\n", __func__, dprintk("%s: Return status %zd committed %d sync=%d\n", __func__,
status, wdata->verf.committed, sync); status, wdata->writeverf.committed, sync);
if (sync) if (sync)
pnfs_ld_write_done(wdata); pnfs_ld_write_done(wdata);
......
...@@ -484,7 +484,7 @@ EXPORT_SYMBOL_GPL(nfs_pgio_header_free); ...@@ -484,7 +484,7 @@ EXPORT_SYMBOL_GPL(nfs_pgio_header_free);
static bool nfs_pgio_data_init(struct nfs_pgio_header *hdr, static bool nfs_pgio_data_init(struct nfs_pgio_header *hdr,
unsigned int pagecount) unsigned int pagecount)
{ {
if (nfs_pgarray_set(&hdr->data.pages, pagecount)) { if (nfs_pgarray_set(&hdr->data.page_array, pagecount)) {
hdr->data.header = hdr; hdr->data.header = hdr;
atomic_inc(&hdr->refcnt); atomic_inc(&hdr->refcnt);
return true; return true;
...@@ -501,8 +501,8 @@ void nfs_pgio_data_destroy(struct nfs_pgio_data *data) ...@@ -501,8 +501,8 @@ void nfs_pgio_data_destroy(struct nfs_pgio_data *data)
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
put_nfs_open_context(data->args.context); put_nfs_open_context(data->args.context);
if (data->pages.pagevec != data->pages.page_array) if (data->page_array.pagevec != data->page_array.page_array)
kfree(data->pages.pagevec); kfree(data->page_array.pagevec);
if (atomic_dec_and_test(&hdr->refcnt)) if (atomic_dec_and_test(&hdr->refcnt))
hdr->completion_ops->completion(hdr); hdr->completion_ops->completion(hdr);
} }
...@@ -530,7 +530,7 @@ static void nfs_pgio_rpcsetup(struct nfs_pgio_data *data, ...@@ -530,7 +530,7 @@ static void nfs_pgio_rpcsetup(struct nfs_pgio_data *data,
/* pnfs_set_layoutcommit needs this */ /* pnfs_set_layoutcommit needs this */
data->mds_offset = data->args.offset; data->mds_offset = data->args.offset;
data->args.pgbase = req->wb_pgbase + offset; data->args.pgbase = req->wb_pgbase + offset;
data->args.pages = data->pages.pagevec; data->args.pages = data->page_array.pagevec;
data->args.count = count; data->args.count = count;
data->args.context = get_nfs_open_context(req->wb_context); data->args.context = get_nfs_open_context(req->wb_context);
data->args.lock_context = req->wb_lock_context; data->args.lock_context = req->wb_lock_context;
...@@ -548,7 +548,7 @@ static void nfs_pgio_rpcsetup(struct nfs_pgio_data *data, ...@@ -548,7 +548,7 @@ static void nfs_pgio_rpcsetup(struct nfs_pgio_data *data,
data->res.fattr = &data->fattr; data->res.fattr = &data->fattr;
data->res.count = count; data->res.count = count;
data->res.eof = 0; data->res.eof = 0;
data->res.verf = &data->verf; data->res.verf = &data->writeverf;
nfs_fattr_init(&data->fattr); nfs_fattr_init(&data->fattr);
} }
...@@ -717,7 +717,7 @@ int nfs_generic_pgio(struct nfs_pageio_descriptor *desc, ...@@ -717,7 +717,7 @@ int nfs_generic_pgio(struct nfs_pageio_descriptor *desc,
data = &hdr->data; data = &hdr->data;
nfs_init_cinfo(&cinfo, desc->pg_inode, desc->pg_dreq); nfs_init_cinfo(&cinfo, desc->pg_inode, desc->pg_dreq);
pages = data->pages.pagevec; pages = data->page_array.pagevec;
while (!list_empty(head)) { while (!list_empty(head)) {
req = nfs_list_entry(head->next); req = nfs_list_entry(head->next);
nfs_list_remove_request(req); nfs_list_remove_request(req);
......
...@@ -598,9 +598,9 @@ nfs_clear_request_commit(struct nfs_page *req) ...@@ -598,9 +598,9 @@ nfs_clear_request_commit(struct nfs_page *req)
static inline static inline
int nfs_write_need_commit(struct nfs_pgio_data *data) int nfs_write_need_commit(struct nfs_pgio_data *data)
{ {
if (data->verf.committed == NFS_DATA_SYNC) if (data->writeverf.committed == NFS_DATA_SYNC)
return data->header->lseg == NULL; return data->header->lseg == NULL;
return data->verf.committed != NFS_FILE_SYNC; return data->writeverf.committed != NFS_FILE_SYNC;
} }
#else #else
...@@ -1095,8 +1095,9 @@ static void nfs_writeback_release_common(struct nfs_pgio_data *data) ...@@ -1095,8 +1095,9 @@ static void nfs_writeback_release_common(struct nfs_pgio_data *data)
if (test_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags)) if (test_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags))
; /* Do nothing */ ; /* Do nothing */
else if (!test_and_set_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags)) else if (!test_and_set_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags))
memcpy(&hdr->verf, &data->verf, sizeof(hdr->verf)); memcpy(&hdr->verf, &data->writeverf, sizeof(hdr->verf));
else if (memcmp(&hdr->verf, &data->verf, sizeof(hdr->verf))) else if (memcmp(&hdr->verf, &data->writeverf,
sizeof(hdr->verf)))
set_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags); set_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags);
spin_unlock(&hdr->lock); spin_unlock(&hdr->lock);
} }
......
...@@ -1262,13 +1262,13 @@ struct nfs_pgio_data { ...@@ -1262,13 +1262,13 @@ struct nfs_pgio_data {
struct list_head list; struct list_head list;
struct rpc_task task; struct rpc_task task;
struct nfs_fattr fattr; struct nfs_fattr fattr;
struct nfs_writeverf verf; /* Used for writes */ struct nfs_writeverf writeverf; /* Used for writes */
struct nfs_pgio_args args; /* argument struct */ struct nfs_pgio_args args; /* argument struct */
struct nfs_pgio_res res; /* result struct */ struct nfs_pgio_res res; /* result struct */
unsigned long timestamp; /* For lease renewal */ unsigned long timestamp; /* For lease renewal */
int (*pgio_done_cb)(struct rpc_task *task, struct nfs_pgio_data *data); int (*pgio_done_cb)(struct rpc_task *task, struct nfs_pgio_data *data);
__u64 mds_offset; /* Filelayout dense stripe */ __u64 mds_offset; /* Filelayout dense stripe */
struct nfs_page_array pages; struct nfs_page_array page_array;
struct nfs_client *ds_clp; /* pNFS data server */ struct nfs_client *ds_clp; /* pNFS data server */
int ds_idx; /* ds index if ds_clp is set */ int ds_idx; /* ds index if ds_clp is set */
}; };
......
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