Commit 0d031dc4 authored by Yu Zhe's avatar Yu Zhe Committed by David Sterba

btrfs: remove unnecessary type casts

Explicit type casts are not necessary when it's void* to another pointer
type.
Signed-off-by: default avatarYu Zhe <yuzhe@nfschina.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 1a42daab
...@@ -2033,7 +2033,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state, ...@@ -2033,7 +2033,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
static void btrfsic_bio_end_io(struct bio *bp) static void btrfsic_bio_end_io(struct bio *bp)
{ {
struct btrfsic_block *block = (struct btrfsic_block *)bp->bi_private; struct btrfsic_block *block = bp->bi_private;
int iodone_w_error; int iodone_w_error;
/* mutex is not held! This is not save if IO is not yet completed /* mutex is not held! This is not save if IO is not yet completed
......
...@@ -1984,7 +1984,7 @@ static void end_workqueue_fn(struct btrfs_work *work) ...@@ -1984,7 +1984,7 @@ static void end_workqueue_fn(struct btrfs_work *work)
static int cleaner_kthread(void *arg) static int cleaner_kthread(void *arg)
{ {
struct btrfs_fs_info *fs_info = (struct btrfs_fs_info *)arg; struct btrfs_fs_info *fs_info = arg;
int again; int again;
while (1) { while (1) {
...@@ -3317,7 +3317,7 @@ static int init_mount_fs_info(struct btrfs_fs_info *fs_info, struct super_block ...@@ -3317,7 +3317,7 @@ static int init_mount_fs_info(struct btrfs_fs_info *fs_info, struct super_block
static int btrfs_uuid_rescan_kthread(void *data) static int btrfs_uuid_rescan_kthread(void *data)
{ {
struct btrfs_fs_info *fs_info = (struct btrfs_fs_info *)data; struct btrfs_fs_info *fs_info = data;
int ret; int ret;
/* /*
......
...@@ -8938,7 +8938,7 @@ int btrfs_drop_inode(struct inode *inode) ...@@ -8938,7 +8938,7 @@ int btrfs_drop_inode(struct inode *inode)
static void init_once(void *foo) static void init_once(void *foo)
{ {
struct btrfs_inode *ei = (struct btrfs_inode *) foo; struct btrfs_inode *ei = foo;
inode_init_once(&ei->vfs_inode); inode_init_once(&ei->vfs_inode);
} }
......
...@@ -2596,7 +2596,7 @@ static noinline int search_ioctl(struct inode *inode, ...@@ -2596,7 +2596,7 @@ static noinline int search_ioctl(struct inode *inode,
static noinline int btrfs_ioctl_tree_search(struct inode *inode, static noinline int btrfs_ioctl_tree_search(struct inode *inode,
void __user *argp) void __user *argp)
{ {
struct btrfs_ioctl_search_args __user *uargs; struct btrfs_ioctl_search_args __user *uargs = argp;
struct btrfs_ioctl_search_key sk; struct btrfs_ioctl_search_key sk;
int ret; int ret;
size_t buf_size; size_t buf_size;
...@@ -2604,8 +2604,6 @@ static noinline int btrfs_ioctl_tree_search(struct inode *inode, ...@@ -2604,8 +2604,6 @@ static noinline int btrfs_ioctl_tree_search(struct inode *inode,
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
uargs = (struct btrfs_ioctl_search_args __user *)argp;
if (copy_from_user(&sk, &uargs->key, sizeof(sk))) if (copy_from_user(&sk, &uargs->key, sizeof(sk)))
return -EFAULT; return -EFAULT;
...@@ -2628,7 +2626,7 @@ static noinline int btrfs_ioctl_tree_search(struct inode *inode, ...@@ -2628,7 +2626,7 @@ static noinline int btrfs_ioctl_tree_search(struct inode *inode,
static noinline int btrfs_ioctl_tree_search_v2(struct inode *inode, static noinline int btrfs_ioctl_tree_search_v2(struct inode *inode,
void __user *argp) void __user *argp)
{ {
struct btrfs_ioctl_search_args_v2 __user *uarg; struct btrfs_ioctl_search_args_v2 __user *uarg = argp;
struct btrfs_ioctl_search_args_v2 args; struct btrfs_ioctl_search_args_v2 args;
int ret; int ret;
size_t buf_size; size_t buf_size;
...@@ -2638,7 +2636,6 @@ static noinline int btrfs_ioctl_tree_search_v2(struct inode *inode, ...@@ -2638,7 +2636,6 @@ static noinline int btrfs_ioctl_tree_search_v2(struct inode *inode,
return -EPERM; return -EPERM;
/* copy search header and buffer size */ /* copy search header and buffer size */
uarg = (struct btrfs_ioctl_search_args_v2 __user *)argp;
if (copy_from_user(&args, uarg, sizeof(args))) if (copy_from_user(&args, uarg, sizeof(args)))
return -EFAULT; return -EFAULT;
......
...@@ -362,7 +362,7 @@ struct btrfs_root *find_reloc_root(struct btrfs_fs_info *fs_info, u64 bytenr) ...@@ -362,7 +362,7 @@ struct btrfs_root *find_reloc_root(struct btrfs_fs_info *fs_info, u64 bytenr)
rb_node = rb_simple_search(&rc->reloc_root_tree.rb_root, bytenr); rb_node = rb_simple_search(&rc->reloc_root_tree.rb_root, bytenr);
if (rb_node) { if (rb_node) {
node = rb_entry(rb_node, struct mapping_node, rb_node); node = rb_entry(rb_node, struct mapping_node, rb_node);
root = (struct btrfs_root *)node->data; root = node->data;
} }
spin_unlock(&rc->reloc_root_tree.lock); spin_unlock(&rc->reloc_root_tree.lock);
return btrfs_grab_root(root); return btrfs_grab_root(root);
......
...@@ -2790,7 +2790,7 @@ static void scrub_parity_bio_endio_worker(struct btrfs_work *work) ...@@ -2790,7 +2790,7 @@ static void scrub_parity_bio_endio_worker(struct btrfs_work *work)
static void scrub_parity_bio_endio(struct bio *bio) static void scrub_parity_bio_endio(struct bio *bio)
{ {
struct scrub_parity *sparity = (struct scrub_parity *)bio->bi_private; struct scrub_parity *sparity = bio->bi_private;
struct btrfs_fs_info *fs_info = sparity->sctx->fs_info; struct btrfs_fs_info *fs_info = sparity->sctx->fs_info;
if (bio->bi_status) if (bio->bi_status)
......
...@@ -519,7 +519,7 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info, ...@@ -519,7 +519,7 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info,
items = calc_reclaim_items_nr(fs_info, to_reclaim) * 2; items = calc_reclaim_items_nr(fs_info, to_reclaim) * 2;
} }
trans = (struct btrfs_trans_handle *)current->journal_info; trans = current->journal_info;
/* /*
* If we are doing more ordered than delalloc we need to just wait on * If we are doing more ordered than delalloc we need to just wait on
......
...@@ -150,7 +150,7 @@ void btrfs_detach_subpage(const struct btrfs_fs_info *fs_info, ...@@ -150,7 +150,7 @@ void btrfs_detach_subpage(const struct btrfs_fs_info *fs_info,
if (!btrfs_is_subpage(fs_info, page) || !PagePrivate(page)) if (!btrfs_is_subpage(fs_info, page) || !PagePrivate(page))
return; return;
subpage = (struct btrfs_subpage *)detach_page_private(page); subpage = detach_page_private(page);
ASSERT(subpage); ASSERT(subpage);
btrfs_free_subpage(subpage); btrfs_free_subpage(subpage);
} }
......
...@@ -8266,7 +8266,7 @@ bool btrfs_pinned_by_swapfile(struct btrfs_fs_info *fs_info, void *ptr) ...@@ -8266,7 +8266,7 @@ bool btrfs_pinned_by_swapfile(struct btrfs_fs_info *fs_info, void *ptr)
static int relocating_repair_kthread(void *data) static int relocating_repair_kthread(void *data)
{ {
struct btrfs_block_group *cache = (struct btrfs_block_group *)data; struct btrfs_block_group *cache = data;
struct btrfs_fs_info *fs_info = cache->fs_info; struct btrfs_fs_info *fs_info = cache->fs_info;
u64 target; u64 target;
int ret = 0; int ret = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment