Lines Matching refs:ia
427 struct fuse_io_args ia; member
448 curr_index = wpa->ia.write.in.offset >> PAGE_SHIFT; in fuse_find_writeback()
449 if (idx_from >= curr_index + wpa->ia.ap.num_pages) in fuse_find_writeback()
660 void fuse_read_args_fill(struct fuse_io_args *ia, struct file *file, loff_t pos, in fuse_read_args_fill() argument
664 struct fuse_args *args = &ia->ap.args; in fuse_read_args_fill()
666 ia->read.in.fh = ff->fh; in fuse_read_args_fill()
667 ia->read.in.offset = pos; in fuse_read_args_fill()
668 ia->read.in.size = count; in fuse_read_args_fill()
669 ia->read.in.flags = file->f_flags; in fuse_read_args_fill()
673 args->in_args[0].size = sizeof(ia->read.in); in fuse_read_args_fill()
674 args->in_args[0].value = &ia->read.in; in fuse_read_args_fill()
761 struct fuse_io_args *ia; in fuse_io_alloc() local
763 ia = kzalloc(sizeof(*ia), GFP_KERNEL); in fuse_io_alloc()
764 if (ia) { in fuse_io_alloc()
765 ia->io = io; in fuse_io_alloc()
766 ia->ap.pages = fuse_pages_alloc(npages, GFP_KERNEL, in fuse_io_alloc()
767 &ia->ap.descs); in fuse_io_alloc()
768 if (!ia->ap.pages) { in fuse_io_alloc()
769 kfree(ia); in fuse_io_alloc()
770 ia = NULL; in fuse_io_alloc()
773 return ia; in fuse_io_alloc()
776 static void fuse_io_free(struct fuse_io_args *ia) in fuse_io_free() argument
778 kfree(ia->ap.pages); in fuse_io_free()
779 kfree(ia); in fuse_io_free()
785 struct fuse_io_args *ia = container_of(args, typeof(*ia), ap.args); in fuse_aio_complete_req() local
786 struct fuse_io_priv *io = ia->io; in fuse_aio_complete_req()
789 fuse_release_user_pages(&ia->ap, io->should_dirty); in fuse_aio_complete_req()
794 if (ia->write.out.size > ia->write.in.size) { in fuse_aio_complete_req()
796 } else if (ia->write.in.size != ia->write.out.size) { in fuse_aio_complete_req()
797 pos = ia->write.in.offset - io->offset + in fuse_aio_complete_req()
798 ia->write.out.size; in fuse_aio_complete_req()
803 if (ia->read.in.size != outsize) in fuse_aio_complete_req()
804 pos = ia->read.in.offset - io->offset + outsize; in fuse_aio_complete_req()
808 fuse_io_free(ia); in fuse_aio_complete_req()
812 struct fuse_io_args *ia, size_t num_bytes) in fuse_async_req_send() argument
815 struct fuse_io_priv *io = ia->io; in fuse_async_req_send()
823 ia->ap.args.end = fuse_aio_complete_req; in fuse_async_req_send()
824 ia->ap.args.may_block = io->should_dirty; in fuse_async_req_send()
825 err = fuse_simple_background(fm, &ia->ap.args, GFP_KERNEL); in fuse_async_req_send()
827 fuse_aio_complete_req(fm, &ia->ap.args, err); in fuse_async_req_send()
832 static ssize_t fuse_send_read(struct fuse_io_args *ia, loff_t pos, size_t count, in fuse_send_read() argument
835 struct file *file = ia->io->iocb->ki_filp; in fuse_send_read()
839 fuse_read_args_fill(ia, file, pos, count, FUSE_READ); in fuse_send_read()
841 ia->read.in.read_flags |= FUSE_READ_LOCKOWNER; in fuse_send_read()
842 ia->read.in.lock_owner = fuse_lock_owner_id(fm->fc, owner); in fuse_send_read()
845 if (ia->io->async) in fuse_send_read()
846 return fuse_async_req_send(fm, ia, count); in fuse_send_read()
848 return fuse_simple_request(fm, &ia->ap.args); in fuse_send_read()
888 struct fuse_io_args ia = { in fuse_do_readpage() local
911 fuse_read_args_fill(&ia, file, pos, desc.length, FUSE_READ); in fuse_do_readpage()
912 res = fuse_simple_request(fm, &ia.ap.args); in fuse_do_readpage()
919 fuse_short_read(inode, attr_ver, res, &ia.ap); in fuse_do_readpage()
947 struct fuse_io_args *ia = container_of(args, typeof(*ia), ap.args); in fuse_readpages_end() local
948 struct fuse_args_pages *ap = &ia->ap; in fuse_readpages_end()
949 size_t count = ia->read.in.size; in fuse_readpages_end()
963 fuse_short_read(inode, ia->read.attr_ver, num_read, ap); in fuse_readpages_end()
978 if (ia->ff) { in fuse_readpages_end()
980 fuse_file_put(mapping ? mapping->host : NULL, ia->ff, in fuse_readpages_end()
984 fuse_io_free(ia); in fuse_readpages_end()
987 static void fuse_send_readpages(struct fuse_io_args *ia, struct file *file) in fuse_send_readpages() argument
991 struct fuse_args_pages *ap = &ia->ap; in fuse_send_readpages()
1008 fuse_read_args_fill(ia, file, pos, count, FUSE_READ); in fuse_send_readpages()
1009 ia->read.attr_ver = fuse_get_attr_version(fm->fc); in fuse_send_readpages()
1011 ia->ff = fuse_file_get(ff); in fuse_send_readpages()
1046 struct fuse_io_args *ia; in fuse_readahead() local
1062 ia = fuse_io_alloc(NULL, nr_pages); in fuse_readahead()
1063 if (!ia) in fuse_readahead()
1065 ap = &ia->ap; in fuse_readahead()
1073 fuse_send_readpages(ia, rac->file); in fuse_readahead()
1098 static void fuse_write_args_fill(struct fuse_io_args *ia, struct fuse_file *ff, in fuse_write_args_fill() argument
1101 struct fuse_args *args = &ia->ap.args; in fuse_write_args_fill()
1103 ia->write.in.fh = ff->fh; in fuse_write_args_fill()
1104 ia->write.in.offset = pos; in fuse_write_args_fill()
1105 ia->write.in.size = count; in fuse_write_args_fill()
1112 args->in_args[0].size = sizeof(ia->write.in); in fuse_write_args_fill()
1113 args->in_args[0].value = &ia->write.in; in fuse_write_args_fill()
1116 args->out_args[0].size = sizeof(ia->write.out); in fuse_write_args_fill()
1117 args->out_args[0].value = &ia->write.out; in fuse_write_args_fill()
1132 static ssize_t fuse_send_write(struct fuse_io_args *ia, loff_t pos, in fuse_send_write() argument
1135 struct kiocb *iocb = ia->io->iocb; in fuse_send_write()
1139 struct fuse_write_in *inarg = &ia->write.in; in fuse_send_write()
1142 fuse_write_args_fill(ia, ff, pos, count); in fuse_send_write()
1149 if (ia->io->async) in fuse_send_write()
1150 return fuse_async_req_send(fm, ia, count); in fuse_send_write()
1152 err = fuse_simple_request(fm, &ia->ap.args); in fuse_send_write()
1153 if (!err && ia->write.out.size > count) in fuse_send_write()
1156 return err ?: ia->write.out.size; in fuse_send_write()
1178 static ssize_t fuse_send_write_pages(struct fuse_io_args *ia, in fuse_send_write_pages() argument
1182 struct fuse_args_pages *ap = &ia->ap; in fuse_send_write_pages()
1193 fuse_write_args_fill(ia, ff, pos, count); in fuse_send_write_pages()
1194 ia->write.in.flags = fuse_write_flags(iocb); in fuse_send_write_pages()
1196 ia->write.in.write_flags |= FUSE_WRITE_KILL_SUIDGID; in fuse_send_write_pages()
1199 if (!err && ia->write.out.size > count) in fuse_send_write_pages()
1202 short_write = ia->write.out.size < count; in fuse_send_write_pages()
1204 count = ia->write.out.size; in fuse_send_write_pages()
1220 if (ia->write.page_locked && (i == ap->num_pages - 1)) in fuse_send_write_pages()
1228 static ssize_t fuse_fill_write_pages(struct fuse_io_args *ia, in fuse_fill_write_pages() argument
1233 struct fuse_args_pages *ap = &ia->ap; in fuse_fill_write_pages()
1291 ia->write.page_locked = true; in fuse_fill_write_pages()
1326 struct fuse_io_args ia = {}; in fuse_perform_write() local
1327 struct fuse_args_pages *ap = &ia.ap; in fuse_perform_write()
1337 count = fuse_fill_write_pages(&ia, mapping, ii, pos, nr_pages); in fuse_perform_write()
1341 err = fuse_send_write_pages(&ia, iocb, inode, in fuse_perform_write()
1344 size_t num_written = ia.write.out.size; in fuse_perform_write()
1530 struct fuse_io_args *ia; in fuse_direct_io() local
1534 ia = fuse_io_alloc(io, max_pages); in fuse_direct_io()
1535 if (!ia) in fuse_direct_io()
1552 err = fuse_get_user_pages(&ia->ap, iter, &nbytes, write, in fuse_direct_io()
1559 ia->write.in.write_flags |= FUSE_WRITE_KILL_SUIDGID; in fuse_direct_io()
1561 nres = fuse_send_write(ia, pos, nbytes, owner); in fuse_direct_io()
1563 nres = fuse_send_read(ia, pos, nbytes, owner); in fuse_direct_io()
1567 fuse_release_user_pages(&ia->ap, io->should_dirty); in fuse_direct_io()
1568 fuse_io_free(ia); in fuse_direct_io()
1570 ia = NULL; in fuse_direct_io()
1587 ia = fuse_io_alloc(io, max_pages); in fuse_direct_io()
1588 if (!ia) in fuse_direct_io()
1592 if (ia) in fuse_direct_io()
1593 fuse_io_free(ia); in fuse_direct_io()
1725 struct fuse_args_pages *ap = &wpa->ia.ap; in fuse_writepage_free()
1734 if (wpa->ia.ff) in fuse_writepage_free()
1735 fuse_file_put(wpa->inode, wpa->ia.ff, false, false); in fuse_writepage_free()
1744 struct fuse_args_pages *ap = &wpa->ia.ap; in fuse_writepage_finish()
1766 struct fuse_write_in *inarg = &wpa->ia.write.in; in fuse_send_writepage()
1767 struct fuse_args *args = &wpa->ia.ap.args; in fuse_send_writepage()
1768 __u64 data_size = wpa->ia.ap.num_pages * PAGE_SIZE; in fuse_send_writepage()
1841 pgoff_t idx_from = wpa->ia.write.in.offset >> PAGE_SHIFT; in fuse_insert_writeback()
1842 pgoff_t idx_to = idx_from + wpa->ia.ap.num_pages - 1; in fuse_insert_writeback()
1846 WARN_ON(!wpa->ia.ap.num_pages); in fuse_insert_writeback()
1855 curr_index = curr->ia.write.in.offset >> PAGE_SHIFT; in fuse_insert_writeback()
1857 if (idx_from >= curr_index + curr->ia.ap.num_pages) in fuse_insert_writeback()
1879 container_of(args, typeof(*wpa), ia.ap.args); in fuse_writepage_end()
1897 struct fuse_write_in *inarg = &wpa->ia.write.in; in fuse_writepage_end()
1902 next->ia.ff = fuse_file_get(wpa->ia.ff); in fuse_writepage_end()
2002 ap = &wpa->ia.ap; in fuse_writepage_args_alloc()
2044 ap = &wpa->ia.ap; in fuse_writepage_locked()
2051 wpa->ia.ff = fuse_write_file_get(fi); in fuse_writepage_locked()
2052 if (!wpa->ia.ff) in fuse_writepage_locked()
2056 fuse_write_args_fill(&wpa->ia, wpa->ia.ff, page_offset(page), 0); in fuse_writepage_locked()
2059 wpa->ia.write.in.write_flags |= FUSE_WRITE_CACHE; in fuse_writepage_locked()
2130 struct fuse_args_pages *ap = &data->wpa->ia.ap; in fuse_pages_realloc()
2159 int num_pages = wpa->ia.ap.num_pages; in fuse_writepages_send()
2162 wpa->ia.ff = fuse_file_get(data->ff); in fuse_writepages_send()
2185 struct fuse_args_pages *new_ap = &new_wpa->ia.ap; in fuse_writepage_add()
2201 curr_index = tmp->ia.write.in.offset >> PAGE_SHIFT; in fuse_writepage_add()
2203 WARN_ON(tmp->ia.ap.num_pages != 1); in fuse_writepage_add()
2204 swap(tmp->ia.ap.pages[0], new_ap->pages[0]); in fuse_writepage_add()
2267 struct fuse_args_pages *ap = &wpa->ia.ap; in fuse_writepages_fill()
2315 ap = &wpa->ia.ap; in fuse_writepages_fill()
2316 fuse_write_args_fill(&wpa->ia, data->ff, page_offset(page), 0); in fuse_writepages_fill()
2317 wpa->ia.write.in.write_flags |= FUSE_WRITE_CACHE; in fuse_writepages_fill()
2384 WARN_ON(!data.wpa->ia.ap.num_pages); in fuse_writepages()