erofs: add "noinline_data" extended option
PATCH 1/1 erofs: add "noinline_data" extended option
In order to add preliminary DAX feature support.
Signed-off-by Gao Xiang <[email protected]>
--- include/erofs/config.h | 1 + lib/inode.c | 5 +++++ mkfs/main.c | 6 ++++++ 3 files changed, 12 insertions(+)
include/erofs/config.h +1 -0
@@ -44,6 +44,7 @@ struct erofs_configure {bool c_random_pclusterblks;#endif char c_timeinherit; +bool c_noinline_data;#ifdef HAVE_LIBSELINUX struct selabel_handle *sehnd;
lib/inode.c +5 -0
@@ -562,6 +562,11 @@ static int erofs_prepare_inode_buffer(struct erofs_inode *inode)if (is_inode_layout_compression (inode)) goto noinline; +if (cfg.c_noinline_data &&S_ISREG (inode->i_mode)) { + inode->datalayout =EROFS_INODE_FLAT_PLAIN ; + goto noinline; + } +/* * if the file size is block-aligned for uncompressed files, * should use EROFS_INODE_FLAT_PLAIN data mapping mode.
mkfs/main.c +6 -0
@@ -161,6 +161,12 @@ static int parse_extended_opts(const char *opts)return -EINVAL ;erofs_sb_clear_sb_chksum (); } + +if (MATCH_EXTENTED_OPT ("noinline_data" , token, keylen)) { +if (vallen) +return -EINVAL ; + cfg.c_noinline_data = true; + } }return 0 ; }
Signature · 1 line
2.24.4
Should the commit message starts with “erofs-utils:” instead of “erofs:”?
Quoted 58 lines · 在 2021年7月4日,21:41,Gao Xiang <[email protected]> 写道:
In order to add preliminary DAX feature support.
Signed-off-by Gao Xiang <[email protected]>---
include/erofs/config.h | 1 + lib/inode.c | 5 +++++ mkfs/main.c | 6 ++++++ 3 files changed, 12 insertions(+)include/erofs/config.h +1
-0@@ -44,6 +44,7 @@ struct erofs_configure {bool c_random_pclusterblks;#endif char c_timeinherit; +bool c_noinline_data;#ifdef HAVE_LIBSELINUX struct selabel_handle *sehnd;lib/inode.c +5
-0@@ -562,6 +562,11 @@ static int erofs_prepare_inode_buffer(struct erofs_inode *inode)if (is_inode_layout_compression (inode)) goto noinline; +if (cfg.c_noinline_data &&S_ISREG (inode->i_mode)) { + inode->datalayout =EROFS_INODE_FLAT_PLAIN ; + goto noinline; + } +/* * if the file size is block-aligned for uncompressed files, * should use EROFS_INODE_FLAT_PLAIN data mapping mode. mkfs/main.c +6
-0@@ -161,6 +161,12 @@ static int parse_extended_opts(const char *opts)return -EINVAL ;erofs_sb_clear_sb_chksum (); } + +if (MATCH_EXTENTED_OPT ("noinline_data" , token, keylen)) { +if (vallen) +return -EINVAL ; + cfg.c_noinline_data = true; + } }return 0 ; }Signature · 1 line
2.24.4
Quoted 1 line · 胡玮文
Should the commit message starts with “erofs-utils:” instead of “erofs:”?
Hi Weiwen,
yeah, you are right, let me revise it in the morning...
Thanks,
Gao Xiang
Quoted 59 lines
Quoted 59 lines · 在 2021年7月4日,21:41,Gao Xiang <[email protected]> 写道:
In order to add preliminary DAX feature support.
Signed-off-by Gao Xiang <[email protected]>---
include/erofs/config.h | 1 + lib/inode.c | 5 +++++ mkfs/main.c | 6 ++++++ 3 files changed, 12 insertions(+)include/erofs/config.h +1
-0@@ -44,6 +44,7 @@ struct erofs_configure {bool c_random_pclusterblks;#endif char c_timeinherit; +bool c_noinline_data;#ifdef HAVE_LIBSELINUX struct selabel_handle *sehnd;lib/inode.c +5
-0@@ -562,6 +562,11 @@ static int erofs_prepare_inode_buffer(struct erofs_inode *inode)if (is_inode_layout_compression (inode)) goto noinline; +if (cfg.c_noinline_data &&S_ISREG (inode->i_mode)) { + inode->datalayout =EROFS_INODE_FLAT_PLAIN ; + goto noinline; + } +/* * if the file size is block-aligned for uncompressed files, * should use EROFS_INODE_FLAT_PLAIN data mapping mode. mkfs/main.c +6
-0@@ -161,6 +161,12 @@ static int parse_extended_opts(const char *opts)return -EINVAL ;erofs_sb_clear_sb_chksum (); } + +if (MATCH_EXTENTED_OPT ("noinline_data" , token, keylen)) { +if (vallen) +return -EINVAL ; + cfg.c_noinline_data = true; + } }return 0 ; }Signature · 1 line
2.24.4