Whamcloud - gitweb
Revert "LU-1756 kernel: cleanup lustre_compat25.h"
authorOleg Drokin <green@whamcloud.com>
Wed, 21 Nov 2012 16:42:00 +0000 (11:42 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 21 Nov 2012 16:42:00 +0000 (11:42 -0500)
This is causing build failures on SLES11SP2

This reverts commit 472fe13982952c9ccad969a996c054f9cf643847.

lustre/include/liblustre.h
lustre/include/linux/lustre_compat25.h
lustre/llite/dir.c
lustre/llite/llite_lib.c

index 93432b6..bf34f04 100644 (file)
@@ -420,7 +420,7 @@ typedef struct file_lock {
 
 /* quota */
 #define QUOTA_OK 0
 
 /* quota */
 #define QUOTA_OK 0
-#define NO_QUOTA (-EDQUOT)
+#define NO_QUOTA 1
 
 /* ACL */
 typedef struct {
 
 /* ACL */
 typedef struct {
index 2921bfb..f872a1e 100644 (file)
@@ -587,9 +587,18 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount)
 # define ll_vfs_dq_off(sb, remount) vfs_dq_off(sb, remount)
 #endif
 
 # define ll_vfs_dq_off(sb, remount) vfs_dq_off(sb, remount)
 #endif
 
-#ifndef HAVE_BDI_INIT
-#define bdi_init(bdi)    0
-#define bdi_destroy(bdi) do { } while (0)
+#ifdef HAVE_BDI_INIT
+#define ll_bdi_init(bdi)    bdi_init(bdi)
+#define ll_bdi_destroy(bdi) bdi_destroy(bdi)
+#else
+#define ll_bdi_init(bdi)    0
+#define ll_bdi_destroy(bdi) do { } while(0)
+#endif
+
+#ifdef HAVE_NEW_BACKING_DEV_INFO
+# define ll_bdi_wb_cnt(bdi) ((bdi).wb_cnt)
+#else
+# define ll_bdi_wb_cnt(bdi) 1
 #endif
 
 #ifdef HAVE_BLK_QUEUE_MAX_SECTORS /* removed in rhel6 */
 #endif
 
 #ifdef HAVE_BLK_QUEUE_MAX_SECTORS /* removed in rhel6 */
@@ -626,13 +635,15 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount)
 #endif
 
 #ifdef HAVE_ADD_TO_PAGE_CACHE_LRU
 #endif
 
 #ifdef HAVE_ADD_TO_PAGE_CACHE_LRU
+#define ll_add_to_page_cache_lru(pg, mapping, off, gfp) \
+        add_to_page_cache_lru(pg, mapping, off, gfp)
 #define ll_pagevec_init(pv, cold)       do {} while (0)
 #define ll_pagevec_add(pv, pg)          (0)
 #define ll_pagevec_lru_add_file(pv)     do {} while (0)
 #else
 #define ll_pagevec_init(pv, cold)       do {} while (0)
 #define ll_pagevec_add(pv, pg)          (0)
 #define ll_pagevec_lru_add_file(pv)     do {} while (0)
 #else
-#define add_to_page_cache_lru(pg, mapping, off, gfp) \
+#define ll_add_to_page_cache_lru(pg, mapping, off, gfp) \
         add_to_page_cache(pg, mapping, off, gfp)
         add_to_page_cache(pg, mapping, off, gfp)
-#define ll_pagevec_init(pv, cold)       pagevec_init(pv, cold);
+#define ll_pagevec_init(pv, cold)       pagevec_init(&lru_pvec, cold);
 #define ll_pagevec_add(pv, pg)                                 \
 ({                                                             \
        int __ret;                                              \
 #define ll_pagevec_add(pv, pg)                                 \
 ({                                                             \
        int __ret;                                              \
@@ -648,6 +659,13 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount)
 #define HAVE_NODE_TO_CPUMASK
 #endif
 
 #define HAVE_NODE_TO_CPUMASK
 #endif
 
+#ifndef QUOTA_OK
+# define QUOTA_OK 0
+#endif
+#ifndef NO_QUOTA
+# define NO_QUOTA (-EDQUOT)
+#endif
+
 #if !defined(_ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_) && !defined(ext2_set_bit)
 # define ext2_set_bit             __test_and_set_bit_le
 # define ext2_clear_bit           __test_and_clear_bit_le
 #if !defined(_ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_) && !defined(ext2_set_bit)
 # define ext2_set_bit             __test_and_set_bit_le
 # define ext2_clear_bit           __test_and_clear_bit_le
index 7317ee0..80fe011 100644 (file)
@@ -224,9 +224,9 @@ static int ll_dir_filler(void *_hash, struct page *page0)
 
                 offset = hash_x_index(hash, hash64);
 
 
                 offset = hash_x_index(hash, hash64);
 
-               prefetchw(&page->flags);
-               ret = add_to_page_cache_lru(page, inode->i_mapping, offset,
-                                           GFP_KERNEL);
+                prefetchw(&page->flags);
+                ret = ll_add_to_page_cache_lru(page, inode->i_mapping, offset,
+                                               GFP_KERNEL);
                 if (ret == 0) {
                         unlock_page(page);
                         if (ll_pagevec_add(&lru_pvec, page) == 0)
                 if (ret == 0) {
                         unlock_page(page);
                         if (ll_pagevec_add(&lru_pvec, page) == 0)
index ac30c7f..c8bba12 100644 (file)
@@ -987,14 +987,14 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
         if (err)
                 GOTO(out_free, err);
 
         if (err)
                 GOTO(out_free, err);
 
-       err = bdi_init(&lsi->lsi_bdi);
-       if (err)
-               GOTO(out_free, err);
-       lsi->lsi_flags |= LSI_BDI_INITIALIZED;
-       lsi->lsi_bdi.capabilities = BDI_CAP_MAP_COPY;
-       err = ll_bdi_register(&lsi->lsi_bdi);
-       if (err)
-               GOTO(out_free, err);
+        err = ll_bdi_init(&lsi->lsi_bdi);
+        if (err)
+                GOTO(out_free, err);
+        lsi->lsi_flags |= LSI_BDI_INITIALIZED;
+        lsi->lsi_bdi.capabilities = BDI_CAP_MAP_COPY;
+        err = ll_bdi_register(&lsi->lsi_bdi);
+        if (err)
+                GOTO(out_free, err);
 
 #ifdef HAVE_SB_BDI
         sb->s_bdi = &lsi->lsi_bdi;
 
 #ifdef HAVE_SB_BDI
         sb->s_bdi = &lsi->lsi_bdi;
@@ -1103,10 +1103,10 @@ void ll_put_super(struct super_block *sb)
         if (profilenm)
                 class_del_profile(profilenm);
 
         if (profilenm)
                 class_del_profile(profilenm);
 
-       if (lsi->lsi_flags & LSI_BDI_INITIALIZED) {
-               bdi_destroy(&lsi->lsi_bdi);
-               lsi->lsi_flags &= ~LSI_BDI_INITIALIZED;
-       }
+        if (lsi->lsi_flags & LSI_BDI_INITIALIZED) {
+                ll_bdi_destroy(&lsi->lsi_bdi);
+                lsi->lsi_flags &= ~LSI_BDI_INITIALIZED;
+        }
 
         ll_free_sbi(sb);
         lsi->lsi_llsbi = NULL;
 
         ll_free_sbi(sb);
         lsi->lsi_llsbi = NULL;