@@ -303,8 +303,8 @@ struct cuse_init_args {
303
303
struct fuse_args_pages ap ;
304
304
struct cuse_init_in in ;
305
305
struct cuse_init_out out ;
306
- struct page * page ;
307
- struct fuse_page_desc desc ;
306
+ struct folio * folio ;
307
+ struct fuse_folio_desc desc ;
308
308
};
309
309
310
310
/**
@@ -326,7 +326,7 @@ static void cuse_process_init_reply(struct fuse_mount *fm,
326
326
struct fuse_args_pages * ap = & ia -> ap ;
327
327
struct cuse_conn * cc = fc_to_cc (fc ), * pos ;
328
328
struct cuse_init_out * arg = & ia -> out ;
329
- struct page * page = ap -> pages [0 ];
329
+ struct folio * folio = ap -> folios [0 ];
330
330
struct cuse_devinfo devinfo = { };
331
331
struct device * dev ;
332
332
struct cdev * cdev ;
@@ -343,7 +343,7 @@ static void cuse_process_init_reply(struct fuse_mount *fm,
343
343
/* parse init reply */
344
344
cc -> unrestricted_ioctl = arg -> flags & CUSE_UNRESTRICTED_IOCTL ;
345
345
346
- rc = cuse_parse_devinfo (page_address ( page ), ap -> args .out_args [1 ].size ,
346
+ rc = cuse_parse_devinfo (folio_address ( folio ), ap -> args .out_args [1 ].size ,
347
347
& devinfo );
348
348
if (rc )
349
349
goto err ;
@@ -411,7 +411,7 @@ static void cuse_process_init_reply(struct fuse_mount *fm,
411
411
kobject_uevent (& dev -> kobj , KOBJ_ADD );
412
412
out :
413
413
kfree (ia );
414
- __free_page ( page );
414
+ folio_put ( folio );
415
415
return ;
416
416
417
417
err_cdev :
@@ -429,21 +429,22 @@ static void cuse_process_init_reply(struct fuse_mount *fm,
429
429
static int cuse_send_init (struct cuse_conn * cc )
430
430
{
431
431
int rc ;
432
- struct page * page ;
432
+ struct folio * folio ;
433
433
struct fuse_mount * fm = & cc -> fm ;
434
434
struct cuse_init_args * ia ;
435
435
struct fuse_args_pages * ap ;
436
436
437
437
BUILD_BUG_ON (CUSE_INIT_INFO_MAX > PAGE_SIZE );
438
438
439
439
rc = - ENOMEM ;
440
- page = alloc_page (GFP_KERNEL | __GFP_ZERO );
441
- if (!page )
440
+
441
+ folio = folio_alloc (GFP_KERNEL | __GFP_ZERO , 0 );
442
+ if (!folio )
442
443
goto err ;
443
444
444
445
ia = kzalloc (sizeof (* ia ), GFP_KERNEL );
445
446
if (!ia )
446
- goto err_free_page ;
447
+ goto err_free_folio ;
447
448
448
449
ap = & ia -> ap ;
449
450
ia -> in .major = FUSE_KERNEL_VERSION ;
@@ -459,18 +460,19 @@ static int cuse_send_init(struct cuse_conn *cc)
459
460
ap -> args .out_args [1 ].size = CUSE_INIT_INFO_MAX ;
460
461
ap -> args .out_argvar = true;
461
462
ap -> args .out_pages = true;
462
- ap -> num_pages = 1 ;
463
- ap -> pages = & ia -> page ;
464
- ap -> descs = & ia -> desc ;
465
- ia -> page = page ;
463
+ ap -> uses_folios = true;
464
+ ap -> num_folios = 1 ;
465
+ ap -> folios = & ia -> folio ;
466
+ ap -> folio_descs = & ia -> desc ;
467
+ ia -> folio = folio ;
466
468
ia -> desc .length = ap -> args .out_args [1 ].size ;
467
469
ap -> args .end = cuse_process_init_reply ;
468
470
469
471
rc = fuse_simple_background (fm , & ap -> args , GFP_KERNEL );
470
472
if (rc ) {
471
473
kfree (ia );
472
- err_free_page :
473
- __free_page ( page );
474
+ err_free_folio :
475
+ folio_put ( folio );
474
476
}
475
477
err :
476
478
return rc ;
0 commit comments