]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/btrfs/inode.c
Merge branch 'for-chris-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/fdmanan...
[mirror_ubuntu-artful-kernel.git] / fs / btrfs / inode.c
index 1436799b763bd0e2eda26d2e62c0c22b68faf25e..bdb0008712c8aa5d410ac4b3245f812b85f7d988 100644 (file)
@@ -1996,7 +1996,7 @@ again:
        page_start = page_offset(page);
        page_end = page_offset(page) + PAGE_CACHE_SIZE - 1;
 
-       lock_extent_bits(&BTRFS_I(inode)->io_tree, page_start, page_end, 0,
+       lock_extent_bits(&BTRFS_I(inode)->io_tree, page_start, page_end,
                         &cached_state);
 
        /* already ordered? We're done */
@@ -2489,7 +2489,7 @@ static noinline int relink_extent_backref(struct btrfs_path *path,
        lock_start = backref->file_pos;
        lock_end = backref->file_pos + backref->num_bytes - 1;
        lock_extent_bits(&BTRFS_I(inode)->io_tree, lock_start, lock_end,
-                        0, &cached);
+                        &cached);
 
        ordered = btrfs_lookup_first_ordered_extent(inode, lock_end);
        if (ordered) {
@@ -2881,7 +2881,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
 
        lock_extent_bits(io_tree, ordered_extent->file_offset,
                         ordered_extent->file_offset + ordered_extent->len - 1,
-                        0, &cached_state);
+                        &cached_state);
 
        ret = test_range_bit(io_tree, ordered_extent->file_offset,
                        ordered_extent->file_offset + ordered_extent->len - 1,
@@ -4675,7 +4675,7 @@ again:
        }
        wait_on_page_writeback(page);
 
-       lock_extent_bits(io_tree, page_start, page_end, 0, &cached_state);
+       lock_extent_bits(io_tree, page_start, page_end, &cached_state);
        set_page_extent_mapped(page);
 
        ordered = btrfs_lookup_ordered_extent(inode, page_start);
@@ -4806,7 +4806,7 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
        while (1) {
                struct btrfs_ordered_extent *ordered;
 
-               lock_extent_bits(io_tree, hole_start, block_end - 1, 0,
+               lock_extent_bits(io_tree, hole_start, block_end - 1,
                                 &cached_state);
                ordered = btrfs_lookup_ordered_range(inode, hole_start,
                                                     block_end - hole_start);
@@ -5118,7 +5118,7 @@ static void evict_inode_truncate_pages(struct inode *inode)
                end = state->end;
                spin_unlock(&io_tree->lock);
 
-               lock_extent_bits(io_tree, start, end, 0, &cached_state);
+               lock_extent_bits(io_tree, start, end, &cached_state);
 
                /*
                 * If still has DELALLOC flag, the extent didn't reach disk,
@@ -6351,9 +6351,6 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
        u64 objectid;
        u64 index = 0;
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        /*
         * 2 for inode item and ref
         * 2 for dir items
@@ -7390,7 +7387,7 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend,
 
        while (1) {
                lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend,
-                                0, cached_state);
+                                cached_state);
                /*
                 * We're concerned with the entire range that we're going to be
                 * doing DIO to, so we need to make sure theres no ordered
@@ -8646,7 +8643,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned int offset,
        }
 
        if (!inode_evicting)
-               lock_extent_bits(tree, page_start, page_end, 0, &cached_state);
+               lock_extent_bits(tree, page_start, page_end, &cached_state);
        ordered = btrfs_lookup_ordered_extent(inode, page_start);
        if (ordered) {
                /*
@@ -8684,7 +8681,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned int offset,
                btrfs_put_ordered_extent(ordered);
                if (!inode_evicting) {
                        cached_state = NULL;
-                       lock_extent_bits(tree, page_start, page_end, 0,
+                       lock_extent_bits(tree, page_start, page_end,
                                         &cached_state);
                }
        }
@@ -8782,7 +8779,7 @@ again:
        }
        wait_on_page_writeback(page);
 
-       lock_extent_bits(io_tree, page_start, page_end, 0, &cached_state);
+       lock_extent_bits(io_tree, page_start, page_end, &cached_state);
        set_page_extent_mapped(page);
 
        /*
@@ -9450,14 +9447,10 @@ static void btrfs_run_delalloc_work(struct btrfs_work *work)
        delalloc_work = container_of(work, struct btrfs_delalloc_work,
                                     work);
        inode = delalloc_work->inode;
-       if (delalloc_work->wait) {
-               btrfs_wait_ordered_range(inode, 0, (u64)-1);
-       } else {
+       filemap_flush(inode->i_mapping);
+       if (test_bit(BTRFS_INODE_HAS_ASYNC_EXTENT,
+                               &BTRFS_I(inode)->runtime_flags))
                filemap_flush(inode->i_mapping);
-               if (test_bit(BTRFS_INODE_HAS_ASYNC_EXTENT,
-                            &BTRFS_I(inode)->runtime_flags))
-                       filemap_flush(inode->i_mapping);
-       }
 
        if (delalloc_work->delay_iput)
                btrfs_add_delayed_iput(inode);
@@ -9467,7 +9460,7 @@ static void btrfs_run_delalloc_work(struct btrfs_work *work)
 }
 
 struct btrfs_delalloc_work *btrfs_alloc_delalloc_work(struct inode *inode,
-                                                   int wait, int delay_iput)
+                                                   int delay_iput)
 {
        struct btrfs_delalloc_work *work;
 
@@ -9478,7 +9471,6 @@ struct btrfs_delalloc_work *btrfs_alloc_delalloc_work(struct inode *inode,
        init_completion(&work->completion);
        INIT_LIST_HEAD(&work->list);
        work->inode = inode;
-       work->wait = wait;
        work->delay_iput = delay_iput;
        WARN_ON_ONCE(!inode);
        btrfs_init_work(&work->work, btrfs_flush_delalloc_helper,
@@ -9526,7 +9518,7 @@ static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput,
                }
                spin_unlock(&root->delalloc_lock);
 
-               work = btrfs_alloc_delalloc_work(inode, 0, delay_iput);
+               work = btrfs_alloc_delalloc_work(inode, delay_iput);
                if (!work) {
                        if (delay_iput)
                                btrfs_add_delayed_iput(inode);