vm_fault_address, [
#include <linux/mm.h>
],[
- unsigned long vaddr = ((struct vm_fault *)0)->address;
- (void)vaddr;
+ struct vm_fault vmf = { 0 };
+ unsigned long addr = (unsigned long)vmf.address;
+ (void)addr;
],[
AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
[virtual_address has been replaced by address field])
]) # LC_FSCRYPT_IS_NOKEY_NAME
#
+# LC_BIO_SET_DEV
+#
+# Linux: v5.11-rc5-9-g309dca309fc3
+# block: store a block_device pointer in struct bio
+# created bio_set_dev macro
+# Linux: v5.15-rc6-127-gcf6d6238cdd3
+# block: turn macro helpers into inline functions
+# created inline function(s).
+#
+# Only provide a bio_set_dev it is is not proveded by the kernel
+#
+AC_DEFUN([LC_BIO_SET_DEV], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+ LB_CHECK_COMPILE([if 'bio_set_dev' is available],
+ [bio_set_dev], [
+ #include <linux/bio.h>
+ ],[
+ struct bio *bio = NULL;
+ struct block_device *bdev = NULL;
+
+ bio_set_dev(bio, bdev);
+ ],[
+ AC_DEFINE(HAVE_BIO_SET_DEV, 1, ['bio_set_dev' is available])
+ ])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_BIO_SET_DEV
+
+#
# LC_HAVE_USER_NAMESPACE_ARG
#
# kernel 5.12 commit 549c7297717c32ee53f156cd949e055e601f67bb
# 5.7
LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
+ # 5.9
+ LC_HAVE_ITER_FILE_SPLICE_WRITE
+
# 5.10
LC_FSCRYPT_IS_NOKEY_NAME
- # 5.10
- LC_HAVE_ITER_FILE_SPLICE_WRITE
+ # 5.11
+ LC_BIO_SET_DEV
# 5.12
LC_HAVE_USER_NAMESPACE_ARG
# define bio_get_dev(bio) ((bio)->bi_bdev)
# define bio_get_disk(bio) (bio_get_dev(bio)->bd_disk)
# define bio_get_queue(bio) bdev_get_queue(bio_get_dev(bio))
-# define bio_set_dev(bio, bdev) (bio_get_dev(bio) = (bdev))
+
+# ifndef HAVE_BIO_SET_DEV
+# define bio_set_dev(bio, bdev) (bio_get_dev(bio) = (bdev))
+# endif
#else
# define bio_get_disk(bio) ((bio)->bi_disk)
# define bio_get_queue(bio) (bio_get_disk(bio)->queue)
}
}
+/*
+ * Linux v5.12-rc1-20-ga8affc03a9b3
+ * block: rename BIO_MAX_PAGES to BIO_MAX_VECS
+ */
+#ifndef BIO_MAX_VECS
+#define BIO_MAX_VECS BIO_MAX_PAGES
+#endif
+
static int osd_do_bio(struct osd_device *osd, struct inode *inode,
struct osd_iobuf *iobuf, sector_t start_blocks,
sector_t count)
bio_start_page_idx = page_idx;
/* allocate new bio */
- bio = bio_alloc(GFP_NOIO, min(BIO_MAX_PAGES,
+ bio = bio_alloc(GFP_NOIO, min_t(unsigned short,
+ BIO_MAX_VECS,
(block_idx_end - block_idx +
blocks_left_page - 1)));
if (bio == NULL) {