diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index c8e1264..0e5dcca 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1781,6 +1781,22 @@ LB_LINUX_TRY_COMPILE([ ]) ]) +AC_DEFUN([LC_BACKING_DEV_INFO_HAS_WB_CNT], +[AC_MSG_CHECKING([if backing_dev_info has a wb_cnt field]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + struct backing_dev_info bdi; + bdi.wb_cnt = 0; +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BACKING_DEV_INFO_WB_CNT, 1, + [backing_dev_info has a wb_cnt field]) +],[ + AC_MSG_RESULT(no) +]) +]) + # LC_WALK_SPACE_HAS_DATA_SEM # # 2.6.33 ext4_ext_walk_space() takes i_data_sem internally. @@ -1832,6 +1848,39 @@ LB_LINUX_TRY_COMPILE([ ]) ]) +# 2.6.32 removes blk_queue_max_sectors +AC_DEFUN([LC_BLK_QUEUE_MAX_SECTORS], +[AC_MSG_CHECKING([if blk_queue_max_sectors is defined]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + blk_queue_max_sectors(NULL, 0); +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BLK_QUEUE_MAX_SECTORS, 1, + [blk_queue_max_sectors is defined]) +],[ + AC_MSG_RESULT(no) +]) +]) + +# 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments +AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS], +[AC_MSG_CHECKING([if blk_queue_max_segments is defined]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + blk_queue_max_segments(NULL, 0); +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1, + [blk_queue_max_segments is defined]) +],[ + AC_MSG_RESULT(no) +]) +]) + + # # LC_PROG_LINUX # @@ -1990,6 +2039,7 @@ AC_DEFUN([LC_PROG_LINUX], # 2.6.32 LC_NEW_BACKING_DEV_INFO + LC_BACKING_DEV_INFO_HAS_WB_CNT if test x$enable_server = xyes ; then LC_WALK_SPACE_HAS_DATA_SEM fi @@ -2000,6 +2050,10 @@ AC_DEFUN([LC_PROG_LINUX], if test x$enable_server = xyes ; then LC_QUOTA64 # must after LC_HAVE_QUOTAIO_V1_H fi + + # 2.6.32 rhel6 + LC_BLK_QUEUE_MAX_SECTORS + LC_BLK_QUEUE_MAX_SEGMENTS ]) # diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 554bef8..5cbb6c8 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -492,7 +492,7 @@ int ll_unregister_blkdev(unsigned int dev, const char *name) #define SHRINKER_MASK_T gfp_t -typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask); +typedef int (*shrinker_t)(struct shrinker *, int nr_to_scan, gfp_t gfp_mask); static inline struct shrinker *set_shrinker(int seek, shrinker_t func) @@ -661,6 +661,18 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount) #define blk_queue_logical_block_size(q, sz) blk_queue_hardsect_size(q, sz) #endif +#ifdef HAVE_BLK_QUEUE_MAX_SECTORS /* removed in 2.6.32 rhel6 */ +#define blk_queue_max_hw_sectors(q, sect) blk_queue_max_sectors(q, sect) +#endif + +/* +#ifndef HAVE_BLK_QUEUE_MAX_SEGMENTS +#define blk_queue_max_segments(q, seg) \ + blk_queue_max_phys_segments(q, seg); \ + blk_queue_max_hw_segments(q, seg) +#endif +*/ + #ifdef HAVE_DQUOT_INIT #define ll_vfs_dq_init DQUOT_INIT #define ll_vfs_dq_drop DQUOT_DROP diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c index 40ab6e1..9222094 100644 --- a/lustre/ldlm/ldlm_pool.c +++ b/lustre/ldlm/ldlm_pool.c @@ -1128,12 +1128,12 @@ static int ldlm_pools_shrink(ldlm_side_t client, int nr, return cached; } -static int ldlm_pools_srv_shrink(int nr, unsigned int gfp_mask) +static int ldlm_pools_srv_shrink(struct shrinker * DUMMY, int nr, unsigned int gfp_mask) { return ldlm_pools_shrink(LDLM_NAMESPACE_SERVER, nr, gfp_mask); } -static int ldlm_pools_cli_shrink(int nr, unsigned int gfp_mask) +static int ldlm_pools_cli_shrink(struct shrinker * DUMMY, int nr, unsigned int gfp_mask) { return ldlm_pools_shrink(LDLM_NAMESPACE_CLIENT, nr, gfp_mask); } diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 70ab767..d7102db 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -822,7 +822,7 @@ void ll_lli_init(struct ll_inode_info *lli); int ll_fill_super(struct super_block *sb); void ll_put_super(struct super_block *sb); void ll_kill_super(struct super_block *sb); -int ll_shrink_cache(int nr_to_scan, SHRINKER_MASK_T gfp_mask); +int ll_shrink_cache(struct shrinker * DUMMY, int nr_to_scan, SHRINKER_MASK_T gfp_mask); struct inode *ll_inode_from_lock(struct ldlm_lock *lock); void ll_clear_inode(struct inode *inode); int ll_setattr_raw(struct inode *inode, struct iattr *attr); diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index a0bd6ad..d24d1f3 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1206,13 +1206,13 @@ void ll_put_super(struct super_block *sb) if (profilenm) class_del_profile(profilenm); -#ifdef HAVE_NEW_BACKING_DEV_INFO +#ifdef HAVE_BACKING_DEV_INFO_WB_CNT if (lsi->bdi.wb_cnt > 0) { #endif #ifdef HAVE_BDI_INIT bdi_destroy(&lsi->bdi); #endif -#ifdef HAVE_NEW_BACKING_DEV_INFO +#ifdef HAVE_BACKING_DEV_INFO_WB_CNT } #endif @@ -1228,7 +1228,7 @@ void ll_put_super(struct super_block *sb) EXIT; } /* client_put_super */ -int ll_shrink_cache(int nr_to_scan, SHRINKER_MASK_T gfp_mask) +int ll_shrink_cache(struct shrinker *DUMMY,int nr_to_scan, SHRINKER_MASK_T gfp_mask) { struct ll_sb_info *sbi; int count = 0; diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c index 71547df..c65e57f 100644 --- a/lustre/llite/lloop.c +++ b/lustre/llite/lloop.c @@ -505,10 +505,10 @@ static int loop_set_fd(struct lloop_device *lo, struct file *unused, */ blk_queue_logical_block_size(lo->lo_queue, min_t(unsigned, CFS_PAGE_SIZE, 16384)); - blk_queue_max_sectors(lo->lo_queue, - LLOOP_MAX_SEGMENTS << (CFS_PAGE_SHIFT - 9)); - blk_queue_max_phys_segments(lo->lo_queue, LLOOP_MAX_SEGMENTS); - blk_queue_max_hw_segments(lo->lo_queue, LLOOP_MAX_SEGMENTS); + + blk_queue_max_hw_sectors(lo->lo_queue, + LLOOP_MAX_SEGMENTS << (CFS_PAGE_SHIFT - 9)); + blk_queue_max_segments(lo->lo_queue, LLOOP_MAX_SEGMENTS); set_capacity(disks[lo->lo_number], size); bd_set_size(bdev, size << 9);