btrfs: make extent_range_redirty_for_io return void
[deliverable/linux.git] / fs / btrfs / extent_io.c
index 33a01ea414651d217349940ca6c0e2ed7bea6f4c..f06800e48f9786988e0b7b75bf8391fa6699d6fc 100644 (file)
@@ -616,7 +616,7 @@ static int __clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
        if (bits & (EXTENT_IOBITS | EXTENT_BOUNDARY))
                clear = 1;
 again:
-       if (!prealloc && (mask & __GFP_WAIT)) {
+       if (!prealloc && gfpflags_allow_blocking(mask)) {
                /*
                 * Don't care for allocation failure here because we might end
                 * up not needing the pre-allocated extent state at all, which
@@ -741,7 +741,7 @@ search_again:
        if (start > end)
                goto out;
        spin_unlock(&tree->lock);
-       if (mask & __GFP_WAIT)
+       if (gfpflags_allow_blocking(mask))
                cond_resched();
        goto again;
 }
@@ -874,7 +874,7 @@ __set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
 
        bits |= EXTENT_FIRST_DELALLOC;
 again:
-       if (!prealloc && (mask & __GFP_WAIT)) {
+       if (!prealloc && gfpflags_allow_blocking(mask)) {
                prealloc = alloc_extent_state(mask);
                BUG_ON(!prealloc);
        }
@@ -1052,7 +1052,7 @@ search_again:
        if (start > end)
                goto out;
        spin_unlock(&tree->lock);
-       if (mask & __GFP_WAIT)
+       if (gfpflags_allow_blocking(mask))
                cond_resched();
        goto again;
 }
@@ -1100,7 +1100,7 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
        btrfs_debug_check_extent_io_range(tree, start, end);
 
 again:
-       if (!prealloc && (mask & __GFP_WAIT)) {
+       if (!prealloc && gfpflags_allow_blocking(mask)) {
                /*
                 * Best effort, don't worry if extent state allocation fails
                 * here for the first iteration. We might have a cached state
@@ -1278,7 +1278,7 @@ search_again:
        if (start > end)
                goto out;
        spin_unlock(&tree->lock);
-       if (mask & __GFP_WAIT)
+       if (gfpflags_allow_blocking(mask))
                cond_resched();
        first_iteration = false;
        goto again;
@@ -1451,7 +1451,7 @@ int unlock_extent(struct extent_io_tree *tree, u64 start, u64 end)
                                GFP_NOFS);
 }
 
-int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end)
+void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end)
 {
        unsigned long index = start >> PAGE_CACHE_SHIFT;
        unsigned long end_index = end >> PAGE_CACHE_SHIFT;
@@ -1464,10 +1464,9 @@ int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end)
                page_cache_release(page);
                index++;
        }
-       return 0;
 }
 
-int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
+void extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
 {
        unsigned long index = start >> PAGE_CACHE_SHIFT;
        unsigned long end_index = end >> PAGE_CACHE_SHIFT;
@@ -1481,7 +1480,6 @@ int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
                page_cache_release(page);
                index++;
        }
-       return 0;
 }
 
 /*
@@ -1820,7 +1818,7 @@ out_failed:
        return found;
 }
 
-int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end,
+void extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end,
                                 struct page *locked_page,
                                 unsigned clear_bits,
                                 unsigned long page_ops)
@@ -1835,7 +1833,7 @@ int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end,
 
        clear_extent_bit(tree, start, end, clear_bits, 1, 0, NULL, GFP_NOFS);
        if (page_ops == 0)
-               return 0;
+               return;
 
        if ((page_ops & PAGE_SET_ERROR) && nr_pages > 0)
                mapping_set_error(inode->i_mapping, -EIO);
@@ -1869,7 +1867,6 @@ int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end,
                index += ret;
                cond_resched();
        }
-       return 0;
 }
 
 /*
@@ -2516,7 +2513,7 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset,
 
 /* lots and lots of room for performance fixes in the end_bio funcs */
 
-int end_extent_writepage(struct page *page, int err, u64 start, u64 end)
+void end_extent_writepage(struct page *page, int err, u64 start, u64 end)
 {
        int uptodate = (err == 0);
        struct extent_io_tree *tree;
@@ -2537,7 +2534,6 @@ int end_extent_writepage(struct page *page, int err, u64 start, u64 end)
                ret = ret < 0 ? ret : -EIO;
                mapping_set_error(page->mapping, ret);
        }
-       return 0;
 }
 
 /*
@@ -2579,9 +2575,7 @@ static void end_bio_extent_writepage(struct bio *bio)
                start = page_offset(page);
                end = start + bvec->bv_offset + bvec->bv_len - 1;
 
-               if (end_extent_writepage(page, bio->bi_error, start, end))
-                       continue;
-
+               end_extent_writepage(page, bio->bi_error, start, end);
                end_page_writeback(page);
        }
 
@@ -4386,7 +4380,7 @@ int try_release_extent_mapping(struct extent_map_tree *map,
        u64 start = page_offset(page);
        u64 end = start + PAGE_CACHE_SIZE - 1;
 
-       if ((mask & __GFP_WAIT) &&
+       if (gfpflags_allow_blocking(mask) &&
            page->mapping->host->i_size > 16 * 1024 * 1024) {
                u64 len;
                while (start <= end) {
@@ -5227,7 +5221,7 @@ int set_extent_buffer_dirty(struct extent_buffer *eb)
        return was_dirty;
 }
 
-int clear_extent_buffer_uptodate(struct extent_buffer *eb)
+void clear_extent_buffer_uptodate(struct extent_buffer *eb)
 {
        unsigned long i;
        struct page *page;
@@ -5240,10 +5234,9 @@ int clear_extent_buffer_uptodate(struct extent_buffer *eb)
                if (page)
                        ClearPageUptodate(page);
        }
-       return 0;
 }
 
-int set_extent_buffer_uptodate(struct extent_buffer *eb)
+void set_extent_buffer_uptodate(struct extent_buffer *eb)
 {
        unsigned long i;
        struct page *page;
@@ -5255,7 +5248,6 @@ int set_extent_buffer_uptodate(struct extent_buffer *eb)
                page = eb->pages[i];
                SetPageUptodate(page);
        }
-       return 0;
 }
 
 int extent_buffer_uptodate(struct extent_buffer *eb)
This page took 0.028069 seconds and 5 git commands to generate.