From 8a820379c7c1aa73e08c7277c2618b21191e50f9 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Thu, 8 Jan 2009 05:55:35 +0000 Subject: [PATCH] Branch b1_6 b=17968 i=yangsheng, deen Fixed various compiler warnings on ppc/ppc64 sles9. Author: Jim Garlick(LLNL) --- lustre/autoconf/lustre-core.m4 | 33 +++++++++++++++++++++++++++++++ lustre/include/obd_support.h | 2 +- lustre/llite/rw.c | 2 +- lustre/llite/rw26.c | 4 ++++ lustre/lvfs/fsfilt_ext3.c | 2 +- lustre/mdc/mdc_locks.c | 2 +- lustre/obdfilter/filter_lvb.c | 4 ++-- lustre/quota/quota_context.c | 2 +- lustre/quota/quota_internal.h | 5 +++-- lustre/utils/ll_recover_lost_found_objs.c | 2 +- lustre/utils/llog_reader.c | 2 +- lustre/utils/llverfs.c | 4 ++-- 12 files changed, 51 insertions(+), 13 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index a05fd1a..1ed8833 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -910,6 +910,38 @@ LB_LINUX_TRY_COMPILE([ ]) ]) +# +# LC_RELEASEPAGE_ARG_GFP_T +# more 2.6 api changes. Second argument type for newer kernels is +# gfp_t and for older 2.6 kernels is int. +# +AC_DEFUN([LC_RELEASEPAGE_ARG_GFP_T], +[AC_MSG_CHECKING([releasepage has gfp_t as argument]) +tmp_flags="$EXTRA_KCFLAGS" +EXTRA_KCFLAGS="-Werror" +LB_LINUX_TRY_COMPILE([ + #include + + static int my_releasepage(struct page *pg, gfp_t gfp_mask) + { + return 0; + } + + struct address_space_operations my_aops = { + .releasepage = my_releasepage, + }; +],[ + my_aops.releasepage(NULL, 0); +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_RELEASEPAGE_ARG_GFP_T, 1, + [Define if releasepage argument should be gfp_t]) +],[ + AC_MSG_RESULT(no) +]) +EXTRA_KCFLAGS="$tmp_flags" +]) + # LC_UMOUNTBEGIN_HAS_VFSMOUNT # more 2.6 API changes. 2.6.18 umount_begin has different parameters AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT], @@ -1349,6 +1381,7 @@ AC_DEFUN([LC_PROG_LINUX], LC_STATFS_DENTRY_PARAM LC_VFS_KERN_MOUNT LC_INVALIDATEPAGE_RETURN_INT + LC_RELEASEPAGE_ARG_GFP_T LC_UMOUNTBEGIN_HAS_VFSMOUNT #2.6.18 + RHEL5 (fc6) diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index 3362d31..739af13 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -568,7 +568,7 @@ do { \ #ifdef HAVE_RCU # ifdef HAVE_CALL_RCU_PARAM -# define my_call_rcu(rcu, cb) call_rcu(rcu, cb, rcu) +# define my_call_rcu(rcu, cb) call_rcu(rcu, (void (*) (void *))(cb), rcu) # else # define my_call_rcu(rcu, cb) call_rcu(rcu, cb) # endif diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 7d10cc7..9bedeba 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -2046,7 +2046,7 @@ static int ll_file_oig_pages(struct inode * inode, struct page **pages, LL_CDEBUG_PAGE(D_PAGE, pages[i], "offset "LPU64"," " from %u, bytes = %u\n", - pos, from, bytes); + (__u64)pos, from, bytes); LASSERTF(pos >> CFS_PAGE_SHIFT == pages[i]->index, "wrong page index %lu (%lu)\n", pages[i]->index, diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c index aab56fb..d957754 100644 --- a/lustre/llite/rw26.c +++ b/lustre/llite/rw26.c @@ -98,7 +98,11 @@ static void ll_invalidatepage(struct page *page, unsigned long offset) } #endif +#ifdef HAVE_RELEASEPAGE_ARG_GFP_T static int ll_releasepage(struct page *page, gfp_t gfp_mask) +#else +static int ll_releasepage(struct page *page, int gfp_mask) +#endif { if (PagePrivate(page)) ll_removepage(page); diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index dbdd51d..e4124f1 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -1293,7 +1293,7 @@ out: static int fsfilt_ext3_setup(struct super_block *sb) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,6)) && defined(HAVE_QUOTA_SUPPORT) +#if !defined(S_PDIROPS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,6)) && defined(HAVE_QUOTA_SUPPORT) struct ext3_sb_info *sbi = EXT3_SB(sb); #endif #if 0 diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index 50c719e..24f0d9e 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -266,7 +266,7 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp, if (rc & (rc - 1)) size[DLM_INTENT_REC_OFF + 2] = min(size[DLM_INTENT_REC_OFF + 2] + round_up(rc) - rc, - obddev->u.cli.cl_max_mds_easize); + (__u32)obddev->u.cli.cl_max_mds_easize); /* If inode is known, cancel conflicting OPEN locks. */ if (data->fid2.id) { diff --git a/lustre/obdfilter/filter_lvb.c b/lustre/obdfilter/filter_lvb.c index 3e77239..eb965a4 100644 --- a/lustre/obdfilter/filter_lvb.c +++ b/lustre/obdfilter/filter_lvb.c @@ -223,8 +223,8 @@ static int filter_lvbo_update(struct ldlm_resource *res, struct ptlrpc_request * } if (lvb->lvb_blocks != dentry->d_inode->i_blocks) { CDEBUG(D_DLMTRACE,"res: "LPU64" updating lvb blocks from disk: " - LPU64" -> %lu\n", res->lr_name.name[0], - lvb->lvb_blocks, dentry->d_inode->i_blocks); + LPU64" -> "LPU64"\n", res->lr_name.name[0], + lvb->lvb_blocks, (__u64)dentry->d_inode->i_blocks); lvb->lvb_blocks = dentry->d_inode->i_blocks; } diff --git a/lustre/quota/quota_context.c b/lustre/quota/quota_context.c index daff303..a7bb435 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -345,7 +345,7 @@ check_cur_qunit(struct obd_device *obd, ", pending_write: "LPU64", record: "LPD64 ", qunit_sz: %lu, tune_sz: %lu, ret: %d.\n", QDATA_IS_BLK(qdata) ? 'b' : 'i', limit, usage, pending_write, - record, qunit_sz, tune_sz, ret); + (__s64)record, qunit_sz, tune_sz, ret); LASSERT(ret == 0 || qdata->qd_count); spin_unlock(&lqs->lqs_lock); diff --git a/lustre/quota/quota_internal.h b/lustre/quota/quota_internal.h index c1c4baa..b4a7acc 100644 --- a/lustre/quota/quota_internal.h +++ b/lustre/quota/quota_internal.h @@ -93,8 +93,9 @@ LQS_IS_GRP(lqs) ? 'g' : 'u', \ lqs->lqs_bunit_sz, lqs->lqs_btune_sz, lqs->lqs_iunit_sz, \ lqs->lqs_itune_sz, lqs->lqs_bwrite_pending, \ - lqs->lqs_iwrite_pending, lqs->lqs_ino_rec, \ - lqs->lqs_blk_rec, atomic_read(&lqs->lqs_refcount), ## arg); + lqs->lqs_iwrite_pending, (__s64)lqs->lqs_ino_rec, \ + (__s64)lqs->lqs_blk_rec, atomic_read(&lqs->lqs_refcount), \ + ## arg); /* quota_context.c */ diff --git a/lustre/utils/ll_recover_lost_found_objs.c b/lustre/utils/ll_recover_lost_found_objs.c index 449cfae5..85f1e1d 100644 --- a/lustre/utils/ll_recover_lost_found_objs.c +++ b/lustre/utils/ll_recover_lost_found_objs.c @@ -401,7 +401,7 @@ int main(int argc, char **argv) struct stat stat_buf; char tmp_path[PATH_MAX]; char mount_path[PATH_MAX] = {0}; - char c; + int c; int retval; progname = argv[0]; diff --git a/lustre/utils/llog_reader.c b/lustre/utils/llog_reader.c index b071aa1..99fcb3d 100644 --- a/lustre/utils/llog_reader.c +++ b/lustre/utils/llog_reader.c @@ -238,7 +238,7 @@ static void print_1_cfg(struct lustre_cfg *lcfg) if (lcfg->lcfg_nid) printf("nid=%s("LPX64") ", libcfs_nid2str(lcfg->lcfg_nid), - lcfg->lcfg_nid); + (__u64)lcfg->lcfg_nid); if (lcfg->lcfg_nal) printf("nal=%d ", lcfg->lcfg_nal); for (i = 0; i < lcfg->lcfg_bufcount; i++) diff --git a/lustre/utils/llverfs.c b/lustre/utils/llverfs.c index 613d1b8..4863d86 100644 --- a/lustre/utils/llverfs.c +++ b/lustre/utils/llverfs.c @@ -498,10 +498,10 @@ int main(int argc, char **argv) FILE *countfile = NULL; char filecount[PATH_MAX]; unsigned long dir_num = 0, dir_num_orig = 0;/* starting directory */ - char c; + int c; progname = strrchr(argv[0], '/') ? strrchr(argv[0], '/') + 1 : argv[0]; - while ((c = (char)getopt_long(argc, argv, "t:rwvplo:h", + while ((c = getopt_long(argc, argv, "t:rwvplo:h", longopts, NULL)) != -1) { switch (c) { case 'c': -- 1.8.3.1