#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
#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)
#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
#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 */