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
/* 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)
#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
#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>
#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
-#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))
#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()
/*
#include <linux/version.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
#include <asm/statfs.h>
-#endif
#include <linux/fs.h>
#include <linux/dcache.h>
LPROC_LL_SETATTR,
LPROC_LL_TRUNC,
LPROC_LL_FLOCK,
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
LPROC_LL_GETATTR,
-#else
- LPROC_LL_REVALIDATE,
-#endif
LPROC_LL_STAFS,
LPROC_LL_ALLOC_INODE,
LPROC_LL_SETXATTR,
#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
-#endif
/* 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
-#endif
#endif
# 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
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;
-#else
- struct group_info group_info;
-#endif
#ifdef OBD_CTXT_DEBUG
__u32 magic;
#endif
#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>
-#endif
#include <linux/sched.h>
#include <lvfs.h>
};
#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) \
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 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 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_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)