Whamcloud - gitweb
LU-11712 osd-ldiskfs: Wrap blk integrity with config check
[fs/lustre-release.git] / lustre / include / lustre_compat.h
index 66a5bb7..f55f6e5 100644 (file)
@@ -148,6 +148,14 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
 #define SLAB_DESTROY_BY_RCU 0
 #endif
 
+#ifndef HAVE_INIT_LIST_HEAD_RCU
+static inline void INIT_LIST_HEAD_RCU(struct list_head *list)
+{
+       WRITE_ONCE(list->next, list);
+       WRITE_ONCE(list->prev, list);
+}
+#endif
+
 #ifndef HAVE_DQUOT_SUSPEND
 # define ll_vfs_dq_init             vfs_dq_init
 # define ll_vfs_dq_drop             vfs_dq_drop
@@ -386,11 +394,6 @@ static inline int radix_tree_exceptional_entry(void *arg)
 static inline void truncate_inode_pages_final(struct address_space *map)
 {
        truncate_inode_pages(map, 0);
-               /* Workaround for LU-118 */
-       if (map->nrpages) {
-               spin_lock_irq(&map->tree_lock);
-               spin_unlock_irq(&map->tree_lock);
-       }       /* Workaround end */
 }
 #endif
 
@@ -739,6 +742,7 @@ static inline unsigned int bip_size(struct bio_integrity_payload *bip)
 #endif
 }
 
+#ifdef HAVE_BLK_INTEGRITY_ENABLED
 #ifndef INTEGRITY_FLAG_READ
 #define INTEGRITY_FLAG_READ BLK_INTEGRITY_VERIFY
 #endif
@@ -774,5 +778,17 @@ static inline bool bdev_integrity_enabled(struct block_device *bdev, int rw)
 
        return false;
 }
+#else
+static inline bool bdev_integrity_enabled(struct block_device *bdev, int rw)
+{
+       return false;
+}
+#endif /* HAVE_BLK_INTEGRITY_ENABLED */
+
+#ifdef HAVE_PAGEVEC_INIT_ONE_PARAM
+#define ll_pagevec_init(pvec, n) pagevec_init(pvec)
+#else
+#define ll_pagevec_init(pvec, n) pagevec_init(pvec, n)
+#endif
 
 #endif /* _LUSTRE_COMPAT_H */