Commit 64e1db56 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: make btrfs_cleanup_ordered_extents take btrfs_inode

Preparation to converting btrfs_run_delalloc_range to using btrfs_inode
without BTRFS_I() calls.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent b672b5c1
...@@ -104,7 +104,7 @@ static void __endio_write_update_ordered(struct btrfs_inode *inode, ...@@ -104,7 +104,7 @@ static void __endio_write_update_ordered(struct btrfs_inode *inode,
* to be released, which we want to happen only when finishing the ordered * to be released, which we want to happen only when finishing the ordered
* extent (btrfs_finish_ordered_io()). * extent (btrfs_finish_ordered_io()).
*/ */
static inline void btrfs_cleanup_ordered_extents(struct inode *inode, static inline void btrfs_cleanup_ordered_extents(struct btrfs_inode *inode,
struct page *locked_page, struct page *locked_page,
u64 offset, u64 bytes) u64 offset, u64 bytes)
{ {
...@@ -116,7 +116,7 @@ static inline void btrfs_cleanup_ordered_extents(struct inode *inode, ...@@ -116,7 +116,7 @@ static inline void btrfs_cleanup_ordered_extents(struct inode *inode,
struct page *page; struct page *page;
while (index <= end_index) { while (index <= end_index) {
page = find_get_page(inode->i_mapping, index); page = find_get_page(inode->vfs_inode.i_mapping, index);
index++; index++;
if (!page) if (!page)
continue; continue;
...@@ -134,8 +134,7 @@ static inline void btrfs_cleanup_ordered_extents(struct inode *inode, ...@@ -134,8 +134,7 @@ static inline void btrfs_cleanup_ordered_extents(struct inode *inode,
bytes -= PAGE_SIZE; bytes -= PAGE_SIZE;
} }
return __endio_write_update_ordered(BTRFS_I(inode), offset, bytes, return __endio_write_update_ordered(inode, offset, bytes, false);
false);
} }
static int btrfs_dirty_inode(struct inode *inode); static int btrfs_dirty_inode(struct inode *inode);
...@@ -1838,7 +1837,7 @@ int btrfs_run_delalloc_range(struct inode *inode, struct page *locked_page, ...@@ -1838,7 +1837,7 @@ int btrfs_run_delalloc_range(struct inode *inode, struct page *locked_page,
page_started, nr_written); page_started, nr_written);
} }
if (ret) if (ret)
btrfs_cleanup_ordered_extents(inode, locked_page, start, btrfs_cleanup_ordered_extents(BTRFS_I(inode), locked_page, start,
end - start + 1); end - start + 1);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment