mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 13:43:51 +00:00
f2fs: support fiemap() for directory inode
Adjust f2fs_fiemap() to support fiemap() on directory inode. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
04f9287ab3
commit
7975f3498d
@ -1539,7 +1539,7 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f2fs_has_inline_data(inode)) {
|
if (f2fs_has_inline_data(inode) || f2fs_has_inline_dentry(inode)) {
|
||||||
ret = f2fs_inline_data_fiemap(inode, fieinfo, start, len);
|
ret = f2fs_inline_data_fiemap(inode, fieinfo, start, len);
|
||||||
if (ret != -EAGAIN)
|
if (ret != -EAGAIN)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -704,7 +704,13 @@ int f2fs_inline_data_fiemap(struct inode *inode,
|
|||||||
if (IS_ERR(ipage))
|
if (IS_ERR(ipage))
|
||||||
return PTR_ERR(ipage);
|
return PTR_ERR(ipage);
|
||||||
|
|
||||||
if (!f2fs_has_inline_data(inode)) {
|
if ((S_ISREG(inode->i_mode) || S_ISLNK(inode->i_mode)) &&
|
||||||
|
!f2fs_has_inline_data(inode)) {
|
||||||
|
err = -EAGAIN;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (S_ISDIR(inode->i_mode) && !f2fs_has_inline_dentry(inode)) {
|
||||||
err = -EAGAIN;
|
err = -EAGAIN;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -1250,6 +1250,7 @@ const struct inode_operations f2fs_dir_inode_operations = {
|
|||||||
#ifdef CONFIG_F2FS_FS_XATTR
|
#ifdef CONFIG_F2FS_FS_XATTR
|
||||||
.listxattr = f2fs_listxattr,
|
.listxattr = f2fs_listxattr,
|
||||||
#endif
|
#endif
|
||||||
|
.fiemap = f2fs_fiemap,
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct inode_operations f2fs_symlink_inode_operations = {
|
const struct inode_operations f2fs_symlink_inode_operations = {
|
||||||
|
Loading…
Reference in New Issue
Block a user