remarkable-linux/fs/btrfs
Qu Wenruo 3e72ee8874 btrfs: Refactor __get_raid_index() to btrfs_bg_flags_to_raid_index()
Function __get_raid_index() is used to convert block group flags into
raid index, which can be used to get various info directly from
btrfs_raid_array[].

Refactor this function a little:

1) Rename to btrfs_bg_flags_to_raid_index()
   Double underline prefix is normally for internal functions, while the
   function is used by both extent-tree and volumes.

   Although the name is a little longer, but it should explain its usage
   quite well.

2) Move it to volumes.h and make it static inline
   Just several if-else branches, really no need to define it as a normal
   function.

   This also makes later code re-use between kernel and btrfs-progs
   easier.

3) Remove function get_block_group_index()
   Really no need to do such a simple thing as an exported function.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-03-26 15:09:38 +02:00
..
tests Btrfs: extent map selftest: add missing void parameter to btrfs_test_extent_map 2018-03-26 15:09:29 +02:00
acl.c
async-thread.c
async-thread.h
backref.c btrfs: add missing initialization in btrfs_check_shared 2018-03-14 22:26:46 +01:00
backref.h
btrfs_inode.h btrfs: Remove btrfs_inode::delayed_iput_count 2018-03-26 15:09:37 +02:00
check-integrity.c btrfs: Fix bug for misused dev_t when lookup in dev state hash table. 2017-11-01 20:45:36 +01:00
check-integrity.h
compression.c for-4.16-tag 2018-01-29 14:04:23 -08:00
compression.h btrfs: compression: add helper for type to string conversion 2018-01-22 16:08:16 +01:00
ctree.c btrfs: Improve btrfs_search_slot description 2018-01-22 16:08:19 +01:00
ctree.h btrfs: Refactor __get_raid_index() to btrfs_bg_flags_to_raid_index() 2018-03-26 15:09:38 +02:00
dedupe.h
delayed-inode.c btrfs: Don't pass fs_info to btrfs_run_delayed_items/_nr 2018-03-26 15:09:31 +02:00
delayed-inode.h btrfs: Don't pass fs_info to btrfs_run_delayed_items/_nr 2018-03-26 15:09:31 +02:00
delayed-ref.c btrfs: Ignore errors from btrfs_qgroup_trace_extent_post 2018-02-02 16:25:14 +01:00
delayed-ref.h Btrfs: add __init macro to btrfs init functions 2018-01-22 16:08:11 +01:00
dev-replace.c btrfs: log, when replace, is canceled by the user 2018-03-26 15:09:34 +02:00
dev-replace.h btrfs: btrfs_dev_replace_cancel() can return int 2018-03-26 15:09:30 +02:00
dir-item.c btrfs: Cleanup existing name_len checks 2018-01-22 16:08:12 +01:00
disk-io.c btrfs: tree-checker: Replace root parameter with fs_info 2018-03-26 15:09:38 +02:00
disk-io.h btrfs: remove unused function btrfs_async_submit_limit() 2018-03-26 15:09:35 +02:00
export.c btrfs: Cleanup existing name_len checks 2018-01-22 16:08:12 +01:00
export.h
extent-tree.c btrfs: Refactor __get_raid_index() to btrfs_bg_flags_to_raid_index() 2018-03-26 15:09:38 +02:00
extent_io.c btrfs: extent_buffer_uptodate() make it static and inline 2018-03-26 15:09:33 +02:00
extent_io.h btrfs: extent_buffer_uptodate() make it static and inline 2018-03-26 15:09:33 +02:00
extent_map.c Btrfs: add tracepoint for em's EEXIST case 2018-03-26 15:09:38 +02:00
extent_map.h Btrfs: move extent map specific code to extent_map.c 2018-01-22 16:08:22 +01:00
file-item.c
file.c for-4.16-tag 2018-01-29 14:04:23 -08:00
free-space-cache.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-01-31 14:31:10 -08:00
free-space-cache.h
free-space-tree.c btrfs: use reada direction enum instead of constant value in load_free_space_tree 2018-03-26 15:09:37 +02:00
free-space-tree.h
hash.c
hash.h
inode-item.c Btrfs: fix log replay failure after unlink and link combination 2018-03-01 16:18:40 +01:00
inode-map.c
inode-map.h
inode.c btrfs: Remove btrfs_inode::delayed_iput_count 2018-03-26 15:09:37 +02:00
ioctl.c btrfs: rename __btrfs_dev_replace_cancel() 2018-03-26 15:09:30 +02:00
Kconfig
locking.c
locking.h
lzo.c
Makefile Btrfs: add extent map selftests 2018-01-22 16:08:22 +01:00
math.h
ordered-data.c
ordered-data.h btrfs: Don't hardcode the csum size in btrfs_ordered_sum_size 2018-03-26 15:09:29 +02:00
orphan.c
print-tree.c
print-tree.h
props.c btrfs: prop: use common helper for type to string conversion 2018-01-22 16:08:16 +01:00
props.h
qgroup.c btrfs: Move qgroup rescan on quota enable to btrfs_quota_enable 2018-03-26 15:09:38 +02:00
qgroup.h
raid56.c btrfs: Fix NULL pointer exception in find_bio_stripe 2018-03-14 22:26:35 +01:00
raid56.h
rcu-string.h
reada.c
ref-verify.c btrfs: ref-verify: Remove unused parameter from walk_up_tree() to kill warning 2018-01-22 16:08:13 +01:00
ref-verify.h
relocation.c btrfs: Handle btrfs_set_extent_delalloc failure in relocate_file_extent_cluster 2018-03-01 16:16:12 +01:00
root-tree.c btrfs: Cleanup existing name_len checks 2018-01-22 16:08:12 +01:00
scrub.c btrfs: not a disk error if the bio_add_page fails 2018-03-26 15:09:36 +02:00
send.c Btrfs: send, fix issuing write op when processing hole in no data mode 2018-03-01 16:18:07 +01:00
send.h
struct-funcs.c
super.c btrfs: add a comment to mark the deprecated mount option 2018-03-26 15:09:34 +02:00
sysfs.c Revert "btrfs: use proper endianness accessors for super_copy" 2018-03-16 14:49:44 +01:00
sysfs.h
transaction.c btrfs: Move error handling of btrfs_start_dirty_block_groups closer to call site 2018-03-26 15:09:36 +02:00
transaction.h btrfs: Document consistency of transaction->io_bgs list 2018-03-26 15:09:34 +02:00
tree-checker.c btrfs: tree-checker: Replace root parameter with fs_info 2018-03-26 15:09:38 +02:00
tree-checker.h btrfs: tree-checker: Replace root parameter with fs_info 2018-03-26 15:09:38 +02:00
tree-defrag.c
tree-log.c btrfs: Don't pass fs_info to btrfs_run_delayed_items/_nr 2018-03-26 15:09:31 +02:00
tree-log.h
ulist.c
ulist.h
uuid-tree.c
volumes.c btrfs: Refactor __get_raid_index() to btrfs_bg_flags_to_raid_index() 2018-03-26 15:09:38 +02:00
volumes.h btrfs: Refactor __get_raid_index() to btrfs_bg_flags_to_raid_index() 2018-03-26 15:09:38 +02:00
xattr.c for-4.16-tag 2018-01-29 14:04:23 -08:00
xattr.h
zlib.c
zstd.c btrfs: move some zstd work data from stack to workspace 2018-01-22 16:08:14 +01:00