ocfs2 1.6 - seventh set
Two simple straight-forward non-controversial patches.... I hope.
PATCH 1/2 ocfs2: Enable fiemap() support
EL5 U4 enables fiemap() support for file systems that has FS_HAS_FIEMAP flag set. Patch detects such kernels and appends the flag to enable it.
Signed-off-by Sunil Mushran <[email protected]>
--- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/super.c | 4 ++++ 4 files changed, 14 insertions(+), 0 deletions(-)
Config.make.in +1 -0
@@ -84,6 +84,7 @@ NO_NAME_IN_BACKING_DEV_INFO=@NO_NAME_IN_BACKING_DEV_INFO@ NO_KOBJ_ATTRIBUTE = @NO_KOBJ_ATTRIBUTE@ SKIP_QUOTAS= @SKIP_QUOTAS@ SKIP_EXPORTS= @SKIP_EXPORTS@ +APPEND_FIEMAP_FLAG=@APPEND_FIEMAP_FLAG@ OCFS_DEBUG = @OCFS_DEBUG@
configure.in +5 -0
@@ -459,6 +459,11 @@ OCFS2_CHECK_KERNEL([cancel_work_sync() in workqueue.h], workqueue.h, , cancel_work_sync_header=cancel_work_sync.h, [extern int cancel_work_sync(struct work_struct]) KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $cancel_work_sync_header" +APPEND_FIEMAP_FLAG= +OCFS2_CHECK_KERNEL([ FS_HAS_FIEMAP in fs.h], fs.h, + APPEND_FIEMAP_FLAG=yes, , [#define FS_HAS_FIEMAP ]) +AC_SUBST(APPEND_FIEMAP_FLAG) + # End kapi_compat checks # using -include has two advantages:
fs/ocfs2/Makefile +4 -0
@@ -136,6 +136,10 @@ ifdef SKIP_EXPORTS EXTRA_CFLAGS += -DSKIP_EXPORTS endif +ifdef APPEND_FIEMAP_FLAG +EXTRA_CFLAGS += -DAPPEND_FIEMAP_FLAG +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes.
fs/ocfs2/super.c +4 -0
@@ -1559,6 +1559,10 @@ static int __init ocfs2_init(void)ocfs2_print_version (); +#ifdef APPEND_FIEMAP_FLAG + ocfs2_fs_type.fs_flags |=FS_HAS_FIEMAP ; +#endif + status =init_ocfs2_uptodate_cache ();if (status <0 ) {mlog_errno (status);
Signature · 1 line
1.6.3.3
PATCH 2/2 ocfs2: Enable fallocate() support
In reply to Sunil MushranEL5 U4 enables fallocate() support for file systems that has FS_HAS_FALLOCATE flag set. Patch detects such kernels and appends the flag to enable it.
Signed-off-by Sunil Mushran <[email protected]>
--- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/super.c | 4 ++++ 4 files changed, 14 insertions(+), 0 deletions(-)
Config.make.in +1 -0
@@ -85,6 +85,7 @@ NO_KOBJ_ATTRIBUTE = @NO_KOBJ_ATTRIBUTE@ SKIP_QUOTAS= @SKIP_QUOTAS@ SKIP_EXPORTS= @SKIP_EXPORTS@ APPEND_FIEMAP_FLAG=@APPEND_FIEMAP_FLAG@ +APPEND_FALLOCATE_FLAG=@APPEND_FALLOCATE_FLAG@ OCFS_DEBUG = @OCFS_DEBUG@
configure.in +5 -0
@@ -464,6 +464,11 @@ OCFS2_CHECK_KERNEL([ FS_HAS_FIEMAP in fs.h], fs.h, APPEND_FIEMAP_FLAG=yes, , [#define FS_HAS_FIEMAP ]) AC_SUBST(APPEND_FIEMAP_FLAG) +APPEND_FALLOCATE_FLAG= +OCFS2_CHECK_KERNEL([ FS_HAS_FALLOCATE in fs.h], fs.h, + APPEND_FALLOCATE_FLAG=yes, , [#define FS_HAS_FALLOCATE ]) +AC_SUBST(APPEND_FALLOCATE_FLAG) + # End kapi_compat checks # using -include has two advantages:
fs/ocfs2/Makefile +4 -0
@@ -140,6 +140,10 @@ ifdef APPEND_FIEMAP_FLAG EXTRA_CFLAGS += -DAPPEND_FIEMAP_FLAG endif +ifdef APPEND_FALLOCATE_FLAG +EXTRA_CFLAGS += -DAPPEND_FALLOCATE_FLAG +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes.
fs/ocfs2/super.c +4 -0
@@ -1563,6 +1563,10 @@ static int __init ocfs2_init(void) ocfs2_fs_type.fs_flags |=FS_HAS_FIEMAP ;#endif +#ifdef APPEND_FALLOCATE_FLAG + ocfs2_fs_type.fs_flags |=FS_HAS_FALLOCATE ; +#endif + status =init_ocfs2_uptodate_cache ();if (status <0 ) {mlog_errno (status);
Signature · 1 line
1.6.3.3
Quoted 1 line · Sunil Mushran
Two simple straight-forward non-controversial patches.... I hope.
I'm guessing these FS_HAS_* flags only exist in EL5U4. This
works just fine.
Joel
Signature · 9 lines
"Nearly all men can stand adversity, but if you really want to test a man's character, give him power." - Abraham Lincoln Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127