Commit 2755a0de authored by David Sterba's avatar David Sterba

btrfs: hide typecast to definition of BTRFS_SEND_TRANS_STUB

Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
parent 94404e82
...@@ -347,8 +347,7 @@ static int verify_parent_transid(struct extent_io_tree *io_tree, ...@@ -347,8 +347,7 @@ static int verify_parent_transid(struct extent_io_tree *io_tree,
{ {
struct extent_state *cached_state = NULL; struct extent_state *cached_state = NULL;
int ret; int ret;
bool need_lock = (current->journal_info == bool need_lock = (current->journal_info == BTRFS_SEND_TRANS_STUB);
(void *)BTRFS_SEND_TRANS_STUB);
if (!parent_transid || btrfs_header_generation(eb) == parent_transid) if (!parent_transid || btrfs_header_generation(eb) == parent_transid)
return 0; return 0;
......
...@@ -5728,7 +5728,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) ...@@ -5728,7 +5728,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
NULL); NULL);
sort_clone_roots = 1; sort_clone_roots = 1;
current->journal_info = (void *)BTRFS_SEND_TRANS_STUB; current->journal_info = BTRFS_SEND_TRANS_STUB;
ret = send_subvol(sctx); ret = send_subvol(sctx);
current->journal_info = NULL; current->journal_info = NULL;
if (ret < 0) if (ret < 0)
......
...@@ -386,7 +386,7 @@ start_transaction(struct btrfs_root *root, u64 num_items, unsigned int type, ...@@ -386,7 +386,7 @@ start_transaction(struct btrfs_root *root, u64 num_items, unsigned int type,
int ret; int ret;
/* Send isn't supposed to start transactions. */ /* Send isn't supposed to start transactions. */
ASSERT(current->journal_info != (void *)BTRFS_SEND_TRANS_STUB); ASSERT(current->journal_info != BTRFS_SEND_TRANS_STUB);
if (test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state)) if (test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state))
return ERR_PTR(-EROFS); return ERR_PTR(-EROFS);
......
...@@ -79,7 +79,7 @@ struct btrfs_transaction { ...@@ -79,7 +79,7 @@ struct btrfs_transaction {
#define TRANS_EXTWRITERS (__TRANS_USERSPACE | __TRANS_START | \ #define TRANS_EXTWRITERS (__TRANS_USERSPACE | __TRANS_START | \
__TRANS_ATTACH) __TRANS_ATTACH)
#define BTRFS_SEND_TRANS_STUB 1 #define BTRFS_SEND_TRANS_STUB ((void *)1)
struct btrfs_trans_handle { struct btrfs_trans_handle {
u64 transid; u64 transid;
......
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