Lines Matching refs:fc

25 static int fuse_send_open(struct fuse_conn *fc, u64 nodeid, struct file *file,  in fuse_send_open()  argument
33 if (!fc->atomic_o_trunc) in fuse_send_open()
44 return fuse_simple_request(fc, &args); in fuse_send_open()
47 struct fuse_file *fuse_file_alloc(struct fuse_conn *fc) in fuse_file_alloc() argument
55 ff->fc = fc; in fuse_file_alloc()
67 spin_lock(&fc->lock); in fuse_file_alloc()
68 ff->kh = ++fc->khctr; in fuse_file_alloc()
69 spin_unlock(&fc->lock); in fuse_file_alloc()
86 static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req) in fuse_release_end() argument
96 if (ff->fc->no_open && !isdir) { in fuse_file_put()
103 fuse_put_request(ff->fc, req); in fuse_file_put()
107 fuse_request_send(ff->fc, req); in fuse_file_put()
109 fuse_put_request(ff->fc, req); in fuse_file_put()
113 fuse_request_send_background(ff->fc, req); in fuse_file_put()
119 int fuse_do_open(struct fuse_conn *fc, u64 nodeid, struct file *file, in fuse_do_open() argument
125 ff = fuse_file_alloc(fc); in fuse_do_open()
131 if (!fc->no_open || isdir) { in fuse_do_open()
135 err = fuse_send_open(fc, nodeid, file, opcode, &outarg); in fuse_do_open()
144 fc->no_open = 1; in fuse_do_open()
161 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_link_write_file() local
168 spin_lock(&fc->lock); in fuse_link_write_file()
171 spin_unlock(&fc->lock); in fuse_link_write_file()
177 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_finish_open() local
186 if (fc->atomic_o_trunc && (file->f_flags & O_TRUNC)) { in fuse_finish_open()
189 spin_lock(&fc->lock); in fuse_finish_open()
190 fi->attr_version = ++fc->attr_version; in fuse_finish_open()
192 spin_unlock(&fc->lock); in fuse_finish_open()
195 if (fc->writeback_cache) in fuse_finish_open()
201 if ((file->f_mode & FMODE_WRITE) && fc->writeback_cache) in fuse_finish_open()
207 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_open_common() local
210 fc->atomic_o_trunc && in fuse_open_common()
211 fc->writeback_cache; in fuse_open_common()
225 err = fuse_do_open(fc, get_node_id(inode), file, isdir); in fuse_open_common()
240 struct fuse_conn *fc = ff->fc; in fuse_prepare_release() local
244 spin_lock(&fc->lock); in fuse_prepare_release()
247 rb_erase(&ff->polled_node, &fc->polled_files); in fuse_prepare_release()
248 spin_unlock(&fc->lock); in fuse_prepare_release()
272 inarg->lock_owner = fuse_lock_owner_id(ff->fc, in fuse_release_common()
287 fuse_file_put(ff, ff->fc->destroy_req != NULL, isdir); in fuse_release_common()
297 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_release() local
300 if (fc->writeback_cache) in fuse_release()
325 u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id) in fuse_lock_owner_id() argument
327 u32 *k = fc->scramble_key; in fuse_lock_owner_id()
352 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_range_is_writeback() local
357 spin_lock(&fc->lock); in fuse_range_is_writeback()
369 spin_unlock(&fc->lock); in fuse_range_is_writeback()
411 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_flush() local
420 if (fc->no_flush) in fuse_flush()
435 req = fuse_get_req_nofail_nopages(fc, file); in fuse_flush()
438 inarg.lock_owner = fuse_lock_owner_id(fc, id); in fuse_flush()
445 fuse_request_send(fc, req); in fuse_flush()
447 fuse_put_request(fc, req); in fuse_flush()
449 fc->no_flush = 1; in fuse_flush()
459 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_fsync_common() local
494 if ((!isdir && fc->no_fsync) || (isdir && fc->no_fsyncdir)) in fuse_fsync_common()
505 err = fuse_simple_request(fc, &args); in fuse_fsync_common()
508 fc->no_fsyncdir = 1; in fuse_fsync_common()
510 fc->no_fsync = 1; in fuse_fsync_common()
608 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_aio_complete() local
611 spin_lock(&fc->lock); in fuse_aio_complete()
612 fi->attr_version = ++fc->attr_version; in fuse_aio_complete()
613 spin_unlock(&fc->lock); in fuse_aio_complete()
622 static void fuse_aio_complete_req(struct fuse_conn *fc, struct fuse_req *req) in fuse_aio_complete_req() argument
642 static size_t fuse_async_req_send(struct fuse_conn *fc, struct fuse_req *req, in fuse_async_req_send() argument
655 fuse_request_send_background(fc, req); in fuse_async_req_send()
665 struct fuse_conn *fc = ff->fc; in fuse_send_read() local
672 inarg->lock_owner = fuse_lock_owner_id(fc, owner); in fuse_send_read()
676 return fuse_async_req_send(fc, req, count, io); in fuse_send_read()
678 fuse_request_send(fc, req); in fuse_send_read()
685 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_read_update_size() local
688 spin_lock(&fc->lock); in fuse_read_update_size()
691 fi->attr_version = ++fc->attr_version; in fuse_read_update_size()
694 spin_unlock(&fc->lock); in fuse_read_update_size()
701 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_short_read() local
703 if (fc->writeback_cache) { in fuse_short_read()
728 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_do_readpage() local
743 req = fuse_get_req(fc, 1); in fuse_do_readpage()
747 attr_ver = fuse_get_attr_version(fc); in fuse_do_readpage()
769 fuse_put_request(fc, req); in fuse_do_readpage()
790 static void fuse_readpages_end(struct fuse_conn *fc, struct fuse_req *req) in fuse_readpages_end() argument
828 struct fuse_conn *fc = ff->fc; in fuse_send_readpages() local
836 req->misc.read.attr_ver = fuse_get_attr_version(fc); in fuse_send_readpages()
837 if (fc->async_read) { in fuse_send_readpages()
840 fuse_request_send_background(fc, req); in fuse_send_readpages()
842 fuse_request_send(fc, req); in fuse_send_readpages()
843 fuse_readpages_end(fc, req); in fuse_send_readpages()
844 fuse_put_request(fc, req); in fuse_send_readpages()
860 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_readpages_fill() local
866 (req->num_pages + 1) * PAGE_SIZE > fc->max_read || in fuse_readpages_fill()
871 if (fc->async_read) in fuse_readpages_fill()
872 req = fuse_get_req_for_background(fc, nr_alloc); in fuse_readpages_fill()
874 req = fuse_get_req(fc, nr_alloc); in fuse_readpages_fill()
885 fuse_put_request(fc, req); in fuse_readpages_fill()
901 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_readpages() local
912 if (fc->async_read) in fuse_readpages()
913 data.req = fuse_get_req_for_background(fc, nr_alloc); in fuse_readpages()
915 data.req = fuse_get_req(fc, nr_alloc); in fuse_readpages()
926 fuse_put_request(fc, data.req); in fuse_readpages()
935 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_file_read_iter() local
945 if (fc->auto_inval_data || in fuse_file_read_iter()
968 if (ff->fc->minor < 9) in fuse_write_fill()
985 struct fuse_conn *fc = ff->fc; in fuse_send_write() local
996 inarg->lock_owner = fuse_lock_owner_id(fc, owner); in fuse_send_write()
1000 return fuse_async_req_send(fc, req, count, io); in fuse_send_write()
1002 fuse_request_send(fc, req); in fuse_send_write()
1008 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_write_update_size() local
1012 spin_lock(&fc->lock); in fuse_write_update_size()
1013 fi->attr_version = ++fc->attr_version; in fuse_write_update_size()
1018 spin_unlock(&fc->lock); in fuse_write_update_size()
1062 struct fuse_conn *fc = get_fuse_conn(mapping->host); in fuse_fill_write_pages() local
1077 bytes = min_t(size_t, bytes, fc->max_write - count); in fuse_fill_write_pages()
1114 if (!fc->big_writes) in fuse_fill_write_pages()
1116 } while (iov_iter_count(ii) && count < fc->max_write && in fuse_fill_write_pages()
1135 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_perform_write() local
1151 req = fuse_get_req(fc, nr_pages); in fuse_perform_write()
1175 fuse_put_request(fc, req); in fuse_perform_write()
1356 struct fuse_conn *fc = ff->fc; in fuse_direct_io() local
1357 size_t nmax = write ? fc->max_write : fc->max_read; in fuse_direct_io()
1367 req = fuse_get_req_for_background(fc, fuse_iter_npages(iter)); in fuse_direct_io()
1369 req = fuse_get_req(fc, fuse_iter_npages(iter)); in fuse_direct_io()
1411 fuse_put_request(fc, req); in fuse_direct_io()
1413 req = fuse_get_req_for_background(fc, in fuse_direct_io()
1416 req = fuse_get_req(fc, fuse_iter_npages(iter)); in fuse_direct_io()
1422 fuse_put_request(fc, req); in fuse_direct_io()
1475 static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req) in fuse_writepage_free() argument
1486 static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req) in fuse_writepage_finish() argument
1503 static void fuse_send_writepage(struct fuse_conn *fc, struct fuse_req *req, in fuse_send_writepage() argument
1505 __releases(fc->lock) in fuse_send_writepage()
1506 __acquires(fc->lock) in fuse_send_writepage()
1512 if (!fc->connected) in fuse_send_writepage()
1526 fuse_request_send_background_locked(fc, req); in fuse_send_writepage()
1530 fuse_writepage_finish(fc, req); in fuse_send_writepage()
1531 spin_unlock(&fc->lock); in fuse_send_writepage()
1532 fuse_writepage_free(fc, req); in fuse_send_writepage()
1533 fuse_put_request(fc, req); in fuse_send_writepage()
1534 spin_lock(&fc->lock); in fuse_send_writepage()
1544 __releases(fc->lock) in fuse_flush_writepages()
1545 __acquires(fc->lock) in fuse_flush_writepages()
1547 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_flush_writepages() local
1555 fuse_send_writepage(fc, req, crop); in fuse_flush_writepages()
1559 static void fuse_writepage_end(struct fuse_conn *fc, struct fuse_req *req) in fuse_writepage_end() argument
1565 spin_lock(&fc->lock); in fuse_writepage_end()
1567 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_writepage_end() local
1598 fuse_send_writepage(fc, next, inarg->offset + inarg->size); in fuse_writepage_end()
1601 fuse_writepage_finish(fc, req); in fuse_writepage_end()
1602 spin_unlock(&fc->lock); in fuse_writepage_end()
1603 fuse_writepage_free(fc, req); in fuse_writepage_end()
1606 static struct fuse_file *__fuse_write_file_get(struct fuse_conn *fc, in __fuse_write_file_get() argument
1611 spin_lock(&fc->lock); in __fuse_write_file_get()
1617 spin_unlock(&fc->lock); in __fuse_write_file_get()
1622 static struct fuse_file *fuse_write_file_get(struct fuse_conn *fc, in fuse_write_file_get() argument
1625 struct fuse_file *ff = __fuse_write_file_get(fc, fi); in fuse_write_file_get()
1632 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_write_inode() local
1637 ff = __fuse_write_file_get(fc, fi); in fuse_write_inode()
1649 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_writepage_locked() local
1668 req->ff = fuse_write_file_get(fc, fi); in fuse_writepage_locked()
1688 spin_lock(&fc->lock); in fuse_writepage_locked()
1692 spin_unlock(&fc->lock); in fuse_writepage_locked()
1742 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_writepages_send() local
1748 spin_lock(&fc->lock); in fuse_writepages_send()
1751 spin_unlock(&fc->lock); in fuse_writepages_send()
1760 struct fuse_conn *fc = get_fuse_conn(new_req->inode); in fuse_writepage_in_flight() local
1769 spin_lock(&fc->lock); in fuse_writepage_in_flight()
1799 spin_unlock(&fc->lock); in fuse_writepage_in_flight()
1804 fuse_writepage_free(fc, new_req); in fuse_writepage_in_flight()
1812 spin_unlock(&fc->lock); in fuse_writepage_in_flight()
1823 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_writepages_fill() local
1830 data->ff = fuse_write_file_get(fc, get_fuse_inode(inode)); in fuse_writepages_fill()
1845 (req->num_pages + 1) * PAGE_SIZE > fc->max_write || in fuse_writepages_fill()
1887 spin_lock(&fc->lock); in fuse_writepages_fill()
1889 spin_unlock(&fc->lock); in fuse_writepages_fill()
1915 spin_lock(&fc->lock); in fuse_writepages_fill()
1917 spin_unlock(&fc->lock); in fuse_writepages_fill()
1971 struct fuse_conn *fc = get_fuse_conn(file_inode(file)); in fuse_write_begin() local
1976 WARN_ON(!fc->writeback_cache); in fuse_write_begin()
2119 static int convert_fuse_file_lock(struct fuse_conn *fc, in convert_fuse_file_lock() argument
2141 fl->fl_pid = pid_nr_ns(find_pid_ns(ffl->pid, fc->pid_ns), &init_pid_ns); in convert_fuse_file_lock()
2157 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_lk_fill() local
2162 inarg->owner = fuse_lock_owner_id(fc, fl->fl_owner); in fuse_lk_fill()
2179 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_getlk() local
2189 err = fuse_simple_request(fc, &args); in fuse_getlk()
2191 err = convert_fuse_file_lock(fc, &outarg.lk, fl); in fuse_getlk()
2199 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_setlk() local
2204 pid_t pid_nr = pid_nr_ns(pid, fc->pid_ns); in fuse_setlk()
2217 err = fuse_simple_request(fc, &args); in fuse_setlk()
2229 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_file_lock() local
2235 if (fc->no_lock) { in fuse_file_lock()
2241 if (fc->no_lock) in fuse_file_lock()
2252 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_file_flock() local
2255 if (fc->no_flock) { in fuse_file_flock()
2271 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_bmap() local
2277 if (!inode->i_sb->s_bdev || fc->no_bmap) in fuse_bmap()
2291 err = fuse_simple_request(fc, &args); in fuse_bmap()
2293 fc->no_bmap = 1; in fuse_bmap()
2301 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_lseek() local
2312 if (fc->no_lseek) in fuse_lseek()
2323 err = fuse_simple_request(fc, &args); in fuse_lseek()
2326 fc->no_lseek = 1; in fuse_lseek()
2425 static int fuse_copy_ioctl_iovec(struct fuse_conn *fc, struct iovec *dst, in fuse_copy_ioctl_iovec() argument
2432 if (fc->minor < 16) { in fuse_copy_ioctl_iovec()
2511 struct fuse_conn *fc = ff->fc; in fuse_do_ioctl() local
2596 req = fuse_get_req(fc, num_pages); in fuse_do_ioctl()
2633 fuse_request_send(fc, req); in fuse_do_ioctl()
2636 fuse_put_request(fc, req); in fuse_do_ioctl()
2664 err = fuse_copy_ioctl_iovec(fc, iov_page, vaddr, in fuse_do_ioctl()
2699 fuse_put_request(fc, req); in fuse_do_ioctl()
2713 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_ioctl_common() local
2715 if (!fuse_allow_current_process(fc)) in fuse_ioctl_common()
2741 static struct rb_node **fuse_find_polled_node(struct fuse_conn *fc, u64 kh, in fuse_find_polled_node() argument
2744 struct rb_node **link = &fc->polled_files.rb_node; in fuse_find_polled_node()
2772 static void fuse_register_polled_file(struct fuse_conn *fc, in fuse_register_polled_file() argument
2775 spin_lock(&fc->lock); in fuse_register_polled_file()
2779 link = fuse_find_polled_node(fc, ff->kh, &parent); in fuse_register_polled_file()
2782 rb_insert_color(&ff->polled_node, &fc->polled_files); in fuse_register_polled_file()
2784 spin_unlock(&fc->lock); in fuse_register_polled_file()
2790 struct fuse_conn *fc = ff->fc; in fuse_file_poll() local
2796 if (fc->no_poll) in fuse_file_poll()
2808 fuse_register_polled_file(fc, ff); in fuse_file_poll()
2819 err = fuse_simple_request(fc, &args); in fuse_file_poll()
2824 fc->no_poll = 1; in fuse_file_poll()
2835 int fuse_notify_poll_wakeup(struct fuse_conn *fc, in fuse_notify_poll_wakeup() argument
2841 spin_lock(&fc->lock); in fuse_notify_poll_wakeup()
2843 link = fuse_find_polled_node(fc, kh, NULL); in fuse_notify_poll_wakeup()
2851 spin_unlock(&fc->lock); in fuse_notify_poll_wakeup()
2881 bool async_dio = ff->fc->async_dio; in fuse_direct_IO()
2977 struct fuse_conn *fc = ff->fc; in fuse_file_fallocate() local
2992 if (fc->no_fallocate) in fuse_file_fallocate()
3023 err = fuse_simple_request(fc, &args); in fuse_file_fallocate()
3025 fc->no_fallocate = 1; in fuse_file_fallocate()
3035 if (changed && fc->writeback_cache) in fuse_file_fallocate()