aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-inode.c
diff options
context:
space:
mode:
authorRashika <rashika.kheria@gmail.com>2013-10-30 17:42:42 -0400
committerChris Mason <chris.mason@fusionio.com>2013-11-11 22:11:19 -0500
commit95e94d14b42c1992493ce72492351d4601b274fe (patch)
tree22fc7f4d17b31556ed8eecce12a77747d0300f61 /fs/btrfs/delayed-inode.c
parent2e9f5954978cd5b0c26e6eeb9fd4ccbdce0f5ecc (diff)
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 <zab@redhat.com> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/delayed-inode.c')
-rw-r--r--fs/btrfs/delayed-inode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index df1a496bc8d4..af2ecca8a109 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -108,8 +108,8 @@ static struct btrfs_delayed_node *btrfs_get_delayed_node(struct inode *inode)
108 return node; 108 return node;
109 } 109 }
110 btrfs_inode->delayed_node = node; 110 btrfs_inode->delayed_node = node;
111 atomic_inc(&node->refs); /* can be accessed */ 111 /* can be accessed and cached in the inode */
112 atomic_inc(&node->refs); /* cached in the inode */ 112 atomic_add(2, &node->refs);
113 spin_unlock(&root->inode_lock); 113 spin_unlock(&root->inode_lock);
114 return node; 114 return node;
115 } 115 }
@@ -138,8 +138,8 @@ again:
138 return ERR_PTR(-ENOMEM); 138 return ERR_PTR(-ENOMEM);
139 btrfs_init_delayed_node(node, root, ino); 139 btrfs_init_delayed_node(node, root, ino);
140 140
141 atomic_inc(&node->refs); /* cached in the btrfs inode */ 141 /* cached in the btrfs inode and can be accessed */
142 atomic_inc(&node->refs); /* can be accessed */ 142 atomic_add(2, &node->refs);
143 143
144 ret = radix_tree_preload(GFP_NOFS & ~__GFP_HIGHMEM); 144 ret = radix_tree_preload(GFP_NOFS & ~__GFP_HIGHMEM);
145 if (ret) { 145 if (ret) {