From 9496591a7f31e8766ee1124725fbab3841d8baef Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Wed, 21 Nov 2012 11:42:00 -0500 Subject: [PATCH] Revert "LU-1756 kernel: cleanup lustre_compat25.h" This is causing build failures on SLES11SP2 This reverts commit 472fe13982952c9ccad969a996c054f9cf643847. --- lustre/include/liblustre.h | 2 +- lustre/include/linux/lustre_compat25.h | 28 +++++++++++++++++++++++----- lustre/llite/dir.c | 6 +++--- lustre/llite/llite_lib.c | 24 ++++++++++++------------ 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index 93432b6..bf34f04 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -420,7 +420,7 @@ typedef struct file_lock { /* quota */ #define QUOTA_OK 0 -#define NO_QUOTA (-EDQUOT) +#define NO_QUOTA 1 /* ACL */ typedef struct { diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 2921bfb..f872a1e 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -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 -#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 */ @@ -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 +#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 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) -#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; \ @@ -648,6 +659,13 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount) #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 diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 7317ee0..80fe011 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -224,9 +224,9 @@ static int ll_dir_filler(void *_hash, struct page *page0) 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) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index ac30c7f..c8bba12 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -987,14 +987,14 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) 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; @@ -1103,10 +1103,10 @@ void ll_put_super(struct super_block *sb) 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; -- 1.8.3.1