@@ -271,18 +271,7 @@ static int readahead_cache(struct inode *inode)
271
271
return 0 ;
272
272
}
273
273
274
- struct io_ctl {
275
- void * cur , * orig ;
276
- struct page * page ;
277
- struct page * * pages ;
278
- struct btrfs_root * root ;
279
- unsigned long size ;
280
- int index ;
281
- int num_pages ;
282
- unsigned check_crcs :1 ;
283
- };
284
-
285
- static int io_ctl_init (struct io_ctl * io_ctl , struct inode * inode ,
274
+ static int io_ctl_init (struct btrfs_io_ctl * io_ctl , struct inode * inode ,
286
275
struct btrfs_root * root , int write )
287
276
{
288
277
int num_pages ;
@@ -298,7 +287,7 @@ static int io_ctl_init(struct io_ctl *io_ctl, struct inode *inode,
298
287
(num_pages * sizeof (u32 )) >= PAGE_CACHE_SIZE )
299
288
return - ENOSPC ;
300
289
301
- memset (io_ctl , 0 , sizeof (struct io_ctl ));
290
+ memset (io_ctl , 0 , sizeof (struct btrfs_io_ctl ));
302
291
303
292
io_ctl -> pages = kcalloc (num_pages , sizeof (struct page * ), GFP_NOFS );
304
293
if (!io_ctl -> pages )
@@ -311,12 +300,12 @@ static int io_ctl_init(struct io_ctl *io_ctl, struct inode *inode,
311
300
return 0 ;
312
301
}
313
302
314
- static void io_ctl_free (struct io_ctl * io_ctl )
303
+ static void io_ctl_free (struct btrfs_io_ctl * io_ctl )
315
304
{
316
305
kfree (io_ctl -> pages );
317
306
}
318
307
319
- static void io_ctl_unmap_page (struct io_ctl * io_ctl )
308
+ static void io_ctl_unmap_page (struct btrfs_io_ctl * io_ctl )
320
309
{
321
310
if (io_ctl -> cur ) {
322
311
kunmap (io_ctl -> page );
@@ -325,7 +314,7 @@ static void io_ctl_unmap_page(struct io_ctl *io_ctl)
325
314
}
326
315
}
327
316
328
- static void io_ctl_map_page (struct io_ctl * io_ctl , int clear )
317
+ static void io_ctl_map_page (struct btrfs_io_ctl * io_ctl , int clear )
329
318
{
330
319
ASSERT (io_ctl -> index < io_ctl -> num_pages );
331
320
io_ctl -> page = io_ctl -> pages [io_ctl -> index ++ ];
@@ -336,7 +325,7 @@ static void io_ctl_map_page(struct io_ctl *io_ctl, int clear)
336
325
memset (io_ctl -> cur , 0 , PAGE_CACHE_SIZE );
337
326
}
338
327
339
- static void io_ctl_drop_pages (struct io_ctl * io_ctl )
328
+ static void io_ctl_drop_pages (struct btrfs_io_ctl * io_ctl )
340
329
{
341
330
int i ;
342
331
@@ -351,7 +340,7 @@ static void io_ctl_drop_pages(struct io_ctl *io_ctl)
351
340
}
352
341
}
353
342
354
- static int io_ctl_prepare_pages (struct io_ctl * io_ctl , struct inode * inode ,
343
+ static int io_ctl_prepare_pages (struct btrfs_io_ctl * io_ctl , struct inode * inode ,
355
344
int uptodate )
356
345
{
357
346
struct page * page ;
@@ -385,7 +374,7 @@ static int io_ctl_prepare_pages(struct io_ctl *io_ctl, struct inode *inode,
385
374
return 0 ;
386
375
}
387
376
388
- static void io_ctl_set_generation (struct io_ctl * io_ctl , u64 generation )
377
+ static void io_ctl_set_generation (struct btrfs_io_ctl * io_ctl , u64 generation )
389
378
{
390
379
__le64 * val ;
391
380
@@ -408,7 +397,7 @@ static void io_ctl_set_generation(struct io_ctl *io_ctl, u64 generation)
408
397
io_ctl -> cur += sizeof (u64 );
409
398
}
410
399
411
- static int io_ctl_check_generation (struct io_ctl * io_ctl , u64 generation )
400
+ static int io_ctl_check_generation (struct btrfs_io_ctl * io_ctl , u64 generation )
412
401
{
413
402
__le64 * gen ;
414
403
@@ -437,7 +426,7 @@ static int io_ctl_check_generation(struct io_ctl *io_ctl, u64 generation)
437
426
return 0 ;
438
427
}
439
428
440
- static void io_ctl_set_crc (struct io_ctl * io_ctl , int index )
429
+ static void io_ctl_set_crc (struct btrfs_io_ctl * io_ctl , int index )
441
430
{
442
431
u32 * tmp ;
443
432
u32 crc = ~(u32 )0 ;
@@ -461,7 +450,7 @@ static void io_ctl_set_crc(struct io_ctl *io_ctl, int index)
461
450
kunmap (io_ctl -> pages [0 ]);
462
451
}
463
452
464
- static int io_ctl_check_crc (struct io_ctl * io_ctl , int index )
453
+ static int io_ctl_check_crc (struct btrfs_io_ctl * io_ctl , int index )
465
454
{
466
455
u32 * tmp , val ;
467
456
u32 crc = ~(u32 )0 ;
@@ -494,7 +483,7 @@ static int io_ctl_check_crc(struct io_ctl *io_ctl, int index)
494
483
return 0 ;
495
484
}
496
485
497
- static int io_ctl_add_entry (struct io_ctl * io_ctl , u64 offset , u64 bytes ,
486
+ static int io_ctl_add_entry (struct btrfs_io_ctl * io_ctl , u64 offset , u64 bytes ,
498
487
void * bitmap )
499
488
{
500
489
struct btrfs_free_space_entry * entry ;
@@ -524,7 +513,7 @@ static int io_ctl_add_entry(struct io_ctl *io_ctl, u64 offset, u64 bytes,
524
513
return 0 ;
525
514
}
526
515
527
- static int io_ctl_add_bitmap (struct io_ctl * io_ctl , void * bitmap )
516
+ static int io_ctl_add_bitmap (struct btrfs_io_ctl * io_ctl , void * bitmap )
528
517
{
529
518
if (!io_ctl -> cur )
530
519
return - ENOSPC ;
@@ -547,7 +536,7 @@ static int io_ctl_add_bitmap(struct io_ctl *io_ctl, void *bitmap)
547
536
return 0 ;
548
537
}
549
538
550
- static void io_ctl_zero_remaining_pages (struct io_ctl * io_ctl )
539
+ static void io_ctl_zero_remaining_pages (struct btrfs_io_ctl * io_ctl )
551
540
{
552
541
/*
553
542
* If we're not on the boundary we know we've modified the page and we
@@ -564,7 +553,7 @@ static void io_ctl_zero_remaining_pages(struct io_ctl *io_ctl)
564
553
}
565
554
}
566
555
567
- static int io_ctl_read_entry (struct io_ctl * io_ctl ,
556
+ static int io_ctl_read_entry (struct btrfs_io_ctl * io_ctl ,
568
557
struct btrfs_free_space * entry , u8 * type )
569
558
{
570
559
struct btrfs_free_space_entry * e ;
@@ -591,7 +580,7 @@ static int io_ctl_read_entry(struct io_ctl *io_ctl,
591
580
return 0 ;
592
581
}
593
582
594
- static int io_ctl_read_bitmap (struct io_ctl * io_ctl ,
583
+ static int io_ctl_read_bitmap (struct btrfs_io_ctl * io_ctl ,
595
584
struct btrfs_free_space * entry )
596
585
{
597
586
int ret ;
@@ -650,7 +639,7 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode,
650
639
{
651
640
struct btrfs_free_space_header * header ;
652
641
struct extent_buffer * leaf ;
653
- struct io_ctl io_ctl ;
642
+ struct btrfs_io_ctl io_ctl ;
654
643
struct btrfs_key key ;
655
644
struct btrfs_free_space * e , * n ;
656
645
LIST_HEAD (bitmaps );
@@ -879,7 +868,7 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info,
879
868
}
880
869
881
870
static noinline_for_stack
882
- int write_cache_extent_entries (struct io_ctl * io_ctl ,
871
+ int write_cache_extent_entries (struct btrfs_io_ctl * io_ctl ,
883
872
struct btrfs_free_space_ctl * ctl ,
884
873
struct btrfs_block_group_cache * block_group ,
885
874
int * entries , int * bitmaps ,
@@ -1002,7 +991,7 @@ update_cache_item(struct btrfs_trans_handle *trans,
1002
991
static noinline_for_stack int
1003
992
write_pinned_extent_entries (struct btrfs_root * root ,
1004
993
struct btrfs_block_group_cache * block_group ,
1005
- struct io_ctl * io_ctl ,
994
+ struct btrfs_io_ctl * io_ctl ,
1006
995
int * entries )
1007
996
{
1008
997
u64 start , extent_start , extent_end , len ;
@@ -1052,7 +1041,7 @@ write_pinned_extent_entries(struct btrfs_root *root,
1052
1041
}
1053
1042
1054
1043
static noinline_for_stack int
1055
- write_bitmap_entries (struct io_ctl * io_ctl , struct list_head * bitmap_list )
1044
+ write_bitmap_entries (struct btrfs_io_ctl * io_ctl , struct list_head * bitmap_list )
1056
1045
{
1057
1046
struct list_head * pos , * n ;
1058
1047
int ret ;
@@ -1086,7 +1075,7 @@ static int flush_dirty_cache(struct inode *inode)
1086
1075
1087
1076
static void noinline_for_stack
1088
1077
cleanup_write_cache_enospc (struct inode * inode ,
1089
- struct io_ctl * io_ctl ,
1078
+ struct btrfs_io_ctl * io_ctl ,
1090
1079
struct extent_state * * cached_state ,
1091
1080
struct list_head * bitmap_list )
1092
1081
{
@@ -1123,7 +1112,7 @@ static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
1123
1112
struct btrfs_path * path , u64 offset )
1124
1113
{
1125
1114
struct extent_state * cached_state = NULL ;
1126
- struct io_ctl io_ctl ;
1115
+ struct btrfs_io_ctl io_ctl ;
1127
1116
LIST_HEAD (bitmap_list );
1128
1117
int entries = 0 ;
1129
1118
int bitmaps = 0 ;
0 commit comments