Lines Matching refs:aio_req
246 static inline void ovl_aio_put(struct ovl_aio_req *aio_req) in ovl_aio_put() argument
248 if (refcount_dec_and_test(&aio_req->ref)) { in ovl_aio_put()
249 fput(aio_req->iocb.ki_filp); in ovl_aio_put()
250 kmem_cache_free(ovl_aio_request_cachep, aio_req); in ovl_aio_put()
254 static void ovl_aio_cleanup_handler(struct ovl_aio_req *aio_req) in ovl_aio_cleanup_handler() argument
256 struct kiocb *iocb = &aio_req->iocb; in ovl_aio_cleanup_handler()
257 struct kiocb *orig_iocb = aio_req->orig_iocb; in ovl_aio_cleanup_handler()
270 ovl_aio_put(aio_req); in ovl_aio_cleanup_handler()
275 struct ovl_aio_req *aio_req = container_of(iocb, in ovl_aio_rw_complete() local
277 struct kiocb *orig_iocb = aio_req->orig_iocb; in ovl_aio_rw_complete()
279 ovl_aio_cleanup_handler(aio_req); in ovl_aio_rw_complete()
309 struct ovl_aio_req *aio_req; in ovl_read_iter() local
312 aio_req = kmem_cache_zalloc(ovl_aio_request_cachep, GFP_KERNEL); in ovl_read_iter()
313 if (!aio_req) in ovl_read_iter()
317 aio_req->orig_iocb = iocb; in ovl_read_iter()
318 kiocb_clone(&aio_req->iocb, iocb, get_file(real.file)); in ovl_read_iter()
319 aio_req->iocb.ki_complete = ovl_aio_rw_complete; in ovl_read_iter()
320 refcount_set(&aio_req->ref, 2); in ovl_read_iter()
321 ret = vfs_iocb_iter_read(real.file, &aio_req->iocb, iter); in ovl_read_iter()
322 ovl_aio_put(aio_req); in ovl_read_iter()
324 ovl_aio_cleanup_handler(aio_req); in ovl_read_iter()
377 struct ovl_aio_req *aio_req; in ovl_write_iter() local
380 aio_req = kmem_cache_zalloc(ovl_aio_request_cachep, GFP_KERNEL); in ovl_write_iter()
381 if (!aio_req) in ovl_write_iter()
389 aio_req->orig_iocb = iocb; in ovl_write_iter()
390 kiocb_clone(&aio_req->iocb, iocb, get_file(real.file)); in ovl_write_iter()
391 aio_req->iocb.ki_flags = ifl; in ovl_write_iter()
392 aio_req->iocb.ki_complete = ovl_aio_rw_complete; in ovl_write_iter()
393 refcount_set(&aio_req->ref, 2); in ovl_write_iter()
394 ret = vfs_iocb_iter_write(real.file, &aio_req->iocb, iter); in ovl_write_iter()
395 ovl_aio_put(aio_req); in ovl_write_iter()
397 ovl_aio_cleanup_handler(aio_req); in ovl_write_iter()