Skip to content

Commit 6aabd85

Browse files
adam900710kdave
authored andcommitted
btrfs: remove unused function btrfs_bio_fits_in_stripe()
As the last caller in compression.c has been removed, we don't need that function anymore. Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 9150724 commit 6aabd85

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

fs/btrfs/ctree.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3220,8 +3220,6 @@ void btrfs_merge_delalloc_extent(struct inode *inode, struct extent_state *new,
32203220
struct extent_state *other);
32213221
void btrfs_split_delalloc_extent(struct inode *inode,
32223222
struct extent_state *orig, u64 split);
3223-
int btrfs_bio_fits_in_stripe(struct page *page, size_t size, struct bio *bio,
3224-
unsigned long bio_flags);
32253223
void btrfs_set_range_writeback(struct btrfs_inode *inode, u64 start, u64 end);
32263224
vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf);
32273225
int btrfs_readpage(struct file *file, struct page *page);

fs/btrfs/inode.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,48 +2233,6 @@ void btrfs_clear_delalloc_extent(struct inode *vfs_inode,
22332233
}
22342234
}
22352235

2236-
/*
2237-
* btrfs_bio_fits_in_stripe - Checks whether the size of the given bio will fit
2238-
* in a chunk's stripe. This function ensures that bios do not span a
2239-
* stripe/chunk
2240-
*
2241-
* @page - The page we are about to add to the bio
2242-
* @size - size we want to add to the bio
2243-
* @bio - bio we want to ensure is smaller than a stripe
2244-
* @bio_flags - flags of the bio
2245-
*
2246-
* return 1 if page cannot be added to the bio
2247-
* return 0 if page can be added to the bio
2248-
* return error otherwise
2249-
*/
2250-
int btrfs_bio_fits_in_stripe(struct page *page, size_t size, struct bio *bio,
2251-
unsigned long bio_flags)
2252-
{
2253-
struct inode *inode = page->mapping->host;
2254-
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
2255-
u64 logical = bio->bi_iter.bi_sector << 9;
2256-
u32 bio_len = bio->bi_iter.bi_size;
2257-
struct extent_map *em;
2258-
int ret = 0;
2259-
struct btrfs_io_geometry geom;
2260-
2261-
if (bio_flags & EXTENT_BIO_COMPRESSED)
2262-
return 0;
2263-
2264-
em = btrfs_get_chunk_map(fs_info, logical, fs_info->sectorsize);
2265-
if (IS_ERR(em))
2266-
return PTR_ERR(em);
2267-
ret = btrfs_get_io_geometry(fs_info, em, btrfs_op(bio), logical, &geom);
2268-
if (ret < 0)
2269-
goto out;
2270-
2271-
if (geom.len < bio_len + size)
2272-
ret = 1;
2273-
out:
2274-
free_extent_map(em);
2275-
return ret;
2276-
}
2277-
22782236
/*
22792237
* in order to insert checksums into the metadata in large chunks,
22802238
* we wait until bio submission time. All the pages in the bio are

0 commit comments

Comments
 (0)