dm block manager: add unlikely() annotations on dm_bufio error paths
authorJoe Thornber <ejt@redhat.com>
Thu, 19 Nov 2015 12:55:58 +0000 (12:55 +0000)
committerMike Snitzer <snitzer@redhat.com>
Thu, 16 Feb 2017 18:01:07 +0000 (13:01 -0500)
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/persistent-data/dm-block-manager.c

index a6dde7cab4584e877ff22c2f5a9bac283513cda1..8212f14214f1d13eb2b7294faef60c5bc2ca4218 100644 (file)
@@ -462,7 +462,7 @@ int dm_bm_read_lock(struct dm_block_manager *bm, dm_block_t b,
        int r;
 
        p = dm_bufio_read(bm->bufio, b, (struct dm_buffer **) result);
-       if (IS_ERR(p))
+       if (unlikely(IS_ERR(p)))
                return PTR_ERR(p);
 
        aux = dm_bufio_get_aux_data(to_buffer(*result));
@@ -498,7 +498,7 @@ int dm_bm_write_lock(struct dm_block_manager *bm,
                return -EPERM;
 
        p = dm_bufio_read(bm->bufio, b, (struct dm_buffer **) result);
-       if (IS_ERR(p))
+       if (unlikely(IS_ERR(p)))
                return PTR_ERR(p);
 
        aux = dm_bufio_get_aux_data(to_buffer(*result));
@@ -531,7 +531,7 @@ int dm_bm_read_try_lock(struct dm_block_manager *bm,
        int r;
 
        p = dm_bufio_get(bm->bufio, b, (struct dm_buffer **) result);
-       if (IS_ERR(p))
+       if (unlikely(IS_ERR(p)))
                return PTR_ERR(p);
        if (unlikely(!p))
                return -EWOULDBLOCK;
@@ -567,7 +567,7 @@ int dm_bm_write_lock_zero(struct dm_block_manager *bm,
                return -EPERM;
 
        p = dm_bufio_new(bm->bufio, b, (struct dm_buffer **) result);
-       if (IS_ERR(p))
+       if (unlikely(IS_ERR(p)))
                return PTR_ERR(p);
 
        memset(p, 0, dm_bm_block_size(bm));