@@ -2058,45 +2058,6 @@ static struct fuse_writepage_args *fuse_writepage_args_setup(struct folio *folio
2058
2058
return wpa ;
2059
2059
}
2060
2060
2061
- static int fuse_writepage_locked (struct folio * folio )
2062
- {
2063
- struct address_space * mapping = folio -> mapping ;
2064
- struct inode * inode = mapping -> host ;
2065
- struct fuse_inode * fi = get_fuse_inode (inode );
2066
- struct fuse_writepage_args * wpa ;
2067
- struct fuse_args_pages * ap ;
2068
- struct fuse_file * ff ;
2069
- int error = - EIO ;
2070
-
2071
- ff = fuse_write_file_get (fi );
2072
- if (!ff )
2073
- goto err ;
2074
-
2075
- wpa = fuse_writepage_args_setup (folio , 0 , ff );
2076
- error = - ENOMEM ;
2077
- if (!wpa )
2078
- goto err_writepage_args ;
2079
-
2080
- ap = & wpa -> ia .ap ;
2081
- ap -> num_folios = 1 ;
2082
-
2083
- folio_start_writeback (folio );
2084
- fuse_writepage_args_page_fill (wpa , folio , 0 , 0 , folio_size (folio ));
2085
-
2086
- spin_lock (& fi -> lock );
2087
- list_add_tail (& wpa -> queue_entry , & fi -> queued_writes );
2088
- fuse_flush_writepages (inode );
2089
- spin_unlock (& fi -> lock );
2090
-
2091
- return 0 ;
2092
-
2093
- err_writepage_args :
2094
- fuse_file_put (ff , false);
2095
- err :
2096
- mapping_set_error (folio -> mapping , error );
2097
- return error ;
2098
- }
2099
-
2100
2061
struct fuse_fill_wb_data {
2101
2062
struct fuse_writepage_args * wpa ;
2102
2063
struct fuse_file * ff ;
@@ -2282,8 +2243,19 @@ static int fuse_writepages(struct address_space *mapping,
2282
2243
static int fuse_launder_folio (struct folio * folio )
2283
2244
{
2284
2245
int err = 0 ;
2246
+ struct fuse_fill_wb_data data = {
2247
+ .inode = folio -> mapping -> host ,
2248
+ };
2249
+ struct iomap_writepage_ctx wpc = {
2250
+ .inode = folio -> mapping -> host ,
2251
+ .iomap .type = IOMAP_MAPPED ,
2252
+ .ops = & fuse_writeback_ops ,
2253
+ .wb_ctx = & data ,
2254
+ };
2255
+
2285
2256
if (folio_clear_dirty_for_io (folio )) {
2286
- err = fuse_writepage_locked (folio );
2257
+ err = iomap_writeback_folio (& wpc , folio );
2258
+ err = fuse_iomap_writeback_submit (& wpc , err );
2287
2259
if (!err )
2288
2260
folio_wait_writeback (folio );
2289
2261
}
0 commit comments