The third set of patches that deal with missing const modifier in various places in the el5 kernel.
Sunil Mushran
2009-Nov-11 01:38 UTC
[Ocfs2-devel] [PATCH 1/8] ocfs2: Handle non-const seq_operations
Mainline commit 15ad7cdcfd76450d4beebc789ec646664238184d const-ified seq_file->op. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/dlmglue.c | 4 ++++ 4 files changed, 14 insertions(+), 0 deletions(-) diff --git a/Config.make.in b/Config.make.in index ba72950..18edfa8 100644 --- a/Config.make.in +++ b/Config.make.in @@ -62,6 +62,7 @@ NO_DLMCONSTANTS_HEADER = @NO_DLMCONSTANTS_HEADER@ NO_F_PATH_IN_STRUCT_FILE = @NO_F_PATH_IN_STRUCT_FILE@ ADDRESS_SPACE_OPS_EXT = @ADDRESS_SPACE_OPS_EXT@ FVERSION_IS_ULONG = @FVERSION_IS_ULONG@ +SEQ_OPS_IS_NOT_CONST = @SEQ_OPS_IS_NOT_CONST@ OCFS_DEBUG = @OCFS_DEBUG@ diff --git a/configure.in b/configure.in index 7ee2d34..b1aaf4e 100644 --- a/configure.in +++ b/configure.in @@ -231,6 +231,11 @@ if test "x$FVERSION_IS_ULONG" = "x" ; then fi KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS fversion.h" +SEQ_OPS_IS_NOT_CONST+OCFS2_CHECK_KERNEL([const struct seq_operations in seq_file.h], seq_file.h, + , SEQ_OPS_IS_NOT_CONST=yes, [const struct seq_operations \*op;]) +AC_SUBST(SEQ_OPS_IS_NOT_CONST) + # End kapi_compat checks diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index e6b5801..37d3009 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -56,6 +56,10 @@ ifdef FVERSION_IS_ULONG EXTRA_CFLAGS += -DFVERSION_IS_ULONG endif +ifdef SEQ_OPS_IS_NOT_CONST +EXTRA_CFLAGS += -DSEQ_OPS_IS_NOT_CONST +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes. diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 0d38d67..0b73382 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -2834,7 +2834,11 @@ static int ocfs2_dlm_seq_show(struct seq_file *m, void *v) return 0; } +#ifndef SEQ_OPS_IS_NOT_CONST static const struct seq_operations ocfs2_dlm_seq_ops = { +#else +static struct seq_operations ocfs2_dlm_seq_ops = { +#endif .start = ocfs2_dlm_seq_start, .stop = ocfs2_dlm_seq_stop, .next = ocfs2_dlm_seq_next, -- 1.5.6.5
Sunil Mushran
2009-Nov-11 01:38 UTC
[Ocfs2-devel] [PATCH 2/8] ocfs2: Handle non-const inode->i_op
Mainline commit c5ef1c42c51b1b5b4a401a6517bdda30933ddbaf const-ified inode->i_op. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/dlm/Makefile | 4 ++++ fs/ocfs2/dlm/dlmfs.c | 18 ++++++++++++++++++ fs/ocfs2/file.c | 8 ++++++++ fs/ocfs2/file.h | 5 +++++ fs/ocfs2/namei.c | 4 ++++ fs/ocfs2/namei.h | 4 ++++ fs/ocfs2/symlink.c | 9 +++++++++ fs/ocfs2/symlink.h | 5 +++++ 11 files changed, 67 insertions(+), 0 deletions(-) diff --git a/Config.make.in b/Config.make.in index 18edfa8..2c18b6f 100644 --- a/Config.make.in +++ b/Config.make.in @@ -63,6 +63,7 @@ NO_F_PATH_IN_STRUCT_FILE = @NO_F_PATH_IN_STRUCT_FILE@ ADDRESS_SPACE_OPS_EXT = @ADDRESS_SPACE_OPS_EXT@ FVERSION_IS_ULONG = @FVERSION_IS_ULONG@ SEQ_OPS_IS_NOT_CONST = @SEQ_OPS_IS_NOT_CONST@ +IOP_IS_NOT_CONST = @IOP_IS_NOT_CONST@ OCFS_DEBUG = @OCFS_DEBUG@ diff --git a/configure.in b/configure.in index b1aaf4e..16d02c3 100644 --- a/configure.in +++ b/configure.in @@ -236,6 +236,11 @@ OCFS2_CHECK_KERNEL([const struct seq_operations in seq_file.h], seq_file.h, , SEQ_OPS_IS_NOT_CONST=yes, [const struct seq_operations \*op;]) AC_SUBST(SEQ_OPS_IS_NOT_CONST) +IOP_IS_NOT_CONST+OCFS2_CHECK_KERNEL([inode->i_op has the const modifier in fs.h], fs.h, + , IOP_IS_NOT_CONST=yes, [^.*const struct inode_operations.*\*i_op;]) +AC_SUBST(IOP_IS_NOT_CONST) + # End kapi_compat checks diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index 37d3009..e66665a 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -60,6 +60,10 @@ ifdef SEQ_OPS_IS_NOT_CONST EXTRA_CFLAGS += -DSEQ_OPS_IS_NOT_CONST endif +ifdef IOP_IS_NOT_CONST +EXTRA_CFLAGS += -DIOP_IS_NOT_CONST +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes. diff --git a/fs/ocfs2/dlm/Makefile b/fs/ocfs2/dlm/Makefile index a42d35d..250994f 100644 --- a/fs/ocfs2/dlm/Makefile +++ b/fs/ocfs2/dlm/Makefile @@ -30,6 +30,10 @@ ifdef NO_F_PATH_IN_STRUCT_FILE EXTRA_CFLAGS += -DNO_F_PATH_IN_STRUCT_FILE endif +ifdef IOP_IS_NOT_CONST +EXTRA_CFLAGS += -DIOP_IS_NOT_CONST +endif + DLM_SOURCES += \ dlmast.c \ dlmconvert.c \ diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c index 8e293fa..b1b9996 100644 --- a/fs/ocfs2/dlm/dlmfs.c +++ b/fs/ocfs2/dlm/dlmfs.c @@ -64,9 +64,15 @@ static const struct super_operations dlmfs_ops; static const struct file_operations dlmfs_file_operations; +#ifdef IOP_IS_NOT_CONST +static struct inode_operations dlmfs_dir_inode_operations; +static struct inode_operations dlmfs_root_inode_operations; +static struct inode_operations dlmfs_file_inode_operations; +#else static const struct inode_operations dlmfs_dir_inode_operations; static const struct inode_operations dlmfs_root_inode_operations; static const struct inode_operations dlmfs_file_inode_operations; +#endif static struct kmem_cache *dlmfs_inode_cache; struct workqueue_struct *user_dlm_worker; @@ -553,14 +559,22 @@ static const struct file_operations dlmfs_file_operations = { .write = dlmfs_file_write, }; +#ifdef IOP_IS_NOT_CONST +static struct inode_operations dlmfs_dir_inode_operations = { +#else static const struct inode_operations dlmfs_dir_inode_operations = { +#endif .create = dlmfs_create, .lookup = simple_lookup, .unlink = dlmfs_unlink, }; /* this way we can restrict mkdir to only the toplevel of the fs. */ +#ifdef IOP_IS_NOT_CONST +static struct inode_operations dlmfs_root_inode_operations = { +#else static const struct inode_operations dlmfs_root_inode_operations = { +#endif .lookup = simple_lookup, .mkdir = dlmfs_mkdir, .rmdir = simple_rmdir, @@ -574,7 +588,11 @@ static const struct super_operations dlmfs_ops = { .drop_inode = generic_delete_inode, }; +#ifdef IOP_IS_NOT_CONST +static struct inode_operations dlmfs_file_inode_operations = { +#else static const struct inode_operations dlmfs_file_inode_operations = { +#endif .getattr = simple_getattr, }; diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 68bf44f..7bac90d 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -2245,7 +2245,11 @@ bail: return ret; } +#ifdef IOP_IS_NOT_CONST +struct inode_operations ocfs2_file_iops = { +#else const struct inode_operations ocfs2_file_iops = { +#endif .setattr = ocfs2_setattr, .getattr = ocfs2_getattr, .permission = ocfs2_permission, @@ -2257,7 +2261,11 @@ const struct inode_operations ocfs2_file_iops = { .fiemap = ocfs2_fiemap, }; +#ifdef IOP_IS_NOT_CONST +struct inode_operations ocfs2_special_file_iops = { +#else const struct inode_operations ocfs2_special_file_iops = { +#endif .setattr = ocfs2_setattr, .getattr = ocfs2_getattr, .permission = ocfs2_permission, diff --git a/fs/ocfs2/file.h b/fs/ocfs2/file.h index d66cf4f..da85393 100644 --- a/fs/ocfs2/file.h +++ b/fs/ocfs2/file.h @@ -30,8 +30,13 @@ extern const struct file_operations ocfs2_fops; extern const struct file_operations ocfs2_dops; extern const struct file_operations ocfs2_fops_no_plocks; extern const struct file_operations ocfs2_dops_no_plocks; +#ifdef IOP_IS_NOT_CONST +extern struct inode_operations ocfs2_file_iops; +extern struct inode_operations ocfs2_special_file_iops; +#else extern const struct inode_operations ocfs2_file_iops; extern const struct inode_operations ocfs2_special_file_iops; +#endif struct ocfs2_alloc_context; enum ocfs2_alloc_restarted; diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index f010b22..f2df1eb 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -2309,7 +2309,11 @@ leave: return status; } +#ifdef IOP_IS_NOT_CONST +struct inode_operations ocfs2_dir_iops = { +#else const struct inode_operations ocfs2_dir_iops = { +#endif .create = ocfs2_create, .lookup = ocfs2_lookup, .link = ocfs2_link, diff --git a/fs/ocfs2/namei.h b/fs/ocfs2/namei.h index e5d059d..bc3792e 100644 --- a/fs/ocfs2/namei.h +++ b/fs/ocfs2/namei.h @@ -26,7 +26,11 @@ #ifndef OCFS2_NAMEI_H #define OCFS2_NAMEI_H +#ifdef IOP_IS_NOT_CONST +extern struct inode_operations ocfs2_dir_iops; +#else extern const struct inode_operations ocfs2_dir_iops; +#endif struct dentry *ocfs2_get_parent(struct dentry *child); diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c index e342103..426584f 100644 --- a/fs/ocfs2/symlink.c +++ b/fs/ocfs2/symlink.c @@ -153,7 +153,11 @@ static void ocfs2_fast_put_link(struct dentry *dentry, struct nameidata *nd, voi kfree(link); } +#ifdef IOP_IS_NOT_CONST +struct inode_operations ocfs2_symlink_inode_operations = { +#else const struct inode_operations ocfs2_symlink_inode_operations = { +#endif .readlink = page_readlink, .follow_link = page_follow_link_light, .put_link = page_put_link, @@ -164,7 +168,12 @@ const struct inode_operations ocfs2_symlink_inode_operations = { .listxattr = ocfs2_listxattr, .removexattr = generic_removexattr, }; + +#ifdef IOP_IS_NOT_CONST +struct inode_operations ocfs2_fast_symlink_inode_operations = { +#else const struct inode_operations ocfs2_fast_symlink_inode_operations = { +#endif .readlink = ocfs2_readlink, .follow_link = ocfs2_fast_follow_link, .put_link = ocfs2_fast_put_link, diff --git a/fs/ocfs2/symlink.h b/fs/ocfs2/symlink.h index 65a6c9c..f53d1e0 100644 --- a/fs/ocfs2/symlink.h +++ b/fs/ocfs2/symlink.h @@ -26,8 +26,13 @@ #ifndef OCFS2_SYMLINK_H #define OCFS2_SYMLINK_H +#ifdef IOP_IS_NOT_CONST +extern struct inode_operations ocfs2_symlink_inode_operations; +extern struct inode_operations ocfs2_fast_symlink_inode_operations; +#else extern const struct inode_operations ocfs2_symlink_inode_operations; extern const struct inode_operations ocfs2_fast_symlink_inode_operations; +#endif /* * Test whether an inode is a fast symlink. -- 1.5.6.5
Sunil Mushran
2009-Nov-11 01:38 UTC
[Ocfs2-devel] [PATCH 3/8] ocfs2: Handle non-const dentry->d_op
Mainline commit e56980d451904b623573ef4966cbab768e433c79 const-ified dentry->d_op. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Config.make.in | 1 + configure.in | 6 ++++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/dcache.c | 4 ++++ fs/ocfs2/dcache.h | 4 ++++ 5 files changed, 19 insertions(+), 0 deletions(-) diff --git a/Config.make.in b/Config.make.in index 2c18b6f..7cda5cb 100644 --- a/Config.make.in +++ b/Config.make.in @@ -64,6 +64,7 @@ ADDRESS_SPACE_OPS_EXT = @ADDRESS_SPACE_OPS_EXT@ FVERSION_IS_ULONG = @FVERSION_IS_ULONG@ SEQ_OPS_IS_NOT_CONST = @SEQ_OPS_IS_NOT_CONST@ IOP_IS_NOT_CONST = @IOP_IS_NOT_CONST@ +DOP_IS_NOT_CONST = @DOP_IS_NOT_CONST@ OCFS_DEBUG = @OCFS_DEBUG@ diff --git a/configure.in b/configure.in index 16d02c3..f79da91 100644 --- a/configure.in +++ b/configure.in @@ -242,6 +242,12 @@ OCFS2_CHECK_KERNEL([inode->i_op has the const modifier in fs.h], fs.h, AC_SUBST(IOP_IS_NOT_CONST) +DOP_IS_NOT_CONST+OCFS2_CHECK_KERNEL([dentry->d_op has the const modifier in dcache.h], dcache.h, + , DOP_IS_NOT_CONST=yes, [^.*const struct dentry_operations \*d_op;]) +AC_SUBST(DOP_IS_NOT_CONST) + + # End kapi_compat checks # using -include has two advantages: diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index e66665a..4e1a0e6 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -64,6 +64,10 @@ ifdef IOP_IS_NOT_CONST EXTRA_CFLAGS += -DIOP_IS_NOT_CONST endif +ifdef DOP_IS_NOT_CONST +EXTRA_CFLAGS += -DDOP_IS_NOT_CONST +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes. diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index 8ad82bc..55a3fdb 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c @@ -500,7 +500,11 @@ out_move: d_move(dentry, target); } +#ifdef DOP_IS_NOT_CONST +struct dentry_operations ocfs2_dentry_ops = { +#else const struct dentry_operations ocfs2_dentry_ops = { +#endif .d_revalidate = ocfs2_dentry_revalidate, .d_iput = ocfs2_dentry_iput, }; diff --git a/fs/ocfs2/dcache.h b/fs/ocfs2/dcache.h index d13a087..2703a1a 100644 --- a/fs/ocfs2/dcache.h +++ b/fs/ocfs2/dcache.h @@ -26,7 +26,11 @@ #ifndef OCFS2_DCACHE_H #define OCFS2_DCACHE_H +#ifdef DOP_IS_NOT_CONST +extern struct dentry_operations ocfs2_dentry_ops; +#else extern const struct dentry_operations ocfs2_dentry_ops; +#endif struct ocfs2_dentry_lock { /* Use count of dentry lock */ -- 1.5.6.5
Sunil Mushran
2009-Nov-11 01:38 UTC
[Ocfs2-devel] [PATCH 4/8] ocfs2: Handle non-const sb->s_op
Mainline commit ee9b6d61a2a43c5952eb43283f8db284a4e70b8a const-ified sb->s_op. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/dlm/Makefile | 4 ++++ fs/ocfs2/dlm/dlmfs.c | 8 ++++++++ fs/ocfs2/super.c | 4 ++++ 6 files changed, 26 insertions(+), 0 deletions(-) diff --git a/Config.make.in b/Config.make.in index 7cda5cb..9da1d2b 100644 --- a/Config.make.in +++ b/Config.make.in @@ -65,6 +65,7 @@ FVERSION_IS_ULONG = @FVERSION_IS_ULONG@ SEQ_OPS_IS_NOT_CONST = @SEQ_OPS_IS_NOT_CONST@ IOP_IS_NOT_CONST = @IOP_IS_NOT_CONST@ DOP_IS_NOT_CONST = @DOP_IS_NOT_CONST@ +SOP_IS_NOT_CONST = @SOP_IS_NOT_CONST@ OCFS_DEBUG = @OCFS_DEBUG@ diff --git a/configure.in b/configure.in index f79da91..76ea242 100644 --- a/configure.in +++ b/configure.in @@ -247,6 +247,11 @@ OCFS2_CHECK_KERNEL([dentry->d_op has the const modifier in dcache.h], dcache.h, , DOP_IS_NOT_CONST=yes, [^.*const struct dentry_operations \*d_op;]) AC_SUBST(DOP_IS_NOT_CONST) +SOP_IS_NOT_CONST+OCFS2_CHECK_KERNEL([sb->s_op has the const modifier in fs.h], fs.h, + , SOP_IS_NOT_CONST=yes, [^.*const struct super_operations.*\*s_op;]) +AC_SUBST(SOP_IS_NOT_CONST) + # End kapi_compat checks diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index 4e1a0e6..ddeb107 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -68,6 +68,10 @@ ifdef DOP_IS_NOT_CONST EXTRA_CFLAGS += -DDOP_IS_NOT_CONST endif +ifdef SOP_IS_NOT_CONST +EXTRA_CFLAGS += -DSOP_IS_NOT_CONST +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes. diff --git a/fs/ocfs2/dlm/Makefile b/fs/ocfs2/dlm/Makefile index 250994f..b70058d 100644 --- a/fs/ocfs2/dlm/Makefile +++ b/fs/ocfs2/dlm/Makefile @@ -34,6 +34,10 @@ ifdef IOP_IS_NOT_CONST EXTRA_CFLAGS += -DIOP_IS_NOT_CONST endif +ifdef SOP_IS_NOT_CONST +EXTRA_CFLAGS += -DSOP_IS_NOT_CONST +endif + DLM_SOURCES += \ dlmast.c \ dlmconvert.c \ diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c index b1b9996..d05653d 100644 --- a/fs/ocfs2/dlm/dlmfs.c +++ b/fs/ocfs2/dlm/dlmfs.c @@ -62,7 +62,11 @@ #include "ocfs2_lockingver.h" +#ifdef SOP_IS_NOT_CONST +static struct super_operations dlmfs_ops; +#else static const struct super_operations dlmfs_ops; +#endif static const struct file_operations dlmfs_file_operations; #ifdef IOP_IS_NOT_CONST static struct inode_operations dlmfs_dir_inode_operations; @@ -580,7 +584,11 @@ static const struct inode_operations dlmfs_root_inode_operations = { .rmdir = simple_rmdir, }; +#ifdef SOP_IS_NOT_CONST +static struct super_operations dlmfs_ops = { +#else static const struct super_operations dlmfs_ops = { +#endif .statfs = simple_statfs, .alloc_inode = dlmfs_alloc_inode, .destroy_inode = dlmfs_destroy_inode, diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 8c8b206..5e4fbad 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -135,7 +135,11 @@ static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend); static int ocfs2_enable_quotas(struct ocfs2_super *osb); static void ocfs2_disable_quotas(struct ocfs2_super *osb); +#ifdef SOP_IS_NOT_CONST +static struct super_operations ocfs2_sops = { +#else static const struct super_operations ocfs2_sops = { +#endif .statfs = ocfs2_statfs, .alloc_inode = ocfs2_alloc_inode, .destroy_inode = ocfs2_destroy_inode, -- 1.5.6.5
Sunil Mushran
2009-Nov-11 01:38 UTC
[Ocfs2-devel] [PATCH 5/8] ocfs2: Handle non-const sb->s_export_op
Mainline commit 39655164405940d4818224a085e35420e2f97aed const-ified sb->s_export_op. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/export.c | 4 ++++ fs/ocfs2/export.h | 4 ++++ 5 files changed, 18 insertions(+), 0 deletions(-) diff --git a/Config.make.in b/Config.make.in index 9da1d2b..9d2feb2 100644 --- a/Config.make.in +++ b/Config.make.in @@ -66,6 +66,7 @@ SEQ_OPS_IS_NOT_CONST = @SEQ_OPS_IS_NOT_CONST@ IOP_IS_NOT_CONST = @IOP_IS_NOT_CONST@ DOP_IS_NOT_CONST = @DOP_IS_NOT_CONST@ SOP_IS_NOT_CONST = @SOP_IS_NOT_CONST@ +EXPORTOP_IS_NOT_CONST = @EXPORTOP_IS_NOT_CONST@ OCFS_DEBUG = @OCFS_DEBUG@ diff --git a/configure.in b/configure.in index 76ea242..2ab0696 100644 --- a/configure.in +++ b/configure.in @@ -252,6 +252,11 @@ OCFS2_CHECK_KERNEL([sb->s_op has the const modifier in fs.h], fs.h, , SOP_IS_NOT_CONST=yes, [^.*const struct super_operations.*\*s_op;]) AC_SUBST(SOP_IS_NOT_CONST) +EXPORTOP_IS_NOT_CONST+OCFS2_CHECK_KERNEL([sb->s_export_op has the const modifier in fs.h], fs.h, + , EXPORTOP_IS_NOT_CONST=yes, [^.*const struct export_operations \*s_export_op;]) +AC_SUBST(EXPORTOP_IS_NOT_CONST) + # End kapi_compat checks diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index ddeb107..f39b1ee 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -72,6 +72,10 @@ ifdef SOP_IS_NOT_CONST EXTRA_CFLAGS += -DSOP_IS_NOT_CONST endif +ifdef EXPORTOP_IS_NOT_CONST +EXTRA_CFLAGS += -DEXPORTOP_IS_NOT_CONST +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes. diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c index 15713cb..fce7d23 100644 --- a/fs/ocfs2/export.c +++ b/fs/ocfs2/export.c @@ -275,7 +275,11 @@ static struct dentry *ocfs2_fh_to_parent(struct super_block *sb, return ocfs2_get_dentry(sb, &parent); } +#ifdef EXPORTOP_IS_NOT_CONST +struct export_operations ocfs2_export_ops = { +#else const struct export_operations ocfs2_export_ops = { +#endif .encode_fh = ocfs2_encode_fh, .fh_to_dentry = ocfs2_fh_to_dentry, .fh_to_parent = ocfs2_fh_to_parent, diff --git a/fs/ocfs2/export.h b/fs/ocfs2/export.h index 41a7386..0707bf3 100644 --- a/fs/ocfs2/export.h +++ b/fs/ocfs2/export.h @@ -28,6 +28,10 @@ #include <linux/exportfs.h> +#ifdef EXPORTOP_IS_NOT_CONST +extern struct export_operations ocfs2_export_ops; +#else extern const struct export_operations ocfs2_export_ops; +#endif #endif /* OCFS2_EXPORT_H */ -- 1.5.6.5
Sunil Mushran
2009-Nov-11 01:38 UTC
[Ocfs2-devel] [PATCH 6/8] ocfs2: Handle missing const modifier in match_token() args
Mainline commit a447c0932445f92ce6f4c1bd020f62c5097a7842 const-ified match_table_t argument in match_token(). Signed-off-by: Sunil Mushran <sunil.mushran at 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 9d2feb2..8e1f49a 100644 --- a/Config.make.in +++ b/Config.make.in @@ -67,6 +67,7 @@ IOP_IS_NOT_CONST = @IOP_IS_NOT_CONST@ DOP_IS_NOT_CONST = @DOP_IS_NOT_CONST@ SOP_IS_NOT_CONST = @SOP_IS_NOT_CONST@ EXPORTOP_IS_NOT_CONST = @EXPORTOP_IS_NOT_CONST@ +MATCHTABLE_IS_NOT_CONST = @MATCHTABLE_IS_NOT_CONST@ OCFS_DEBUG = @OCFS_DEBUG@ diff --git a/configure.in b/configure.in index 2ab0696..b0dabdd 100644 --- a/configure.in +++ b/configure.in @@ -257,6 +257,11 @@ OCFS2_CHECK_KERNEL([sb->s_export_op has the const modifier in fs.h], fs.h, , EXPORTOP_IS_NOT_CONST=yes, [^.*const struct export_operations \*s_export_op;]) AC_SUBST(EXPORTOP_IS_NOT_CONST) +MATCHTABLE_IS_NOT_CONST+OCFS2_CHECK_KERNEL([match_token() takes const arg in parser.h], parser.h, + , MATCHTABLE_IS_NOT_CONST=yes, [^int match_token(char \*, const match_table_t table, ]) +AC_SUBST(MATCHTABLE_IS_NOT_CONST) + # End kapi_compat checks diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index f39b1ee..bd5afb5 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -76,6 +76,10 @@ ifdef EXPORTOP_IS_NOT_CONST EXTRA_CFLAGS += -DEXPORTOP_IS_NOT_CONST endif +ifdef MATCHTABLE_IS_NOT_CONST +EXTRA_CFLAGS += -DMATCHTABLE_IS_NOT_CONST +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 5e4fbad..bee2c31 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -180,7 +180,11 @@ enum { Opt_err, }; +#ifdef MATCHTABLE_IS_NOT_CONST +static match_table_t tokens = { +#else static const match_table_t tokens = { +#endif {Opt_barrier, "barrier=%u"}, {Opt_err_panic, "errors=panic"}, {Opt_err_ro, "errors=remount-ro"}, -- 1.5.6.5
Sunil Mushran
2009-Nov-11 01:38 UTC
[Ocfs2-devel] [PATCH 7/8] ocfs2: Handle non-const vm_area_struct->vm_ops
Mainline commit f0f37e2f77731b3473fa6bd5ee53255d9a9cdb40 const-ified vm_area_struct->vm_ops. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/mmap.c | 4 ++++ 4 files changed, 14 insertions(+), 0 deletions(-) diff --git a/Config.make.in b/Config.make.in index 8e1f49a..32d99a8 100644 --- a/Config.make.in +++ b/Config.make.in @@ -68,6 +68,7 @@ DOP_IS_NOT_CONST = @DOP_IS_NOT_CONST@ SOP_IS_NOT_CONST = @SOP_IS_NOT_CONST@ EXPORTOP_IS_NOT_CONST = @EXPORTOP_IS_NOT_CONST@ MATCHTABLE_IS_NOT_CONST = @MATCHTABLE_IS_NOT_CONST@ +VMOP_IS_NOT_CONST = @VMOP_IS_NOT_CONST@ OCFS_DEBUG = @OCFS_DEBUG@ diff --git a/configure.in b/configure.in index b0dabdd..e7939c4 100644 --- a/configure.in +++ b/configure.in @@ -262,6 +262,11 @@ OCFS2_CHECK_KERNEL([match_token() takes const arg in parser.h], parser.h, , MATCHTABLE_IS_NOT_CONST=yes, [^int match_token(char \*, const match_table_t table, ]) AC_SUBST(MATCHTABLE_IS_NOT_CONST) +VMOP_IS_NOT_CONST+OCFS2_CHECK_KERNEL([vm_area_struct->vm_ops has the const modifier in mm.h], mm.h, + , VMOP_IS_NOT_CONST=yes, [^.*const struct vm_operations_struct \*vm_ops;]) +AC_SUBST(VMOP_IS_NOT_CONST) + # End kapi_compat checks diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index bd5afb5..b8ce33c 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -80,6 +80,10 @@ ifdef MATCHTABLE_IS_NOT_CONST EXTRA_CFLAGS += -DMATCHTABLE_IS_NOT_CONST endif +ifdef VMOP_IS_NOT_CONST +EXTRA_CFLAGS += -DVMOP_IS_NOT_CONST +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes. diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c index 55afd11..b4a25c8 100644 --- a/fs/ocfs2/mmap.c +++ b/fs/ocfs2/mmap.c @@ -202,7 +202,11 @@ out: return ret; } +#ifdef VMOP_IS_NOT_CONST +static struct vm_operations_struct ocfs2_file_vm_ops = { +#else static const struct vm_operations_struct ocfs2_file_vm_ops = { +#endif .fault = ocfs2_fault, .page_mkwrite = ocfs2_page_mkwrite, }; -- 1.5.6.5
Sunil Mushran
2009-Nov-11 01:38 UTC
[Ocfs2-devel] [PATCH 8/8] ocfs2: Handle missing const modifier in seq_open()
Mainline commit 15ad7cdcfd76450d4beebc789ec646664238184d added the const modifier to struct seq_operations * in seq_open(). Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/cluster/Makefile | 4 ++++ fs/ocfs2/cluster/netdebug.c | 8 ++++++++ fs/ocfs2/dlm/Makefile | 4 ++++ fs/ocfs2/dlm/dlmdebug.c | 4 ++++ 6 files changed, 26 insertions(+), 0 deletions(-) diff --git a/Config.make.in b/Config.make.in index 32d99a8..2e5ff54 100644 --- a/Config.make.in +++ b/Config.make.in @@ -69,6 +69,7 @@ SOP_IS_NOT_CONST = @SOP_IS_NOT_CONST@ 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@ OCFS_DEBUG = @OCFS_DEBUG@ diff --git a/configure.in b/configure.in index e7939c4..cdadf77 100644 --- a/configure.in +++ b/configure.in @@ -267,6 +267,11 @@ OCFS2_CHECK_KERNEL([vm_area_struct->vm_ops has the const modifier in mm.h], mm.h , VMOP_IS_NOT_CONST=yes, [^.*const struct vm_operations_struct \*vm_ops;]) AC_SUBST(VMOP_IS_NOT_CONST) +SEQOP_IS_NOT_CONST+OCFS2_CHECK_KERNEL([seq_open() has const struct seq_operations * in seq_file.h], seq_file.h, + , SEQOP_IS_NOT_CONST=yes, [int seq_open(struct file \*, const struct seq_operations \*);]) +AC_SUBST(SEQOP_IS_NOT_CONST) + # End kapi_compat checks diff --git a/fs/ocfs2/cluster/Makefile b/fs/ocfs2/cluster/Makefile index c1f4f31..d89112d 100644 --- a/fs/ocfs2/cluster/Makefile +++ b/fs/ocfs2/cluster/Makefile @@ -22,6 +22,10 @@ ifdef NO_DELAYED_WORK_STRUCT EXTRA_CFLAGS += -DNO_DELAYED_WORK_STRUCT endif +ifdef SEQOP_IS_NOT_CONST +EXTRA_CFLAGS += -DSEQOP_IS_NOT_CONST +endif + SOURCES += \ heartbeat.c \ masklog.c \ diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c index da794bc..cacd83f 100644 --- a/fs/ocfs2/cluster/netdebug.c +++ b/fs/ocfs2/cluster/netdebug.c @@ -163,7 +163,11 @@ static void nst_seq_stop(struct seq_file *seq, void *v) { } +#ifdef SEQOP_IS_NOT_CONST +static struct seq_operations nst_seq_ops = { +#else static const struct seq_operations nst_seq_ops = { +#endif .start = nst_seq_start, .next = nst_seq_next, .stop = nst_seq_stop, @@ -344,7 +348,11 @@ static void sc_seq_stop(struct seq_file *seq, void *v) { } +#ifdef SEQOP_IS_NOT_CONST +static struct seq_operations sc_seq_ops = { +#else static const struct seq_operations sc_seq_ops = { +#endif .start = sc_seq_start, .next = sc_seq_next, .stop = sc_seq_stop, diff --git a/fs/ocfs2/dlm/Makefile b/fs/ocfs2/dlm/Makefile index b70058d..122b370 100644 --- a/fs/ocfs2/dlm/Makefile +++ b/fs/ocfs2/dlm/Makefile @@ -38,6 +38,10 @@ ifdef SOP_IS_NOT_CONST EXTRA_CFLAGS += -DSOP_IS_NOT_CONST endif +ifdef SEQOP_IS_NOT_CONST +EXTRA_CFLAGS += -DSEQOP_IS_NOT_CONST +endif + DLM_SOURCES += \ dlmast.c \ dlmconvert.c \ diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c index 42b0bad..f18afe9 100644 --- a/fs/ocfs2/dlm/dlmdebug.c +++ b/fs/ocfs2/dlm/dlmdebug.c @@ -682,7 +682,11 @@ static int lockres_seq_show(struct seq_file *s, void *v) return 0; } +#ifdef SEQOP_IS_NOT_CONST +static struct seq_operations debug_lockres_ops = { +#else static const struct seq_operations debug_lockres_ops = { +#endif .start = lockres_seq_start, .stop = lockres_seq_stop, .next = lockres_seq_next, -- 1.5.6.5
On Tue, Nov 10, 2009 at 05:38:22PM -0800, Sunil Mushran wrote:> The third set of patches that deal with missing const modifier in various > places in the el5 kernel.Ack. Joel -- Life's Little Instruction Book #452 "Never compromise your integrity." Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127