The next set. The previous 3 sets have been pushed to the git repo.
Sunil Mushran
2009-Nov-12 03:39 UTC
[Ocfs2-devel] [PATCH 1/8] ocfs2: Handle missing macro MNT_RELATIME
Mainline commit 47ae32d6a54955a041cdc30b06d0bb16e75f68d5 added macro MNT_RELATIME. It should be noted that the functionality will not be available on EL5 as the vfs support is missing. TODO: This feature needs to be enabled by parsing the realtime mount option in ocfs2 itself. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Makefile | 3 ++- configure.in | 5 +++++ kapi-compat/include/relatime.h | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletions(-) create mode 100644 kapi-compat/include/relatime.h diff --git a/Makefile b/Makefile index 06ddabf..6676daf 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,8 @@ KAPI_COMPAT_FILES = \ kapi-compat/include/sync_mapping.h \ kapi-compat/include/fpath.h \ kapi-compat/include/ushortmax.h \ - kapi-compat/include/fversion.h + kapi-compat/include/fversion.h \ + kapi-compat/include/relatime.h PATCH_FILES diff --git a/configure.in b/configure.in index 26b9f80..07325c3 100644 --- a/configure.in +++ b/configure.in @@ -271,6 +271,11 @@ OCFS2_CHECK_KERNEL([seq_open() has const struct seq_operations * in seq_file.h], , SEQOP_IS_NOT_CONST=yes, [int seq_open(struct file \*, const struct seq_operations \*);]) AC_SUBST(SEQOP_IS_NOT_CONST) +relatime_compat_header="" +OCFS2_CHECK_KERNEL([MNT_RELATIME in mount.h], mount.h, + , relatime_compat_header=relatime.h, [^#define MNT_RELATIME]) +KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $relatime_compat_header" + # End kapi_compat checks diff --git a/kapi-compat/include/relatime.h b/kapi-compat/include/relatime.h new file mode 100644 index 0000000..34c5d38 --- /dev/null +++ b/kapi-compat/include/relatime.h @@ -0,0 +1,6 @@ +#ifndef KAPI_RELATIME_H +#define KAPI_RELATIME_H + +#define MNT_RELATIME 0x20 + +#endif -- 1.5.6.5
Sunil Mushran
2009-Nov-12 03:39 UTC
[Ocfs2-devel] [PATCH 2/8] ocfs2: Handle missing vectorized fileops aio_read() and aio_write()
Mainline commit 027445c37282bc1ed26add45e573ad2d3e4860a5 vectorized fileops aio_read() and aio_write(). Patch provides support for the non-vectorized fileops (in EL5) by hand crafting the iovec with the provided buf and buflen. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Config.make.in | 1 + Makefile | 3 +- configure.in | 6 ++++ fs/ocfs2/Makefile | 4 +++ fs/ocfs2/file.c | 6 ++-- fs/ocfs2/kapi-default.h | 7 +++++ kapi-compat/include/aiovec.h | 57 ++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 kapi-compat/include/aiovec.h diff --git a/Config.make.in b/Config.make.in index 2e5ff54..d129c64 100644 --- a/Config.make.in +++ b/Config.make.in @@ -70,6 +70,7 @@ EXPORTOP_IS_NOT_CONST = @EXPORTOP_IS_NOT_CONST@ MATCHTABLE_IS_NOT_CONST = @MATCHTABLE_IS_NOT_CONST@ VMOP_IS_NOT_CONST = @VMOP_IS_NOT_CONST@ SEQOP_IS_NOT_CONST = @SEQOP_IS_NOT_CONST@ +NO_VECTORIZED_AIO = @NO_VECTORIZED_AIO@ OCFS_DEBUG = @OCFS_DEBUG@ diff --git a/Makefile b/Makefile index 6676daf..140b9cd 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,8 @@ KAPI_COMPAT_FILES = \ kapi-compat/include/fpath.h \ kapi-compat/include/ushortmax.h \ kapi-compat/include/fversion.h \ - kapi-compat/include/relatime.h + kapi-compat/include/relatime.h \ + kapi-compat/include/aiovec.h PATCH_FILES diff --git a/configure.in b/configure.in index 07325c3..0b98e28 100644 --- a/configure.in +++ b/configure.in @@ -276,6 +276,12 @@ OCFS2_CHECK_KERNEL([MNT_RELATIME in mount.h], mount.h, , relatime_compat_header=relatime.h, [^#define MNT_RELATIME]) KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $relatime_compat_header" +NO_VECTORIZED_AIO+OCFS2_CHECK_KERNEL([aio_read() in struct file_operations using iovec in fs.h], fs.h, + , NO_VECTORIZED_AIO=aiovec.h, [ssize_t (\*aio_read) (struct kiocb \*, const struct iovec \*, unsigned long, loff_t);]) +AC_SUBST(NO_VECTORIZED_AIO) +KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $NO_VECTORIZED_AIO" + # End kapi_compat checks diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index 1b19e4c..df389bc 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -84,6 +84,10 @@ ifdef VMOP_IS_NOT_CONST EXTRA_CFLAGS += -DVMOP_IS_NOT_CONST endif +ifdef NO_VECTORIZED_AIO +CFLAGS_file.o += -DNO_VECTORIZED_AIO +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes. diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 7bac90d..f5e8681 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1892,7 +1892,7 @@ out: return ret; } -static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, +static ssize_t __ocfs2_file_aio_write(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) @@ -2168,7 +2168,7 @@ bail: return ret; } -static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, +static ssize_t __ocfs2_file_aio_read(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) @@ -2222,7 +2222,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, } ocfs2_inode_unlock(inode, lock_level); - ret = generic_file_aio_read(iocb, iov, nr_segs, iocb->ki_pos); + ret = kapi_generic_file_aio_read(iocb, iov, nr_segs, iocb->ki_pos); if (ret == -EINVAL) mlog(0, "generic_file_aio_read returned -EINVAL\n"); diff --git a/fs/ocfs2/kapi-default.h b/fs/ocfs2/kapi-default.h index 3f04924..d068aaf 100644 --- a/fs/ocfs2/kapi-default.h +++ b/fs/ocfs2/kapi-default.h @@ -39,4 +39,11 @@ typedef struct work_struct kapi_work_struct_t; typedef u64 f_version_t; #endif +#ifndef kapi_generic_file_aio_read +# define kapi_generic_file_aio_read(a, b, c, d) \ + generic_file_aio_read(a, b, c, d) +# define ocfs2_file_aio_read __ocfs2_file_aio_read +# define ocfs2_file_aio_write __ocfs2_file_aio_write +#endif + #endif diff --git a/kapi-compat/include/aiovec.h b/kapi-compat/include/aiovec.h new file mode 100644 index 0000000..0c4c312 --- /dev/null +++ b/kapi-compat/include/aiovec.h @@ -0,0 +1,57 @@ +#ifndef KAPI_AIOVEC_H +#define KAPI_AIOVEC_H + +#ifdef NO_VECTORIZED_AIO + +#include <linux/fs.h> +#include <linux/uio.h> + +static ssize_t kapi_generic_file_aio_read(struct kiocb *iocb, + const struct iovec *iov, + unsigned long nr_segs, + loff_t pos) +{ + BUG_ON(nr_segs != 1); + return generic_file_aio_read(iocb, iov->iov_base, iov->iov_len, pos); +} + +static ssize_t __ocfs2_file_aio_read(struct kiocb *iocb, + const struct iovec *iov, + unsigned long nr_segs, + loff_t pos); + +static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, + char __user *buf, + size_t buflen, + loff_t pos) +{ + struct iovec iov_local = { .iov_base = (void __user *)buf, + .iov_len = buflen }; + const struct iovec *iov = &iov_local; + unsigned long nr_segs = 1; + + return __ocfs2_file_aio_read(iocb, iov, nr_segs, pos); +} + +static ssize_t __ocfs2_file_aio_write(struct kiocb *iocb, + const struct iovec *iov, + unsigned long nr_segs, + loff_t pos); + +static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, + const char __user *buf, + size_t buflen, + loff_t pos) +{ + struct iovec iov_local = { .iov_base = (void __user *)buf, + .iov_len = buflen }; + const struct iovec *iov = &iov_local; + unsigned long nr_segs = 1; + + iocb->ki_left = buflen; + return __ocfs2_file_aio_write(iocb, iov, nr_segs, pos); +} + +#endif + +#endif -- 1.5.6.5
Sunil Mushran
2009-Nov-12 03:40 UTC
[Ocfs2-devel] [PATCH 3/8] ocfs2: Handle older prototype of iops->permission()
Mainline commit e6305c43eda10ebfd2ad9e35d6e172ccc7bb3695 changed the prototype of iops->permission() by dropping the last argument. - int (*permission) (struct inode *, int, struct nameidata *); + int (*permission) (struct inode *, int); Patch allows building with kernels having the older prototype. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Config.make.in | 1 + configure.in | 13 +++++++++++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/file.c | 4 ++++ fs/ocfs2/file.h | 4 ++++ 5 files changed, 26 insertions(+), 0 deletions(-) diff --git a/Config.make.in b/Config.make.in index d129c64..a19d096 100644 --- a/Config.make.in +++ b/Config.make.in @@ -71,6 +71,7 @@ MATCHTABLE_IS_NOT_CONST = @MATCHTABLE_IS_NOT_CONST@ VMOP_IS_NOT_CONST = @VMOP_IS_NOT_CONST@ SEQOP_IS_NOT_CONST = @SEQOP_IS_NOT_CONST@ NO_VECTORIZED_AIO = @NO_VECTORIZED_AIO@ +OLD_PERMISSION = @OLD_PERMISSION@ OCFS_DEBUG = @OCFS_DEBUG@ diff --git a/configure.in b/configure.in index 0b98e28..a1c4255 100644 --- a/configure.in +++ b/configure.in @@ -282,6 +282,19 @@ OCFS2_CHECK_KERNEL([aio_read() in struct file_operations using iovec in fs.h], f AC_SUBST(NO_VECTORIZED_AIO) KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $NO_VECTORIZED_AIO" +OLD_PERSMISSION+OCFS2_CHECK_KERNEL([ older prototype of iops->permission() in fs.h], fs.h, +OLD_PERSMISSION=yes, , [int (\*permission) (struct inode \*, int, struct nameidata \*);]) +AC_SUBST(OLD_PERSMISSION) +if test "x$OLD_PERSMISSION" = "x" ; then + new_permission+ OCFS2_CHECK_KERNEL([ newer prototype of iops->permission() in fs.h], fs.h, + new_permission=yes, , [int (\*permission) (struct inode \*, int);]) + if test "x$new_permission" = "x" ; then + AC_MSG_ERROR(Cannot build with kernel as the prototype of iops->permission is not recognized) + fi +fi + # End kapi_compat checks diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index df389bc..32d864d 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -88,6 +88,10 @@ ifdef NO_VECTORIZED_AIO CFLAGS_file.o += -DNO_VECTORIZED_AIO endif +ifdef OLD_PERMISSION +EXTRA_CFLAGS += -DOLD_PERMISSION +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes. diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index f5e8681..4c12c2d 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1138,7 +1138,11 @@ bail: return err; } +#ifdef OLD_PERMISSION +int ocfs2_permission(struct inode *inode, int mask, struct nameidata *nd) +#else int ocfs2_permission(struct inode *inode, int mask) +#endif { int ret; diff --git a/fs/ocfs2/file.h b/fs/ocfs2/file.h index da85393..845ea30 100644 --- a/fs/ocfs2/file.h +++ b/fs/ocfs2/file.h @@ -64,7 +64,11 @@ int ocfs2_extend_no_holes(struct inode *inode, u64 new_i_size, int ocfs2_setattr(struct dentry *dentry, struct iattr *attr); int ocfs2_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat); +#ifdef OLD_PERMISSION +int ocfs2_permission(struct inode *inode, int mask, struct nameidata *nd); +#else int ocfs2_permission(struct inode *inode, int mask); +#endif int ocfs2_should_update_atime(struct inode *inode, struct vfsmount *vfsmnt); -- 1.5.6.5
Sunil Mushran
2009-Nov-12 03:40 UTC
[Ocfs2-devel] [PATCH 4/8] ocfs2: Handle missing helper mandatory_lock()
Mainline commit a16877ca9cec211708a161057a7cbfbf2cbc3a53 added helper mandatory_lock(). Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Makefile | 3 ++- configure.in | 4 ++++ kapi-compat/include/mandatory_lock.h | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletions(-) create mode 100644 kapi-compat/include/mandatory_lock.h diff --git a/Makefile b/Makefile index 140b9cd..b9d5c5f 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,8 @@ KAPI_COMPAT_FILES = \ kapi-compat/include/ushortmax.h \ kapi-compat/include/fversion.h \ kapi-compat/include/relatime.h \ - kapi-compat/include/aiovec.h + kapi-compat/include/aiovec.h \ + kapi-compat/include/mandatory_lock.h PATCH_FILES diff --git a/configure.in b/configure.in index a1c4255..d0d1d18 100644 --- a/configure.in +++ b/configure.in @@ -295,6 +295,10 @@ if test "x$OLD_PERSMISSION" = "x" ; then fi fi +mandatory_lock_header+OCFS2_CHECK_KERNEL([mandatory_lock() in fs.h], fs.h, + , mandatory_lock_header=mandatory_lock.h, [^static inline int mandatory_lock(]) +KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $mandatory_lock_header" # End kapi_compat checks diff --git a/kapi-compat/include/mandatory_lock.h b/kapi-compat/include/mandatory_lock.h new file mode 100644 index 0000000..9c9f937 --- /dev/null +++ b/kapi-compat/include/mandatory_lock.h @@ -0,0 +1,25 @@ +#ifndef KAPI_MANDATORY_LOCK_H +#define KAPI_MANDATORY_LOCK_H + +#include <linux/fs.h> +/* + * Candidates for mandatory locking have the setgid bit set + * but no group execute bit - an otherwise meaningless combination. + */ + +static inline int __mandatory_lock(struct inode *ino) +{ + return (ino->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID; +} + +/* + * ... and these candidates should be on MS_MANDLOCK mounted fs, + * otherwise these will be advisory locks + */ + +static inline int mandatory_lock(struct inode *ino) +{ + return IS_MANDLOCK(ino) && __mandatory_lock(ino); +} + +#endif /* KAPI_MANDATORY_LOCK_H */ -- 1.5.6.5
Sunil Mushran
2009-Nov-12 03:40 UTC
[Ocfs2-devel] [PATCH 5/8] ocfs2: Handle missing helper current_fsuid()
Mainline commit 86a264abe542cfececb4df129bc45a0338d8cdb9 added helper current_fsuid(). An earlier commit grouped security credentials in struct task in struct cred. The patch ensures that if the above helper is not found, that struct cred is missing. If not, build fails. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Makefile | 3 ++- configure.in | 13 +++++++++++++ kapi-compat/include/fsuid.h | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletions(-) create mode 100644 kapi-compat/include/fsuid.h diff --git a/Makefile b/Makefile index b9d5c5f..46c7218 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,8 @@ KAPI_COMPAT_FILES = \ kapi-compat/include/fversion.h \ kapi-compat/include/relatime.h \ kapi-compat/include/aiovec.h \ - kapi-compat/include/mandatory_lock.h + kapi-compat/include/mandatory_lock.h \ + kapi-compat/include/fsuid.h PATCH_FILES diff --git a/configure.in b/configure.in index d0d1d18..3548225 100644 --- a/configure.in +++ b/configure.in @@ -300,6 +300,19 @@ OCFS2_CHECK_KERNEL([mandatory_lock() in fs.h], fs.h, , mandatory_lock_header=mandatory_lock.h, [^static inline int mandatory_lock(]) KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $mandatory_lock_header" +no_current_fsuid+OCFS2_CHECK_KERNEL([current_fsuid() in cred.h], cred.h, + , no_current_fsuid=fsuid.h, [#define current_fsuid()]) +if test "x$no_current_fsuid" = "xfsuid.h" ; then + fsuid_in_task+ OCFS2_CHECK_KERNEL([ fsuid in struct task in sched.h], sched.h, + fsuid_in_task=yes, , [uid_t uid,euid,suid,fsuid;]) + if test "x$fsuid_in_task" = "x" ; then + AC_MSG_ERROR(Cannot build with kernel that is missing fsuid and struct cred in struct task) + fi +fi +KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $no_current_fsuid" + # End kapi_compat checks # using -include has two advantages: diff --git a/kapi-compat/include/fsuid.h b/kapi-compat/include/fsuid.h new file mode 100644 index 0000000..08d0915 --- /dev/null +++ b/kapi-compat/include/fsuid.h @@ -0,0 +1,7 @@ +#ifndef KAPI_FSUID_H +#define KAPI_FSUID_H + +#define current_fsuid() (current->fsuid) +#define current_fsgid() (current->fsgid) + +#endif -- 1.5.6.5
Sunil Mushran
2009-Nov-12 03:40 UTC
[Ocfs2-devel] [PATCH 6/8] ocfs2: Handle missing enum umh_wait
Mainline commit 86313c488a6848b7ec2ba04e74f25f79dd32a0b7 added enum umh_wait in kmod.h. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Makefile | 3 ++- configure.in | 5 +++++ kapi-compat/include/umh_wait.h | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletions(-) create mode 100644 kapi-compat/include/umh_wait.h diff --git a/Makefile b/Makefile index 46c7218..01b0033 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,8 @@ KAPI_COMPAT_FILES = \ kapi-compat/include/relatime.h \ kapi-compat/include/aiovec.h \ kapi-compat/include/mandatory_lock.h \ - kapi-compat/include/fsuid.h + kapi-compat/include/fsuid.h \ + kapi-compat/include/umh_wait.h PATCH_FILES diff --git a/configure.in b/configure.in index 3548225..9cfdbe3 100644 --- a/configure.in +++ b/configure.in @@ -313,6 +313,11 @@ if test "x$no_current_fsuid" = "xfsuid.h" ; then fi KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $no_current_fsuid" +kmod_compat_header+OCFS2_CHECK_KERNEL([enum umh_wait in kmod.h], kmod.h, + , kmod_compat_header=umh_wait.h, [enum umh_wait {]) +KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $kmod_compat_header" + # End kapi_compat checks # using -include has two advantages: diff --git a/kapi-compat/include/umh_wait.h b/kapi-compat/include/umh_wait.h new file mode 100644 index 0000000..42a082b --- /dev/null +++ b/kapi-compat/include/umh_wait.h @@ -0,0 +1,10 @@ +#ifndef KAPI_KMOD_H +#define KAPI_KMOD_H + +enum umh_wait { + UMH_NO_WAIT = -1, /* don't wait at all */ + UMH_WAIT_EXEC = 0, /* wait for the exec, but not the process */ + UMH_WAIT_PROC = 1, /* wait for the process to complete */ +}; + +#endif -- 1.5.6.5
Sunil Mushran
2009-Nov-12 03:40 UTC
[Ocfs2-devel] [PATCH 7/8] ocfs2: Handle older prototype of register_sysctl_table()
Mainline commit 0b4d414714f0d2f922d39424b0c5c82ad900a381 removed the insert_at_head argument from register_sysctl_table(). Patch allows building with older kernels. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Makefile | 3 ++- configure.in | 5 +++++ fs/ocfs2/kapi-default.h | 4 ++++ fs/ocfs2/stackglue.c | 2 +- kapi-compat/include/register_sysctl.h | 6 ++++++ 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 kapi-compat/include/register_sysctl.h diff --git a/Makefile b/Makefile index 01b0033..a8d30d0 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,8 @@ KAPI_COMPAT_FILES = \ kapi-compat/include/aiovec.h \ kapi-compat/include/mandatory_lock.h \ kapi-compat/include/fsuid.h \ - kapi-compat/include/umh_wait.h + kapi-compat/include/umh_wait.h \ + kapi-compat/include/register_sysctl.h PATCH_FILES diff --git a/configure.in b/configure.in index 9cfdbe3..cc0574a 100644 --- a/configure.in +++ b/configure.in @@ -318,6 +318,11 @@ OCFS2_CHECK_KERNEL([enum umh_wait in kmod.h], kmod.h, , kmod_compat_header=umh_wait.h, [enum umh_wait {]) KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $kmod_compat_header" +old_register_sysctl+OCFS2_CHECK_KERNEL([register_sysctl_table() has one arg in sysctl.h], sysctl.h, + , old_register_sysctl=register_sysctl.h, [^struct ctl_table_header \*register_sysctl_table(struct ctl_table \* table);]) +KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $old_register_sysctl" + # End kapi_compat checks # using -include has two advantages: diff --git a/fs/ocfs2/kapi-default.h b/fs/ocfs2/kapi-default.h index d068aaf..7489a19 100644 --- a/fs/ocfs2/kapi-default.h +++ b/fs/ocfs2/kapi-default.h @@ -46,4 +46,8 @@ typedef u64 f_version_t; # define ocfs2_file_aio_write __ocfs2_file_aio_write #endif +#ifndef kapi_register_sysctl_table +# define kapi_register_sysctl_table(a) register_sysctl_table(a) +#endif + #endif diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index 3f2f1c4..b4c85be 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c @@ -678,7 +678,7 @@ static int __init ocfs2_stack_glue_init(void) { strcpy(cluster_stack_name, OCFS2_STACK_PLUGIN_O2CB); - ocfs2_table_header = register_sysctl_table(ocfs2_root_table); + ocfs2_table_header = kapi_register_sysctl_table(ocfs2_root_table); if (!ocfs2_table_header) { printk(KERN_ERR "ocfs2 stack glue: unable to register sysctl\n"); diff --git a/kapi-compat/include/register_sysctl.h b/kapi-compat/include/register_sysctl.h new file mode 100644 index 0000000..15d9068 --- /dev/null +++ b/kapi-compat/include/register_sysctl.h @@ -0,0 +1,6 @@ +#ifndef KAPI_REGISTER_SYSCTL_H +#define KAPI_REGISTER_SYSCTL_H + +#define kapi_register_sysctl_table(a) register_sysctl_table(a, 0) + +#endif -- 1.5.6.5
Sunil Mushran
2009-Nov-12 03:40 UTC
[Ocfs2-devel] [PATCH 8/8] ocfs2: Handle missing enum value FS_OCFS2
Mainline commit 0e03036c97b70b2602f7dedaa3a223ed7563c2c9 added enum FS_OCFS2. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Makefile | 3 ++- configure.in | 5 +++++ kapi-compat/include/sysctl.h | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletions(-) create mode 100644 kapi-compat/include/sysctl.h diff --git a/Makefile b/Makefile index a8d30d0..adaf9fb 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,8 @@ KAPI_COMPAT_FILES = \ kapi-compat/include/mandatory_lock.h \ kapi-compat/include/fsuid.h \ kapi-compat/include/umh_wait.h \ - kapi-compat/include/register_sysctl.h + kapi-compat/include/register_sysctl.h \ + kapi-compat/include/sysctl.h PATCH_FILES diff --git a/configure.in b/configure.in index cc0574a..b662f88 100644 --- a/configure.in +++ b/configure.in @@ -323,6 +323,11 @@ OCFS2_CHECK_KERNEL([register_sysctl_table() has one arg in sysctl.h], sysctl.h, , old_register_sysctl=register_sysctl.h, [^struct ctl_table_header \*register_sysctl_table(struct ctl_table \* table);]) KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $old_register_sysctl" +sysctl_compat_header+OCFS2_CHECK_KERNEL([enum FS_OCFS2 in sysctl.h], sysctl.h, + , sysctl_compat_header=sysctl.h, [FS_OCFS2=]) +KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $sysctl_compat_header" + # End kapi_compat checks # using -include has two advantages: diff --git a/kapi-compat/include/sysctl.h b/kapi-compat/include/sysctl.h new file mode 100644 index 0000000..73ed0a7 --- /dev/null +++ b/kapi-compat/include/sysctl.h @@ -0,0 +1,9 @@ +#ifndef KAPI_SYSCTL_H +#define KAPI_SYSCTL_H + +/* CTL_FS names: */ +enum { + FS_OCFS2=988, /* ocfs2 */ +}; + +#endif -- 1.5.6.5
On Wed, Nov 11, 2009 at 07:39:57PM -0800, Sunil Mushran wrote:> The next set. The previous 3 sets have been pushed to the git repo.Ack. Joel -- f/8 and be there. Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127