Whamcloud - gitweb
LU-6741 osp: Pack small request inline
[fs/lustre-release.git] / lustre / include / lustre_compat.h
index 0c0dc91..c038aa1 100644 (file)
@@ -123,13 +123,9 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
 #ifdef HAVE_INODE_DIO_WAIT
 /* inode_dio_wait(i) use as-is for write lock */
 # define inode_dio_write_done(i)       do {} while (0) /* for write unlock */
-# define inode_dio_read(i)             atomic_inc(&(i)->i_dio_count)
-/* inode_dio_done(i) use as-is for read unlock */
 #else
 # define inode_dio_wait(i)             down_write(&(i)->i_alloc_sem)
 # define inode_dio_write_done(i)       up_write(&(i)->i_alloc_sem)
-# define inode_dio_read(i)             down_read(&(i)->i_alloc_sem)
-# define inode_dio_done(i)             up_read(&(i)->i_alloc_sem)
 #endif
 
 #ifndef FS_HAS_FIEMAP
@@ -188,6 +184,7 @@ unsigned int ll_crypto_tfm_alg_min_keysize(struct crypto_blkcipher *tfm)
 #ifdef HAVE_BVEC_ITER
 #define bio_idx(bio)                   (bio->bi_iter.bi_idx)
 #define bio_set_sector(bio, sector)    (bio->bi_iter.bi_sector = sector)
+#define bvl_to_page(bvl)               (bvl.bv_page)
 #else
 #define bio_idx(bio)                   (bio->bi_idx)
 #define bio_set_sector(bio, sector)    (bio->bi_sector = sector)
@@ -195,7 +192,7 @@ unsigned int ll_crypto_tfm_alg_min_keysize(struct crypto_blkcipher *tfm)
 #ifndef HAVE_BIO_END_SECTOR
 #define bio_end_sector(bio)            (bio->bi_sector + bio_sectors(bio))
 #endif
-#define bvec_iter_page(bvec, iter)     (*bvec->bv_page)
+#define bvl_to_page(bvl)               (bvl->bv_page)
 #endif
 
 #ifndef HAVE_BLK_QUEUE_MAX_SEGMENTS
@@ -391,4 +388,20 @@ static inline void truncate_inode_pages_final(struct address_space *map)
 #define SIZE_MAX       (~(size_t)0)
 #endif
 
+#ifdef HAVE_SECURITY_IINITSEC_CALLBACK
+# define ll_security_inode_init_security(inode, dir, name, value, len, \
+                                        initxattrs, dentry)           \
+        security_inode_init_security(inode, dir, &((dentry)->d_name), \
+                                     initxattrs, dentry)
+#elif defined HAVE_SECURITY_IINITSEC_QSTR
+# define ll_security_inode_init_security(inode, dir, name, value, len, \
+                                        initxattrs, dentry)           \
+        security_inode_init_security(inode, dir, &((dentry)->d_name), \
+                                     name, value, len)
+#else /* !HAVE_SECURITY_IINITSEC_CALLBACK && !HAVE_SECURITY_IINITSEC_QSTR */
+# define ll_security_inode_init_security(inode, dir, name, value, len, \
+                                        initxattrs, dentry)           \
+        security_inode_init_security(inode, dir, name, value, len)
+#endif
+
 #endif /* _LUSTRE_COMPAT_H */