Lines Matching refs:iocb

269 nfs_local_iocb_free(struct nfs_local_kiocb *iocb)  in nfs_local_iocb_free()  argument
271 kfree(iocb->bvec); in nfs_local_iocb_free()
272 kfree(iocb); in nfs_local_iocb_free()
279 struct nfs_local_kiocb *iocb; in nfs_local_iocb_alloc() local
281 iocb = kmalloc(sizeof(*iocb), flags); in nfs_local_iocb_alloc()
282 if (iocb == NULL) in nfs_local_iocb_alloc()
284 iocb->bvec = nfs_bvec_alloc_and_import_pagevec(hdr->page_array.pagevec, in nfs_local_iocb_alloc()
286 if (iocb->bvec == NULL) { in nfs_local_iocb_alloc()
287 kfree(iocb); in nfs_local_iocb_alloc()
290 init_sync_kiocb(&iocb->kiocb, nfs_to->nfsd_file_file(localio)); in nfs_local_iocb_alloc()
291 iocb->kiocb.ki_pos = hdr->args.offset; in nfs_local_iocb_alloc()
292 iocb->localio = localio; in nfs_local_iocb_alloc()
293 iocb->hdr = hdr; in nfs_local_iocb_alloc()
294 iocb->kiocb.ki_flags &= ~IOCB_APPEND; in nfs_local_iocb_alloc()
295 return iocb; in nfs_local_iocb_alloc()
299 nfs_local_iter_init(struct iov_iter *i, struct nfs_local_kiocb *iocb, int dir) in nfs_local_iter_init() argument
301 struct nfs_pgio_header *hdr = iocb->hdr; in nfs_local_iter_init()
303 iov_iter_bvec(i, dir, iocb->bvec, hdr->page_array.npages, in nfs_local_iter_init()
340 nfs_local_pgio_release(struct nfs_local_kiocb *iocb) in nfs_local_pgio_release() argument
342 struct nfs_pgio_header *hdr = iocb->hdr; in nfs_local_pgio_release()
344 nfs_to_nfsd_file_put_local(iocb->localio); in nfs_local_pgio_release()
345 nfs_local_iocb_free(iocb); in nfs_local_pgio_release()
350 nfs_local_read_done(struct nfs_local_kiocb *iocb, long status) in nfs_local_read_done() argument
352 struct nfs_pgio_header *hdr = iocb->hdr; in nfs_local_read_done()
353 struct file *filp = iocb->kiocb.ki_filp; in nfs_local_read_done()
367 struct nfs_local_kiocb *iocb = in nfs_local_call_read() local
369 struct file *filp = iocb->kiocb.ki_filp; in nfs_local_call_read()
376 nfs_local_iter_init(&iter, iocb, READ); in nfs_local_call_read()
378 status = filp->f_op->read_iter(&iocb->kiocb, &iter); in nfs_local_call_read()
381 nfs_local_read_done(iocb, status); in nfs_local_call_read()
382 nfs_local_pgio_release(iocb); in nfs_local_call_read()
392 struct nfs_local_kiocb *iocb; in nfs_do_local_read() local
397 iocb = nfs_local_iocb_alloc(hdr, localio, GFP_KERNEL); in nfs_do_local_read()
398 if (iocb == NULL) in nfs_do_local_read()
404 INIT_WORK(&iocb->work, nfs_local_call_read); in nfs_do_local_read()
405 queue_work(nfslocaliod_workqueue, &iocb->work); in nfs_do_local_read()
473 static void nfs_local_vfs_getattr(struct nfs_local_kiocb *iocb) in nfs_local_vfs_getattr() argument
476 struct file *filp = iocb->kiocb.ki_filp; in nfs_local_vfs_getattr()
477 struct nfs_pgio_header *hdr = iocb->hdr; in nfs_local_vfs_getattr()
506 nfs_local_write_done(struct nfs_local_kiocb *iocb, long status) in nfs_local_write_done() argument
508 struct nfs_pgio_header *hdr = iocb->hdr; in nfs_local_write_done()
535 struct nfs_local_kiocb *iocb = in nfs_local_call_write() local
537 struct file *filp = iocb->kiocb.ki_filp; in nfs_local_call_write()
546 nfs_local_iter_init(&iter, iocb, WRITE); in nfs_local_call_write()
549 status = filp->f_op->write_iter(&iocb->kiocb, &iter); in nfs_local_call_write()
553 nfs_local_write_done(iocb, status); in nfs_local_call_write()
554 nfs_local_vfs_getattr(iocb); in nfs_local_call_write()
555 nfs_local_pgio_release(iocb); in nfs_local_call_write()
566 struct nfs_local_kiocb *iocb; in nfs_do_local_write() local
572 iocb = nfs_local_iocb_alloc(hdr, localio, GFP_NOIO); in nfs_do_local_write()
573 if (iocb == NULL) in nfs_do_local_write()
580 iocb->kiocb.ki_flags |= IOCB_DSYNC; in nfs_do_local_write()
583 iocb->kiocb.ki_flags |= IOCB_DSYNC|IOCB_SYNC; in nfs_do_local_write()
589 INIT_WORK(&iocb->work, nfs_local_call_write); in nfs_do_local_write()
590 queue_work(nfslocaliod_workqueue, &iocb->work); in nfs_do_local_write()