diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 39fe7d70791a2671b5bf363543b1c33652414027..c1fb6dd10911c01e9b37d533a7588ee6bf934ecb 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -708,6 +708,12 @@ static int get_data_block(struct inode *inode, sector_t iblock, return err; } +int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, + u64 start, u64 len) +{ + return generic_block_fiemap(inode, fieinfo, start, len, get_data_block); +} + static int f2fs_read_data_page(struct file *file, struct page *page) { struct inode *inode = page->mapping->host; diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index f628c3c5e63faf3b7834190705906358a6bd4ed5..e51c732b0dd9043ccdc37e8e68d10a024c82a6e0 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1271,6 +1271,7 @@ struct page *find_data_page(struct inode *, pgoff_t, bool); struct page *get_lock_data_page(struct inode *, pgoff_t); struct page *get_new_data_page(struct inode *, struct page *, pgoff_t, bool); int do_write_data_page(struct page *, struct f2fs_io_info *); +int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *, u64, u64); /* * gc.c diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 78110dab56817a3ef4017d40924cf26906112f7f..9c49c593d8eb4ab39a1aa28c1b841f949d02c050 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -540,6 +540,7 @@ const struct inode_operations f2fs_file_inode_operations = { .listxattr = f2fs_listxattr, .removexattr = generic_removexattr, #endif + .fiemap = f2fs_fiemap, }; static void fill_zero(struct inode *inode, pgoff_t index,