Lines Matching refs:desc
218 void nfs_pageio_init(struct nfs_pageio_descriptor *desc, in nfs_pageio_init() argument
224 INIT_LIST_HEAD(&desc->pg_list); in nfs_pageio_init()
225 desc->pg_bytes_written = 0; in nfs_pageio_init()
226 desc->pg_count = 0; in nfs_pageio_init()
227 desc->pg_bsize = bsize; in nfs_pageio_init()
228 desc->pg_base = 0; in nfs_pageio_init()
229 desc->pg_inode = inode; in nfs_pageio_init()
230 desc->pg_doio = doio; in nfs_pageio_init()
231 desc->pg_ioflags = io_flags; in nfs_pageio_init()
232 desc->pg_error = 0; in nfs_pageio_init()
272 static int nfs_pageio_do_add_request(struct nfs_pageio_descriptor *desc, in nfs_pageio_do_add_request() argument
277 if (desc->pg_count != 0) { in nfs_pageio_do_add_request()
287 if (desc->pg_bsize < PAGE_SIZE) in nfs_pageio_do_add_request()
289 newlen += desc->pg_count; in nfs_pageio_do_add_request()
290 if (newlen > desc->pg_bsize) in nfs_pageio_do_add_request()
292 prev = nfs_list_entry(desc->pg_list.prev); in nfs_pageio_do_add_request()
296 desc->pg_base = req->wb_pgbase; in nfs_pageio_do_add_request()
298 nfs_list_add_request(req, &desc->pg_list); in nfs_pageio_do_add_request()
299 desc->pg_count = newlen; in nfs_pageio_do_add_request()
306 static void nfs_pageio_doio(struct nfs_pageio_descriptor *desc) in nfs_pageio_doio() argument
308 if (!list_empty(&desc->pg_list)) { in nfs_pageio_doio()
309 int error = desc->pg_doio(desc->pg_inode, in nfs_pageio_doio()
310 &desc->pg_list, in nfs_pageio_doio()
311 nfs_page_array_len(desc->pg_base, in nfs_pageio_doio()
312 desc->pg_count), in nfs_pageio_doio()
313 desc->pg_count, in nfs_pageio_doio()
314 desc->pg_ioflags); in nfs_pageio_doio()
316 desc->pg_error = error; in nfs_pageio_doio()
318 desc->pg_bytes_written += desc->pg_count; in nfs_pageio_doio()
320 if (list_empty(&desc->pg_list)) { in nfs_pageio_doio()
321 desc->pg_count = 0; in nfs_pageio_doio()
322 desc->pg_base = 0; in nfs_pageio_doio()
334 int nfs_pageio_add_request(struct nfs_pageio_descriptor *desc, in nfs_pageio_add_request() argument
337 while (!nfs_pageio_do_add_request(desc, req)) { in nfs_pageio_add_request()
338 nfs_pageio_doio(desc); in nfs_pageio_add_request()
339 if (desc->pg_error < 0) in nfs_pageio_add_request()
349 void nfs_pageio_complete(struct nfs_pageio_descriptor *desc) in nfs_pageio_complete() argument
351 nfs_pageio_doio(desc); in nfs_pageio_complete()
365 void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *desc, pgoff_t index) in nfs_pageio_cond_complete() argument
367 if (!list_empty(&desc->pg_list)) { in nfs_pageio_cond_complete()
368 struct nfs_page *prev = nfs_list_entry(desc->pg_list.prev); in nfs_pageio_cond_complete()
370 nfs_pageio_doio(desc); in nfs_pageio_cond_complete()