Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: unexport btrfs_run_discard_work and make it static

Mark btrfs_run_discard_work static and move it above its callers.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Johannes Thumshirn and committed by
David Sterba
bb5167e6 016f9d0b

+17 -18
+17 -17
fs/btrfs/discard.c
··· 73 73 return &discard_ctl->discard_list[block_group->discard_index]; 74 74 } 75 75 76 + /* 77 + * Determine if async discard should be running. 78 + * 79 + * @discard_ctl: discard control 80 + * 81 + * Check if the file system is writeable and BTRFS_FS_DISCARD_RUNNING is set. 82 + */ 83 + static bool btrfs_run_discard_work(struct btrfs_discard_ctl *discard_ctl) 84 + { 85 + struct btrfs_fs_info *fs_info = container_of(discard_ctl, 86 + struct btrfs_fs_info, 87 + discard_ctl); 88 + 89 + return (!(fs_info->sb->s_flags & SB_RDONLY) && 90 + test_bit(BTRFS_FS_DISCARD_RUNNING, &fs_info->flags)); 91 + } 92 + 76 93 static void __add_to_discard_list(struct btrfs_discard_ctl *discard_ctl, 77 94 struct btrfs_block_group *block_group) 78 95 { ··· 559 542 discard_ctl->block_group = NULL; 560 543 __btrfs_discard_schedule_work(discard_ctl, now, false); 561 544 spin_unlock(&discard_ctl->lock); 562 - } 563 - 564 - /* 565 - * Determine if async discard should be running. 566 - * 567 - * @discard_ctl: discard control 568 - * 569 - * Check if the file system is writeable and BTRFS_FS_DISCARD_RUNNING is set. 570 - */ 571 - bool btrfs_run_discard_work(struct btrfs_discard_ctl *discard_ctl) 572 - { 573 - struct btrfs_fs_info *fs_info = container_of(discard_ctl, 574 - struct btrfs_fs_info, 575 - discard_ctl); 576 - 577 - return (!(fs_info->sb->s_flags & SB_RDONLY) && 578 - test_bit(BTRFS_FS_DISCARD_RUNNING, &fs_info->flags)); 579 545 } 580 546 581 547 /*
-1
fs/btrfs/discard.h
··· 24 24 struct btrfs_block_group *block_group); 25 25 void btrfs_discard_schedule_work(struct btrfs_discard_ctl *discard_ctl, 26 26 bool override); 27 - bool btrfs_run_discard_work(struct btrfs_discard_ctl *discard_ctl); 28 27 29 28 /* Update operations */ 30 29 void btrfs_discard_calc_delay(struct btrfs_discard_ctl *discard_ctl);