aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2014-10-04 12:57:44 -0400
committerChris Mason <clm@fb.com>2014-10-04 12:57:44 -0400
commit0ec31a61f0d46e03e9e80c2ff57fa3ae2fdf92d3 (patch)
treecb56a470a5b8ed52cde9417d7bfa6f94349b4c38 /fs/btrfs
parent27b19cc8864e206c4203041892b0f706f044a0f1 (diff)
parentee39b432b4ac083acdafd7b4f156283722e3bf14 (diff)
Merge branch 'remove-unlikely' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/async-thread.c10
-rw-r--r--fs/btrfs/extent-tree.c4
-rw-r--r--fs/btrfs/file.c4
-rw-r--r--fs/btrfs/inode.c10
-rw-r--r--fs/btrfs/ioctl.c2
-rw-r--r--fs/btrfs/transaction.c2
6 files changed, 16 insertions, 16 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index 2da0a66790ba..4dabeb893b7c 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -92,7 +92,7 @@ __btrfs_alloc_workqueue(const char *name, int flags, int max_active,
92{ 92{
93 struct __btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS); 93 struct __btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS);
94 94
95 if (unlikely(!ret)) 95 if (!ret)
96 return NULL; 96 return NULL;
97 97
98 ret->max_active = max_active; 98 ret->max_active = max_active;
@@ -116,7 +116,7 @@ __btrfs_alloc_workqueue(const char *name, int flags, int max_active,
116 ret->normal_wq = alloc_workqueue("%s-%s", flags, 116 ret->normal_wq = alloc_workqueue("%s-%s", flags,
117 ret->max_active, "btrfs", 117 ret->max_active, "btrfs",
118 name); 118 name);
119 if (unlikely(!ret->normal_wq)) { 119 if (!ret->normal_wq) {
120 kfree(ret); 120 kfree(ret);
121 return NULL; 121 return NULL;
122 } 122 }
@@ -138,12 +138,12 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
138{ 138{
139 struct btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS); 139 struct btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS);
140 140
141 if (unlikely(!ret)) 141 if (!ret)
142 return NULL; 142 return NULL;
143 143
144 ret->normal = __btrfs_alloc_workqueue(name, flags & ~WQ_HIGHPRI, 144 ret->normal = __btrfs_alloc_workqueue(name, flags & ~WQ_HIGHPRI,
145 max_active, thresh); 145 max_active, thresh);
146 if (unlikely(!ret->normal)) { 146 if (!ret->normal) {
147 kfree(ret); 147 kfree(ret);
148 return NULL; 148 return NULL;
149 } 149 }
@@ -151,7 +151,7 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
151 if (flags & WQ_HIGHPRI) { 151 if (flags & WQ_HIGHPRI) {
152 ret->high = __btrfs_alloc_workqueue(name, flags, max_active, 152 ret->high = __btrfs_alloc_workqueue(name, flags, max_active,
153 thresh); 153 thresh);
154 if (unlikely(!ret->high)) { 154 if (!ret->high) {
155 __btrfs_destroy_workqueue(ret->normal); 155 __btrfs_destroy_workqueue(ret->normal);
156 kfree(ret); 156 kfree(ret);
157 return NULL; 157 return NULL;
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 9a5effa32a66..0d599ba1aaed 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -9690,7 +9690,7 @@ void btrfs_end_nocow_write(struct btrfs_root *root)
9690 9690
9691int btrfs_start_nocow_write(struct btrfs_root *root) 9691int btrfs_start_nocow_write(struct btrfs_root *root)
9692{ 9692{
9693 if (unlikely(atomic_read(&root->will_be_snapshoted))) 9693 if (atomic_read(&root->will_be_snapshoted))
9694 return 0; 9694 return 0;
9695 9695
9696 percpu_counter_inc(&root->subv_writers->counter); 9696 percpu_counter_inc(&root->subv_writers->counter);
@@ -9698,7 +9698,7 @@ int btrfs_start_nocow_write(struct btrfs_root *root)
9698 * Make sure counter is updated before we check for snapshot creation. 9698 * Make sure counter is updated before we check for snapshot creation.
9699 */ 9699 */
9700 smp_mb(); 9700 smp_mb();
9701 if (unlikely(atomic_read(&root->will_be_snapshoted))) { 9701 if (atomic_read(&root->will_be_snapshoted)) {
9702 btrfs_end_nocow_write(root); 9702 btrfs_end_nocow_write(root);
9703 return 0; 9703 return 0;
9704 } 9704 }
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 29b147d46b0a..a18ceabd99a8 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -452,7 +452,7 @@ static noinline int btrfs_copy_from_user(loff_t pos, int num_pages,
452 if (unlikely(copied == 0)) 452 if (unlikely(copied == 0))
453 break; 453 break;
454 454
455 if (unlikely(copied < PAGE_CACHE_SIZE - offset)) { 455 if (copied < PAGE_CACHE_SIZE - offset) {
456 offset += copied; 456 offset += copied;
457 } else { 457 } else {
458 pg++; 458 pg++;
@@ -1792,7 +1792,7 @@ static ssize_t btrfs_file_write_iter(struct kiocb *iocb,
1792 if (sync) 1792 if (sync)
1793 atomic_inc(&BTRFS_I(inode)->sync_writers); 1793 atomic_inc(&BTRFS_I(inode)->sync_writers);
1794 1794
1795 if (unlikely(file->f_flags & O_DIRECT)) { 1795 if (file->f_flags & O_DIRECT) {
1796 num_written = __btrfs_direct_write(iocb, from, pos); 1796 num_written = __btrfs_direct_write(iocb, from, pos);
1797 } else { 1797 } else {
1798 num_written = __btrfs_buffered_write(file, from, pos); 1798 num_written = __btrfs_buffered_write(file, from, pos);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 6c4da8446397..fc9c0439caa3 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7803,9 +7803,9 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip,
7803 atomic_inc(&dip->pending_bios); 7803 atomic_inc(&dip->pending_bios);
7804 7804
7805 while (bvec <= (orig_bio->bi_io_vec + orig_bio->bi_vcnt - 1)) { 7805 while (bvec <= (orig_bio->bi_io_vec + orig_bio->bi_vcnt - 1)) {
7806 if (unlikely(map_length < submit_len + bvec->bv_len || 7806 if (map_length < submit_len + bvec->bv_len ||
7807 bio_add_page(bio, bvec->bv_page, bvec->bv_len, 7807 bio_add_page(bio, bvec->bv_page, bvec->bv_len,
7808 bvec->bv_offset) < bvec->bv_len)) { 7808 bvec->bv_offset) < bvec->bv_len) {
7809 /* 7809 /*
7810 * inc the count before we submit the bio so 7810 * inc the count before we submit the bio so
7811 * we know the end IO handler won't happen before 7811 * we know the end IO handler won't happen before
@@ -8018,8 +8018,8 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb,
8018 ret = btrfs_delalloc_reserve_space(inode, count); 8018 ret = btrfs_delalloc_reserve_space(inode, count);
8019 if (ret) 8019 if (ret)
8020 goto out; 8020 goto out;
8021 } else if (unlikely(test_bit(BTRFS_INODE_READDIO_NEED_LOCK, 8021 } else if (test_bit(BTRFS_INODE_READDIO_NEED_LOCK,
8022 &BTRFS_I(inode)->runtime_flags))) { 8022 &BTRFS_I(inode)->runtime_flags)) {
8023 inode_dio_done(inode); 8023 inode_dio_done(inode);
8024 flags = DIO_LOCKING | DIO_SKIP_HOLES; 8024 flags = DIO_LOCKING | DIO_SKIP_HOLES;
8025 wakeup = false; 8025 wakeup = false;
@@ -9014,7 +9014,7 @@ static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput,
9014 spin_unlock(&root->delalloc_lock); 9014 spin_unlock(&root->delalloc_lock);
9015 9015
9016 work = btrfs_alloc_delalloc_work(inode, 0, delay_iput); 9016 work = btrfs_alloc_delalloc_work(inode, 0, delay_iput);
9017 if (unlikely(!work)) { 9017 if (!work) {
9018 if (delay_iput) 9018 if (delay_iput)
9019 btrfs_add_delayed_iput(inode); 9019 btrfs_add_delayed_iput(inode);
9020 else 9020 else
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index fd9d19057e7e..e732274f1afd 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3166,7 +3166,7 @@ static void clone_update_extent_map(struct inode *inode,
3166 em->start + em->len - 1, 0); 3166 em->start + em->len - 1, 0);
3167 } 3167 }
3168 3168
3169 if (unlikely(ret)) 3169 if (ret)
3170 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, 3170 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC,
3171 &BTRFS_I(inode)->runtime_flags); 3171 &BTRFS_I(inode)->runtime_flags);
3172} 3172}
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 0bcdcc65627f..dcaae3616728 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -418,7 +418,7 @@ start_transaction(struct btrfs_root *root, u64 num_items, unsigned int type,
418 /* 418 /*
419 * Do the reservation for the relocation root creation 419 * Do the reservation for the relocation root creation
420 */ 420 */
421 if (unlikely(need_reserve_reloc_root(root))) { 421 if (need_reserve_reloc_root(root)) {
422 num_bytes += root->nodesize; 422 num_bytes += root->nodesize;
423 reloc_reserved = true; 423 reloc_reserved = true;
424 } 424 }