aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2011-04-19 12:00:01 -0400
committerDavid Sterba <dsterba@suse.cz>2011-05-02 07:57:20 -0400
commitc704005d886cf0bc9bc3974eb009b22fe0da32c7 (patch)
treeb9effb8d686af95ca92782697b75a70bf34a3964 /fs/btrfs/extent_io.c
parent4891aca2dac612a2f21a3278d9906ade13b55788 (diff)
btrfs: unify checking of IS_ERR and null
use IS_ERR_OR_NULL when possible, done by this coccinelle script: @ match @ identifier id; @@ ( - BUG_ON(IS_ERR(id) || !id); + BUG_ON(IS_ERR_OR_NULL(id)); | - IS_ERR(id) || !id + IS_ERR_OR_NULL(id) | - !id || IS_ERR(id) + IS_ERR_OR_NULL(id) ) Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index b730c12fa958..3c92712e9763 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2056,7 +2056,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree,
2056 } 2056 }
2057 em = get_extent(inode, page, pg_offset, cur, 2057 em = get_extent(inode, page, pg_offset, cur,
2058 end - cur + 1, 0); 2058 end - cur + 1, 0);
2059 if (IS_ERR(em) || !em) { 2059 if (IS_ERR_OR_NULL(em)) {
2060 SetPageError(page); 2060 SetPageError(page);
2061 unlock_extent(tree, cur, end, GFP_NOFS); 2061 unlock_extent(tree, cur, end, GFP_NOFS);
2062 break; 2062 break;
@@ -2341,7 +2341,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
2341 } 2341 }
2342 em = epd->get_extent(inode, page, pg_offset, cur, 2342 em = epd->get_extent(inode, page, pg_offset, cur,
2343 end - cur + 1, 1); 2343 end - cur + 1, 1);
2344 if (IS_ERR(em) || !em) { 2344 if (IS_ERR_OR_NULL(em)) {
2345 SetPageError(page); 2345 SetPageError(page);
2346 break; 2346 break;
2347 } 2347 }
@@ -2769,7 +2769,7 @@ int extent_prepare_write(struct extent_io_tree *tree,
2769 while (block_start <= block_end) { 2769 while (block_start <= block_end) {
2770 em = get_extent(inode, page, pg_offset, block_start, 2770 em = get_extent(inode, page, pg_offset, block_start,
2771 block_end - block_start + 1, 1); 2771 block_end - block_start + 1, 1);
2772 if (IS_ERR(em) || !em) 2772 if (IS_ERR_OR_NULL(em))
2773 goto err; 2773 goto err;
2774 2774
2775 cur_end = min(block_end, extent_map_end(em) - 1); 2775 cur_end = min(block_end, extent_map_end(em) - 1);
@@ -2899,7 +2899,7 @@ int try_release_extent_mapping(struct extent_map_tree *map,
2899 len = end - start + 1; 2899 len = end - start + 1;
2900 write_lock(&map->lock); 2900 write_lock(&map->lock);
2901 em = lookup_extent_mapping(map, start, len); 2901 em = lookup_extent_mapping(map, start, len);
2902 if (!em || IS_ERR(em)) { 2902 if (IS_ERR_OR_NULL(em)) {
2903 write_unlock(&map->lock); 2903 write_unlock(&map->lock);
2904 break; 2904 break;
2905 } 2905 }
@@ -2942,7 +2942,7 @@ sector_t extent_bmap(struct address_space *mapping, sector_t iblock,
2942 em = get_extent(inode, NULL, 0, start, blksize, 0); 2942 em = get_extent(inode, NULL, 0, start, blksize, 0);
2943 unlock_extent_cached(&BTRFS_I(inode)->io_tree, start, 2943 unlock_extent_cached(&BTRFS_I(inode)->io_tree, start,
2944 start + blksize - 1, &cached_state, GFP_NOFS); 2944 start + blksize - 1, &cached_state, GFP_NOFS);
2945 if (!em || IS_ERR(em)) 2945 if (IS_ERR_OR_NULL(em))
2946 return 0; 2946 return 0;
2947 2947
2948 if (em->block_start > EXTENT_MAP_LAST_BYTE) 2948 if (em->block_start > EXTENT_MAP_LAST_BYTE)
@@ -2976,7 +2976,7 @@ static struct extent_map *get_extent_skip_holes(struct inode *inode,
2976 break; 2976 break;
2977 len = (len + sectorsize - 1) & ~(sectorsize - 1); 2977 len = (len + sectorsize - 1) & ~(sectorsize - 1);
2978 em = get_extent(inode, NULL, 0, offset, len, 0); 2978 em = get_extent(inode, NULL, 0, offset, len, 0);
2979 if (!em || IS_ERR(em)) 2979 if (IS_ERR_OR_NULL(em))
2980 return em; 2980 return em;
2981 2981
2982 /* if this isn't a hole return it */ 2982 /* if this isn't a hole return it */