clear_extent_buffer_uptodate(eb);
 out:
        unlock_extent_cached(io_tree, eb->start, eb->start + eb->len - 1,
-                            &cached_state, GFP_NOFS);
+                            &cached_state);
        if (need_lock)
                btrfs_tree_read_unlock_blocking(eb);
        return ret;
 
                             EXTENT_DELALLOC, 1, cached_state);
        if (!ret) {
                unlock_extent_cached(tree, delalloc_start, delalloc_end,
-                                    &cached_state, GFP_NOFS);
+                                    &cached_state);
                __unlock_for_delalloc(inode, locked_page,
                              delalloc_start, delalloc_end);
                cond_resched();
                        set_extent_uptodate(tree, cur, cur + iosize - 1,
                                            &cached, GFP_NOFS);
                        unlock_extent_cached(tree, cur,
-                                            cur + iosize - 1,
-                                            &cached, GFP_NOFS);
+                                            cur + iosize - 1, &cached);
                        break;
                }
                em = __get_extent_map(inode, page, pg_offset, cur,
                        set_extent_uptodate(tree, cur, cur + iosize - 1,
                                            &cached, GFP_NOFS);
                        unlock_extent_cached(tree, cur,
-                                            cur + iosize - 1,
-                                            &cached, GFP_NOFS);
+                                            cur + iosize - 1, &cached);
                        cur = cur + iosize;
                        pg_offset += iosize;
                        continue;
 out:
        btrfs_free_path(path);
        unlock_extent_cached(&BTRFS_I(inode)->io_tree, start, start + len - 1,
-                            &cached_state, GFP_NOFS);
+                            &cached_state);
        return ret;
 }
 
 
 }
 
 static inline int unlock_extent_cached(struct extent_io_tree *tree, u64 start,
-               u64 end, struct extent_state **cached, gfp_t mask)
+               u64 end, struct extent_state **cached)
 {
        return __clear_extent_bit(tree, start, end, EXTENT_LOCKED, 1, 0, cached,
-                               mask, NULL);
+                               GFP_NOFS, NULL);
 }
 
 static inline int unlock_extent_cached_atomic(struct extent_io_tree *tree,
 
                    ordered->file_offset + ordered->len > start_pos &&
                    ordered->file_offset <= last_pos) {
                        unlock_extent_cached(&inode->io_tree, start_pos,
-                                       last_pos, cached_state, GFP_NOFS);
+                                       last_pos, cached_state);
                        for (i = 0; i < num_pages; i++) {
                                unlock_page(pages[i]);
                                put_page(pages[i]);
                                                pos, copied, NULL);
                if (extents_locked)
                        unlock_extent_cached(&BTRFS_I(inode)->io_tree,
-                                            lockstart, lockend, &cached_state,
-                                            GFP_NOFS);
+                                            lockstart, lockend, &cached_state);
                btrfs_delalloc_release_extents(BTRFS_I(inode), reserve_bytes);
                if (ret) {
                        btrfs_drop_pages(pages, num_pages);
                if (ordered)
                        btrfs_put_ordered_extent(ordered);
                unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart,
-                                    lockend, &cached_state, GFP_NOFS);
+                                    lockend, &cached_state);
                ret = btrfs_wait_ordered_range(inode, lockstart,
                                               lockend - lockstart + 1);
                if (ret) {
        btrfs_free_block_rsv(fs_info, rsv);
 out:
        unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend,
-                            &cached_state, GFP_NOFS);
+                            &cached_state);
 out_only_mutex:
        if (!updated_inode && truncated_block && !ret && !err) {
                /*
                        btrfs_put_ordered_extent(ordered);
                        unlock_extent_cached(&BTRFS_I(inode)->io_tree,
                                             alloc_start, locked_end,
-                                            &cached_state, GFP_KERNEL);
+                                            &cached_state);
                        /*
                         * we can't wait on the range with the transaction
                         * running or with the extent lock held
        }
 out_unlock:
        unlock_extent_cached(&BTRFS_I(inode)->io_tree, alloc_start, locked_end,
-                            &cached_state, GFP_KERNEL);
+                            &cached_state);
 out:
        inode_unlock(inode);
        /* Let go of our reservation. */
                        *offset = min_t(loff_t, start, inode->i_size);
        }
        unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend,
-                            &cached_state, GFP_NOFS);
+                            &cached_state);
        return ret;
 }
 
 
 {
        io_ctl_drop_pages(io_ctl);
        unlock_extent_cached(&BTRFS_I(inode)->io_tree, 0,
-                            i_size_read(inode) - 1, cached_state,
-                            GFP_NOFS);
+                            i_size_read(inode) - 1, cached_state);
 }
 
 static int __btrfs_wait_cache_io(struct btrfs_root *root,
        io_ctl_drop_pages(io_ctl);
 
        unlock_extent_cached(&BTRFS_I(inode)->io_tree, 0,
-                            i_size_read(inode) - 1, &cached_state, GFP_NOFS);
+                            i_size_read(inode) - 1, &cached_state);
 
        /*
         * at this point the pages are under IO and we're happy,
 
                                        PAGE_SIZE);
        if (ordered) {
                unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start,
-                                    page_end, &cached_state, GFP_NOFS);
+                                    page_end, &cached_state);
                unlock_page(page);
                btrfs_start_ordered_extent(inode, ordered, 1);
                btrfs_put_ordered_extent(ordered);
        btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE);
 out:
        unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start, page_end,
-                            &cached_state, GFP_NOFS);
+                            &cached_state);
 out_page:
        unlock_page(page);
        put_page(page);
        btrfs_end_transaction(trans);
 out_unlock:
        unlock_extent_cached(&BTRFS_I(inode)->io_tree, lock_start, lock_end,
-                            &cached, GFP_NOFS);
+                            &cached);
        iput(inode);
        return ret;
 }
        ordered = btrfs_lookup_ordered_extent(inode, block_start);
        if (ordered) {
                unlock_extent_cached(io_tree, block_start, block_end,
-                                    &cached_state, GFP_NOFS);
+                                    &cached_state);
                unlock_page(page);
                put_page(page);
                btrfs_start_ordered_extent(inode, ordered, 1);
                                        &cached_state, 0);
        if (ret) {
                unlock_extent_cached(io_tree, block_start, block_end,
-                                    &cached_state, GFP_NOFS);
+                                    &cached_state);
                goto out_unlock;
        }
 
        }
        ClearPageChecked(page);
        set_page_dirty(page);
-       unlock_extent_cached(io_tree, block_start, block_end, &cached_state,
-                            GFP_NOFS);
+       unlock_extent_cached(io_tree, block_start, block_end, &cached_state);
 
 out_unlock:
        if (ret)
                if (!ordered)
                        break;
                unlock_extent_cached(io_tree, hole_start, block_end - 1,
-                                    &cached_state, GFP_NOFS);
+                                    &cached_state);
                btrfs_start_ordered_extent(inode, ordered, 1);
                btrfs_put_ordered_extent(ordered);
        }
                        break;
        }
        free_extent_map(em);
-       unlock_extent_cached(io_tree, hole_start, block_end - 1, &cached_state,
-                            GFP_NOFS);
+       unlock_extent_cached(io_tree, hole_start, block_end - 1, &cached_state);
        return err;
 }
 
                        break;
 
                unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend,
-                                    cached_state, GFP_NOFS);
+                                    cached_state);
 
                if (ordered) {
                        /*
                        PAGE_SIZE);
        if (ordered) {
                unlock_extent_cached(io_tree, page_start, page_end,
-                                    &cached_state, GFP_NOFS);
+                                    &cached_state);
                unlock_page(page);
                btrfs_start_ordered_extent(inode, ordered, 1);
                btrfs_put_ordered_extent(ordered);
                                        &cached_state, 0);
        if (ret) {
                unlock_extent_cached(io_tree, page_start, page_end,
-                                    &cached_state, GFP_NOFS);
+                                    &cached_state);
                ret = VM_FAULT_SIGBUS;
                goto out_unlock;
        }
        BTRFS_I(inode)->last_sub_trans = BTRFS_I(inode)->root->log_transid;
        BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->root->last_log_commit;
 
-       unlock_extent_cached(io_tree, page_start, page_end, &cached_state, GFP_NOFS);
+       unlock_extent_cached(io_tree, page_start, page_end, &cached_state);
 
 out_unlock:
        if (!ret) {
 
                /* get the big lock and read metadata off disk */
                lock_extent_bits(io_tree, start, end, &cached);
                em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len, 0);
-               unlock_extent_cached(io_tree, start, end, &cached, GFP_NOFS);
+               unlock_extent_cached(io_tree, start, end, &cached);
 
                if (IS_ERR(em))
                        return NULL;
                        ordered = btrfs_lookup_ordered_extent(inode,
                                                              page_start);
                        unlock_extent_cached(tree, page_start, page_end,
-                                            &cached_state, GFP_NOFS);
+                                            &cached_state);
                        if (!ordered)
                                break;
 
                          &cached_state);
 
        unlock_extent_cached(&BTRFS_I(inode)->io_tree,
-                            page_start, page_end - 1, &cached_state,
-                            GFP_NOFS);
+                            page_start, page_end - 1, &cached_state);
 
        for (i = 0; i < i_done; i++) {
                clear_page_dirty_for_io(pages[i]);
 
        free_extent_map(em);
 
 out_unlock:
-       unlock_extent_cached(io_tree, lockstart, lockend, &cached_state,
-                            GFP_NOFS);
+       unlock_extent_cached(io_tree, lockstart, lockend, &cached_state);
        return ret;
 }