Whamcloud - gitweb
Branch HEAD
authoryangsheng <yangsheng>
Fri, 13 Feb 2009 18:32:39 +0000 (18:32 +0000)
committeryangsheng <yangsheng>
Fri, 13 Feb 2009 18:32:39 +0000 (18:32 +0000)
b=18462

i=adilger, johann

Eliminate kernel patches for linux/fs.h.

lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h
lustre/kernel_patches/patches/dev_read_only-2.6-fc5.patch
lustre/kernel_patches/patches/export_symbols-2.6.12.patch
lustre/kernel_patches/series/2.6-sles10.series
lustre/obdfilter/filter_log.c

index 04023c7..19051bc 100644 (file)
@@ -592,14 +592,6 @@ AC_DEFUN([LC_LUSTRE_VERSION_H],
 ])
 ])
 
-AC_DEFUN([LC_FUNC_SET_FS_PWD],
-[LB_CHECK_SYMBOL_EXPORT([set_fs_pwd],
-[fs/namespace.c],[
-        AC_DEFINE(HAVE_SET_FS_PWD, 1, [set_fs_pwd is exported])
-],[
-])
-])
-
 #
 # LC_CAPA_CRYPTO
 #
@@ -968,6 +960,23 @@ LB_LINUX_TRY_COMPILE([
 EXTRA_KCFLAGS="$tmp_flags"
 ])
 
+# inode have i_private field since 2.6.17
+AC_DEFUN([LC_INODE_IPRIVATE],
+[AC_MSG_CHECKING([if inode has a i_private field])
+LB_LINUX_TRY_COMPILE([
+#include <linux/fs.h>
+],[
+       struct inode i;
+       i.i_private = NULL; 
+],[
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_INODE_IPRIVATE, 1,
+               [struct inode has i_private field])
+],[
+       AC_MSG_RESULT(no)
+])
+])
+
 # 2.6.19 API changes
 # inode don't have i_blksize field
 AC_DEFUN([LC_INODE_BLKSIZE],
@@ -1512,7 +1521,6 @@ AC_DEFUN([LC_PROG_LINUX],
 
          LC_STRUCT_INTENT_FILE
 
-         LC_FUNC_SET_FS_PWD
          LC_CAPA_CRYPTO
          LC_CONFIG_RMTCLIENT
          LC_CONFIG_GSS
@@ -1542,6 +1550,7 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_SECURITY_PLUG  # for SLES10 SP2
 
          # 2.6.17
+         LC_INODE_IPRIVATE
          LC_DQUOTOFF_MUTEX
 
          # 2.6.18
index bb6ced3..b197133 100644 (file)
@@ -56,7 +56,6 @@ struct ll_iattr {
 #define ll_iattr iattr
 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14) */
 
-#ifndef HAVE_SET_FS_PWD
 static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
                 struct dentry *dentry)
 {
@@ -75,9 +74,6 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
                 mntput(old_pwdmnt);
         }
 }
-#else
-#define ll_set_fs_pwd set_fs_pwd
-#endif /* HAVE_SET_FS_PWD */
 
 /*
  * set ATTR_BLOCKS to a high value to avoid any risk of collision with other
@@ -665,6 +661,12 @@ static inline long labs(long x)
 #define invalidate_mapping_pages(mapping,s,e) invalidate_inode_pages(mapping)
 #endif
 
+#ifdef HAVE_INODE_IPRIVATE
+#define INODE_PRIVATE_DATA(inode)       ((inode)->i_private)
+#else
+#define INODE_PRIVATE_DATA(inode)       ((inode)->u.generic_ip)
+#endif
+
 #ifndef SLAB_DESTROY_BY_RCU
 #define SLAB_DESTROY_BY_RCU 0
 #endif
index 51c7f66..8969f25 100644 (file)
@@ -130,16 +130,17 @@ Index: linux-2.6.16.i686/fs/block_dev.c
        up(&bdev->bd_sem);
 Index: linux-2.6.16.i686/include/linux/fs.h
 ===================================================================
---- linux-2.6.16.i686.orig/include/linux/fs.h
-+++ linux-2.6.16.i686/include/linux/fs.h
-@@ -1595,6 +1595,10 @@ extern void file_kill(struct file *f);
- struct bio;
- extern void submit_bio(int, struct bio *);
- extern int bdev_read_only(struct block_device *);
+--- linux-2.6.16.i686.orig/include/linux/blkdev.h
++++ linux-2.6.16.i686/include/linux/blkdev.h
+@@ -1595,6 +1595,11 @@ extern void file_kill(struct file *f);
+ } \
+ )
+ #endif 
++
 +#define HAVE_CLEAR_RDONLY_ON_PUT
 +void dev_set_rdonly(struct block_device *bdev);
 +int dev_check_rdonly(struct block_device *bdev);
 +void dev_clear_rdonly(struct block_device *bdev);
- extern int set_blocksize(struct block_device *, int);
- extern int sb_set_blocksize(struct super_block *, int);
- extern int sb_min_blocksize(struct super_block *, int);
+ #define MODULE_ALIAS_BLOCKDEV(major,minor) \
+       MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
index e21fcf4..73f4555 100644 (file)
@@ -1,55 +1,3 @@
-Index: linux-2.6.12-rc6/fs/filesystems.c
-===================================================================
---- linux-2.6.12-rc6.orig/fs/filesystems.c     2005-06-06 17:22:29.000000000 +0200
-+++ linux-2.6.12-rc6/fs/filesystems.c  2005-06-14 15:53:58.298522852 +0200
-@@ -28,7 +28,9 @@
-  */
- static struct file_system_type *file_systems;
--static DEFINE_RWLOCK(file_systems_lock);
-+DEFINE_RWLOCK(file_systems_lock);
-+
-+EXPORT_SYMBOL(file_systems_lock);
- /* WARNING: This can be used only if we _already_ own a reference */
- void get_filesystem(struct file_system_type *fs)
-Index: linux-2.6.12-rc6/include/linux/fs.h
-===================================================================
---- linux-2.6.12-rc6.orig/include/linux/fs.h   2005-06-14 15:53:18.356140529 +0200
-+++ linux-2.6.12-rc6/include/linux/fs.h        2005-06-14 15:53:58.309265039 +0200
-@@ -1563,6 +1563,7 @@
- extern struct file_operations generic_ro_fops;
-+extern rwlock_t file_systems_lock;
- #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
- extern int vfs_readlink(struct dentry *, char __user *, int, const char *);
-Index: linux-2.6.12-rc6/fs/namespace.c
-===================================================================
---- linux-2.6.12-rc6.orig/fs/namespace.c       2005-06-14 15:53:17.868835847 +0200
-+++ linux-2.6.12-rc6/fs/namespace.c    2005-06-14 15:53:58.361022851 +0200
-@@ -1240,6 +1240,7 @@
-               mntput(old_pwdmnt);
-       }
- }
-+EXPORT_SYMBOL(set_fs_pwd);
- static void chroot_fs_refs(struct nameidata *old_nd, struct nameidata *new_nd)
- {
-Index: linux-2.6.12.5/kernel/exit.c
-===================================================================
---- linux-2.6.12.5.orig/kernel/exit.c  2005-08-17 17:51:28.000000000 +0200
-+++ linux-2.6.12.5/kernel/exit.c       2005-08-17 17:51:44.000000000 +0200
-@@ -250,6 +250,8 @@
-       switch_uid(INIT_USER);
- }
-+EXPORT_SYMBOL(reparent_to_init);
-+
- void __set_special_pids(pid_t session, pid_t pgrp)
- {
-       struct task_struct *curr = current;
 Index: linux-2.6.12-rc6/fs/dcache.c
 ===================================================================
 --- linux-2.6.12-rc6.orig/fs/dcache.c  2005-06-14 15:53:19.812195198 +0200
index dc85e99..2e2325f 100644 (file)
@@ -9,11 +9,9 @@ sd_iostats-2.6-rhel5.patch
 export_symbol_numa-2.6-fc5.patch 
 blkdev_tunables-2.6-sles10.patch
 jbd-stats-2.6-sles10.patch
-i_filter_data.patch
 quota-fix-oops-in-invalidate_dquots.patch
 jbd-journal-chksum-2.6-sles10.patch
 proc-sleep-2.6.16-sles10.patch 
 export-nr_free_buffer_pages.patch 
-fmode-exec-2.6-sles10.patch
 quota-large-limits-sles10.patch
 md-mmp-unplug-dev-sles10.patch
index 2462a07..d1f4c18 100644 (file)
@@ -66,7 +66,7 @@ int filter_log_sz_change(struct llog_handle *cathandle,
         ENTRY;
 
         LOCK_INODE_MUTEX(inode);
-        ofd = inode->i_filterdata;
+        ofd = INODE_PRIVATE_DATA(inode);
 
         if (ofd && ofd->ofd_epoch >= ioepoch) {
                 if (ofd->ofd_epoch > ioepoch)
@@ -83,7 +83,7 @@ int filter_log_sz_change(struct llog_handle *cathandle,
                 if (!ofd)
                         GOTO(out, rc = -ENOMEM);
                 igrab(inode);
-                inode->i_filterdata = ofd;
+                INODE_PRIVATE_DATA(inode) = ofd;
                 ofd->ofd_epoch = ioepoch;
         }
         /* the decision to write a record is now made, unlock */