Lines Matching refs:wpa

433 		struct fuse_writepage_args *wpa;  in fuse_find_writeback()  local
436 wpa = rb_entry(n, struct fuse_writepage_args, writepages_entry); in fuse_find_writeback()
437 WARN_ON(get_fuse_inode(wpa->inode) != fi); in fuse_find_writeback()
438 curr_index = wpa->ia.write.in.offset >> PAGE_SHIFT; in fuse_find_writeback()
439 if (idx_from >= curr_index + wpa->ia.ap.num_pages) in fuse_find_writeback()
444 return wpa; in fuse_find_writeback()
1755 static void fuse_writepage_free(struct fuse_writepage_args *wpa) in fuse_writepage_free() argument
1757 struct fuse_args_pages *ap = &wpa->ia.ap; in fuse_writepage_free()
1760 if (wpa->bucket) in fuse_writepage_free()
1761 fuse_sync_bucket_dec(wpa->bucket); in fuse_writepage_free()
1766 fuse_file_put(wpa->ia.ff, false); in fuse_writepage_free()
1769 kfree(wpa); in fuse_writepage_free()
1781 static void fuse_writepage_finish(struct fuse_writepage_args *wpa) in fuse_writepage_finish() argument
1783 struct fuse_args_pages *ap = &wpa->ia.ap; in fuse_writepage_finish()
1784 struct inode *inode = wpa->inode; in fuse_writepage_finish()
1796 struct fuse_writepage_args *wpa, loff_t size) in fuse_send_writepage() argument
1801 struct fuse_inode *fi = get_fuse_inode(wpa->inode); in fuse_send_writepage()
1802 struct fuse_write_in *inarg = &wpa->ia.write.in; in fuse_send_writepage()
1803 struct fuse_args *args = &wpa->ia.ap.args; in fuse_send_writepage()
1804 __u64 data_size = wpa->ia.ap.num_pages * PAGE_SIZE; in fuse_send_writepage()
1836 rb_erase(&wpa->writepages_entry, &fi->writepages); in fuse_send_writepage()
1837 fuse_writepage_finish(wpa); in fuse_send_writepage()
1841 for (aux = wpa->next; aux; aux = next) { in fuse_send_writepage()
1848 fuse_writepage_free(wpa); in fuse_send_writepage()
1865 struct fuse_writepage_args *wpa; in fuse_flush_writepages() local
1868 wpa = list_entry(fi->queued_writes.next, in fuse_flush_writepages()
1870 list_del_init(&wpa->queue_entry); in fuse_flush_writepages()
1871 fuse_send_writepage(fm, wpa, crop); in fuse_flush_writepages()
1876 struct fuse_writepage_args *wpa) in fuse_insert_writeback() argument
1878 pgoff_t idx_from = wpa->ia.write.in.offset >> PAGE_SHIFT; in fuse_insert_writeback()
1879 pgoff_t idx_to = idx_from + wpa->ia.ap.num_pages - 1; in fuse_insert_writeback()
1883 WARN_ON(!wpa->ia.ap.num_pages); in fuse_insert_writeback()
1891 WARN_ON(curr->inode != wpa->inode); in fuse_insert_writeback()
1902 rb_link_node(&wpa->writepages_entry, parent, p); in fuse_insert_writeback()
1903 rb_insert_color(&wpa->writepages_entry, root); in fuse_insert_writeback()
1907 static void tree_insert(struct rb_root *root, struct fuse_writepage_args *wpa) in tree_insert() argument
1909 WARN_ON(fuse_insert_writeback(root, wpa)); in tree_insert()
1915 struct fuse_writepage_args *wpa = in fuse_writepage_end() local
1916 container_of(args, typeof(*wpa), ia.ap.args); in fuse_writepage_end()
1917 struct inode *inode = wpa->inode; in fuse_writepage_end()
1931 rb_erase(&wpa->writepages_entry, &fi->writepages); in fuse_writepage_end()
1932 while (wpa->next) { in fuse_writepage_end()
1934 struct fuse_write_in *inarg = &wpa->ia.write.in; in fuse_writepage_end()
1935 struct fuse_writepage_args *next = wpa->next; in fuse_writepage_end()
1937 wpa->next = next->next; in fuse_writepage_end()
1967 fuse_writepage_finish(wpa); in fuse_writepage_end()
1969 fuse_writepage_free(wpa); in fuse_writepage_end()
2020 struct fuse_writepage_args *wpa; in fuse_writepage_args_alloc() local
2023 wpa = kzalloc(sizeof(*wpa), GFP_NOFS); in fuse_writepage_args_alloc()
2024 if (wpa) { in fuse_writepage_args_alloc()
2025 ap = &wpa->ia.ap; in fuse_writepage_args_alloc()
2029 kfree(wpa); in fuse_writepage_args_alloc()
2030 wpa = NULL; in fuse_writepage_args_alloc()
2033 return wpa; in fuse_writepage_args_alloc()
2038 struct fuse_writepage_args *wpa) in fuse_writepage_add_to_bucket() argument
2046 wpa->bucket = rcu_dereference(fc->curr_bucket); in fuse_writepage_add_to_bucket()
2047 } while (unlikely(!atomic_inc_not_zero(&wpa->bucket->count))); in fuse_writepage_add_to_bucket()
2051 static void fuse_writepage_args_page_fill(struct fuse_writepage_args *wpa, struct folio *folio, in fuse_writepage_args_page_fill() argument
2055 struct fuse_args_pages *ap = &wpa->ia.ap; in fuse_writepage_args_page_fill()
2072 struct fuse_writepage_args *wpa; in fuse_writepage_args_setup() local
2075 wpa = fuse_writepage_args_alloc(); in fuse_writepage_args_setup()
2076 if (!wpa) in fuse_writepage_args_setup()
2079 fuse_writepage_add_to_bucket(fc, wpa); in fuse_writepage_args_setup()
2080 fuse_write_args_fill(&wpa->ia, ff, folio_pos(folio), 0); in fuse_writepage_args_setup()
2081 wpa->ia.write.in.write_flags |= FUSE_WRITE_CACHE; in fuse_writepage_args_setup()
2082 wpa->inode = inode; in fuse_writepage_args_setup()
2083 wpa->ia.ff = ff; in fuse_writepage_args_setup()
2085 ap = &wpa->ia.ap; in fuse_writepage_args_setup()
2089 return wpa; in fuse_writepage_args_setup()
2097 struct fuse_writepage_args *wpa; in fuse_writepage_locked() local
2112 wpa = fuse_writepage_args_setup(folio, ff); in fuse_writepage_locked()
2114 if (!wpa) in fuse_writepage_locked()
2117 ap = &wpa->ia.ap; in fuse_writepage_locked()
2121 fuse_writepage_args_page_fill(wpa, folio, tmp_folio, 0); in fuse_writepage_locked()
2124 tree_insert(&fi->writepages, wpa); in fuse_writepage_locked()
2125 list_add_tail(&wpa->queue_entry, &fi->queued_writes); in fuse_writepage_locked()
2143 struct fuse_writepage_args *wpa; member
2152 struct fuse_args_pages *ap = &data->wpa->ia.ap; in fuse_pages_realloc()
2178 struct fuse_writepage_args *wpa = data->wpa; in fuse_writepages_send() local
2181 int num_pages = wpa->ia.ap.num_pages; in fuse_writepages_send()
2185 list_add_tail(&wpa->queue_entry, &fi->queued_writes); in fuse_writepages_send()
2283 struct fuse_writepage_args *wpa = data->wpa; in fuse_writepages_fill() local
2284 struct fuse_args_pages *ap = &wpa->ia.ap; in fuse_writepages_fill()
2298 if (wpa && fuse_writepage_need_send(fc, &folio->page, ap, data)) { in fuse_writepages_fill()
2300 data->wpa = NULL; in fuse_writepages_fill()
2321 if (data->wpa == NULL) { in fuse_writepages_fill()
2323 wpa = fuse_writepage_args_setup(folio, data->ff); in fuse_writepages_fill()
2324 if (!wpa) { in fuse_writepages_fill()
2328 fuse_file_get(wpa->ia.ff); in fuse_writepages_fill()
2330 ap = &wpa->ia.ap; in fuse_writepages_fill()
2334 fuse_writepage_args_page_fill(wpa, folio, tmp_folio, ap->num_pages); in fuse_writepages_fill()
2338 if (data->wpa) { in fuse_writepages_fill()
2346 } else if (fuse_writepage_add(wpa, &folio->page)) { in fuse_writepages_fill()
2347 data->wpa = wpa; in fuse_writepages_fill()
2374 data.wpa = NULL; in fuse_writepages()
2385 if (data.wpa) { in fuse_writepages()
2386 WARN_ON(!data.wpa->ia.ap.num_pages); in fuse_writepages()