Whamcloud - gitweb
Branch HEAD
authoryangsheng <yangsheng>
Fri, 2 Nov 2007 10:20:24 +0000 (10:20 +0000)
committeryangsheng <yangsheng>
Fri, 2 Nov 2007 10:20:24 +0000 (10:20 +0000)
b=13568
i=adilger
i=green

Remove 2.4 kernel code from include files.

12 files changed:
lustre/ChangeLog
lustre/include/liblustre.h
lustre/include/linux/lprocfs_status.h
lustre/include/linux/lustre_compat25.h
lustre/include/linux/lustre_lite.h
lustre/include/linux/lustre_net.h
lustre/include/linux/lustre_user.h
lustre/include/linux/lvfs.h
lustre/include/linux/lvfs_linux.h
lustre/include/linux/obd_class.h
lustre/include/lustre_disk.h
lustre/include/lustre_quota.h

index afca675..2be7146 100644 (file)
@@ -40,6 +40,12 @@ Details    : Remove 2.5.0 check from quota_check.c, quota_ctl.c,
             Remove 2.4 kernel check from lustre/lov/lproc_lov.c.
             Remove 2.4 kernel check from lustre/lmv/lproc_lmv.c.
             Remove lock_24kernel from lustre/lvfs/fsfilt_ext3.c.
             Remove 2.4 kernel check from lustre/lov/lproc_lov.c.
             Remove 2.4 kernel check from lustre/lmv/lproc_lmv.c.
             Remove lock_24kernel from lustre/lvfs/fsfilt_ext3.c.
+            Remove 2.4 kernel code from include/liblustre.h,
+            include/lustre_disk.h, include/lustre_quota.h,
+            include/linux/lprocfs_status.h, include/linux/lvfs.h,
+            include/linux/lustre_lite.h, include/linux/lustre_net.h,
+            include/linux/lustre_user.h, include/linux/lvfs_linux.h,
+            include/linux/obd_class.h, include/linux/lustre_compat25.h.
 
 Severity   : enhancement
 Bugzilla   : 13690
 
 Severity   : enhancement
 Bugzilla   : 13690
index d84ed39..c809c7c 100644 (file)
@@ -105,7 +105,7 @@ typedef unsigned short umode_t;
 
 /* always adopt 2.5 definitions */
 #define KERNEL_VERSION(a,b,c) ((a)*100+(b)*10+c)
 
 /* always adopt 2.5 definitions */
 #define KERNEL_VERSION(a,b,c) ((a)*100+(b)*10+c)
-#define LINUX_VERSION_CODE KERNEL_VERSION(2,5,0)
+#define LINUX_VERSION_CODE KERNEL_VERSION(2,6,5)
 
 #ifndef page_private
 #define page_private(page) ((page)->private)
 
 #ifndef page_private
 #define page_private(page) ((page)->private)
index 85574fa..1c50c8c 100644 (file)
 #include <linux/smp.h>
 #include <linux/rwsem.h>
 #include <libcfs/kp30.h>
 #include <linux/smp.h>
 #include <linux/rwsem.h>
 #include <libcfs/kp30.h>
-
-# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-#  include <linux/statfs.h>
-# else 
-#  define kstatfs statfs
-# endif
+#include <linux/statfs.h>
 
 #else 
 #  define kstatfs statfs
 
 #else 
 #  define kstatfs statfs
index cd61080..e294e3f 100644 (file)
@@ -25,8 +25,8 @@
 
 #ifdef __KERNEL__
 
 
 #ifdef __KERNEL__
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) && LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)
-#error sorry, lustre requires at least 2.5.69
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5)
+#error Sorry, Lustre requires at Linux kernel version 2.6.5 or later
 #endif
 
 #include <libcfs/linux/portals_compat25.h>
 #endif
 
 #include <libcfs/linux/portals_compat25.h>
@@ -94,30 +94,9 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
 #define LOCK_DQONOFF_MUTEX(dqopt) do {down(&(dqopt)->dqonoff_sem); } while(0)
 #endif /* HAVE_DQUOTOFF_MUTEX */
 
 #define LOCK_DQONOFF_MUTEX(dqopt) do {down(&(dqopt)->dqonoff_sem); } while(0)
 #endif /* HAVE_DQUOTOFF_MUTEX */
 
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4)
-#define NGROUPS_SMALL           NGROUPS
-#define NGROUPS_PER_BLOCK       ((int)(EXEC_PAGESIZE / sizeof(gid_t)))
-
-struct group_info {
-        int        ngroups;
-        atomic_t   usage;
-        gid_t      small_block[NGROUPS_SMALL];
-        int        nblocks;
-        gid_t     *blocks[0];
-};
-#define current_ngroups current->ngroups
-#define current_groups current->groups
-
-struct group_info *groups_alloc(int gidsetsize);
-void groups_free(struct group_info *ginfo);
-#else /* >= 2.6.4 */
-
 #define current_ngroups current->group_info->ngroups
 #define current_groups current->group_info->small_block
 
 #define current_ngroups current->group_info->ngroups
 #define current_groups current->group_info->small_block
 
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4) */
-
 #ifndef page_private
 #define page_private(page) ((page)->private)
 #define set_page_private(page, v) ((page)->private = (v))
 #ifndef page_private
 #define page_private(page) ((page)->private)
 #define set_page_private(page, v) ((page)->private = (v))
@@ -130,8 +109,6 @@ void groups_free(struct group_info *ginfo);
 #define lock_dentry(___dentry)          spin_lock(&(___dentry)->d_lock)
 #define unlock_dentry(___dentry)        spin_unlock(&(___dentry)->d_lock)
 
 #define lock_dentry(___dentry)          spin_lock(&(___dentry)->d_lock)
 #define unlock_dentry(___dentry)        spin_unlock(&(___dentry)->d_lock)
 
-#define lock_24kernel()         do {} while (0)
-#define unlock_24kernel()       do {} while (0)
 #define ll_kernel_locked()      kernel_locked()
 
 /*
 #define ll_kernel_locked()      kernel_locked()
 
 /*
index 41c670e..20dea87 100644 (file)
@@ -13,9 +13,7 @@
 
 #include <linux/version.h>
 
 
 #include <linux/version.h>
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
 #include <asm/statfs.h>
 #include <asm/statfs.h>
-#endif
 
 #include <linux/fs.h>
 #include <linux/dcache.h>
 
 #include <linux/fs.h>
 #include <linux/dcache.h>
@@ -50,12 +48,7 @@ enum {
          LPROC_LL_SETATTR,
          LPROC_LL_TRUNC,
          LPROC_LL_FLOCK,
          LPROC_LL_SETATTR,
          LPROC_LL_TRUNC,
          LPROC_LL_FLOCK,
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
          LPROC_LL_GETATTR,
          LPROC_LL_GETATTR,
-#else
-         LPROC_LL_REVALIDATE,
-#endif
          LPROC_LL_STAFS,
          LPROC_LL_ALLOC_INODE,
          LPROC_LL_SETXATTR,
          LPROC_LL_STAFS,
          LPROC_LL_ALLOC_INODE,
          LPROC_LL_SETXATTR,
index 1d2f17e..b0b9bf6 100644 (file)
 
 #ifdef __KERNEL__
 #include <linux/version.h>
 
 #ifdef __KERNEL__
 #include <linux/version.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-#include <linux/tqueue.h>
-#else
 #include <linux/workqueue.h>
 #endif
 #include <linux/workqueue.h>
 #endif
-#endif
 
 /* XXX Liang: should be moved to other header instead of here */
 
 /* XXX Liang: should be moved to other header instead of here */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
 #ifndef WITH_GROUP_INFO
 #define WITH_GROUP_INFO
 #endif
 #ifndef WITH_GROUP_INFO
 #define WITH_GROUP_INFO
 #endif
-#endif
 
 #endif
 
 #endif
index 4778993..bc67a18 100644 (file)
@@ -23,9 +23,6 @@
 # endif
 #else
 # include <linux/version.h>
 # endif
 #else
 # include <linux/version.h>
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,21)
-#  define NEED_QUOTA_DEFS
-# endif
 # ifdef HAVE_QUOTA_SUPPORT
 #  include <linux/quota.h>
 # endif
 # ifdef HAVE_QUOTA_SUPPORT
 #  include <linux/quota.h>
 # endif
index 51d549a..7c2f6ae 100644 (file)
@@ -64,11 +64,7 @@ struct lvfs_run_ctxt {
         struct lvfs_ucred        luc;
         int                      ngroups;
         struct lvfs_callback_ops cb_ops;
         struct lvfs_ucred        luc;
         int                      ngroups;
         struct lvfs_callback_ops cb_ops;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
         struct group_info       *group_info;
         struct group_info       *group_info;
-#else
-        struct group_info        group_info;
-#endif
 #ifdef OBD_CTXT_DEBUG
         __u32                    magic;
 #endif
 #ifdef OBD_CTXT_DEBUG
         __u32                    magic;
 #endif
index 6df9c36..be7ab2a 100644 (file)
@@ -7,9 +7,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/fs.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
 #include <linux/namei.h>
 #include <linux/namei.h>
-#endif
 #include <linux/sched.h>
 
 #include <lvfs.h>
 #include <linux/sched.h>
 
 #include <lvfs.h>
@@ -44,20 +42,13 @@ struct lvfs_dentry_params
 };
 #define LVFS_DENTRY_PARAMS_INIT         { .ldp_magic = LVFS_DENTRY_PARAM_MAGIC }
 
 };
 #define LVFS_DENTRY_PARAMS_INIT         { .ldp_magic = LVFS_DENTRY_PARAM_MAGIC }
 
-# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-#  define BDEVNAME_DECLARE_STORAGE(foo) char foo[BDEVNAME_SIZE]
-#  define ll_bdevname(SB, STORAGE) __bdevname(kdev_t_to_nr(SB->s_dev), STORAGE)
-#  define lvfs_sbdev(SB)       ((SB)->s_bdev)
-#  define lvfs_sbdev_type      struct block_device *
-   int fsync_bdev(struct block_device *);
-#  define lvfs_sbdev_sync      fsync_bdev
-# else
-#  define BDEVNAME_DECLARE_STORAGE(foo) char __unused_##foo
-#  define ll_bdevname(SB,STORAGE) ((void)__unused_##STORAGE,bdevname(lvfs_sbdev(SB)))
-#  define lvfs_sbdev(SB)       (kdev_t_to_nr((SB)->s_dev))
-#  define lvfs_sbdev_type      kdev_t
-#  define lvfs_sbdev_sync      fsync_dev
-# endif
+#define BDEVNAME_DECLARE_STORAGE(foo) char foo[BDEVNAME_SIZE]
+#define ll_bdevname(SB, STORAGE) __bdevname(kdev_t_to_nr(SB->s_dev), STORAGE)
+#define lvfs_sbdev(SB)       ((SB)->s_bdev)
+#define lvfs_sbdev_type      struct block_device *
+#define lvfs_sbdev_sync      fsync_bdev
+
+int fsync_bdev(struct block_device *);
 
 /* Instead of calling within lvfs (a layering violation) */
 #define lvfs_set_rdonly(obd, sb) \
 
 /* Instead of calling within lvfs (a layering violation) */
 #define lvfs_set_rdonly(obd, sb) \
index d210f91..550d5b5 100644 (file)
@@ -51,7 +51,7 @@ void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid);
 void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid);
 #endif
 
 void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid);
 #endif
 
-#if !defined(__KERNEL__) || (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if !defined(__KERNEL__)
 #define to_kdev_t(dev) dev
 #define kdev_t_to_nr(dev) dev
 #endif
 #define to_kdev_t(dev) dev
 #define kdev_t_to_nr(dev) dev
 #endif
index 2c93c3b..2460aa7 100644 (file)
@@ -241,13 +241,8 @@ struct lustre_sb_info {
 #define LSI_UMOUNT_FORCE                 0x00000010
 #define LSI_UMOUNT_FAILOVER              0x00000020
 
 #define LSI_UMOUNT_FORCE                 0x00000010
 #define LSI_UMOUNT_FAILOVER              0x00000020
 
-#if  (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-# define    s2lsi(sb)        ((struct lustre_sb_info *)((sb)->s_fs_info))
-# define    s2lsi_nocast(sb) ((sb)->s_fs_info)
-#else  /* 2.4 here */
-# define    s2lsi(sb)        ((struct lustre_sb_info *)((sb)->u.generic_sbp))
-# define    s2lsi_nocast(sb) ((sb)->u.generic_sbp)
-#endif
+#define     s2lsi(sb)        ((struct lustre_sb_info *)((sb)->s_fs_info))
+#define     s2lsi_nocast(sb) ((sb)->s_fs_info)
 
 #define     get_profile_name(sb)   (s2lsi(sb)->lsi_lmd->lmd_profile)
 
 
 #define     get_profile_name(sb)   (s2lsi(sb)->lsi_lmd->lmd_profile)
 
index d52f661..e448600 100644 (file)
@@ -79,7 +79,6 @@ struct dquot_id {
 #define QFILE_WR_DQUOT          6
 
 /* admin quotafile operations */
 #define QFILE_WR_DQUOT          6
 
 /* admin quotafile operations */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 int lustre_check_quota_file(struct lustre_quota_info *lqi, int type);
 int lustre_read_quota_info(struct lustre_quota_info *lqi, int type);
 int lustre_write_quota_info(struct lustre_quota_info *lqi, int type);
 int lustre_check_quota_file(struct lustre_quota_info *lqi, int type);
 int lustre_read_quota_info(struct lustre_quota_info *lqi, int type);
 int lustre_write_quota_info(struct lustre_quota_info *lqi, int type);
@@ -88,41 +87,6 @@ int lustre_commit_dquot(struct lustre_dquot *dquot);
 int lustre_init_quota_info(struct lustre_quota_info *lqi, int type);
 int lustre_get_qids(struct file *file, struct inode *inode, int type, 
                     struct list_head *list);
 int lustre_init_quota_info(struct lustre_quota_info *lqi, int type);
 int lustre_get_qids(struct file *file, struct inode *inode, int type, 
                     struct list_head *list);
-#else
-
-#ifndef DQ_FAKE_B
-#define DQ_FAKE_B       6
-#endif
-
-static inline int lustre_check_quota_file(struct lustre_quota_info *lqi,
-                                          int type)
-{
-        return 0;
-}
-static inline int lustre_read_quota_info(struct lustre_quota_info *lqi,
-                                         int type)
-{
-        return 0;
-}
-static inline int lustre_write_quota_info(struct lustre_quota_info *lqi,
-                                          int type)
-{
-        return 0;
-}
-static inline int lustre_read_dquot(struct lustre_dquot *dquot)
-{
-        return 0;
-}
-static inline int lustre_commit_dquot(struct lustre_dquot *dquot)
-{
-        return 0;
-}
-static inline int lustre_init_quota_info(struct lustre_quota_info *lqi,
-                                         int type)
-{
-        return 0;
-}
-#endif  /* KERNEL_VERSION(2,5,0) */
 
 #define LL_DQUOT_OFF(sb)    DQUOT_OFF(sb)
 
 
 #define LL_DQUOT_OFF(sb)    DQUOT_OFF(sb)