Jeff Mahoney
2008-Jan-31 12:55 UTC
[Ocfs2-devel] [patch 4/5] ocfs2: Add check for const address_space_operations
SLES10 doesn't have a const a_ops in struct address_space. This patch adds a check. Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/aops.c | 4 ++++ fs/ocfs2/inode.h | 4 ++++ 5 files changed, 18 insertions(+) diff --git a/Config.make.in b/Config.make.in index dc5431b..98bf410 100644 --- a/Config.make.in +++ b/Config.make.in @@ -73,6 +73,7 @@ NO_GENERIC_SEGMENT_CHECKS = @NO_GENERIC_SEGMENT_CHECKS@ SOP_IS_NOT_CONST = @SOP_IS_NOT_CONST@ IOP_IS_NOT_CONST = @IOP_IS_NOT_CONST@ FOP_IS_NOT_CONST = @FOP_IS_NOT_CONST@ +AOPS_IS_NOT_CONST = @AOPS_IS_NOT_CONST@ NO_VECTORIZED_AIO = @NO_VECTORIZED_AIO@ NO_SPLICE_FROM_PIPE = @NO_SPLICE_FROM_PIPE@ OLD_BIO_END_IO = @OLD_BIO_END_IO@ diff --git a/configure.in b/configure.in index 3d9e49f..a4b3f0e 100644 --- a/configure.in +++ b/configure.in @@ -310,6 +310,11 @@ OCFS2_CHECK_KERNEL([f_op declared as const in struct file in fs.h], fs.h, , FOP_IS_NOT_CONST=yes, [^.*const struct file_operations.*\*f_op;]) AC_SUBST(FOP_IS_NOT_CONST) +AOPS_IS_NOT_CONST+OCFS2_CHECK_KERNEL([a_ops declared as const in struct address_space in fs.h], fs.h, + , AOPS_IS_NOT_CONST=yes, [^.*const struct address_space_operations.*\*a_ops;]) +AC_SUBST(AOPS_IS_NOT_CONST) + NO_VECTORIZED_AIO OCFS2_CHECK_KERNEL([aio_read() in struct file_operations using iovec in fs.h], fs.h, , NO_VECTORIZED_AIO=yes, [ssize_t (\*aio_read) (struct kiocb \*, const struct iovec \*, unsigned long, loff_t);]) diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index 5750280..c8a81c4 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -88,6 +88,10 @@ ifdef FOP_IS_NOT_CONST EXTRA_CFLAGS += -DFOP_IS_NOT_CONST endif +ifdef AOPS_IS_NOT_CONST +EXTRA_CFLAGS += -DAOPS_IS_NOT_CONST +endif + ifdef NO_VECTORIZED_AIO CFLAGS_file.o += -DNO_VECTORIZED_AIO endif diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 54dd079..9b2a743 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -1953,7 +1953,11 @@ int ocfs2_write_end(struct file *file, struct address_space *mapping, return ret; } +#ifdef AOPS_IS_NOT_CONST +struct address_space_operations ocfs2_aops = { +#else const struct address_space_operations ocfs2_aops = { +#endif .readpage = ocfs2_readpage, .readpages = ocfs2_readpages, .writepage = ocfs2_writepage, diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h index 390a855..01437ca 100644 --- a/fs/ocfs2/inode.h +++ b/fs/ocfs2/inode.h @@ -111,7 +111,11 @@ static inline struct ocfs2_inode_info *OCFS2_I(struct inode *inode) extern struct kmem_cache *ocfs2_inode_cache; +#ifdef AOPS_IS_NOT_CONST +extern struct address_space_operations ocfs2_aops; +#else extern const struct address_space_operations ocfs2_aops; +#endif struct buffer_head *ocfs2_bread(struct inode *inode, int block, int *err, int reada);
Jeff Mahoney
2008-Jan-31 12:55 UTC
[Ocfs2-devel] [patch 1/5] ocfs2: add compatibility for lockdep
SLES10 doesn't have lockdep support. This patch ifdefs out the lockdep annotations when lockdep isn't found. Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/inode.c | 4 ++++ 4 files changed, 14 insertions(+) --- a/Config.make.in 2008-01-31 13:51:13.000000000 -0500 +++ b/Config.make.in 2008-01-31 13:51:15.000000000 -0500 @@ -87,6 +87,7 @@ FILLDIR_T_WITH_INO_T = @FILLDIR_T_WITH_I INVALIDATEPAGE_RETURNS_INT = @INVALIDATEPAGE_RETURNS_INT@ DIO_OLD_GET_BLOCKS = @DIO_OLD_GET_BLOCKS@ HAS_SYSTEM_UTSNAME = @HAS_SYSTEM_UTSNAME@ +NO_LOCKDEP = @NO_LOCKDEP@ OCFS_DEBUG = @OCFS_DEBUG@ --- a/configure.in 2008-01-31 13:51:13.000000000 -0500 +++ b/configure.in 2008-01-31 13:51:15.000000000 -0500 @@ -379,6 +379,11 @@ OCFS2_CHECK_KERNEL([system_utsname in ut HAS_SYSTEM_UTSNAME=yes, , [^extern struct new_utsname system_utsname]) AC_SUBST(HAS_SYSTEM_UTSNAME) +NO_LOCKDEP+OCFS2_CHECK_KERNEL([linux/lockdep.h], lockdep.h, , + NO_LOCKDEP=yes, [^struct lock_class {]) +AC_SUBST(NO_LOCKDEP) + # 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 --- a/fs/ocfs2/Makefile 2008-01-31 13:51:13.000000000 -0500 +++ b/fs/ocfs2/Makefile 2008-01-31 13:51:15.000000000 -0500 @@ -136,6 +136,10 @@ ifdef DIO_OLD_GET_BLOCKS EXTRA_CFLAGS += -DDIO_OLD_GET_BLOCKS endif +ifdef NO_LOCKDEP +EXTRA_CFLAGS += -DNO_LOCKDEP +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes. --- a/fs/ocfs2/inode.c 2008-01-31 13:51:13.000000000 -0500 +++ b/fs/ocfs2/inode.c 2008-01-31 13:51:15.000000000 -0500 @@ -60,7 +60,9 @@ struct ocfs2_find_inode_args unsigned int fi_sysfile_type; }; +#ifndef NO_LOCKDEP static struct lock_class_key ocfs2_sysfile_lock_key[NUM_SYSTEM_INODES]; +#endif static int ocfs2_read_locked_inode(struct inode *inode, struct ocfs2_find_inode_args *args); @@ -205,9 +207,11 @@ static int ocfs2_init_locked_inode(struc inode->i_ino = args->fi_ino; OCFS2_I(inode)->ip_blkno = args->fi_blkno; +#ifndef NO_LOCKDEP if (args->fi_sysfile_type != 0) lockdep_set_class(&inode->i_mutex, &ocfs2_sysfile_lock_key[args->fi_sysfile_type]); +#endif mlog_exit(0); return 0;
Jeff Mahoney
2008-Jan-31 12:55 UTC
[Ocfs2-devel] [patch 5/5] ocfs2: Add check for type of b_size in struct buffer_head
SLES10 has a b_size of type u32, not size_t in struct buffer_head. This patch adds a check. Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- Config.make.in | 1 + configure.in | 5 +++++ fs/ocfs2/Makefile | 4 ++++ fs/ocfs2/journal.c | 7 ++++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Config.make.in b/Config.make.in index 98bf410..24740c1 100644 --- a/Config.make.in +++ b/Config.make.in @@ -77,6 +77,7 @@ AOPS_IS_NOT_CONST = @AOPS_IS_NOT_CONST@ NO_VECTORIZED_AIO = @NO_VECTORIZED_AIO@ NO_SPLICE_FROM_PIPE = @NO_SPLICE_FROM_PIPE@ OLD_BIO_END_IO = @OLD_BIO_END_IO@ +B_SIZE_IS_U32 = @B_SIZE_IS_U32@ NO_EXPORTFS_HEADER = @NO_EXPORTFS_HEADER@ WRITEBACK_CONTROL_NO_RANGE_PREFIX = @WRITEBACK_CONTROL_NO_RANGE_PREFIX@ NO_SYNC_FILE_FLAGS = @NO_SYNC_FILE_FLAGS@ diff --git a/configure.in b/configure.in index a4b3f0e..c783d4a 100644 --- a/configure.in +++ b/configure.in @@ -331,6 +331,11 @@ OCFS2_CHECK_KERNEL([old bio_end_io_t in bio.h], bio.h, OLD_BIO_END_IO=yes, , [^typedef int (bio_end_io_t) (struct bio \*, unsigned int, int);]) AC_SUBST(OLD_BIO_END_IO) +B_SIZE_IS_U32+OCFS2_CHECK_KERNEL([b_size is u32 struct buffer_head in buffer_head.h], buffer_head.h, + B_SIZE_IS_U32=yes, , [^ u32 b_size;]) +AC_SUBST(B_SIZE_IS_U32) + NO_EXPORTFS_HEADER OCFS2_CHECK_KERNEL([exportfs.h], exportfs.h, , NO_EXPORTFS_HEADER=yes, [^struct export_operations {]) diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index c8a81c4..af47a25 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -100,6 +100,10 @@ ifdef NO_SPLICE_FROM_PIPE EXTRA_CFLAGS += -DNO_SPLICE_FROM_PIPE endif +ifdef B_SIZE_IS_U32 +EXTRA_CFLAGS += -DB_SIZE_IS_U32 +endif + ifdef NO_EXPORTFS_HEADER EXTRA_CFLAGS += -DNO_EXPORTFS_HEADER endif diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 0332505..907a1bf 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -235,7 +235,12 @@ int ocfs2_journal_access(handle_t *handle, BUG_ON(!handle); BUG_ON(!bh); - mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %zu\n", + mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = " +#ifdef B_SIZE_IS_U32 + "%u\n", +#else + "%zu\n", +#endif (unsigned long long)bh->b_blocknr, type, (type == OCFS2_JOURNAL_ACCESS_CREATE) ? "OCFS2_JOURNAL_ACCESS_CREATE" :
Jeff Mahoney
2008-Jan-31 12:55 UTC
[Ocfs2-devel] [patch 0/5] [patch 0/5] Compatibility fixes for SLES10
Hi guys - I just merged today's git tree against SLES10. There were a few errors and a few warnings that have been there all along. This patch set creates new checks to fix all of them. -Jeff -- Jeff Mahoney SUSE Labs
Jeff Mahoney
2008-Jan-31 12:55 UTC
[Ocfs2-devel] [patch 3/5] ocfs2: Add check for const file_operations
SLES10 doesn't have a const f_op in struct file. This patch adds a check. Signed-off-by: Jeff Mahoney <jeffm@suse.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/dlmglue.c | 4 ++++ fs/ocfs2/file.c | 8 ++++++++ fs/ocfs2/file.h | 5 +++++ 8 files changed, 39 insertions(+) diff --git a/Config.make.in b/Config.make.in index 5b58fe1..dc5431b 100644 --- a/Config.make.in +++ b/Config.make.in @@ -72,6 +72,7 @@ NO_SHOULD_REMOVE_SUID = @NO_SHOULD_REMOVE_SUID@ NO_GENERIC_SEGMENT_CHECKS = @NO_GENERIC_SEGMENT_CHECKS@ SOP_IS_NOT_CONST = @SOP_IS_NOT_CONST@ IOP_IS_NOT_CONST = @IOP_IS_NOT_CONST@ +FOP_IS_NOT_CONST = @FOP_IS_NOT_CONST@ NO_VECTORIZED_AIO = @NO_VECTORIZED_AIO@ NO_SPLICE_FROM_PIPE = @NO_SPLICE_FROM_PIPE@ OLD_BIO_END_IO = @OLD_BIO_END_IO@ diff --git a/configure.in b/configure.in index d1ebeae..3d9e49f 100644 --- a/configure.in +++ b/configure.in @@ -305,6 +305,11 @@ OCFS2_CHECK_KERNEL([i_op declared as const in struct inode in fs.h], fs.h, , IOP_IS_NOT_CONST=yes, [^.*const struct inode_operations.*\*i_op;]) AC_SUBST(IOP_IS_NOT_CONST) +FOP_IS_NOT_CONST+OCFS2_CHECK_KERNEL([f_op declared as const in struct file in fs.h], fs.h, + , FOP_IS_NOT_CONST=yes, [^.*const struct file_operations.*\*f_op;]) +AC_SUBST(FOP_IS_NOT_CONST) + NO_VECTORIZED_AIO OCFS2_CHECK_KERNEL([aio_read() in struct file_operations using iovec in fs.h], fs.h, , NO_VECTORIZED_AIO=yes, [ssize_t (\*aio_read) (struct kiocb \*, const struct iovec \*, unsigned long, loff_t);]) diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index b53630d..5750280 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile @@ -84,6 +84,10 @@ ifdef IOP_IS_NOT_CONST EXTRA_CFLAGS += -DIOP_IS_NOT_CONST endif +ifdef FOP_IS_NOT_CONST +EXTRA_CFLAGS += -DFOP_IS_NOT_CONST +endif + ifdef NO_VECTORIZED_AIO CFLAGS_file.o += -DNO_VECTORIZED_AIO endif diff --git a/fs/ocfs2/dlm/Makefile b/fs/ocfs2/dlm/Makefile index 74bd019..4b718cf 100644 --- a/fs/ocfs2/dlm/Makefile +++ b/fs/ocfs2/dlm/Makefile @@ -46,6 +46,10 @@ ifdef IOP_IS_NOT_CONST EXTRA_CFLAGS += -DIOP_IS_NOT_CONST endif +ifdef FOP_IS_NOT_CONST +EXTRA_CFLAGS += -DFOP_IS_NOT_CONST +endif + ifdef NO_VFSMOUNT_IN_GET_SB_BDEV EXTRA_CFLAGS += -DNO_VFSMOUNT_IN_GET_SB_BDEV endif diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c index ba35f76..f7e0263 100644 --- a/fs/ocfs2/dlm/dlmfs.c +++ b/fs/ocfs2/dlm/dlmfs.c @@ -65,7 +65,11 @@ static struct super_operations dlmfs_ops; #else static const struct super_operations dlmfs_ops; #endif +#ifdef FOP_IS_NOT_CONST +static struct file_operations dlmfs_file_operations; +#else static const struct file_operations dlmfs_file_operations; +#endif #ifdef IOP_IS_NOT_CONST static struct inode_operations dlmfs_dir_inode_operations; static struct inode_operations dlmfs_root_inode_operations; @@ -546,7 +550,11 @@ static int dlmfs_fill_super(struct super_block * sb, return 0; } +#ifdef FOP_IS_NOT_CONST +static struct file_operations dlmfs_file_operations = { +#else static const struct file_operations dlmfs_file_operations = { +#endif .open = dlmfs_file_open, .release = dlmfs_file_release, .read = dlmfs_file_read, diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 9ce2881..04f9ec3 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -2441,7 +2441,11 @@ out: return ret; } +#ifdef FOP_IS_NOT_CONST +static struct file_operations ocfs2_dlm_debug_fops = { +#else static const struct file_operations ocfs2_dlm_debug_fops = { +#endif .open = ocfs2_dlm_debug_open, .release = ocfs2_dlm_debug_release, .read = seq_read, diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 40122fe..e068a76 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -2488,7 +2488,11 @@ const struct inode_operations ocfs2_special_file_iops = { .permission = ocfs2_permission, }; +#ifdef FOP_IS_NOT_CONST +struct file_operations ocfs2_fops = { +#else const struct file_operations ocfs2_fops = { +#endif .llseek = generic_file_llseek, .read = do_sync_read, .write = do_sync_write, @@ -2509,7 +2513,11 @@ const struct file_operations ocfs2_fops = { #endif }; +#ifdef FOP_IS_NOT_CONST +struct file_operations ocfs2_dops = { +#else const struct file_operations ocfs2_dops = { +#endif .llseek = generic_file_llseek, .read = generic_read_dir, .readdir = ocfs2_readdir, diff --git a/fs/ocfs2/file.h b/fs/ocfs2/file.h index 8cf0821..2b118b8 100644 --- a/fs/ocfs2/file.h +++ b/fs/ocfs2/file.h @@ -26,8 +26,13 @@ #ifndef OCFS2_FILE_H #define OCFS2_FILE_H +#ifdef FOP_IS_NOT_CONST +extern struct file_operations ocfs2_fops; +extern struct file_operations ocfs2_dops; +#else extern const struct file_operations ocfs2_fops; extern const struct file_operations ocfs2_dops; +#endif #ifdef IOP_IS_NOT_CONST extern struct inode_operations ocfs2_file_iops; extern struct inode_operations ocfs2_special_file_iops;
Jeff Mahoney
2008-Jan-31 12:55 UTC
[Ocfs2-devel] [patch 2/5] ocfs2: add compatibility for mandatory_lock()
SLES10 doesn't have a mandatory_lock() function, but does support IS_MANDATORY() and the associated functions. This patch adds mandatory_lock() support. Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- Config.make.in | 1 + configure.in | 6 ++++++ fs/ocfs2/Makefile | 4 ++++ kapi-compat/include/mandatory_lock.h | 27 +++++++++++++++++++++++++++ 4 files changed, 38 insertions(+) --- a/Config.make.in 2008-01-31 13:48:44.000000000 -0500 +++ b/Config.make.in 2008-01-31 13:49:00.000000000 -0500 @@ -88,6 +88,7 @@ INVALIDATEPAGE_RETURNS_INT = @INVALIDATE DIO_OLD_GET_BLOCKS = @DIO_OLD_GET_BLOCKS@ HAS_SYSTEM_UTSNAME = @HAS_SYSTEM_UTSNAME@ NO_LOCKDEP = @NO_LOCKDEP@ +NO_MANDATORY_LOCK = @NO_MANDATORY_LOCK@ OCFS_DEBUG = @OCFS_DEBUG@ --- a/configure.in 2008-01-31 13:48:44.000000000 -0500 +++ b/configure.in 2008-01-31 13:49:00.000000000 -0500 @@ -384,6 +384,12 @@ OCFS2_CHECK_KERNEL([linux/lockdep.h], lo NO_LOCKDEP=yes, [^struct lock_class {]) AC_SUBST(NO_LOCKDEP) +NO_MANDATORY_LOCK+OCFS2_CHECK_KERNEL([mandatory_lock() in fs.h], fs.h, , + NO_MANDATORY_LOCK=yes, [^static inline int mandatory_lock(]) +AC_SUBST(NO_MANDATORY_LOCK) +KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS mandatory_lock.h" + # 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 --- a/fs/ocfs2/Makefile 2008-01-31 13:48:44.000000000 -0500 +++ b/fs/ocfs2/Makefile 2008-01-31 13:49:00.000000000 -0500 @@ -140,6 +140,10 @@ ifdef NO_LOCKDEP EXTRA_CFLAGS += -DNO_LOCKDEP endif +ifdef NO_MANDATORY_LOCK +EXTRA_CFLAGS += -DNO_MANDATORY_LOCK +endif + # # Since SUBDIRS means something to kbuild, define them safely. Do not # include trailing slashes. --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ b/kapi-compat/include/mandatory_lock.h 2008-01-31 13:49:00.000000000 -0500 @@ -0,0 +1,27 @@ +#ifndef KAPI_MANDATORY_LOCK_H +#define KAPI_MANDATORY_LOCK_H + +#ifdef NO_MANDATORY_LOCK +#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 + +#endif /* KAPI_MANDATORY_LOCK_H */
Sunil Mushran
2008-Feb-01 14:09 UTC
[Ocfs2-devel] Re: [patch 0/5] [patch 0/5] Compatibility fixes for SLES10
While I've not tested it, the patches here look good. What about the breakup of the earlier patch? Will it be applied atop these? Jeff Mahoney wrote:> Hi guys - > > I just merged today's git tree against SLES10. There were a few > errors and a few warnings that have been there all along. This > patch set creates new checks to fix all of them. > > -Jeff > > -- > Jeff Mahoney > SUSE Labs > >
Sunil Mushran
2008-Feb-01 15:38 UTC
[Ocfs2-devel] Re: [patch 5/5] ocfs2: Add check for type of b_size in struct buffer_head
Jeff Mahoney wrote:> SLES10 has a b_size of type u32, not size_t in struct buffer_head. This > patch adds a check. > > Signed-off-by: Jeff Mahoney <jeffm@suse.com> >Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>> --- > > Config.make.in | 1 + > configure.in | 5 +++++ > fs/ocfs2/Makefile | 4 ++++ > fs/ocfs2/journal.c | 7 ++++++- > 4 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/Config.make.in b/Config.make.in > index 98bf410..24740c1 100644 > --- a/Config.make.in > +++ b/Config.make.in > @@ -77,6 +77,7 @@ AOPS_IS_NOT_CONST = @AOPS_IS_NOT_CONST@ > NO_VECTORIZED_AIO = @NO_VECTORIZED_AIO@ > NO_SPLICE_FROM_PIPE = @NO_SPLICE_FROM_PIPE@ > OLD_BIO_END_IO = @OLD_BIO_END_IO@ > +B_SIZE_IS_U32 = @B_SIZE_IS_U32@ > NO_EXPORTFS_HEADER = @NO_EXPORTFS_HEADER@ > WRITEBACK_CONTROL_NO_RANGE_PREFIX = @WRITEBACK_CONTROL_NO_RANGE_PREFIX@ > NO_SYNC_FILE_FLAGS = @NO_SYNC_FILE_FLAGS@ > diff --git a/configure.in b/configure.in > index a4b3f0e..c783d4a 100644 > --- a/configure.in > +++ b/configure.in > @@ -331,6 +331,11 @@ OCFS2_CHECK_KERNEL([old bio_end_io_t in bio.h], bio.h, > OLD_BIO_END_IO=yes, , [^typedef int (bio_end_io_t) (struct bio \*, unsigned int, int);]) > AC_SUBST(OLD_BIO_END_IO) > > +B_SIZE_IS_U32> +OCFS2_CHECK_KERNEL([b_size is u32 struct buffer_head in buffer_head.h], buffer_head.h, > + B_SIZE_IS_U32=yes, , [^ u32 b_size;]) > +AC_SUBST(B_SIZE_IS_U32) > + > NO_EXPORTFS_HEADER> OCFS2_CHECK_KERNEL([exportfs.h], exportfs.h, > , NO_EXPORTFS_HEADER=yes, [^struct export_operations {]) > diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile > index c8a81c4..af47a25 100644 > --- a/fs/ocfs2/Makefile > +++ b/fs/ocfs2/Makefile > @@ -100,6 +100,10 @@ ifdef NO_SPLICE_FROM_PIPE > EXTRA_CFLAGS += -DNO_SPLICE_FROM_PIPE > endif > > +ifdef B_SIZE_IS_U32 > +EXTRA_CFLAGS += -DB_SIZE_IS_U32 > +endif > + > ifdef NO_EXPORTFS_HEADER > EXTRA_CFLAGS += -DNO_EXPORTFS_HEADER > endif > diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c > index 0332505..907a1bf 100644 > --- a/fs/ocfs2/journal.c > +++ b/fs/ocfs2/journal.c > @@ -235,7 +235,12 @@ int ocfs2_journal_access(handle_t *handle, > BUG_ON(!handle); > BUG_ON(!bh); > > - mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %zu\n", > + mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = " > +#ifdef B_SIZE_IS_U32 > + "%u\n", > +#else > + "%zu\n", > +#endif > (unsigned long long)bh->b_blocknr, type, > (type == OCFS2_JOURNAL_ACCESS_CREATE) ? > "OCFS2_JOURNAL_ACCESS_CREATE" : > > >
Sunil Mushran
2008-Feb-01 15:38 UTC
[Ocfs2-devel] Re: [patch 4/5] ocfs2: Add check for const address_space_operations
Jeff Mahoney wrote:> SLES10 doesn't have a const a_ops in struct address_space. This patch adds > a check. > > Signed-off-by: Jeff Mahoney <jeffm@suse.com> >Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>> --- > > Config.make.in | 1 + > configure.in | 5 +++++ > fs/ocfs2/Makefile | 4 ++++ > fs/ocfs2/aops.c | 4 ++++ > fs/ocfs2/inode.h | 4 ++++ > 5 files changed, 18 insertions(+) > > diff --git a/Config.make.in b/Config.make.in > index dc5431b..98bf410 100644 > --- a/Config.make.in > +++ b/Config.make.in > @@ -73,6 +73,7 @@ NO_GENERIC_SEGMENT_CHECKS = @NO_GENERIC_SEGMENT_CHECKS@ > SOP_IS_NOT_CONST = @SOP_IS_NOT_CONST@ > IOP_IS_NOT_CONST = @IOP_IS_NOT_CONST@ > FOP_IS_NOT_CONST = @FOP_IS_NOT_CONST@ > +AOPS_IS_NOT_CONST = @AOPS_IS_NOT_CONST@ > NO_VECTORIZED_AIO = @NO_VECTORIZED_AIO@ > NO_SPLICE_FROM_PIPE = @NO_SPLICE_FROM_PIPE@ > OLD_BIO_END_IO = @OLD_BIO_END_IO@ > diff --git a/configure.in b/configure.in > index 3d9e49f..a4b3f0e 100644 > --- a/configure.in > +++ b/configure.in > @@ -310,6 +310,11 @@ OCFS2_CHECK_KERNEL([f_op declared as const in struct file in fs.h], fs.h, > , FOP_IS_NOT_CONST=yes, [^.*const struct file_operations.*\*f_op;]) > AC_SUBST(FOP_IS_NOT_CONST) > > +AOPS_IS_NOT_CONST> +OCFS2_CHECK_KERNEL([a_ops declared as const in struct address_space in fs.h], fs.h, > + , AOPS_IS_NOT_CONST=yes, [^.*const struct address_space_operations.*\*a_ops;]) > +AC_SUBST(AOPS_IS_NOT_CONST) > + > NO_VECTORIZED_AIO> OCFS2_CHECK_KERNEL([aio_read() in struct file_operations using iovec in fs.h], fs.h, > , NO_VECTORIZED_AIO=yes, [ssize_t (\*aio_read) (struct kiocb \*, const struct iovec \*, unsigned long, loff_t);]) > diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile > index 5750280..c8a81c4 100644 > --- a/fs/ocfs2/Makefile > +++ b/fs/ocfs2/Makefile > @@ -88,6 +88,10 @@ ifdef FOP_IS_NOT_CONST > EXTRA_CFLAGS += -DFOP_IS_NOT_CONST > endif > > +ifdef AOPS_IS_NOT_CONST > +EXTRA_CFLAGS += -DAOPS_IS_NOT_CONST > +endif > + > ifdef NO_VECTORIZED_AIO > CFLAGS_file.o += -DNO_VECTORIZED_AIO > endif > diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c > index 54dd079..9b2a743 100644 > --- a/fs/ocfs2/aops.c > +++ b/fs/ocfs2/aops.c > @@ -1953,7 +1953,11 @@ int ocfs2_write_end(struct file *file, struct address_space *mapping, > return ret; > } > > +#ifdef AOPS_IS_NOT_CONST > +struct address_space_operations ocfs2_aops = { > +#else > const struct address_space_operations ocfs2_aops = { > +#endif > .readpage = ocfs2_readpage, > .readpages = ocfs2_readpages, > .writepage = ocfs2_writepage, > diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h > index 390a855..01437ca 100644 > --- a/fs/ocfs2/inode.h > +++ b/fs/ocfs2/inode.h > @@ -111,7 +111,11 @@ static inline struct ocfs2_inode_info *OCFS2_I(struct inode *inode) > > extern struct kmem_cache *ocfs2_inode_cache; > > +#ifdef AOPS_IS_NOT_CONST > +extern struct address_space_operations ocfs2_aops; > +#else > extern const struct address_space_operations ocfs2_aops; > +#endif > > struct buffer_head *ocfs2_bread(struct inode *inode, int block, > int *err, int reada); > > >
Sunil Mushran
2008-Feb-01 15:38 UTC
[Ocfs2-devel] Re: [patch 2/5] ocfs2: add compatibility for mandatory_lock()
Jeff Mahoney wrote:> SLES10 doesn't have a mandatory_lock() function, but does support > IS_MANDATORY() and the associated functions. > > This patch adds mandatory_lock() support. > > Signed-off-by: Jeff Mahoney <jeffm@suse.com> >Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>> --- > > Config.make.in | 1 + > configure.in | 6 ++++++ > fs/ocfs2/Makefile | 4 ++++ > kapi-compat/include/mandatory_lock.h | 27 +++++++++++++++++++++++++++ > 4 files changed, 38 insertions(+) > > --- a/Config.make.in 2008-01-31 13:48:44.000000000 -0500 > +++ b/Config.make.in 2008-01-31 13:49:00.000000000 -0500 > @@ -88,6 +88,7 @@ INVALIDATEPAGE_RETURNS_INT = @INVALIDATE > DIO_OLD_GET_BLOCKS = @DIO_OLD_GET_BLOCKS@ > HAS_SYSTEM_UTSNAME = @HAS_SYSTEM_UTSNAME@ > NO_LOCKDEP = @NO_LOCKDEP@ > +NO_MANDATORY_LOCK = @NO_MANDATORY_LOCK@ > > OCFS_DEBUG = @OCFS_DEBUG@ > > --- a/configure.in 2008-01-31 13:48:44.000000000 -0500 > +++ b/configure.in 2008-01-31 13:49:00.000000000 -0500 > @@ -384,6 +384,12 @@ OCFS2_CHECK_KERNEL([linux/lockdep.h], lo > NO_LOCKDEP=yes, [^struct lock_class {]) > AC_SUBST(NO_LOCKDEP) > > +NO_MANDATORY_LOCK> +OCFS2_CHECK_KERNEL([mandatory_lock() in fs.h], fs.h, , > + NO_MANDATORY_LOCK=yes, [^static inline int mandatory_lock(]) > +AC_SUBST(NO_MANDATORY_LOCK) > +KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS mandatory_lock.h" > + > # 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 > --- a/fs/ocfs2/Makefile 2008-01-31 13:48:44.000000000 -0500 > +++ b/fs/ocfs2/Makefile 2008-01-31 13:49:00.000000000 -0500 > @@ -140,6 +140,10 @@ ifdef NO_LOCKDEP > EXTRA_CFLAGS += -DNO_LOCKDEP > endif > > +ifdef NO_MANDATORY_LOCK > +EXTRA_CFLAGS += -DNO_MANDATORY_LOCK > +endif > + > # > # Since SUBDIRS means something to kbuild, define them safely. Do not > # include trailing slashes. > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > +++ b/kapi-compat/include/mandatory_lock.h 2008-01-31 13:49:00.000000000 -0500 > @@ -0,0 +1,27 @@ > +#ifndef KAPI_MANDATORY_LOCK_H > +#define KAPI_MANDATORY_LOCK_H > + > +#ifdef NO_MANDATORY_LOCK > +#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 > + > +#endif /* KAPI_MANDATORY_LOCK_H */ > > >
Sunil Mushran
2008-Feb-01 15:38 UTC
[Ocfs2-devel] Re: [patch 1/5] ocfs2: add compatibility for lockdep
Jeff Mahoney wrote:> SLES10 doesn't have lockdep support. This patch ifdefs out the lockdep > annotations when lockdep isn't found. > > Signed-off-by: Jeff Mahoney <jeffm@suse.com> >Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>> --- > > Config.make.in | 1 + > configure.in | 5 +++++ > fs/ocfs2/Makefile | 4 ++++ > fs/ocfs2/inode.c | 4 ++++ > 4 files changed, 14 insertions(+) > > --- a/Config.make.in 2008-01-31 13:51:13.000000000 -0500 > +++ b/Config.make.in 2008-01-31 13:51:15.000000000 -0500 > @@ -87,6 +87,7 @@ FILLDIR_T_WITH_INO_T = @FILLDIR_T_WITH_I > INVALIDATEPAGE_RETURNS_INT = @INVALIDATEPAGE_RETURNS_INT@ > DIO_OLD_GET_BLOCKS = @DIO_OLD_GET_BLOCKS@ > HAS_SYSTEM_UTSNAME = @HAS_SYSTEM_UTSNAME@ > +NO_LOCKDEP = @NO_LOCKDEP@ > > OCFS_DEBUG = @OCFS_DEBUG@ > > --- a/configure.in 2008-01-31 13:51:13.000000000 -0500 > +++ b/configure.in 2008-01-31 13:51:15.000000000 -0500 > @@ -379,6 +379,11 @@ OCFS2_CHECK_KERNEL([system_utsname in ut > HAS_SYSTEM_UTSNAME=yes, , [^extern struct new_utsname system_utsname]) > AC_SUBST(HAS_SYSTEM_UTSNAME) > > +NO_LOCKDEP> +OCFS2_CHECK_KERNEL([linux/lockdep.h], lockdep.h, , > + NO_LOCKDEP=yes, [^struct lock_class {]) > +AC_SUBST(NO_LOCKDEP) > + > # 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 > --- a/fs/ocfs2/Makefile 2008-01-31 13:51:13.000000000 -0500 > +++ b/fs/ocfs2/Makefile 2008-01-31 13:51:15.000000000 -0500 > @@ -136,6 +136,10 @@ ifdef DIO_OLD_GET_BLOCKS > EXTRA_CFLAGS += -DDIO_OLD_GET_BLOCKS > endif > > +ifdef NO_LOCKDEP > +EXTRA_CFLAGS += -DNO_LOCKDEP > +endif > + > # > # Since SUBDIRS means something to kbuild, define them safely. Do not > # include trailing slashes. > --- a/fs/ocfs2/inode.c 2008-01-31 13:51:13.000000000 -0500 > +++ b/fs/ocfs2/inode.c 2008-01-31 13:51:15.000000000 -0500 > @@ -60,7 +60,9 @@ struct ocfs2_find_inode_args > unsigned int fi_sysfile_type; > }; > > +#ifndef NO_LOCKDEP > static struct lock_class_key ocfs2_sysfile_lock_key[NUM_SYSTEM_INODES]; > +#endif > > static int ocfs2_read_locked_inode(struct inode *inode, > struct ocfs2_find_inode_args *args); > @@ -205,9 +207,11 @@ static int ocfs2_init_locked_inode(struc > > inode->i_ino = args->fi_ino; > OCFS2_I(inode)->ip_blkno = args->fi_blkno; > +#ifndef NO_LOCKDEP > if (args->fi_sysfile_type != 0) > lockdep_set_class(&inode->i_mutex, > &ocfs2_sysfile_lock_key[args->fi_sysfile_type]); > +#endif > > mlog_exit(0); > return 0; > > >
Sunil Mushran
2008-Feb-01 15:38 UTC
[Ocfs2-devel] Re: [patch 3/5] ocfs2: Add check for const file_operations
Jeff Mahoney wrote:> SLES10 doesn't have a const f_op in struct file. This patch adds a check. > > Signed-off-by: Jeff Mahoney <jeffm@suse.com> >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 | 8 ++++++++ > fs/ocfs2/dlmglue.c | 4 ++++ > fs/ocfs2/file.c | 8 ++++++++ > fs/ocfs2/file.h | 5 +++++ > 8 files changed, 39 insertions(+) > > diff --git a/Config.make.in b/Config.make.in > index 5b58fe1..dc5431b 100644 > --- a/Config.make.in > +++ b/Config.make.in > @@ -72,6 +72,7 @@ NO_SHOULD_REMOVE_SUID = @NO_SHOULD_REMOVE_SUID@ > NO_GENERIC_SEGMENT_CHECKS = @NO_GENERIC_SEGMENT_CHECKS@ > SOP_IS_NOT_CONST = @SOP_IS_NOT_CONST@ > IOP_IS_NOT_CONST = @IOP_IS_NOT_CONST@ > +FOP_IS_NOT_CONST = @FOP_IS_NOT_CONST@ > NO_VECTORIZED_AIO = @NO_VECTORIZED_AIO@ > NO_SPLICE_FROM_PIPE = @NO_SPLICE_FROM_PIPE@ > OLD_BIO_END_IO = @OLD_BIO_END_IO@ > diff --git a/configure.in b/configure.in > index d1ebeae..3d9e49f 100644 > --- a/configure.in > +++ b/configure.in > @@ -305,6 +305,11 @@ OCFS2_CHECK_KERNEL([i_op declared as const in struct inode in fs.h], fs.h, > , IOP_IS_NOT_CONST=yes, [^.*const struct inode_operations.*\*i_op;]) > AC_SUBST(IOP_IS_NOT_CONST) > > +FOP_IS_NOT_CONST> +OCFS2_CHECK_KERNEL([f_op declared as const in struct file in fs.h], fs.h, > + , FOP_IS_NOT_CONST=yes, [^.*const struct file_operations.*\*f_op;]) > +AC_SUBST(FOP_IS_NOT_CONST) > + > NO_VECTORIZED_AIO> OCFS2_CHECK_KERNEL([aio_read() in struct file_operations using iovec in fs.h], fs.h, > , NO_VECTORIZED_AIO=yes, [ssize_t (\*aio_read) (struct kiocb \*, const struct iovec \*, unsigned long, loff_t);]) > diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile > index b53630d..5750280 100644 > --- a/fs/ocfs2/Makefile > +++ b/fs/ocfs2/Makefile > @@ -84,6 +84,10 @@ ifdef IOP_IS_NOT_CONST > EXTRA_CFLAGS += -DIOP_IS_NOT_CONST > endif > > +ifdef FOP_IS_NOT_CONST > +EXTRA_CFLAGS += -DFOP_IS_NOT_CONST > +endif > + > ifdef NO_VECTORIZED_AIO > CFLAGS_file.o += -DNO_VECTORIZED_AIO > endif > diff --git a/fs/ocfs2/dlm/Makefile b/fs/ocfs2/dlm/Makefile > index 74bd019..4b718cf 100644 > --- a/fs/ocfs2/dlm/Makefile > +++ b/fs/ocfs2/dlm/Makefile > @@ -46,6 +46,10 @@ ifdef IOP_IS_NOT_CONST > EXTRA_CFLAGS += -DIOP_IS_NOT_CONST > endif > > +ifdef FOP_IS_NOT_CONST > +EXTRA_CFLAGS += -DFOP_IS_NOT_CONST > +endif > + > ifdef NO_VFSMOUNT_IN_GET_SB_BDEV > EXTRA_CFLAGS += -DNO_VFSMOUNT_IN_GET_SB_BDEV > endif > diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c > index ba35f76..f7e0263 100644 > --- a/fs/ocfs2/dlm/dlmfs.c > +++ b/fs/ocfs2/dlm/dlmfs.c > @@ -65,7 +65,11 @@ static struct super_operations dlmfs_ops; > #else > static const struct super_operations dlmfs_ops; > #endif > +#ifdef FOP_IS_NOT_CONST > +static struct file_operations dlmfs_file_operations; > +#else > static const struct file_operations dlmfs_file_operations; > +#endif > #ifdef IOP_IS_NOT_CONST > static struct inode_operations dlmfs_dir_inode_operations; > static struct inode_operations dlmfs_root_inode_operations; > @@ -546,7 +550,11 @@ static int dlmfs_fill_super(struct super_block * sb, > return 0; > } > > +#ifdef FOP_IS_NOT_CONST > +static struct file_operations dlmfs_file_operations = { > +#else > static const struct file_operations dlmfs_file_operations = { > +#endif > .open = dlmfs_file_open, > .release = dlmfs_file_release, > .read = dlmfs_file_read, > diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c > index 9ce2881..04f9ec3 100644 > --- a/fs/ocfs2/dlmglue.c > +++ b/fs/ocfs2/dlmglue.c > @@ -2441,7 +2441,11 @@ out: > return ret; > } > > +#ifdef FOP_IS_NOT_CONST > +static struct file_operations ocfs2_dlm_debug_fops = { > +#else > static const struct file_operations ocfs2_dlm_debug_fops = { > +#endif > .open = ocfs2_dlm_debug_open, > .release = ocfs2_dlm_debug_release, > .read = seq_read, > diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c > index 40122fe..e068a76 100644 > --- a/fs/ocfs2/file.c > +++ b/fs/ocfs2/file.c > @@ -2488,7 +2488,11 @@ const struct inode_operations ocfs2_special_file_iops = { > .permission = ocfs2_permission, > }; > > +#ifdef FOP_IS_NOT_CONST > +struct file_operations ocfs2_fops = { > +#else > const struct file_operations ocfs2_fops = { > +#endif > .llseek = generic_file_llseek, > .read = do_sync_read, > .write = do_sync_write, > @@ -2509,7 +2513,11 @@ const struct file_operations ocfs2_fops = { > #endif > }; > > +#ifdef FOP_IS_NOT_CONST > +struct file_operations ocfs2_dops = { > +#else > const struct file_operations ocfs2_dops = { > +#endif > .llseek = generic_file_llseek, > .read = generic_read_dir, > .readdir = ocfs2_readdir, > diff --git a/fs/ocfs2/file.h b/fs/ocfs2/file.h > index 8cf0821..2b118b8 100644 > --- a/fs/ocfs2/file.h > +++ b/fs/ocfs2/file.h > @@ -26,8 +26,13 @@ > #ifndef OCFS2_FILE_H > #define OCFS2_FILE_H > > +#ifdef FOP_IS_NOT_CONST > +extern struct file_operations ocfs2_fops; > +extern struct file_operations ocfs2_dops; > +#else > extern const struct file_operations ocfs2_fops; > extern const struct file_operations ocfs2_dops; > +#endif > #ifdef IOP_IS_NOT_CONST > extern struct inode_operations ocfs2_file_iops; > extern struct inode_operations ocfs2_special_file_iops; > > >