Whamcloud - gitweb
Branch b1_8
authoryangsheng <yangsheng>
Wed, 30 Sep 2009 15:37:40 +0000 (15:37 +0000)
committeryangsheng <yangsheng>
Wed, 30 Sep 2009 15:37:40 +0000 (15:37 +0000)
b=17153

i=adilger, johann

Fixed the build failed for rhel4/sles9 with -Werror.

lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h
lustre/include/lustre/lustre_user.h
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/utils/obd.c

index f65eefd..6e66130 100644 (file)
@@ -1182,6 +1182,26 @@ AC_DEFUN([LC_REGISTER_SHRINKER],
         AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
                   [kernel exports register_shrinker])
 ],[
+        AC_MSG_CHECKING([if kernel using gfp_t for shrinker second paramter])
+        tmp_flags="$EXTRA_KCFLAGS"
+        EXTRA_KCFLAGS="-Werror"
+        LB_LINUX_TRY_COMPILE([
+                #include <linux/mm.h>
+        ],[
+                struct shrinker *scb(int nts, gfp_t mask) {
+                        return 0;
+                }
+                shrinter_t fp = scb;
+        ],[
+                AC_MSG_RESULT([yes])
+                AC_DEFINE(SHRINKER_MASK_T, gfp_t, 
+                        [kernel using gfp_t for shrinker callback])
+        ],[
+                AC_MSG_RESULT([no])
+                AC_DEFINE(SHRINKER_MASK_T, unsigned int,
+                        [kernel using unsigned for shrinker callback])
+        ])
+        EXTRA_KCFLAGS="$tmp_flags"
 ])
 ])
 
index 724c7cc..7311cf3 100644 (file)
@@ -253,6 +253,8 @@ static inline int cleanup_group_info(void)
 #if !defined(HAVE_D_REHASH_COND) && defined(HAVE___D_REHASH)
 #define d_rehash_cond(dentry, lock) __d_rehash(dentry, lock)
 extern void __d_rehash(struct dentry *dentry, int lock);
+#else
+extern void d_rehash_cond(struct dentry*, int lock);
 #endif
 
 #if !defined(HAVE_D_MOVE_LOCKED) && defined(HAVE___D_MOVE)
@@ -484,6 +486,9 @@ int ll_unregister_blkdev(unsigned int dev, const char *name)
 #endif
 
 #ifdef HAVE_REGISTER_SHRINKER
+
+#define SHRINKER_MASK_T gfp_t
+
 typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask);
 
 static inline
index 3bb1e64..b50a5f4 100644 (file)
@@ -290,7 +290,7 @@ typedef struct lu_fid lustre_fid;
 
 /* scanf input parse format -- strip '[' first.
    e.g. sscanf(fidstr, SFID, RFID(&fid)); */
-#define SFID "0x%llx:0x%x:0x%x"
+#define SFID "0x%"LPF64"x:0x%x:0x%x"
 #define RFID(fid)     \
         &((fid)->f_seq), \
         &((fid)->f_oid), \
index bab694a..77f1de7 100644 (file)
@@ -814,7 +814,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, gfp_t gfp_mask);
+int ll_shrink_cache(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);
index 926aff7..b58b1df 100644 (file)
@@ -1299,7 +1299,7 @@ void ll_put_super(struct super_block *sb)
         EXIT;
 } /* client_put_super */
 
-int ll_shrink_cache(int nr_to_scan, gfp_t gfp_mask)
+int ll_shrink_cache(int nr_to_scan, SHRINKER_MASK_T gfp_mask)
 {
         struct ll_sb_info *sbi;
         int count = 0;
index b400074..96783ca 100644 (file)
@@ -3196,7 +3196,7 @@ int jt_get_obj_version(int argc, char **argv)
         }
 
         obd_ioctl_unpack(&data, buf, sizeof rawbuf);
-        printf("0x%llx\n", version);
+        printf(LPX64"\n", version);
         return 0;
 }