mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
btrfs: Replace multiple atomic_inc() with atomic_add()
This patch replaces multiple atomic_inc() with atomic_add() in delayed-inode.c to reduce source code and have few instructions for compilation. Reviewed-by: Zach Brown <[email protected]> Signed-off-by: Rashika Kheria <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Chris Mason <[email protected]>
This commit is contained in:
parent
2e9f595497
commit
95e94d14b4
1 changed files with 4 additions and 4 deletions
|
|
@ -108,8 +108,8 @@ static struct btrfs_delayed_node *btrfs_get_delayed_node(struct inode *inode)
|
|||
return node;
|
||||
}
|
||||
btrfs_inode->delayed_node = node;
|
||||
atomic_inc(&node->refs); /* can be accessed */
|
||||
atomic_inc(&node->refs); /* cached in the inode */
|
||||
/* can be accessed and cached in the inode */
|
||||
atomic_add(2, &node->refs);
|
||||
spin_unlock(&root->inode_lock);
|
||||
return node;
|
||||
}
|
||||
|
|
@ -138,8 +138,8 @@ again:
|
|||
return ERR_PTR(-ENOMEM);
|
||||
btrfs_init_delayed_node(node, root, ino);
|
||||
|
||||
atomic_inc(&node->refs); /* cached in the btrfs inode */
|
||||
atomic_inc(&node->refs); /* can be accessed */
|
||||
/* cached in the btrfs inode and can be accessed */
|
||||
atomic_add(2, &node->refs);
|
||||
|
||||
ret = radix_tree_preload(GFP_NOFS & ~__GFP_HIGHMEM);
|
||||
if (ret) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue