Skip to content

Commit 66372c0

Browse files
adam900710kdave
authored andcommitted
btrfs: move extent_range_clear_dirty_for_io() into inode.c
The function is only used inside inode.c by compress_file_range(), so move it to inode.c and unexport it. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent bfe18e0 commit 66372c0

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

fs/btrfs/extent_io.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,6 @@ void __cold extent_buffer_free_cachep(void)
164164
kmem_cache_destroy(extent_buffer_cache);
165165
}
166166

167-
void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end)
168-
{
169-
unsigned long index = start >> PAGE_SHIFT;
170-
unsigned long end_index = end >> PAGE_SHIFT;
171-
struct page *page;
172-
173-
while (index <= end_index) {
174-
page = find_get_page(inode->i_mapping, index);
175-
BUG_ON(!page); /* Pages should be in the extent_io_tree */
176-
clear_page_dirty_for_io(page);
177-
put_page(page);
178-
index++;
179-
}
180-
}
181-
182167
static void process_one_page(struct btrfs_fs_info *fs_info,
183168
struct page *page, const struct page *locked_page,
184169
unsigned long page_ops, u64 start, u64 end)

fs/btrfs/extent_io.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ void extent_buffer_bitmap_clear(const struct extent_buffer *eb,
353353
void set_extent_buffer_dirty(struct extent_buffer *eb);
354354
void set_extent_buffer_uptodate(struct extent_buffer *eb);
355355
void clear_extent_buffer_uptodate(struct extent_buffer *eb);
356-
void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end);
357356
void extent_clear_unlock_delalloc(struct btrfs_inode *inode, u64 start, u64 end,
358357
const struct page *locked_page,
359358
struct extent_state **cached,

fs/btrfs/inode.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,21 @@ static inline void inode_should_defrag(struct btrfs_inode *inode,
867867
btrfs_add_inode_defrag(NULL, inode, small_write);
868868
}
869869

870+
static void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end)
871+
{
872+
unsigned long index = start >> PAGE_SHIFT;
873+
unsigned long end_index = end >> PAGE_SHIFT;
874+
struct page *page;
875+
876+
while (index <= end_index) {
877+
page = find_get_page(inode->i_mapping, index);
878+
BUG_ON(!page); /* Pages should be in the extent_io_tree */
879+
clear_page_dirty_for_io(page);
880+
put_page(page);
881+
index++;
882+
}
883+
}
884+
870885
/*
871886
* Work queue call back to started compression on a file and pages.
872887
*

0 commit comments

Comments
 (0)