* [Ocfs2-devel] [PATCH 1/2] ocfs2: Enable fiemap() support
2009-11-23 21:31 [Ocfs2-devel] ocfs2 1.6 - seventh set Sunil Mushran
@ 2009-11-23 21:31 ` Sunil Mushran
2009-11-23 21:31 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Enable fallocate() support Sunil Mushran
2009-11-24 0:45 ` [Ocfs2-devel] ocfs2 1.6 - seventh set Joel Becker
2 siblings, 0 replies; 4+ messages in thread
From: Sunil Mushran @ 2009-11-23 21:31 UTC (permalink / raw)
To: ocfs2-devel
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 <sunil.mushran@oracle.com>
---
Config.make.in | 1 +
configure.in | 5 +++++
fs/ocfs2/Makefile | 4 ++++
fs/ocfs2/super.c | 4 ++++
4 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/Config.make.in b/Config.make.in
index acbe8fd..c149524 100644
--- a/Config.make.in
+++ b/Config.make.in
@@ -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@
diff --git a/configure.in b/configure.in
index 405e1a5..fc46d2c 100644
--- a/configure.in
+++ b/configure.in
@@ -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:
diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile
index 848c121..1905000 100644
--- a/fs/ocfs2/Makefile
+++ b/fs/ocfs2/Makefile
@@ -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.
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index f6e2c69..adc337f 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -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);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [Ocfs2-devel] [PATCH 2/2] ocfs2: Enable fallocate() support
2009-11-23 21:31 [Ocfs2-devel] ocfs2 1.6 - seventh set Sunil Mushran
2009-11-23 21:31 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: Enable fiemap() support Sunil Mushran
@ 2009-11-23 21:31 ` Sunil Mushran
2009-11-24 0:45 ` [Ocfs2-devel] ocfs2 1.6 - seventh set Joel Becker
2 siblings, 0 replies; 4+ messages in thread
From: Sunil Mushran @ 2009-11-23 21:31 UTC (permalink / raw)
To: ocfs2-devel
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.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
---
Config.make.in | 1 +
configure.in | 5 +++++
fs/ocfs2/Makefile | 4 ++++
fs/ocfs2/super.c | 4 ++++
4 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/Config.make.in b/Config.make.in
index c149524..c12ee75 100644
--- a/Config.make.in
+++ b/Config.make.in
@@ -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@
diff --git a/configure.in b/configure.in
index fc46d2c..af7b575 100644
--- a/configure.in
+++ b/configure.in
@@ -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:
diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile
index 1905000..1cc1aaf 100644
--- a/fs/ocfs2/Makefile
+++ b/fs/ocfs2/Makefile
@@ -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.
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index adc337f..fe79509 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -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);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [Ocfs2-devel] ocfs2 1.6 - seventh set
2009-11-23 21:31 [Ocfs2-devel] ocfs2 1.6 - seventh set Sunil Mushran
2009-11-23 21:31 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: Enable fiemap() support Sunil Mushran
2009-11-23 21:31 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Enable fallocate() support Sunil Mushran
@ 2009-11-24 0:45 ` Joel Becker
2 siblings, 0 replies; 4+ messages in thread
From: Joel Becker @ 2009-11-24 0:45 UTC (permalink / raw)
To: ocfs2-devel
On Mon, Nov 23, 2009 at 01:31:39PM -0800, Sunil Mushran wrote:
> 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
--
"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
^ permalink raw reply [flat|nested] 4+ messages in thread