Skip to content

Commit 0ec31a6

Browse files
committed
Merge branch 'remove-unlikely' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus
2 parents 27b19cc + ee39b43 commit 0ec31a6

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

fs/btrfs/async-thread.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ __btrfs_alloc_workqueue(const char *name, int flags, int max_active,
9292
{
9393
struct __btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS);
9494

95-
if (unlikely(!ret))
95+
if (!ret)
9696
return NULL;
9797

9898
ret->max_active = max_active;
@@ -116,7 +116,7 @@ __btrfs_alloc_workqueue(const char *name, int flags, int max_active,
116116
ret->normal_wq = alloc_workqueue("%s-%s", flags,
117117
ret->max_active, "btrfs",
118118
name);
119-
if (unlikely(!ret->normal_wq)) {
119+
if (!ret->normal_wq) {
120120
kfree(ret);
121121
return NULL;
122122
}
@@ -138,20 +138,20 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
138138
{
139139
struct btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS);
140140

141-
if (unlikely(!ret))
141+
if (!ret)
142142
return NULL;
143143

144144
ret->normal = __btrfs_alloc_workqueue(name, flags & ~WQ_HIGHPRI,
145145
max_active, thresh);
146-
if (unlikely(!ret->normal)) {
146+
if (!ret->normal) {
147147
kfree(ret);
148148
return NULL;
149149
}
150150

151151
if (flags & WQ_HIGHPRI) {
152152
ret->high = __btrfs_alloc_workqueue(name, flags, max_active,
153153
thresh);
154-
if (unlikely(!ret->high)) {
154+
if (!ret->high) {
155155
__btrfs_destroy_workqueue(ret->normal);
156156
kfree(ret);
157157
return NULL;

fs/btrfs/extent-tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9690,15 +9690,15 @@ void btrfs_end_nocow_write(struct btrfs_root *root)
96909690

96919691
int btrfs_start_nocow_write(struct btrfs_root *root)
96929692
{
9693-
if (unlikely(atomic_read(&root->will_be_snapshoted)))
9693+
if (atomic_read(&root->will_be_snapshoted))
96949694
return 0;
96959695

96969696
percpu_counter_inc(&root->subv_writers->counter);
96979697
/*
96989698
* Make sure counter is updated before we check for snapshot creation.
96999699
*/
97009700
smp_mb();
9701-
if (unlikely(atomic_read(&root->will_be_snapshoted))) {
9701+
if (atomic_read(&root->will_be_snapshoted)) {
97029702
btrfs_end_nocow_write(root);
97039703
return 0;
97049704
}

fs/btrfs/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ static noinline int btrfs_copy_from_user(loff_t pos, int num_pages,
452452
if (unlikely(copied == 0))
453453
break;
454454

455-
if (unlikely(copied < PAGE_CACHE_SIZE - offset)) {
455+
if (copied < PAGE_CACHE_SIZE - offset) {
456456
offset += copied;
457457
} else {
458458
pg++;
@@ -1792,7 +1792,7 @@ static ssize_t btrfs_file_write_iter(struct kiocb *iocb,
17921792
if (sync)
17931793
atomic_inc(&BTRFS_I(inode)->sync_writers);
17941794

1795-
if (unlikely(file->f_flags & O_DIRECT)) {
1795+
if (file->f_flags & O_DIRECT) {
17961796
num_written = __btrfs_direct_write(iocb, from, pos);
17971797
} else {
17981798
num_written = __btrfs_buffered_write(file, from, pos);

fs/btrfs/inode.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7803,9 +7803,9 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip,
78037803
atomic_inc(&dip->pending_bios);
78047804

78057805
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 ||
78077807
bio_add_page(bio, bvec->bv_page, bvec->bv_len,
7808-
bvec->bv_offset) < bvec->bv_len)) {
7808+
bvec->bv_offset) < bvec->bv_len) {
78097809
/*
78107810
* inc the count before we submit the bio so
78117811
* 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,
80188018
ret = btrfs_delalloc_reserve_space(inode, count);
80198019
if (ret)
80208020
goto out;
8021-
} else if (unlikely(test_bit(BTRFS_INODE_READDIO_NEED_LOCK,
8022-
&BTRFS_I(inode)->runtime_flags))) {
8021+
} else if (test_bit(BTRFS_INODE_READDIO_NEED_LOCK,
8022+
&BTRFS_I(inode)->runtime_flags)) {
80238023
inode_dio_done(inode);
80248024
flags = DIO_LOCKING | DIO_SKIP_HOLES;
80258025
wakeup = false;
@@ -9014,7 +9014,7 @@ static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput,
90149014
spin_unlock(&root->delalloc_lock);
90159015

90169016
work = btrfs_alloc_delalloc_work(inode, 0, delay_iput);
9017-
if (unlikely(!work)) {
9017+
if (!work) {
90189018
if (delay_iput)
90199019
btrfs_add_delayed_iput(inode);
90209020
else

fs/btrfs/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3166,7 +3166,7 @@ static void clone_update_extent_map(struct inode *inode,
31663166
em->start + em->len - 1, 0);
31673167
}
31683168

3169-
if (unlikely(ret))
3169+
if (ret)
31703170
set_bit(BTRFS_INODE_NEEDS_FULL_SYNC,
31713171
&BTRFS_I(inode)->runtime_flags);
31723172
}

fs/btrfs/transaction.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ start_transaction(struct btrfs_root *root, u64 num_items, unsigned int type,
418418
/*
419419
* Do the reservation for the relocation root creation
420420
*/
421-
if (unlikely(need_reserve_reloc_root(root))) {
421+
if (need_reserve_reloc_root(root)) {
422422
num_bytes += root->nodesize;
423423
reloc_reserved = true;
424424
}

0 commit comments

Comments
 (0)