Skip to contentSkip to conversation

ocfs2 1.6 - seventh set

Ocfs2-devel New Sunil Mushran 2 participants 4 messages Nov 23, 2009 – Nov 24, 2009 OCFS2

lore
Share & tools
lore
#0 lore raw

Two simple straight-forward non-controversial patches.... I hope.

#1 lore raw

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.

---
 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
index acbe8fd..c149524 100644
@@ -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
index 405e1a5..fc46d2c 100644
@@ -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
index 848c121..1905000 100644
@@ -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
index f6e2c69..adc337f 100644
@@ -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
#2 lore raw

PATCH 2/2 ocfs2: Enable fallocate() support

In reply to Sunil Mushran

EL5 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.

---
 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
index c149524..c12ee75 100644
@@ -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
index fc46d2c..af7b575 100644
@@ -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
index 1905000..1cc1aaf 100644
@@ -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
index adc337f..fe79509 100644
@@ -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
#3 lore raw
In reply to Sunil Mushran
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