Whamcloud - gitweb
Branch b1_8
authoryangsheng <yangsheng>
Fri, 13 Feb 2009 13:30:28 +0000 (13:30 +0000)
committeryangsheng <yangsheng>
Fri, 13 Feb 2009 13:30:28 +0000 (13:30 +0000)
b=18462

i=adilger, johann

Remove linux/fs.h changes from kernel patch.

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/mds/mds_internal.h
lustre/mds/mds_open.c
lustre/obdfilter/filter_log.c

index dbdcefb..a588f35 100644 (file)
@@ -590,14 +590,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])
-],[
-])
-])
-
 #
 # check for FS_RENAME_DOES_D_MOVE flag
 #
@@ -898,6 +890,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],
@@ -1565,7 +1574,6 @@ AC_DEFUN([LC_PROG_LINUX],
           LC_STRUCT_INTENT_FILE
           LC_POSIX_ACL_XATTR_H
           LC_EXPORT___IGET
-          LC_FUNC_SET_FS_PWD
           LC_FUNC_MS_FLOCK_LOCK
           LC_FUNC_HAVE_CAN_SLEEP_ARG
           LC_FUNC_F_OP_FLOCK
@@ -1596,6 +1604,7 @@ AC_DEFUN([LC_PROG_LINUX],
           LC_VFS_KERN_MOUNT
           LC_INVALIDATEPAGE_RETURN_INT
           LC_UMOUNTBEGIN_HAS_VFSMOUNT
+          LC_INODE_IPRIVATE
           LC_EXPORT_FILEMAP_FDATAWRITE_RANGE
           if test x$enable_server = xyes ; then
                 LC_EXPORT_INVALIDATE_MAPPING_PAGES
index 89ab6a4..e6a8bed 100644 (file)
@@ -56,8 +56,6 @@ struct ll_iattr_struct {
 #define ll_iattr_struct iattr
 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14) */
 
-#ifndef HAVE_SET_FS_PWD
-
 #ifdef HAVE_FS_STRUCT_USE_PATH
 static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
                 struct dentry *dentry)
@@ -76,9 +74,7 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
        if (old_pwd.dentry)
                path_put(&old_pwd);
 }
-
 #else
-
 static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
                 struct dentry *dentry)
 {
@@ -97,10 +93,7 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
                 mntput(old_pwdmnt);
         }
 }
-#endif
-#else
-#define ll_set_fs_pwd set_fs_pwd
-#endif /* HAVE_SET_FS_PWD */
+#endif /* HAVE_FS_STRUCT_USE_PATH */
 
 #ifdef HAVE_INODE_I_MUTEX
 #define UNLOCK_INODE_MUTEX(inode) do {mutex_unlock(&(inode)->i_mutex); } while(0)
@@ -559,5 +552,11 @@ static inline long labs(long x)
 #define SLAB_DESTROY_BY_RCU 0
 #endif
 
+#ifdef HAVE_INODE_IPRIVATE
+#define INODE_PRIVATE_DATA(inode)       ((inode)->i_private)
+#else
+#define INODE_PRIVATE_DATA(inode)       ((inode)->u.generic_ip)
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* _COMPAT25_H */
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 f59d0ed..ae293be 100644 (file)
@@ -9,8 +9,6 @@ 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
-fmode-exec-2.6-sles10.patch
 quota-large-limits-sles10.patch
 md-mmp-unplug-dev-sles10.patch
index 4df631e..3ce767c 100644 (file)
@@ -52,7 +52,9 @@ struct mds_filter_data {
         __u64 io_epoch;
 };
 
-#define MDS_FILTERDATA(inode) ((struct mds_filter_data *)(inode)->i_filterdata)
+#define MDS_FILTERDATA(inode) \
+                ((struct mds_filter_data *)INODE_PRIVATE_DATA(inode))
+
 
 static inline struct mds_obd *mds_req2mds(struct ptlrpc_request *req)
 {
index 2440f98..d5b0cc5 100644 (file)
@@ -138,9 +138,9 @@ void mds_mfd_unlink(struct mds_file_data *mfd, int decref)
 /* Caller must hold mds->mds_epoch_sem */
 static int mds_alloc_filterdata(struct inode *inode)
 {
-        LASSERT(inode->i_filterdata == NULL);
-        OBD_ALLOC(inode->i_filterdata, sizeof(struct mds_filter_data));
-        if (inode->i_filterdata == NULL)
+        LASSERT(INODE_PRIVATE_DATA(inode) == NULL);
+        OBD_ALLOC(INODE_PRIVATE_DATA(inode), sizeof(struct mds_filter_data));
+        if (INODE_PRIVATE_DATA(inode) == NULL)
                 return -ENOMEM;
         LASSERT(igrab(inode) == inode);
         return 0;
@@ -149,9 +149,9 @@ static int mds_alloc_filterdata(struct inode *inode)
 /* Caller must hold mds->mds_epoch_sem */
 static void mds_free_filterdata(struct inode *inode)
 {
-        LASSERT(inode->i_filterdata != NULL);
-        OBD_FREE(inode->i_filterdata, sizeof(struct mds_filter_data));
-        inode->i_filterdata = NULL;
+        LASSERT(INODE_PRIVATE_DATA(inode) != NULL);
+        OBD_FREE(INODE_PRIVATE_DATA(inode), sizeof(struct mds_filter_data));
+        INODE_PRIVATE_DATA(inode) = NULL;
         iput(inode);
 }
 
@@ -186,9 +186,9 @@ static int mds_get_write_access(struct mds_obd *mds, struct inode *inode,
                 goto out;
         }
 
-        if (inode->i_filterdata == NULL)
+        if (MDS_FILTERDATA(inode) == NULL)
                 mds_alloc_filterdata(inode);
-        if (inode->i_filterdata == NULL) {
+        if (MDS_FILTERDATA(inode) == NULL) {
                 rc = -ENOMEM;
                 goto out;
         }
index 261852c..29c2a54 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 >= io_epoch) {
                 if (ofd->ofd_epoch > io_epoch)
@@ -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 = io_epoch;
         }
         /* the decision to write a record is now made, unlock */