Lines Matching refs:data
68 void nfs_readdata_release(void *data) in nfs_readdata_release() argument
70 struct nfs_read_data *rdata = data; in nfs_readdata_release()
85 static void nfs_readpage_truncate_uninitialised_page(struct nfs_read_data *data) in nfs_readpage_truncate_uninitialised_page() argument
87 unsigned int remainder = data->args.count - data->res.count; in nfs_readpage_truncate_uninitialised_page()
88 unsigned int base = data->args.pgbase + data->res.count; in nfs_readpage_truncate_uninitialised_page()
92 if (data->res.eof == 0 || remainder == 0) in nfs_readpage_truncate_uninitialised_page()
98 pages = &data->args.pages[base >> PAGE_CACHE_SHIFT]; in nfs_readpage_truncate_uninitialised_page()
156 static int nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data, in nfs_read_rpcsetup() argument
164 .rpc_argp = &data->args, in nfs_read_rpcsetup()
165 .rpc_resp = &data->res, in nfs_read_rpcsetup()
169 .task = &data->task, in nfs_read_rpcsetup()
173 .callback_data = data, in nfs_read_rpcsetup()
178 data->req = req; in nfs_read_rpcsetup()
179 data->inode = inode; in nfs_read_rpcsetup()
180 data->cred = msg.rpc_cred; in nfs_read_rpcsetup()
182 data->args.fh = NFS_FH(inode); in nfs_read_rpcsetup()
183 data->args.offset = req_offset(req) + offset; in nfs_read_rpcsetup()
184 data->args.pgbase = req->wb_pgbase + offset; in nfs_read_rpcsetup()
185 data->args.pages = data->pagevec; in nfs_read_rpcsetup()
186 data->args.count = count; in nfs_read_rpcsetup()
187 data->args.context = get_nfs_open_context(req->wb_context); in nfs_read_rpcsetup()
189 data->res.fattr = &data->fattr; in nfs_read_rpcsetup()
190 data->res.count = count; in nfs_read_rpcsetup()
191 data->res.eof = 0; in nfs_read_rpcsetup()
192 nfs_fattr_init(&data->fattr); in nfs_read_rpcsetup()
195 NFS_PROTO(inode)->read_setup(data, &msg); in nfs_read_rpcsetup()
198 data->task.tk_pid, in nfs_read_rpcsetup()
202 (unsigned long long)data->args.offset); in nfs_read_rpcsetup()
241 struct nfs_read_data *data; in nfs_pagein_multi() local
254 data = nfs_readdata_alloc(1); in nfs_pagein_multi()
255 if (!data) in nfs_pagein_multi()
257 list_add(&data->pages, &list); in nfs_pagein_multi()
269 data = list_entry(list.next, struct nfs_read_data, pages); in nfs_pagein_multi()
270 list_del_init(&data->pages); in nfs_pagein_multi()
272 data->pagevec[0] = page; in nfs_pagein_multi()
276 ret2 = nfs_read_rpcsetup(req, data, &nfs_read_partial_ops, in nfs_pagein_multi()
288 data = list_entry(list.next, struct nfs_read_data, pages); in nfs_pagein_multi()
289 list_del(&data->pages); in nfs_pagein_multi()
290 nfs_readdata_free(data); in nfs_pagein_multi()
301 struct nfs_read_data *data; in nfs_pagein_one() local
304 data = nfs_readdata_alloc(npages); in nfs_pagein_one()
305 if (!data) in nfs_pagein_one()
308 pages = data->pagevec; in nfs_pagein_one()
312 nfs_list_add_request(req, &data->pages); in nfs_pagein_one()
316 req = nfs_list_entry(data->pages.next); in nfs_pagein_one()
318 return nfs_read_rpcsetup(req, data, &nfs_read_full_ops, count, 0); in nfs_pagein_one()
328 int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data) in nfs_readpage_result() argument
335 status = NFS_PROTO(data->inode)->read_done(task, data); in nfs_readpage_result()
339 nfs_add_stats(data->inode, NFSIOS_SERVERREADBYTES, data->res.count); in nfs_readpage_result()
342 set_bit(NFS_INO_STALE, &NFS_I(data->inode)->flags); in nfs_readpage_result()
343 nfs_mark_for_revalidate(data->inode); in nfs_readpage_result()
348 static void nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data) in nfs_readpage_retry() argument
350 struct nfs_readargs *argp = &data->args; in nfs_readpage_retry()
351 struct nfs_readres *resp = &data->res; in nfs_readpage_retry()
357 nfs_inc_stats(data->inode, NFSIOS_SHORTREAD); in nfs_readpage_retry()
374 struct nfs_read_data *data = calldata; in nfs_readpage_result_partial() local
376 if (nfs_readpage_result(task, data) != 0) in nfs_readpage_result_partial()
381 nfs_readpage_truncate_uninitialised_page(data); in nfs_readpage_result_partial()
382 nfs_readpage_retry(task, data); in nfs_readpage_result_partial()
387 struct nfs_read_data *data = calldata; in nfs_readpage_release_partial() local
388 struct nfs_page *req = data->req; in nfs_readpage_release_partial()
390 int status = data->task.tk_status; in nfs_readpage_release_partial()
408 static void nfs_readpage_set_pages_uptodate(struct nfs_read_data *data) in nfs_readpage_set_pages_uptodate() argument
410 unsigned int count = data->res.count; in nfs_readpage_set_pages_uptodate()
411 unsigned int base = data->args.pgbase; in nfs_readpage_set_pages_uptodate()
414 if (data->res.eof) in nfs_readpage_set_pages_uptodate()
415 count = data->args.count; in nfs_readpage_set_pages_uptodate()
418 pages = &data->args.pages[base >> PAGE_CACHE_SHIFT]; in nfs_readpage_set_pages_uptodate()
426 if (data->res.eof || data->res.count == data->args.count) in nfs_readpage_set_pages_uptodate()
436 struct nfs_read_data *data = calldata; in nfs_readpage_result_full() local
438 if (nfs_readpage_result(task, data) != 0) in nfs_readpage_result_full()
448 nfs_readpage_truncate_uninitialised_page(data); in nfs_readpage_result_full()
449 nfs_readpage_set_pages_uptodate(data); in nfs_readpage_result_full()
450 nfs_readpage_retry(task, data); in nfs_readpage_result_full()
455 struct nfs_read_data *data = calldata; in nfs_readpage_release_full() local
457 while (!list_empty(&data->pages)) { in nfs_readpage_release_full()
458 struct nfs_page *req = nfs_list_entry(data->pages.next); in nfs_readpage_release_full()
528 readpage_async_filler(void *data, struct page *page) in readpage_async_filler() argument
530 struct nfs_readdesc *desc = (struct nfs_readdesc *)data; in readpage_async_filler()