From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 26/30] ocfs2: Handle missing const struct inode_operations in struct inode
Date: Mon Dec 24 13:23:56 2007 [thread overview]
Message-ID: <20071224212307.GD7242@mail.oracle.com> (raw)
In-Reply-To: <1198193387-16606-25-git-send-email-sunil.mushran@oracle.com>
On Thu, Dec 20, 2007 at 03:29:43PM -0800, Sunil Mushran wrote:
> Commit c5ef1c42c51b1b5b4a401a6517bdda30933ddbaf in mainline marks struct
> inode_operations in struct inode as a const. This patch allows one to build
> ocfs2 with kernels having/not having this change.
Please reverse the test.
Joel
> Signed-off-by: Sunil Mushran <sunil.mushran@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 | 8 ++++++++
> fs/ocfs2/symlink.h | 5 +++++
> 11 files changed, 66 insertions(+), 0 deletions(-)
>
> diff --git a/Config.make.in b/Config.make.in
> index 938ac53..d4cd518 100644
> --- a/Config.make.in
> +++ b/Config.make.in
> @@ -70,6 +70,7 @@ SPLICE_HEADER = @SPLICE_HEADER@
> GENERIC_SEGMENT_CHECKS = @GENERIC_SEGMENT_CHECKS@
> FAULT_IN_VMOPS = @FAULT_IN_VMOPS@
> SOP_IS_CONST = @SOP_IS_CONST@
> +IOP_IS_CONST = @IOP_IS_CONST@
>
> OCFS_DEBUG = @OCFS_DEBUG@
>
> diff --git a/configure.in b/configure.in
> index 3093542..8a23983 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -277,6 +277,11 @@ OCFS2_CHECK_KERNEL([s_op declared as const in struct super_block in fs.h], fs.h,
> SOP_IS_CONST=yes, , [^.*const struct super_operations.*\*s_op;])
> AC_SUBST(SOP_IS_CONST)
>
> +IOP_IS_CONST=
> +OCFS2_CHECK_KERNEL([i_op declared as const in struct inode in fs.h], fs.h,
> + IOP_IS_CONST=yes, , [^.*const struct inode_operations.*\*i_op;])
> +AC_SUBST(IOP_IS_CONST)
> +
> # using -include has two advantages:
> # the source doesn't need to know to include compat headers
> # the compat header file names don't go through the search path
> diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile
> index 4ce2431..97912fd 100644
> --- a/fs/ocfs2/Makefile
> +++ b/fs/ocfs2/Makefile
> @@ -69,6 +69,10 @@ ifdef SOPS_IS_CONST
> EXTRA_CFLAGS += -DSOPS_IS_CONST
> endif
>
> +ifdef IOP_IS_CONST
> +EXTRA_CFLAGS += -DIOP_IS_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 2df255e..c7edb07 100644
> --- a/fs/ocfs2/dlm/Makefile
> +++ b/fs/ocfs2/dlm/Makefile
> @@ -32,6 +32,10 @@ ifdef SOP_IS_CONST
> EXTRA_CFLAGS += -DSOP_IS_CONST
> endif
>
> +ifdef IOP_IS_CONST
> +EXTRA_CFLAGS += -DIOP_IS_CONST
> +endif
> +
> DLM_SOURCES = \
> dlmast.c \
> dlmconvert.c \
> diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c
> index dc5b5a5..9ff18be 100644
> --- a/fs/ocfs2/dlm/dlmfs.c
> +++ b/fs/ocfs2/dlm/dlmfs.c
> @@ -66,9 +66,15 @@ static const struct super_operations dlmfs_ops;
> static struct super_operations dlmfs_ops;
> #endif
> static const struct file_operations dlmfs_file_operations;
> +#ifdef IOP_IS_CONST
> 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;
> +#else
> +static struct inode_operations dlmfs_dir_inode_operations;
> +static struct inode_operations dlmfs_root_inode_operations;
> +static struct inode_operations dlmfs_file_inode_operations;
> +#endif
> static struct kmem_cache *dlmfs_inode_cache;
>
> struct workqueue_struct *user_dlm_worker;
> @@ -547,14 +553,22 @@ static const struct file_operations dlmfs_file_operations = {
> .write = dlmfs_file_write,
> };
>
> +#ifdef IOP_IS_CONST
> static const struct inode_operations dlmfs_dir_inode_operations = {
> +#else
> +static 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_CONST
> static const struct inode_operations dlmfs_root_inode_operations = {
> +#else
> +static struct inode_operations dlmfs_root_inode_operations = {
> +#endif
> .lookup = simple_lookup,
> .mkdir = dlmfs_mkdir,
> .rmdir = simple_rmdir,
> @@ -572,7 +586,11 @@ static struct super_operations dlmfs_ops = {
> .drop_inode = generic_delete_inode,
> };
>
> +#ifdef IOP_IS_CONST
> static const struct inode_operations dlmfs_file_inode_operations = {
> +#else
> +static struct inode_operations dlmfs_file_inode_operations = {
> +#endif
> .getattr = simple_getattr,
> };
>
> diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
> index dd074af..e74730d 100644
> --- a/fs/ocfs2/file.c
> +++ b/fs/ocfs2/file.c
> @@ -2469,7 +2469,11 @@ bail:
> return ret;
> }
>
> +#ifdef IOP_IS_CONST
> const struct inode_operations ocfs2_file_iops = {
> +#else
> +struct inode_operations ocfs2_file_iops = {
> +#endif
> .setattr = ocfs2_setattr,
> .getattr = ocfs2_getattr,
> .permission = ocfs2_permission,
> @@ -2478,7 +2482,11 @@ const struct inode_operations ocfs2_file_iops = {
> #endif
> };
>
> +#ifdef IOP_IS_CONST
> const struct inode_operations ocfs2_special_file_iops = {
> +#else
> +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 066f14a..7bf6f9d 100644
> --- a/fs/ocfs2/file.h
> +++ b/fs/ocfs2/file.h
> @@ -28,8 +28,13 @@
>
> extern const struct file_operations ocfs2_fops;
> extern const struct file_operations ocfs2_dops;
> +#ifdef IOP_IS_CONST
> extern const struct inode_operations ocfs2_file_iops;
> extern const struct inode_operations ocfs2_special_file_iops;
> +#else
> +extern struct inode_operations ocfs2_file_iops;
> +extern 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 7292590..5ddcc23 100644
> --- a/fs/ocfs2/namei.c
> +++ b/fs/ocfs2/namei.c
> @@ -1898,7 +1898,11 @@ leave:
> return status;
> }
>
> +#ifdef IOP_IS_CONST
> const struct inode_operations ocfs2_dir_iops = {
> +#else
> +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 688aef6..66e1dee 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_CONST
> extern const struct inode_operations ocfs2_dir_iops;
> +#else
> +extern 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 7134007..d77c1d4 100644
> --- a/fs/ocfs2/symlink.c
> +++ b/fs/ocfs2/symlink.c
> @@ -163,12 +163,20 @@ bail:
> return ERR_PTR(status);
> }
>
> +#ifdef IOP_IS_CONST
> const struct inode_operations ocfs2_symlink_inode_operations = {
> +#else
> +struct inode_operations ocfs2_symlink_inode_operations = {
> +#endif
> .readlink = page_readlink,
> .follow_link = ocfs2_follow_link,
> .getattr = ocfs2_getattr,
> };
> +#ifdef IOP_IS_CONST
> const struct inode_operations ocfs2_fast_symlink_inode_operations = {
> +#else
> +struct inode_operations ocfs2_fast_symlink_inode_operations = {
> +#endif
> .readlink = ocfs2_readlink,
> .follow_link = ocfs2_follow_link,
> .getattr = ocfs2_getattr,
> diff --git a/fs/ocfs2/symlink.h b/fs/ocfs2/symlink.h
> index 65a6c9c..fd0ed70 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_CONST
> extern const struct inode_operations ocfs2_symlink_inode_operations;
> extern const struct inode_operations ocfs2_fast_symlink_inode_operations;
> +#else
> +extern struct inode_operations ocfs2_symlink_inode_operations;
> +extern struct inode_operations ocfs2_fast_symlink_inode_operations;
> +#endif
>
> /*
> * Test whether an inode is a fast symlink.
> --
> 1.5.2.5
>
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel@oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel
--
Life's Little Instruction Book #226
"When someone hugs you, let them be the first to let go."
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2007-12-24 13:23 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-20 15:30 [Ocfs2-devel] ocfs2 1.4: A new beginning Sunil Mushran
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 07/30] ocfs2: Handle struct f_path in struct file Sunil Mushran
2007-12-21 1:09 ` Joel Becker
2007-12-21 9:41 ` Sunil Mushran
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 20/30] ocfs2: Handle splice.h Sunil Mushran
2007-12-21 15:12 ` Joel Becker
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 30/30] ocfs2: Handle missing exportfs.h Sunil Mushran
2007-12-24 13:32 ` Joel Becker
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 09/30] ocfs2: Add helper inc_nlink Sunil Mushran
2007-12-21 11:39 ` Joel Becker
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 06/30] ocfs2: Include do_sync_mapping_range() from mainline Sunil Mushran
2007-12-21 0:54 ` Joel Becker
2007-12-21 9:39 ` Sunil Mushran
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 04/30] ocfs2: Handle macro uninitialized_var Sunil Mushran
2007-12-21 0:56 ` Joel Becker
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 29/30] ocfs2: Handle older prototype of bi_end_io_t Sunil Mushran
2007-12-24 13:30 ` Joel Becker
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 23/30] ocfs2: Handle missing export generic_segment_checks() Sunil Mushran
2007-12-22 3:51 ` Joel Becker
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 15/30] ocfs2: Handle different prototypes of register_sysctl_table() Sunil Mushran
2007-12-21 11:59 ` Joel Becker
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 22/30] ocfs2: Handles missing export should_remove_suid() Sunil Mushran
2007-12-22 3:51 ` Joel Becker
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 17/30] ocfs2: Handle the removal of struct subsystem Sunil Mushran
2007-12-21 15:10 ` Joel Becker
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 28/30] ocfs2: Handle missing __splice_from_pipe() Sunil Mushran
2007-12-24 13:30 ` Joel Becker
2007-12-20 15:29 ` [Ocfs2-devel] [PATCH 24/30] ocfs2: Handle missing vmops->fault() Sunil Mushran
2007-12-24 13:21 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 11/30] ocfs2: Handle missing dtors in kmem_cache_create() Sunil Mushran
2007-12-21 11:47 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 18/30] ocfs2: Handle missing macro is_owner_or_cap() Sunil Mushran
2007-12-21 15:10 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 26/30] ocfs2: Handle missing const struct inode_operations in struct inode Sunil Mushran
2007-12-24 13:23 ` Joel Becker [this message]
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 05/30] ocfs2: Handle macro zero_user_page() Sunil Mushran
2007-12-21 0:56 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 14/30] ocfs2: Handles configfs_depend_item() and configfs_undepend_item() Sunil Mushran
2007-12-21 11:57 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 13/30] ocfs2: Handle enum value FS_OCFS2 Sunil Mushran
2007-12-21 11:57 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 08/30] ocfs2: Define enum umh_wait Sunil Mushran
2007-12-21 11:37 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 03/30] ocfs2: Handle workqueue changes Sunil Mushran
2007-12-21 0:54 ` Joel Becker
2007-12-21 11:51 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 10/30] ocfs2: Add helper drop_nlink Sunil Mushran
2007-12-21 11:39 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 25/30] ocfs2: Handle missing const s_op in struct super_block Sunil Mushran
2007-12-24 13:23 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 21/30] ocfs2: Handle missing macro MNT_RELATIME Sunil Mushran
2007-12-21 15:14 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 19/30] ocfs2: Handle missing iop->fallocate() Sunil Mushran
2007-12-21 15:12 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 16/30] ocfs2: Handle su_mutex in struct configfs_subsystem Sunil Mushran
2007-12-21 12:00 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 27/30] ocfs2: Handle missing vectorized fileops aio_read() and aio_write() Sunil Mushran
2007-12-24 13:28 ` Joel Becker
2007-12-20 15:30 ` [Ocfs2-devel] [PATCH 12/30] ocfs2: Define FS_RENAME_DOES_D_MOVE Sunil Mushran
2007-12-21 11:55 ` Joel Becker
-- strict thread matches above, loose matches on Subject: below --
2007-12-31 14:25 [Ocfs2-devel] ocfs2-1.4: A new beginning - 2nd attempt Sunil Mushran
2007-12-31 14:25 ` [Ocfs2-devel] [PATCH 26/30] ocfs2: Handle missing const struct inode_operations in struct inode Sunil Mushran
2008-01-03 11:22 [Ocfs2-devel] OCFS2 1.4 Repository Base (3rd attempt) Sunil Mushran
2008-01-03 11:22 ` [Ocfs2-devel] [PATCH 26/30] ocfs2: Handle missing const struct inode_operations in struct inode Sunil Mushran
2008-01-08 16:15 ` Mark Fasheh
2008-01-09 18:00 [Ocfs2-devel] OCFS2-1.4 Yet another drop Sunil Mushran
2008-01-09 17:59 ` [Ocfs2-devel] [PATCH 26/30] ocfs2: Handle missing const struct inode_operations in struct inode Sunil Mushran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071224212307.GD7242@mail.oracle.com \
--to=joel.becker@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.