diff --git a/config/kernel-acl.m4 b/config/kernel-acl.m4 index be08c3c60724..3ae5dc6b6dbc 100644 --- a/config/kernel-acl.m4 +++ b/config/kernel-acl.m4 @@ -1,395 +1,395 @@ dnl # dnl # Check if posix_acl_release can be used from a ZFS_META_LICENSED dnl # module. The is_owner_or_cap macro was replaced by dnl # inode_owner_or_capable dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_RELEASE], [ ZFS_LINUX_TEST_SRC([posix_acl_release], [ #include #include #include ], [ struct posix_acl *tmp = posix_acl_alloc(1, 0); posix_acl_release(tmp); ], [], [ZFS_META_LICENSE]) ]) AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [ AC_MSG_CHECKING([whether posix_acl_release() is available]) ZFS_LINUX_TEST_RESULT([posix_acl_release], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_POSIX_ACL_RELEASE, 1, [posix_acl_release() is available]) AC_MSG_CHECKING([whether posix_acl_release() is GPL-only]) ZFS_LINUX_TEST_RESULT([posix_acl_release_license], [ AC_MSG_RESULT(no) ],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_POSIX_ACL_RELEASE_GPL_ONLY, 1, [posix_acl_release() is GPL-only]) ]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 3.14 API change, dnl # set_cached_acl() and forget_cached_acl() changed from inline to dnl # EXPORT_SYMBOL. In the former case, they may not be usable because of dnl # posix_acl_release. In the latter case, we can always use them. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE], [ ZFS_LINUX_TEST_SRC([set_cached_acl], [ #include #include #include ], [ struct inode *ip = NULL; struct posix_acl *acl = posix_acl_alloc(1, 0); set_cached_acl(ip, ACL_TYPE_ACCESS, acl); forget_cached_acl(ip, ACL_TYPE_ACCESS); ], [], [ZFS_META_LICENSE]) ]) AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [ AC_MSG_CHECKING([whether set_cached_acl() is usable]) ZFS_LINUX_TEST_RESULT([set_cached_acl_license], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SET_CACHED_ACL_USABLE, 1, [set_cached_acl() is usable]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 3.1 API change, dnl # posix_acl_chmod() was added as the preferred interface. dnl # dnl # 3.14 API change, dnl # posix_acl_chmod() was changed to __posix_acl_chmod() dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD], [ ZFS_LINUX_TEST_SRC([posix_acl_chmod], [ #include #include ],[ posix_acl_chmod(NULL, 0, 0) ]) ZFS_LINUX_TEST_SRC([__posix_acl_chmod], [ #include #include ],[ __posix_acl_chmod(NULL, 0, 0) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [ AC_MSG_CHECKING([whether __posix_acl_chmod exists]) ZFS_LINUX_TEST_RESULT([__posix_acl_chmod], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE___POSIX_ACL_CHMOD, 1, [__posix_acl_chmod() exists]) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING([whether posix_acl_chmod exists]) ZFS_LINUX_TEST_RESULT([posix_acl_chmod], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1, [posix_acl_chmod() exists]) ],[ ZFS_LINUX_TEST_ERROR([posix_acl_chmod()]) ]) ]) ]) dnl # dnl # 3.1 API change, dnl # posix_acl_equiv_mode now wants an umode_t instead of a mode_t dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [ ZFS_LINUX_TEST_SRC([posix_acl_equiv_mode], [ #include #include ],[ umode_t tmp; posix_acl_equiv_mode(NULL, &tmp); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [ AC_MSG_CHECKING([whether posix_acl_equiv_mode() wants umode_t]) ZFS_LINUX_TEST_RESULT([posix_acl_equiv_mode], [ AC_MSG_RESULT(yes) ],[ ZFS_LINUX_TEST_ERROR([posix_acl_equiv_mode()]) ]) ]) dnl # dnl # 4.8 API change, dnl # The function posix_acl_valid now must be passed a namespace. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS], [ ZFS_LINUX_TEST_SRC([posix_acl_valid_with_ns], [ #include #include ],[ struct user_namespace *user_ns = NULL; const struct posix_acl *acl = NULL; int error; error = posix_acl_valid(user_ns, acl); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS], [ AC_MSG_CHECKING([whether posix_acl_valid() wants user namespace]) ZFS_LINUX_TEST_RESULT([posix_acl_valid_with_ns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_POSIX_ACL_VALID_WITH_NS, 1, [posix_acl_valid() wants user namespace]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 3.1 API change, dnl # Check if inode_operations contains the function get_acl dnl # dnl # 5.15 API change, dnl # Added the bool rcu argument to get_acl for rcu path walk. dnl # dnl # 6.2 API change, dnl # get_acl() was renamed to get_inode_acl() dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [ ZFS_LINUX_TEST_SRC([inode_operations_get_acl], [ #include - struct posix_acl *get_acl_fn(struct inode *inode, int type) + static struct posix_acl *get_acl_fn(struct inode *inode, int type) { return NULL; } static const struct inode_operations iops __attribute__ ((unused)) = { .get_acl = get_acl_fn, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_get_acl_rcu], [ #include - struct posix_acl *get_acl_fn(struct inode *inode, int type, + static struct posix_acl *get_acl_fn(struct inode *inode, int type, bool rcu) { return NULL; } static const struct inode_operations iops __attribute__ ((unused)) = { .get_acl = get_acl_fn, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_get_inode_acl], [ #include - struct posix_acl *get_inode_acl_fn(struct inode *inode, int type, + static struct posix_acl *get_inode_acl_fn(struct inode *inode, int type, bool rcu) { return NULL; } static const struct inode_operations iops __attribute__ ((unused)) = { .get_inode_acl = get_inode_acl_fn, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [ AC_MSG_CHECKING([whether iops->get_acl() exists]) ZFS_LINUX_TEST_RESULT([inode_operations_get_acl], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GET_ACL, 1, [iops->get_acl() exists]) ],[ ZFS_LINUX_TEST_RESULT([inode_operations_get_acl_rcu], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GET_ACL_RCU, 1, [iops->get_acl() takes rcu]) ],[ ZFS_LINUX_TEST_RESULT([inode_operations_get_inode_acl], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GET_INODE_ACL, 1, [has iops->get_inode_acl()]) ],[ ZFS_LINUX_TEST_ERROR([iops->get_acl() or iops->get_inode_acl()]) ]) ]) ]) ]) dnl # dnl # 3.14 API change, dnl # Check if inode_operations contains the function set_acl dnl # dnl # 5.12 API change, dnl # set_acl() added a user_namespace* parameter first dnl # dnl # 6.2 API change, dnl # set_acl() second paramter changed to a struct dentry * dnl # dnl # 6.3 API change, dnl # set_acl() first parameter changed to struct mnt_idmap * dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [ ZFS_LINUX_TEST_SRC([inode_operations_set_acl_mnt_idmap_dentry], [ #include - int set_acl_fn(struct mnt_idmap *idmap, + static int set_acl_fn(struct mnt_idmap *idmap, struct dentry *dent, struct posix_acl *acl, int type) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .set_acl = set_acl_fn, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns_dentry], [ #include - int set_acl_fn(struct user_namespace *userns, + static int set_acl_fn(struct user_namespace *userns, struct dentry *dent, struct posix_acl *acl, int type) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .set_acl = set_acl_fn, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns], [ #include - int set_acl_fn(struct user_namespace *userns, + static int set_acl_fn(struct user_namespace *userns, struct inode *inode, struct posix_acl *acl, int type) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .set_acl = set_acl_fn, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_set_acl], [ #include - int set_acl_fn(struct inode *inode, struct posix_acl *acl, + static int set_acl_fn(struct inode *inode, struct posix_acl *acl, int type) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .set_acl = set_acl_fn, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [ AC_MSG_CHECKING([whether iops->set_acl() exists]) ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists]) AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args]) ],[ ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_mnt_idmap_dentry], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists]) AC_DEFINE(HAVE_SET_ACL_IDMAP_DENTRY, 1, [iops->set_acl() takes 4 args, arg1 is struct mnt_idmap *]) ],[ ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns_dentry], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists]) AC_DEFINE(HAVE_SET_ACL_USERNS_DENTRY_ARG2, 1, [iops->set_acl() takes 4 args, arg2 is struct dentry *]) ],[ ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists, takes 3 args]) ],[ ZFS_LINUX_REQUIRE_API([i_op->set_acl()], [3.14]) ]) ]) ]) ]) ]) dnl # dnl # 4.7 API change, dnl # The kernel get_acl will now check cache before calling i_op->get_acl and dnl # do set_cached_acl after that, so i_op->get_acl don't need to do that dnl # anymore. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE], [ ZFS_LINUX_TEST_SRC([get_acl_handle_cache], [ #include ],[ void *sentinel __attribute__ ((unused)) = uncached_acl_sentinel(NULL); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE], [ AC_MSG_CHECKING([whether uncached_acl_sentinel() exists]) ZFS_LINUX_TEST_RESULT([get_acl_handle_cache], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_KERNEL_GET_ACL_HANDLE_CACHE, 1, [uncached_acl_sentinel() exists]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 4.16 kernel: check if struct posix_acl acl.a_refcount is a refcount_t. dnl # It's an atomic_t on older kernels. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT], [ ZFS_LINUX_TEST_SRC([acl_refcount], [ #include #include #include ],[ struct posix_acl acl; refcount_t *r __attribute__ ((unused)) = &acl.a_refcount; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_ACL_HAS_REFCOUNT], [ AC_MSG_CHECKING([whether posix_acl has refcount_t]) ZFS_LINUX_TEST_RESULT([acl_refcount], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_ACL_REFCOUNT, 1, [posix_acl has refcount_t]) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [ ZFS_AC_KERNEL_SRC_POSIX_ACL_RELEASE ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT ]) AC_DEFUN([ZFS_AC_KERNEL_ACL], [ ZFS_AC_KERNEL_POSIX_ACL_RELEASE ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE ZFS_AC_KERNEL_POSIX_ACL_CHMOD ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE ZFS_AC_KERNEL_ACL_HAS_REFCOUNT ]) diff --git a/config/kernel-automount.m4 b/config/kernel-automount.m4 index f7bb63c68154..52f1931b748e 100644 --- a/config/kernel-automount.m4 +++ b/config/kernel-automount.m4 @@ -1,25 +1,25 @@ dnl # dnl # 2.6.37 API change dnl # The dops->d_automount() dentry operation was added as a clean dnl # solution to handling automounts. Prior to this cifs/nfs clients dnl # which required automount support would abuse the follow_link() dnl # operation on directories for this purpose. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_AUTOMOUNT], [ ZFS_LINUX_TEST_SRC([dentry_operations_d_automount], [ #include - struct vfsmount *d_automount(struct path *p) { return NULL; } + static struct vfsmount *d_automount(struct path *p) { return NULL; } struct dentry_operations dops __attribute__ ((unused)) = { .d_automount = d_automount, }; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_AUTOMOUNT], [ AC_MSG_CHECKING([whether dops->d_automount() exists]) ZFS_LINUX_TEST_RESULT([dentry_operations_d_automount], [ AC_MSG_RESULT(yes) ],[ ZFS_LINUX_TEST_ERROR([dops->d_automount()]) ]) ]) diff --git a/config/kernel-bio.m4 b/config/kernel-bio.m4 index 18620ca5b7e4..b22c1a3de7e1 100644 --- a/config/kernel-bio.m4 +++ b/config/kernel-bio.m4 @@ -1,552 +1,552 @@ dnl # dnl # 2.6.36 API change, dnl # REQ_FAILFAST_{DEV|TRANSPORT|DRIVER} dnl # REQ_DISCARD dnl # REQ_FLUSH dnl # dnl # 4.8 - 4.9 API, dnl # REQ_FLUSH was renamed to REQ_PREFLUSH dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_REQ], [ ZFS_LINUX_TEST_SRC([req_failfast_mask], [ #include ],[ int flags __attribute__ ((unused)); flags = REQ_FAILFAST_MASK; ]) ZFS_LINUX_TEST_SRC([req_discard], [ #include ],[ int flags __attribute__ ((unused)); flags = REQ_DISCARD; ]) ZFS_LINUX_TEST_SRC([req_flush], [ #include ],[ int flags __attribute__ ((unused)); flags = REQ_FLUSH; ]) ZFS_LINUX_TEST_SRC([req_preflush], [ #include ],[ int flags __attribute__ ((unused)); flags = REQ_PREFLUSH; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_FAILFAST_MASK], [ AC_MSG_CHECKING([whether REQ_FAILFAST_MASK is defined]) ZFS_LINUX_TEST_RESULT([req_failfast_mask], [ AC_MSG_RESULT(yes) ],[ ZFS_LINUX_TEST_ERROR([REQ_FAILFAST_MASK]) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_DISCARD], [ AC_MSG_CHECKING([whether REQ_DISCARD is defined]) ZFS_LINUX_TEST_RESULT([req_discard], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_REQ_DISCARD, 1, [REQ_DISCARD is defined]) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_FLUSH], [ AC_MSG_CHECKING([whether REQ_FLUSH is defined]) ZFS_LINUX_TEST_RESULT([req_flush], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_REQ_FLUSH, 1, [REQ_FLUSH is defined]) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_PREFLUSH], [ AC_MSG_CHECKING([whether REQ_PREFLUSH is defined]) ZFS_LINUX_TEST_RESULT([req_preflush], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_REQ_PREFLUSH, 1, [REQ_PREFLUSH is defined]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # Linux 4.8 API, dnl # dnl # The bio_op() helper was introduced as a replacement for explicitly dnl # checking the bio->bi_rw flags. The following checks are used to dnl # detect if a specific operation is supported. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_OPS], [ ZFS_LINUX_TEST_SRC([req_op_discard], [ #include ],[ int op __attribute__ ((unused)) = REQ_OP_DISCARD; ]) ZFS_LINUX_TEST_SRC([req_op_secure_erase], [ #include ],[ int op __attribute__ ((unused)) = REQ_OP_SECURE_ERASE; ]) ZFS_LINUX_TEST_SRC([req_op_flush], [ #include ],[ int op __attribute__ ((unused)) = REQ_OP_FLUSH; ]) ZFS_LINUX_TEST_SRC([bio_bi_opf], [ #include ],[ struct bio bio __attribute__ ((unused)); bio.bi_opf = 0; ]) ZFS_LINUX_TEST_SRC([bio_set_op_attrs], [ #include ],[ struct bio *bio __attribute__ ((unused)) = NULL; bio_set_op_attrs(bio, 0, 0); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_DISCARD], [ AC_MSG_CHECKING([whether REQ_OP_DISCARD is defined]) ZFS_LINUX_TEST_RESULT([req_op_discard], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_REQ_OP_DISCARD, 1, [REQ_OP_DISCARD is defined]) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_SECURE_ERASE], [ AC_MSG_CHECKING([whether REQ_OP_SECURE_ERASE is defined]) ZFS_LINUX_TEST_RESULT([req_op_secure_erase], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_REQ_OP_SECURE_ERASE, 1, [REQ_OP_SECURE_ERASE is defined]) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH], [ AC_MSG_CHECKING([whether REQ_OP_FLUSH is defined]) ZFS_LINUX_TEST_RESULT([req_op_flush], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_REQ_OP_FLUSH, 1, [REQ_OP_FLUSH is defined]) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [ AC_MSG_CHECKING([whether bio->bi_opf is defined]) ZFS_LINUX_TEST_RESULT([bio_bi_opf], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BIO_BI_OPF, 1, [bio->bi_opf is defined]) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_OP_ATTRS], [ AC_MSG_CHECKING([whether bio_set_op_attrs is available]) ZFS_LINUX_TEST_RESULT([bio_set_op_attrs], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BIO_SET_OP_ATTRS, 1, [bio_set_op_attrs is available]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # Linux 4.14 API, dnl # dnl # The bio_set_dev() helper macro was introduced as part of the transition dnl # to have struct gendisk in struct bio. dnl # dnl # Linux 5.0 API, dnl # dnl # The bio_set_dev() helper macro was updated to internally depend on dnl # bio_associate_blkg() symbol which is exported GPL-only. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV], [ ZFS_LINUX_TEST_SRC([bio_set_dev], [ #include #include ],[ struct block_device *bdev = NULL; struct bio *bio = NULL; bio_set_dev(bio, bdev); ], [], [ZFS_META_LICENSE]) ]) dnl # dnl # Linux 5.16 API dnl # dnl # bio_set_dev is no longer a helper macro and is now an inline function, dnl # meaning that the function it calls internally can no longer be overridden dnl # by our code dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV_MACRO], [ ZFS_LINUX_TEST_SRC([bio_set_dev_macro], [ #include #include ],[ #ifndef bio_set_dev #error Not a macro #endif ], [], [ZFS_META_LICENSE]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [ AC_MSG_CHECKING([whether bio_set_dev() is available]) ZFS_LINUX_TEST_RESULT([bio_set_dev], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BIO_SET_DEV, 1, [bio_set_dev() is available]) AC_MSG_CHECKING([whether bio_set_dev() is GPL-only]) ZFS_LINUX_TEST_RESULT([bio_set_dev_license], [ AC_MSG_RESULT(no) ],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1, [bio_set_dev() GPL-only]) ]) AC_MSG_CHECKING([whether bio_set_dev() is a macro]) ZFS_LINUX_TEST_RESULT([bio_set_dev_macro], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BIO_SET_DEV_MACRO, 1, [bio_set_dev() is a macro]) ],[ AC_MSG_RESULT(no) ]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 4.3 API change dnl # Error argument dropped from bio_endio in favor of newly introduced dnl # bio->bi_error. This also replaces bio->bi_flags value BIO_UPTODATE. dnl # Introduced by torvalds/linux@4246a0b63bd8f56a1469b12eafeb875b1041a451 dnl # ("block: add a bi_error field to struct bio"). dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_END_IO_T_ARGS], [ ZFS_LINUX_TEST_SRC([bio_end_io_t_args], [ #include - void wanted_end_io(struct bio *bio) { return; } + static void wanted_end_io(struct bio *bio) { return; } bio_end_io_t *end_io __attribute__ ((unused)) = wanted_end_io; ], []) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [ AC_MSG_CHECKING([whether bio_end_io_t wants 1 arg]) ZFS_LINUX_TEST_RESULT([bio_end_io_t_args], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_1ARG_BIO_END_IO_T, 1, [bio_end_io_t wants 1 arg]) ], [ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 4.13 API change dnl # The bio->bi_error field was replaced with bio->bi_status which is an dnl # enum which describes all possible error types. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BI_STATUS], [ ZFS_LINUX_TEST_SRC([bio_bi_status], [ #include ], [ struct bio bio __attribute__ ((unused)); blk_status_t status __attribute__ ((unused)) = BLK_STS_OK; bio.bi_status = status; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_STATUS], [ AC_MSG_CHECKING([whether bio->bi_status exists]) ZFS_LINUX_TEST_RESULT([bio_bi_status], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BIO_BI_STATUS, 1, [bio->bi_status exists]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 3.14 API change, dnl # Immutable biovecs. A number of fields of struct bio are moved to dnl # struct bvec_iter. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BVEC_ITER], [ ZFS_LINUX_TEST_SRC([bio_bvec_iter], [ #include ],[ struct bio bio; bio.bi_iter.bi_sector = 0; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_BVEC_ITER], [ AC_MSG_CHECKING([whether bio has bi_iter]) ZFS_LINUX_TEST_RESULT([bio_bvec_iter], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BIO_BVEC_ITER, 1, [bio has bi_iter]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 4.8 API change dnl # The rw argument has been removed from submit_bio/submit_bio_wait. dnl # Callers are now expected to set bio->bi_rw instead of passing it in. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SUBMIT_BIO], [ ZFS_LINUX_TEST_SRC([submit_bio], [ #include ],[ struct bio *bio = NULL; (void) submit_bio(bio); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_SUBMIT_BIO], [ AC_MSG_CHECKING([whether submit_bio() wants 1 arg]) ZFS_LINUX_TEST_RESULT([submit_bio], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_1ARG_SUBMIT_BIO, 1, [submit_bio() wants 1 arg]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 2.6.34 API change dnl # current->bio_list dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_CURRENT_BIO_LIST], [ ZFS_LINUX_TEST_SRC([current_bio_list], [ #include ], [ current->bio_list = (struct bio_list *) NULL; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_CURRENT_BIO_LIST], [ AC_MSG_CHECKING([whether current->bio_list exists]) ZFS_LINUX_TEST_RESULT([current_bio_list], [ AC_MSG_RESULT(yes) ],[ ZFS_LINUX_TEST_ERROR([bio_list]) ]) ]) dnl # dnl # Linux 5.5 API, dnl # dnl # The Linux 5.5 kernel updated percpu_ref_tryget() which is inlined by dnl # blkg_tryget() to use rcu_read_lock() instead of rcu_read_lock_sched(). dnl # As a side effect the function was converted to GPL-only. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKG_TRYGET], [ ZFS_LINUX_TEST_SRC([blkg_tryget], [ #include #include #include ],[ struct blkcg_gq blkg __attribute__ ((unused)) = {}; bool rc __attribute__ ((unused)); rc = blkg_tryget(&blkg); ], [], [ZFS_META_LICENSE]) ]) AC_DEFUN([ZFS_AC_KERNEL_BLKG_TRYGET], [ AC_MSG_CHECKING([whether blkg_tryget() is available]) ZFS_LINUX_TEST_RESULT([blkg_tryget], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BLKG_TRYGET, 1, [blkg_tryget() is available]) AC_MSG_CHECKING([whether blkg_tryget() is GPL-only]) ZFS_LINUX_TEST_RESULT([blkg_tryget_license], [ AC_MSG_RESULT(no) ],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BLKG_TRYGET_GPL_ONLY, 1, [blkg_tryget() GPL-only]) ]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # Linux 5.12 API, dnl # dnl # The Linux 5.12 kernel updated struct bio to create a new bi_bdev member dnl # and bio->bi_disk was moved to bio->bi_bdev->bd_disk dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK], [ ZFS_LINUX_TEST_SRC([bio_bdev_disk], [ #include #include ],[ struct bio *b = NULL; struct gendisk *d = b->bi_bdev->bd_disk; blk_register_queue(d); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_BDEV_DISK], [ AC_MSG_CHECKING([whether bio->bi_bdev->bd_disk exists]) ZFS_LINUX_TEST_RESULT([bio_bdev_disk], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BIO_BDEV_DISK, 1, [bio->bi_bdev->bd_disk exists]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # Linux 5.16 API dnl # dnl # The Linux 5.16 API for submit_bio changed the return type to be dnl # void instead of int dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BDEV_SUBMIT_BIO_RETURNS_VOID], [ ZFS_LINUX_TEST_SRC([bio_bdev_submit_bio_void], [ #include ],[ struct block_device_operations *bdev = NULL; __attribute__((unused)) void(*f)(struct bio *) = bdev->submit_bio; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BDEV_SUBMIT_BIO_RETURNS_VOID], [ AC_MSG_CHECKING( [whether block_device_operations->submit_bio() returns void]) ZFS_LINUX_TEST_RESULT([bio_bdev_submit_bio_void], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID, 1, [block_device_operations->submit_bio() returns void]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # Linux 5.16 API dnl # dnl # The Linux 5.16 API moved struct blkcg_gq into linux/blk-cgroup.h, which dnl # has been around since 2015. This test looks for the presence of that dnl # header, so that it can be conditionally included where it exists, but dnl # still be backward compatible with kernels that pre-date its introduction. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_CGROUP_HEADER], [ ZFS_LINUX_TEST_SRC([blk_cgroup_header], [ #include ], []) ]) AC_DEFUN([ZFS_AC_KERNEL_BLK_CGROUP_HEADER], [ AC_MSG_CHECKING([whether linux/blk-cgroup.h exists]) ZFS_LINUX_TEST_RESULT([blk_cgroup_header],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LINUX_BLK_CGROUP_HEADER, 1, [linux/blk-cgroup.h exists]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # Linux 5.18 API dnl # dnl # In 07888c665b405b1cd3577ddebfeb74f4717a84c4 ("block: pass a block_device and opf to bio_alloc") dnl # bio_alloc(gfp_t gfp_mask, unsigned short nr_iovecs) dnl # became dnl # bio_alloc(struct block_device *bdev, unsigned short nr_vecs, unsigned int opf, gfp_t gfp_mask) dnl # however dnl # > NULL/0 can be passed, both for the dnl # > passthrough case on a raw request_queue and to temporarily avoid dnl # > refactoring some nasty code. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_ALLOC_4ARG], [ ZFS_LINUX_TEST_SRC([bio_alloc_4arg], [ #include ],[ gfp_t gfp_mask = 0; unsigned short nr_iovecs = 0; struct block_device *bdev = NULL; unsigned int opf = 0; struct bio *__attribute__((unused)) allocated = bio_alloc(bdev, nr_iovecs, opf, gfp_mask); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_ALLOC_4ARG], [ AC_MSG_CHECKING([whether bio_alloc() wants 4 args]) ZFS_LINUX_TEST_RESULT([bio_alloc_4arg],[ AC_MSG_RESULT(yes) AC_DEFINE([HAVE_BIO_ALLOC_4ARG], 1, [bio_alloc() takes 4 arguments]) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [ ZFS_AC_KERNEL_SRC_REQ ZFS_AC_KERNEL_SRC_BIO_OPS ZFS_AC_KERNEL_SRC_BIO_SET_DEV ZFS_AC_KERNEL_SRC_BIO_END_IO_T_ARGS ZFS_AC_KERNEL_SRC_BIO_BI_STATUS ZFS_AC_KERNEL_SRC_BIO_BVEC_ITER ZFS_AC_KERNEL_SRC_BIO_SUBMIT_BIO ZFS_AC_KERNEL_SRC_BIO_CURRENT_BIO_LIST ZFS_AC_KERNEL_SRC_BLKG_TRYGET ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK ZFS_AC_KERNEL_SRC_BDEV_SUBMIT_BIO_RETURNS_VOID ZFS_AC_KERNEL_SRC_BIO_SET_DEV_MACRO ZFS_AC_KERNEL_SRC_BLK_CGROUP_HEADER ZFS_AC_KERNEL_SRC_BIO_ALLOC_4ARG ]) AC_DEFUN([ZFS_AC_KERNEL_BIO], [ ZFS_AC_KERNEL_BIO_REQ_FAILFAST_MASK ZFS_AC_KERNEL_BIO_REQ_DISCARD ZFS_AC_KERNEL_BIO_REQ_FLUSH ZFS_AC_KERNEL_BIO_REQ_PREFLUSH ZFS_AC_KERNEL_BIO_REQ_OP_DISCARD ZFS_AC_KERNEL_BIO_REQ_OP_SECURE_ERASE ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH ZFS_AC_KERNEL_BIO_BI_OPF ZFS_AC_KERNEL_BIO_SET_OP_ATTRS ZFS_AC_KERNEL_BIO_SET_DEV ZFS_AC_KERNEL_BIO_END_IO_T_ARGS ZFS_AC_KERNEL_BIO_BI_STATUS ZFS_AC_KERNEL_BIO_BVEC_ITER ZFS_AC_KERNEL_BIO_SUBMIT_BIO ZFS_AC_KERNEL_BIO_CURRENT_BIO_LIST ZFS_AC_KERNEL_BLKG_TRYGET ZFS_AC_KERNEL_BIO_BDEV_DISK ZFS_AC_KERNEL_BDEV_SUBMIT_BIO_RETURNS_VOID ZFS_AC_KERNEL_BLK_CGROUP_HEADER ZFS_AC_KERNEL_BIO_ALLOC_4ARG ]) diff --git a/config/kernel-block-device-operations.m4 b/config/kernel-block-device-operations.m4 index d13c1337b1fb..4ff20b9c413d 100644 --- a/config/kernel-block-device-operations.m4 +++ b/config/kernel-block-device-operations.m4 @@ -1,133 +1,133 @@ dnl # dnl # 2.6.38 API change dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [ ZFS_LINUX_TEST_SRC([block_device_operations_check_events], [ #include - unsigned int blk_check_events(struct gendisk *disk, + static unsigned int blk_check_events(struct gendisk *disk, unsigned int clearing) { (void) disk, (void) clearing; return (0); } static const struct block_device_operations bops __attribute__ ((unused)) = { .check_events = blk_check_events, }; ], [], []) ]) AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [ AC_MSG_CHECKING([whether bops->check_events() exists]) ZFS_LINUX_TEST_RESULT([block_device_operations_check_events], [ AC_MSG_RESULT(yes) ],[ ZFS_LINUX_TEST_ERROR([bops->check_events()]) ]) ]) dnl # dnl # 3.10.x API change dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [ ZFS_LINUX_TEST_SRC([block_device_operations_release_void], [ #include - void blk_release(struct gendisk *g, fmode_t mode) { + static void blk_release(struct gendisk *g, fmode_t mode) { (void) g, (void) mode; return; } static const struct block_device_operations bops __attribute__ ((unused)) = { .open = NULL, .release = blk_release, .ioctl = NULL, .compat_ioctl = NULL, }; ], [], []) ]) dnl # dnl # 5.9.x API change dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG], [ ZFS_LINUX_TEST_SRC([block_device_operations_release_void_1arg], [ #include - void blk_release(struct gendisk *g) { + static void blk_release(struct gendisk *g) { (void) g; return; } static const struct block_device_operations bops __attribute__ ((unused)) = { .open = NULL, .release = blk_release, .ioctl = NULL, .compat_ioctl = NULL, }; ], [], []) ]) AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [ AC_MSG_CHECKING([whether bops->release() is void and takes 2 args]) ZFS_LINUX_TEST_RESULT([block_device_operations_release_void], [ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING([whether bops->release() is void and takes 1 arg]) ZFS_LINUX_TEST_RESULT([block_device_operations_release_void_1arg], [ AC_MSG_RESULT(yes) AC_DEFINE([HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG], [1], [Define if release() in block_device_operations takes 1 arg]) ],[ ZFS_LINUX_TEST_ERROR([bops->release()]) ]) ]) ]) dnl # dnl # 5.13 API change dnl # block_device_operations->revalidate_disk() was removed dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [ ZFS_LINUX_TEST_SRC([block_device_operations_revalidate_disk], [ #include - int blk_revalidate_disk(struct gendisk *disk) { + static int blk_revalidate_disk(struct gendisk *disk) { (void) disk; return(0); } static const struct block_device_operations bops __attribute__ ((unused)) = { .revalidate_disk = blk_revalidate_disk, }; ], [], []) ]) AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [ AC_MSG_CHECKING([whether bops->revalidate_disk() exists]) ZFS_LINUX_TEST_RESULT([block_device_operations_revalidate_disk], [ AC_DEFINE([HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [1], [Define if revalidate_disk() in block_device_operations]) AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS], [ ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK ]) AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS], [ ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK ]) diff --git a/config/kernel-commit-metadata.m4 b/config/kernel-commit-metadata.m4 index 7df9b980290e..49bffbf609d2 100644 --- a/config/kernel-commit-metadata.m4 +++ b/config/kernel-commit-metadata.m4 @@ -1,24 +1,24 @@ dnl # dnl # 2.6.33 API change dnl # Added eops->commit_metadata() callback to allow the underlying dnl # filesystem to determine the most efficient way to commit the inode. dnl # Prior to this the nfs server would issue an explicit fsync(). dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_COMMIT_METADATA], [ ZFS_LINUX_TEST_SRC([export_operations_commit_metadata], [ #include - int commit_metadata(struct inode *inode) { return 0; } + static int commit_metadata(struct inode *inode) { return 0; } static struct export_operations eops __attribute__ ((unused))={ .commit_metadata = commit_metadata, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_COMMIT_METADATA], [ AC_MSG_CHECKING([whether eops->commit_metadata() exists]) ZFS_LINUX_TEST_RESULT([export_operations_commit_metadata], [ AC_MSG_RESULT(yes) ],[ ZFS_LINUX_TEST_ERROR([eops->commit_metadata()]) ]) ]) diff --git a/config/kernel-dentry-operations.m4 b/config/kernel-dentry-operations.m4 index dd470d7607b4..500f61e26aee 100644 --- a/config/kernel-dentry-operations.m4 +++ b/config/kernel-dentry-operations.m4 @@ -1,190 +1,190 @@ dnl # dnl # 3.4.0 API change dnl # Added d_make_root() to replace previous d_alloc_root() function. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_D_MAKE_ROOT], [ ZFS_LINUX_TEST_SRC([d_make_root], [ #include ], [ d_make_root(NULL); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_D_MAKE_ROOT], [ AC_MSG_CHECKING([whether d_make_root() is available]) ZFS_LINUX_TEST_RESULT_SYMBOL([d_make_root], [d_make_root], [fs/dcache.c], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_D_MAKE_ROOT, 1, [d_make_root() is available]) ], [ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 2.6.28 API change dnl # Added d_obtain_alias() helper function. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS], [ ZFS_LINUX_TEST_SRC([d_obtain_alias], [ #include ], [ d_obtain_alias(NULL); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_D_OBTAIN_ALIAS], [ AC_MSG_CHECKING([whether d_obtain_alias() is available]) ZFS_LINUX_TEST_RESULT_SYMBOL([d_obtain_alias], [d_obtain_alias], [fs/dcache.c], [ AC_MSG_RESULT(yes) ], [ ZFS_LINUX_TEST_ERROR([d_obtain_alias()]) ]) ]) dnl # dnl # 2.6.12 API change dnl # d_prune_aliases() helper function available. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_D_PRUNE_ALIASES], [ ZFS_LINUX_TEST_SRC([d_prune_aliases], [ #include ], [ struct inode *ip = NULL; d_prune_aliases(ip); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_D_PRUNE_ALIASES], [ AC_MSG_CHECKING([whether d_prune_aliases() is available]) ZFS_LINUX_TEST_RESULT_SYMBOL([d_prune_aliases], [d_prune_aliases], [fs/dcache.c], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_D_PRUNE_ALIASES, 1, [d_prune_aliases() is available]) ], [ ZFS_LINUX_TEST_ERROR([d_prune_aliases()]) ]) ]) dnl # dnl # 2.6.38 API change dnl # Added d_set_d_op() helper function. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_D_SET_D_OP], [ ZFS_LINUX_TEST_SRC([d_set_d_op], [ #include ], [ d_set_d_op(NULL, NULL); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP], [ AC_MSG_CHECKING([whether d_set_d_op() is available]) ZFS_LINUX_TEST_RESULT_SYMBOL([d_set_d_op], [d_set_d_op], [fs/dcache.c], [ AC_MSG_RESULT(yes) ], [ ZFS_LINUX_TEST_ERROR([d_set_d_op]) ]) ]) dnl # dnl # 3.6 API change dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA], [ ZFS_LINUX_TEST_SRC([dentry_operations_revalidate], [ #include #include - int revalidate (struct dentry *dentry, + static int revalidate (struct dentry *dentry, struct nameidata *nidata) { return 0; } static const struct dentry_operations dops __attribute__ ((unused)) = { .d_revalidate = revalidate, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [ AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata]) ZFS_LINUX_TEST_RESULT([dentry_operations_revalidate], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1, [dops->d_revalidate() operation takes nameidata]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # 2.6.30 API change dnl # The 'struct dentry_operations' was constified in the dentry structure. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_CONST_DENTRY_OPERATIONS], [ ZFS_LINUX_TEST_SRC([dentry_operations_const], [ #include const struct dentry_operations test_d_op = { .d_revalidate = NULL, }; ],[ struct dentry d __attribute__ ((unused)); d.d_op = &test_d_op; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS], [ AC_MSG_CHECKING([whether dentry uses const struct dentry_operations]) ZFS_LINUX_TEST_RESULT([dentry_operations_const], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_CONST_DENTRY_OPERATIONS, 1, [dentry uses const struct dentry_operations]) ],[ ZFS_LINUX_TEST_ERROR([const dentry_operations]) ]) ]) dnl # dnl # 2.6.38 API change dnl # Added sb->s_d_op default dentry_operations member dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_S_D_OP], [ ZFS_LINUX_TEST_SRC([super_block_s_d_op], [ #include ],[ struct super_block sb __attribute__ ((unused)); sb.s_d_op = NULL; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_S_D_OP], [ AC_MSG_CHECKING([whether super_block has s_d_op]) ZFS_LINUX_TEST_RESULT([super_block_s_d_op], [ AC_MSG_RESULT(yes) ], [ ZFS_LINUX_TEST_ERROR([super_block s_d_op]) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY], [ ZFS_AC_KERNEL_SRC_D_MAKE_ROOT ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS ZFS_AC_KERNEL_SRC_D_PRUNE_ALIASES ZFS_AC_KERNEL_SRC_D_SET_D_OP ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA ZFS_AC_KERNEL_SRC_CONST_DENTRY_OPERATIONS ZFS_AC_KERNEL_SRC_S_D_OP ]) AC_DEFUN([ZFS_AC_KERNEL_DENTRY], [ ZFS_AC_KERNEL_D_MAKE_ROOT ZFS_AC_KERNEL_D_OBTAIN_ALIAS ZFS_AC_KERNEL_D_PRUNE_ALIASES ZFS_AC_KERNEL_D_SET_D_OP ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS ZFS_AC_KERNEL_S_D_OP ]) diff --git a/config/kernel-dirty-inode.m4 b/config/kernel-dirty-inode.m4 index dc7667fa4881..2ef8658748ca 100644 --- a/config/kernel-dirty-inode.m4 +++ b/config/kernel-dirty-inode.m4 @@ -1,29 +1,29 @@ dnl # dnl # 3.0 API change dnl # The sops->dirty_inode() callbacks were updated to take a flags dnl # argument. This allows the greater control over whether the dnl # filesystem needs to push out a transaction or not. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_DIRTY_INODE], [ ZFS_LINUX_TEST_SRC([dirty_inode_with_flags], [ #include - void dirty_inode(struct inode *a, int b) { return; } + static void dirty_inode(struct inode *a, int b) { return; } static const struct super_operations sops __attribute__ ((unused)) = { .dirty_inode = dirty_inode, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_DIRTY_INODE], [ AC_MSG_CHECKING([whether sops->dirty_inode() wants flags]) ZFS_LINUX_TEST_RESULT([dirty_inode_with_flags], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_DIRTY_INODE_WITH_FLAGS, 1, [sops->dirty_inode() wants flags]) ],[ AC_MSG_RESULT([no]) ]) ]) diff --git a/config/kernel-encode-fh-inode.m4 b/config/kernel-encode-fh-inode.m4 index 9d4ba5f0f61f..b3ec040b5e95 100644 --- a/config/kernel-encode-fh-inode.m4 +++ b/config/kernel-encode-fh-inode.m4 @@ -1,27 +1,27 @@ dnl # dnl # 3.5.0 API change dnl # torvalds/linux@b0b0382bb4904965a9e9fca77ad87514dfda0d1c changed the dnl # ->encode_fh() callback to pass the child inode and its parents inode dnl # rather than a dentry and a boolean saying whether we want the parent. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_ENCODE_FH_WITH_INODE], [ ZFS_LINUX_TEST_SRC([export_operations_encode_fh], [ #include - int encode_fh(struct inode *inode, __u32 *fh, int *max_len, + static int encode_fh(struct inode *inode, __u32 *fh, int *max_len, struct inode *parent) { return 0; } static struct export_operations eops __attribute__ ((unused))={ .encode_fh = encode_fh, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE], [ AC_MSG_CHECKING([whether eops->encode_fh() wants inode]) ZFS_LINUX_TEST_RESULT([export_operations_encode_fh], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_ENCODE_FH_WITH_INODE, 1, [eops->encode_fh() wants child and parent inodes]) ],[ AC_MSG_RESULT(no) ]) ]) diff --git a/config/kernel-evict-inode.m4 b/config/kernel-evict-inode.m4 index 66f10492de54..87082c9a2839 100644 --- a/config/kernel-evict-inode.m4 +++ b/config/kernel-evict-inode.m4 @@ -1,24 +1,24 @@ dnl # dnl # 2.6.36 API change dnl # The sops->delete_inode() and sops->clear_inode() callbacks have dnl # replaced by a single sops->evict_inode() callback. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_EVICT_INODE], [ ZFS_LINUX_TEST_SRC([evict_inode], [ #include - void evict_inode (struct inode * t) { return; } + static void evict_inode (struct inode * t) { return; } static struct super_operations sops __attribute__ ((unused)) = { .evict_inode = evict_inode, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_EVICT_INODE], [ AC_MSG_CHECKING([whether sops->evict_inode() exists]) ZFS_LINUX_TEST_RESULT([evict_inode], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_EVICT_INODE, 1, [sops->evict_inode() exists]) ],[ ZFS_LINUX_TEST_ERROR([evict_inode]) ]) ]) diff --git a/config/kernel-fallocate.m4 b/config/kernel-fallocate.m4 index 815602d3e2c6..95186dada453 100644 --- a/config/kernel-fallocate.m4 +++ b/config/kernel-fallocate.m4 @@ -1,44 +1,44 @@ dnl # dnl # Linux 2.6.38 - 3.x API dnl # The fallocate callback was moved from the inode_operations dnl # structure to the file_operations structure. dnl # dnl # dnl # Linux 3.15+ dnl # fallocate learned a new flag, FALLOC_FL_ZERO_RANGE dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_FALLOCATE], [ ZFS_LINUX_TEST_SRC([file_fallocate], [ #include - long test_fallocate(struct file *file, int mode, + static long test_fallocate(struct file *file, int mode, loff_t offset, loff_t len) { return 0; } static const struct file_operations fops __attribute__ ((unused)) = { .fallocate = test_fallocate, }; ], []) ZFS_LINUX_TEST_SRC([falloc_fl_zero_range], [ #include ],[ int flags __attribute__ ((unused)); flags = FALLOC_FL_ZERO_RANGE; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [ AC_MSG_CHECKING([whether fops->fallocate() exists]) ZFS_LINUX_TEST_RESULT([file_fallocate], [ AC_MSG_RESULT(yes) AC_MSG_CHECKING([whether FALLOC_FL_ZERO_RANGE exists]) ZFS_LINUX_TEST_RESULT([falloc_fl_zero_range], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_FALLOC_FL_ZERO_RANGE, 1, [FALLOC_FL_ZERO_RANGE is defined]) ],[ AC_MSG_RESULT(no) ]) ],[ ZFS_LINUX_TEST_ERROR([file_fallocate]) ]) ]) diff --git a/config/kernel-fsync.m4 b/config/kernel-fsync.m4 index d198191d3ab9..c155f8af81a8 100644 --- a/config/kernel-fsync.m4 +++ b/config/kernel-fsync.m4 @@ -1,53 +1,53 @@ dnl # dnl # Check file_operations->fsync interface. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_FSYNC], [ ZFS_LINUX_TEST_SRC([fsync_without_dentry], [ #include - int test_fsync(struct file *f, int x) { return 0; } + static int test_fsync(struct file *f, int x) { return 0; } static const struct file_operations fops __attribute__ ((unused)) = { .fsync = test_fsync, }; ],[]) ZFS_LINUX_TEST_SRC([fsync_range], [ #include - int test_fsync(struct file *f, loff_t a, loff_t b, int c) + static int test_fsync(struct file *f, loff_t a, loff_t b, int c) { return 0; } static const struct file_operations fops __attribute__ ((unused)) = { .fsync = test_fsync, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [ dnl # dnl # Linux 2.6.35 - Linux 3.0 API dnl # AC_MSG_CHECKING([whether fops->fsync() wants no dentry]) ZFS_LINUX_TEST_RESULT([fsync_without_dentry], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1, [fops->fsync() without dentry]) ],[ AC_MSG_RESULT([no]) dnl # dnl # Linux 3.1 - 3.x API dnl # AC_MSG_CHECKING([whether fops->fsync() wants range]) ZFS_LINUX_TEST_RESULT([fsync_range], [ AC_MSG_RESULT([range]) AC_DEFINE(HAVE_FSYNC_RANGE, 1, [fops->fsync() with range]) ],[ ZFS_LINUX_TEST_ERROR([fops->fsync]) ]) ]) ]) diff --git a/config/kernel-get-link.m4 b/config/kernel-get-link.m4 index e4f478e37c18..1f8f5b0c8b72 100644 --- a/config/kernel-get-link.m4 +++ b/config/kernel-get-link.m4 @@ -1,104 +1,104 @@ dnl # dnl # Supported get_link() interfaces checked newest to oldest. dnl # Note this interface used to be named follow_link. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_LINK], [ ZFS_LINUX_TEST_SRC([inode_operations_get_link], [ #include - const char *get_link(struct dentry *de, struct inode *ip, + static const char *get_link(struct dentry *de, struct inode *ip, struct delayed_call *done) { return "symlink"; } static struct inode_operations iops __attribute__ ((unused)) = { .get_link = get_link, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_get_link_cookie], [ #include - const char *get_link(struct dentry *de, struct + static const char *get_link(struct dentry *de, struct inode *ip, void **cookie) { return "symlink"; } static struct inode_operations iops __attribute__ ((unused)) = { .get_link = get_link, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_follow_link], [ #include - const char *follow_link(struct dentry *de, + static const char *follow_link(struct dentry *de, void **cookie) { return "symlink"; } static struct inode_operations iops __attribute__ ((unused)) = { .follow_link = follow_link, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_follow_link_nameidata], [ #include - void *follow_link(struct dentry *de, struct + static void *follow_link(struct dentry *de, struct nameidata *nd) { return (void *)NULL; } static struct inode_operations iops __attribute__ ((unused)) = { .follow_link = follow_link, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_GET_LINK], [ dnl # dnl # 4.5 API change dnl # The get_link interface has added a delayed done call and dnl # used it to retire the put_link() interface. dnl # AC_MSG_CHECKING([whether iops->get_link() passes delayed]) ZFS_LINUX_TEST_RESULT([inode_operations_get_link], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GET_LINK_DELAYED, 1, [iops->get_link() delayed]) ],[ AC_MSG_RESULT(no) dnl # dnl # 4.5 API change dnl # The follow_link() interface has been replaced by dnl # get_link() which behaves the same as before except: dnl # - An inode is passed as a separate argument dnl # - When called in RCU mode a NULL dentry is passed. dnl # AC_MSG_CHECKING([whether iops->get_link() passes cookie]) ZFS_LINUX_TEST_RESULT([inode_operations_get_link_cookie], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GET_LINK_COOKIE, 1, [iops->get_link() cookie]) ],[ AC_MSG_RESULT(no) dnl # dnl # 4.2 API change dnl # This kernel retired the nameidata structure. dnl # AC_MSG_CHECKING( [whether iops->follow_link() passes cookie]) ZFS_LINUX_TEST_RESULT([inode_operations_follow_link], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_FOLLOW_LINK_COOKIE, 1, [iops->follow_link() cookie]) ],[ AC_MSG_RESULT(no) dnl # dnl # 2.6.32 API dnl # AC_MSG_CHECKING( [whether iops->follow_link() passes nameidata]) ZFS_LINUX_TEST_RESULT( [inode_operations_follow_link_nameidata],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_FOLLOW_LINK_NAMEIDATA, 1, [iops->follow_link() nameidata]) ],[ ZFS_LINUX_TEST_ERROR([get_link]) ]) ]) ]) ]) ]) diff --git a/config/kernel-inode-create.m4 b/config/kernel-inode-create.m4 index 9e9e43180976..95f8aa2d5220 100644 --- a/config/kernel-inode-create.m4 +++ b/config/kernel-inode-create.m4 @@ -1,80 +1,80 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE], [ dnl # dnl # 6.3 API change dnl # The first arg is changed to struct mnt_idmap * dnl # ZFS_LINUX_TEST_SRC([create_mnt_idmap], [ #include #include - int inode_create(struct mnt_idmap *idmap, + static int inode_create(struct mnt_idmap *idmap, struct inode *inode ,struct dentry *dentry, umode_t umode, bool flag) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .create = inode_create, }; ],[]) dnl # dnl # 5.12 API change that added the struct user_namespace* arg dnl # to the front of this function type's arg list. dnl # ZFS_LINUX_TEST_SRC([create_userns], [ #include #include - int inode_create(struct user_namespace *userns, + static int inode_create(struct user_namespace *userns, struct inode *inode ,struct dentry *dentry, umode_t umode, bool flag) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .create = inode_create, }; ],[]) dnl # dnl # 3.6 API change dnl # ZFS_LINUX_TEST_SRC([create_flags], [ #include #include - int inode_create(struct inode *inode ,struct dentry *dentry, + static int inode_create(struct inode *inode ,struct dentry *dentry, umode_t umode, bool flag) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .create = inode_create, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_CREATE], [ AC_MSG_CHECKING([whether iops->create() takes struct mnt_idmap*]) ZFS_LINUX_TEST_RESULT([create_mnt_idmap], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_CREATE_IDMAP, 1, [iops->create() takes struct mnt_idmap*]) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING([whether iops->create() takes struct user_namespace*]) ZFS_LINUX_TEST_RESULT([create_userns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_CREATE_USERNS, 1, [iops->create() takes struct user_namespace*]) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING([whether iops->create() passes flags]) ZFS_LINUX_TEST_RESULT([create_flags], [ AC_MSG_RESULT(yes) ],[ ZFS_LINUX_TEST_ERROR([iops->create()]) ]) ]) ]) ]) diff --git a/config/kernel-inode-getattr.m4 b/config/kernel-inode-getattr.m4 index c8bfb07862ab..5f7ce1ad9a5d 100644 --- a/config/kernel-inode-getattr.m4 +++ b/config/kernel-inode-getattr.m4 @@ -1,123 +1,123 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [ dnl # dnl # Linux 6.3 API dnl # The first arg of getattr I/O operations handler type dnl # is changed to struct mnt_idmap* dnl # ZFS_LINUX_TEST_SRC([inode_operations_getattr_mnt_idmap], [ #include - int test_getattr( + static int test_getattr( struct mnt_idmap *idmap, const struct path *p, struct kstat *k, u32 request_mask, unsigned int query_flags) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .getattr = test_getattr, }; ],[]) dnl # dnl # Linux 5.12 API dnl # The getattr I/O operations handler type was extended to require dnl # a struct user_namespace* as its first arg, to support idmapped dnl # mounts. dnl # ZFS_LINUX_TEST_SRC([inode_operations_getattr_userns], [ #include - int test_getattr( + static int test_getattr( struct user_namespace *userns, const struct path *p, struct kstat *k, u32 request_mask, unsigned int query_flags) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .getattr = test_getattr, }; ],[]) dnl # dnl # Linux 4.11 API dnl # See torvalds/linux@a528d35 dnl # ZFS_LINUX_TEST_SRC([inode_operations_getattr_path], [ #include - int test_getattr( + static int test_getattr( const struct path *p, struct kstat *k, u32 request_mask, unsigned int query_flags) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .getattr = test_getattr, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_getattr_vfsmount], [ #include - int test_getattr( + static int test_getattr( struct vfsmount *mnt, struct dentry *d, struct kstat *k) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .getattr = test_getattr, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [ dnl # dnl # Kernel 6.3 test dnl # AC_MSG_CHECKING([whether iops->getattr() takes mnt_idmap]) ZFS_LINUX_TEST_RESULT([inode_operations_getattr_mnt_idmap], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IDMAP_IOPS_GETATTR, 1, [iops->getattr() takes struct mnt_idmap*]) ],[ AC_MSG_RESULT(no) dnl # dnl # Kernel 5.12 test dnl # AC_MSG_CHECKING([whether iops->getattr() takes user_namespace]) ZFS_LINUX_TEST_RESULT([inode_operations_getattr_userns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_USERNS_IOPS_GETATTR, 1, [iops->getattr() takes struct user_namespace*]) ],[ AC_MSG_RESULT(no) dnl # dnl # Kernel 4.11 test dnl # AC_MSG_CHECKING([whether iops->getattr() takes a path]) ZFS_LINUX_TEST_RESULT([inode_operations_getattr_path], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1, [iops->getattr() takes a path]) ],[ AC_MSG_RESULT(no) dnl # dnl # Kernel < 4.11 test dnl # AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount]) ZFS_LINUX_TEST_RESULT([inode_operations_getattr_vfsmount], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1, [iops->getattr() takes a vfsmount]) ],[ AC_MSG_RESULT(no) ]) ]) ]) ]) ]) diff --git a/config/kernel-inode-lookup.m4 b/config/kernel-inode-lookup.m4 index 1a56e69b04aa..c7373056422c 100644 --- a/config/kernel-inode-lookup.m4 +++ b/config/kernel-inode-lookup.m4 @@ -1,26 +1,26 @@ dnl # dnl # 3.6 API change dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS], [ ZFS_LINUX_TEST_SRC([lookup_flags], [ #include #include - struct dentry *inode_lookup(struct inode *inode, + static struct dentry *inode_lookup(struct inode *inode, struct dentry *dentry, unsigned int flags) { return NULL; } static const struct inode_operations iops __attribute__ ((unused)) = { .lookup = inode_lookup, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_FLAGS], [ AC_MSG_CHECKING([whether iops->lookup() passes flags]) ZFS_LINUX_TEST_RESULT([lookup_flags], [ AC_MSG_RESULT(yes) ],[ ZFS_LINUX_TEST_ERROR([iops->lookup()]) ]) ]) diff --git a/config/kernel-inode-setattr.m4 b/config/kernel-inode-setattr.m4 index 45755b4eb273..69289e897be6 100644 --- a/config/kernel-inode-setattr.m4 +++ b/config/kernel-inode-setattr.m4 @@ -1,87 +1,87 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SETATTR], [ dnl # dnl # Linux 6.3 API dnl # The first arg of setattr I/O operations handler type dnl # is changed to struct mnt_idmap* dnl # ZFS_LINUX_TEST_SRC([inode_operations_setattr_mnt_idmap], [ #include - int test_setattr( + static int test_setattr( struct mnt_idmap *idmap, struct dentry *de, struct iattr *ia) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .setattr = test_setattr, }; ],[]) dnl # dnl # Linux 5.12 API dnl # The setattr I/O operations handler type was extended to require dnl # a struct user_namespace* as its first arg, to support idmapped dnl # mounts. dnl # ZFS_LINUX_TEST_SRC([inode_operations_setattr_userns], [ #include - int test_setattr( + static int test_setattr( struct user_namespace *userns, struct dentry *de, struct iattr *ia) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .setattr = test_setattr, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_setattr], [ #include - int test_setattr( + static int test_setattr( struct dentry *de, struct iattr *ia) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .setattr = test_setattr, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_INODE_SETATTR], [ dnl # dnl # Kernel 6.3 test dnl # AC_MSG_CHECKING([whether iops->setattr() takes mnt_idmap]) ZFS_LINUX_TEST_RESULT([inode_operations_setattr_mnt_idmap], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IDMAP_IOPS_SETATTR, 1, [iops->setattr() takes struct mnt_idmap*]) ],[ AC_MSG_RESULT(no) dnl # dnl # Kernel 5.12 test dnl # AC_MSG_CHECKING([whether iops->setattr() takes user_namespace]) ZFS_LINUX_TEST_RESULT([inode_operations_setattr_userns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_USERNS_IOPS_SETATTR, 1, [iops->setattr() takes struct user_namespace*]) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING([whether iops->setattr() exists]) ZFS_LINUX_TEST_RESULT([inode_operations_setattr], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_SETATTR, 1, [iops->setattr() exists]) ],[ AC_MSG_RESULT(no) ]) ]) ]) ]) diff --git a/config/kernel-make-request-fn.m4 b/config/kernel-make-request-fn.m4 index f17416acca67..4d20dd45c4a1 100644 --- a/config/kernel-make-request-fn.m4 +++ b/config/kernel-make-request-fn.m4 @@ -1,180 +1,180 @@ dnl # dnl # Check for make_request_fn interface. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [ ZFS_LINUX_TEST_SRC([make_request_fn_void], [ #include - void make_request(struct request_queue *q, + static void make_request(struct request_queue *q, struct bio *bio) { return; } ],[ blk_queue_make_request(NULL, &make_request); ]) ZFS_LINUX_TEST_SRC([make_request_fn_blk_qc_t], [ #include - blk_qc_t make_request(struct request_queue *q, + static blk_qc_t make_request(struct request_queue *q, struct bio *bio) { return (BLK_QC_T_NONE); } ],[ blk_queue_make_request(NULL, &make_request); ]) ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn], [ #include - blk_qc_t make_request(struct request_queue *q, + static blk_qc_t make_request(struct request_queue *q, struct bio *bio) { return (BLK_QC_T_NONE); } ],[ struct request_queue *q __attribute__ ((unused)); q = blk_alloc_queue(make_request, NUMA_NO_NODE); ]) ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn_rh], [ #include - blk_qc_t make_request(struct request_queue *q, + static blk_qc_t make_request(struct request_queue *q, struct bio *bio) { return (BLK_QC_T_NONE); } ],[ struct request_queue *q __attribute__ ((unused)); q = blk_alloc_queue_rh(make_request, NUMA_NO_NODE); ]) ZFS_LINUX_TEST_SRC([block_device_operations_submit_bio], [ #include ],[ struct block_device_operations o; o.submit_bio = NULL; ]) ZFS_LINUX_TEST_SRC([blk_alloc_disk], [ #include ],[ struct gendisk *disk __attribute__ ((unused)); disk = blk_alloc_disk(NUMA_NO_NODE); ]) ZFS_LINUX_TEST_SRC([blk_cleanup_disk], [ #include ],[ struct gendisk *disk __attribute__ ((unused)); blk_cleanup_disk(disk); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [ dnl # Checked as part of the blk_alloc_queue_request_fn test dnl # dnl # Linux 5.9 API Change dnl # make_request_fn was moved into block_device_operations->submit_bio dnl # AC_MSG_CHECKING([whether submit_bio is member of struct block_device_operations]) ZFS_LINUX_TEST_RESULT([block_device_operations_submit_bio], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1, [submit_bio is member of struct block_device_operations]) dnl # dnl # Linux 5.14 API Change: dnl # blk_alloc_queue() + alloc_disk() combo replaced by dnl # a single call to blk_alloc_disk(). dnl # AC_MSG_CHECKING([whether blk_alloc_disk() exists]) ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [ AC_MSG_RESULT(yes) AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists]) dnl # dnl # 5.20 API change, dnl # Removed blk_cleanup_disk(), put_disk() should be used. dnl # AC_MSG_CHECKING([whether blk_cleanup_disk() exists]) ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [ AC_MSG_RESULT(yes) AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1, [blk_cleanup_disk() exists]) ], [ AC_MSG_RESULT(no) ]) ], [ AC_MSG_RESULT(no) ]) ],[ AC_MSG_RESULT(no) dnl # Checked as part of the blk_alloc_queue_request_fn test dnl # dnl # Linux 5.7 API Change dnl # blk_alloc_queue() expects request function. dnl # AC_MSG_CHECKING([whether blk_alloc_queue() expects request function]) ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [ AC_MSG_RESULT(yes) dnl # This is currently always the case. AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t]) AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN, 1, [blk_alloc_queue() expects request function]) AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t, [make_request_fn() return type]) AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1, [Noting that make_request_fn() returns blk_qc_t]) ],[ dnl # dnl # CentOS Stream 4.18.0-257 API Change dnl # The Linux 5.7 blk_alloc_queue() change was back- dnl # ported and the symbol renamed blk_alloc_queue_rh(). dnl # As of this kernel version they're not providing dnl # any compatibility code in the kernel for this. dnl # ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn_rh], [ AC_MSG_RESULT(yes) dnl # This is currently always the case. AC_MSG_CHECKING([whether make_request_fn_rh() returns blk_qc_t]) AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH, 1, [blk_alloc_queue_rh() expects request function]) AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t, [make_request_fn() return type]) AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1, [Noting that make_request_fn() returns blk_qc_t]) ],[ AC_MSG_RESULT(no) dnl # dnl # Linux 3.2 API Change dnl # make_request_fn returns void. dnl # AC_MSG_CHECKING( [whether make_request_fn() returns void]) ZFS_LINUX_TEST_RESULT([make_request_fn_void], [ AC_MSG_RESULT(yes) AC_DEFINE(MAKE_REQUEST_FN_RET, void, [make_request_fn() return type]) AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1, [Noting that make_request_fn() returns void]) ],[ AC_MSG_RESULT(no) dnl # dnl # Linux 4.4 API Change dnl # make_request_fn returns blk_qc_t. dnl # AC_MSG_CHECKING( [whether make_request_fn() returns blk_qc_t]) ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [ AC_MSG_RESULT(yes) AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t, [make_request_fn() return type]) AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1, [Noting that make_request_fn() ] [returns blk_qc_t]) ],[ ZFS_LINUX_TEST_ERROR([make_request_fn]) ]) ]) ]) ]) ]) ]) diff --git a/config/kernel-mkdir.m4 b/config/kernel-mkdir.m4 index 7407a791b846..367f100094d3 100644 --- a/config/kernel-mkdir.m4 +++ b/config/kernel-mkdir.m4 @@ -1,94 +1,94 @@ dnl # dnl # Supported mkdir() interfaces checked newest to oldest. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_MKDIR], [ dnl # dnl # 6.3 API change dnl # mkdir() takes struct mnt_idmap * as the first arg dnl # ZFS_LINUX_TEST_SRC([mkdir_mnt_idmap], [ #include - int mkdir(struct mnt_idmap *idmap, + static int mkdir(struct mnt_idmap *idmap, struct inode *inode, struct dentry *dentry, umode_t umode) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .mkdir = mkdir, }; ],[]) dnl # dnl # 5.12 API change dnl # The struct user_namespace arg was added as the first argument to dnl # mkdir() dnl # ZFS_LINUX_TEST_SRC([mkdir_user_namespace], [ #include - int mkdir(struct user_namespace *userns, + static int mkdir(struct user_namespace *userns, struct inode *inode, struct dentry *dentry, umode_t umode) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .mkdir = mkdir, }; ],[]) dnl # dnl # 3.3 API change dnl # The VFS .create, .mkdir and .mknod callbacks were updated to take a dnl # umode_t type rather than an int. The expectation is that any backport dnl # would also change all three prototypes. However, if it turns out that dnl # some distribution doesn't backport the whole thing this could be dnl # broken apart into three separate checks. dnl # ZFS_LINUX_TEST_SRC([inode_operations_mkdir], [ #include - int mkdir(struct inode *inode, struct dentry *dentry, + static int mkdir(struct inode *inode, struct dentry *dentry, umode_t umode) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .mkdir = mkdir, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_MKDIR], [ dnl # dnl # 6.3 API change dnl # mkdir() takes struct mnt_idmap * as the first arg dnl # AC_MSG_CHECKING([whether iops->mkdir() takes struct mnt_idmap*]) ZFS_LINUX_TEST_RESULT([mkdir_mnt_idmap], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_MKDIR_IDMAP, 1, [iops->mkdir() takes struct mnt_idmap*]) ],[ dnl # dnl # 5.12 API change dnl # The struct user_namespace arg was added as the first argument to dnl # mkdir() of the iops structure. dnl # AC_MSG_CHECKING([whether iops->mkdir() takes struct user_namespace*]) ZFS_LINUX_TEST_RESULT([mkdir_user_namespace], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_MKDIR_USERNS, 1, [iops->mkdir() takes struct user_namespace*]) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING([whether iops->mkdir() takes umode_t]) ZFS_LINUX_TEST_RESULT([inode_operations_mkdir], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MKDIR_UMODE_T, 1, [iops->mkdir() takes umode_t]) ],[ ZFS_LINUX_TEST_ERROR([mkdir()]) ]) ]) ]) ]) diff --git a/config/kernel-mknod.m4 b/config/kernel-mknod.m4 index 1494ec1ae4d4..6ad3453aaf0a 100644 --- a/config/kernel-mknod.m4 +++ b/config/kernel-mknod.m4 @@ -1,56 +1,56 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_MKNOD], [ dnl # dnl # 6.3 API change dnl # The first arg is now struct mnt_idmap* dnl # ZFS_LINUX_TEST_SRC([mknod_mnt_idmap], [ #include #include - int tmp_mknod(struct mnt_idmap *idmap, + static int tmp_mknod(struct mnt_idmap *idmap, struct inode *inode ,struct dentry *dentry, umode_t u, dev_t d) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .mknod = tmp_mknod, }; ],[]) dnl # dnl # 5.12 API change that added the struct user_namespace* arg dnl # to the front of this function type's arg list. dnl # ZFS_LINUX_TEST_SRC([mknod_userns], [ #include #include - int tmp_mknod(struct user_namespace *userns, + static int tmp_mknod(struct user_namespace *userns, struct inode *inode ,struct dentry *dentry, umode_t u, dev_t d) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .mknod = tmp_mknod, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_MKNOD], [ AC_MSG_CHECKING([whether iops->mknod() takes struct mnt_idmap*]) ZFS_LINUX_TEST_RESULT([mknod_mnt_idmap], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_MKNOD_IDMAP, 1, [iops->mknod() takes struct mnt_idmap*]) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING([whether iops->mknod() takes struct user_namespace*]) ZFS_LINUX_TEST_RESULT([mknod_userns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_MKNOD_USERNS, 1, [iops->mknod() takes struct user_namespace*]) ],[ AC_MSG_RESULT(no) ]) ]) ]) diff --git a/config/kernel-proc-operations.m4 b/config/kernel-proc-operations.m4 index df216222ecc2..3ae8ce2b6d0d 100644 --- a/config/kernel-proc-operations.m4 +++ b/config/kernel-proc-operations.m4 @@ -1,41 +1,41 @@ dnl # dnl # 5.6 API Change dnl # The proc_ops structure was introduced to replace the use of dnl # of the file_operations structure when registering proc handlers. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_PROC_OPERATIONS], [ ZFS_LINUX_TEST_SRC([proc_ops_struct], [ #include - int test_open(struct inode *ip, struct file *fp) { return 0; } - ssize_t test_read(struct file *fp, char __user *ptr, + static int test_open(struct inode *ip, struct file *fp) { return 0; } + static ssize_t test_read(struct file *fp, char __user *ptr, size_t size, loff_t *offp) { return 0; } - ssize_t test_write(struct file *fp, const char __user *ptr, + static ssize_t test_write(struct file *fp, const char __user *ptr, size_t size, loff_t *offp) { return 0; } - loff_t test_lseek(struct file *fp, loff_t off, int flag) + static loff_t test_lseek(struct file *fp, loff_t off, int flag) { return 0; } - int test_release(struct inode *ip, struct file *fp) + static int test_release(struct inode *ip, struct file *fp) { return 0; } const struct proc_ops test_ops __attribute__ ((unused)) = { .proc_open = test_open, .proc_read = test_read, .proc_write = test_write, .proc_lseek = test_lseek, .proc_release = test_release, }; ], [ struct proc_dir_entry *entry __attribute__ ((unused)) = proc_create_data("test", 0444, NULL, &test_ops, NULL); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_PROC_OPERATIONS], [ AC_MSG_CHECKING([whether proc_ops structure exists]) ZFS_LINUX_TEST_RESULT([proc_ops_struct], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PROC_OPS_STRUCT, 1, [proc_ops structure exists]) ], [ AC_MSG_RESULT(no) ]) ]) diff --git a/config/kernel-put-link.m4 b/config/kernel-put-link.m4 index 4234861f3347..8ab318cbff8c 100644 --- a/config/kernel-put-link.m4 +++ b/config/kernel-put-link.m4 @@ -1,61 +1,61 @@ dnl # dnl # Supported symlink APIs dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_PUT_LINK], [ ZFS_LINUX_TEST_SRC([put_link_cookie], [ #include - void put_link(struct inode *ip, void *cookie) + static void put_link(struct inode *ip, void *cookie) { return; } static struct inode_operations iops __attribute__ ((unused)) = { .put_link = put_link, }; ],[]) ZFS_LINUX_TEST_SRC([put_link_nameidata], [ #include - void put_link(struct dentry *de, struct + static void put_link(struct dentry *de, struct nameidata *nd, void *ptr) { return; } static struct inode_operations iops __attribute__ ((unused)) = { .put_link = put_link, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_PUT_LINK], [ dnl # dnl # 4.5 API change dnl # get_link() uses delayed done, there is no put_link() interface. dnl # This check initially uses the inode_operations_get_link result dnl # ZFS_LINUX_TEST_RESULT([inode_operations_get_link], [ AC_DEFINE(HAVE_PUT_LINK_DELAYED, 1, [iops->put_link() delayed]) ],[ dnl # dnl # 4.2 API change dnl # This kernel retired the nameidata structure. dnl # AC_MSG_CHECKING([whether iops->put_link() passes cookie]) ZFS_LINUX_TEST_RESULT([put_link_cookie], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PUT_LINK_COOKIE, 1, [iops->put_link() cookie]) ],[ AC_MSG_RESULT(no) dnl # dnl # 2.6.32 API dnl # AC_MSG_CHECKING( [whether iops->put_link() passes nameidata]) ZFS_LINUX_TEST_RESULT([put_link_nameidata], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PUT_LINK_NAMEIDATA, 1, [iops->put_link() nameidata]) ],[ ZFS_LINUX_TEST_ERROR([put_link]) ]) ]) ]) ]) diff --git a/config/kernel-rename.m4 b/config/kernel-rename.m4 index b33cd0bfb0f6..34f5b664e2b7 100644 --- a/config/kernel-rename.m4 +++ b/config/kernel-rename.m4 @@ -1,80 +1,80 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_RENAME], [ dnl # dnl # 4.9 API change, dnl # iops->rename2() merged into iops->rename(), and iops->rename() now wants dnl # flags. dnl # ZFS_LINUX_TEST_SRC([inode_operations_rename_flags], [ #include - int rename_fn(struct inode *sip, struct dentry *sdp, + static int rename_fn(struct inode *sip, struct dentry *sdp, struct inode *tip, struct dentry *tdp, unsigned int flags) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .rename = rename_fn, }; ],[]) dnl # dnl # 5.12 API change, dnl # dnl # Linux 5.12 introduced passing struct user_namespace* as the first argument dnl # of the rename() and other inode_operations members. dnl # ZFS_LINUX_TEST_SRC([inode_operations_rename_userns], [ #include - int rename_fn(struct user_namespace *user_ns, struct inode *sip, + static int rename_fn(struct user_namespace *user_ns, struct inode *sip, struct dentry *sdp, struct inode *tip, struct dentry *tdp, unsigned int flags) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .rename = rename_fn, }; ],[]) dnl # dnl # 6.3 API change - the first arg is now struct mnt_idmap* dnl # ZFS_LINUX_TEST_SRC([inode_operations_rename_mnt_idmap], [ #include - int rename_fn(struct mnt_idmap *idmap, struct inode *sip, + static int rename_fn(struct mnt_idmap *idmap, struct inode *sip, struct dentry *sdp, struct inode *tip, struct dentry *tdp, unsigned int flags) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .rename = rename_fn, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_RENAME], [ AC_MSG_CHECKING([whether iops->rename() takes struct mnt_idmap*]) ZFS_LINUX_TEST_RESULT([inode_operations_rename_mnt_idmap], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_RENAME_IDMAP, 1, [iops->rename() takes struct mnt_idmap*]) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING([whether iops->rename() takes struct user_namespace*]) ZFS_LINUX_TEST_RESULT([inode_operations_rename_userns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_RENAME_USERNS, 1, [iops->rename() takes struct user_namespace*]) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING([whether iops->rename() wants flags]) ZFS_LINUX_TEST_RESULT([inode_operations_rename_flags], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_RENAME_WANTS_FLAGS, 1, [iops->rename() wants flags]) ],[ AC_MSG_RESULT(no) ]) ]) ]) ]) diff --git a/config/kernel-show-options.m4 b/config/kernel-show-options.m4 index 93bd5fbfbb24..fd62f30086dc 100644 --- a/config/kernel-show-options.m4 +++ b/config/kernel-show-options.m4 @@ -1,25 +1,25 @@ dnl # dnl # Linux 3.3 API dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_SHOW_OPTIONS], [ ZFS_LINUX_TEST_SRC([super_operations_show_options], [ #include - int show_options(struct seq_file * x, struct dentry * y) { + static int show_options(struct seq_file * x, struct dentry * y) { return 0; }; static struct super_operations sops __attribute__ ((unused)) = { .show_options = show_options, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_SHOW_OPTIONS], [ AC_MSG_CHECKING([whether sops->show_options() wants dentry]) ZFS_LINUX_TEST_RESULT([super_operations_show_options], [ AC_MSG_RESULT([yes]) ],[ ZFS_LINUX_TEST_ERROR([sops->show_options()]) ]) ]) diff --git a/config/kernel-shrink.m4 b/config/kernel-shrink.m4 index 4a529c43b5b0..6580b08d5ff2 100644 --- a/config/kernel-shrink.m4 +++ b/config/kernel-shrink.m4 @@ -1,263 +1,260 @@ dnl # dnl # 3.1 API change dnl # The super_block structure now stores a per-filesystem shrinker. dnl # This interface is preferable because it can be used to specifically dnl # target only the zfs filesystem for pruning. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_SHRINK], [ ZFS_LINUX_TEST_SRC([super_block_s_shrink], [ #include - int shrink(struct shrinker *s, struct shrink_control *sc) - { return 0; } - static const struct super_block sb __attribute__ ((unused)) = { .s_shrink.seeks = DEFAULT_SEEKS, .s_shrink.batch = 0, }; ],[]) ]) dnl # dnl # 6.7 API change dnl # s_shrink is now a pointer. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_SHRINK_PTR], [ ZFS_LINUX_TEST_SRC([super_block_s_shrink_ptr], [ #include - unsigned long shrinker_cb(struct shrinker *shrink, + static unsigned long shrinker_cb(struct shrinker *shrink, struct shrink_control *sc) { return 0; } static struct shrinker shrinker = { .count_objects = shrinker_cb, .scan_objects = shrinker_cb, .seeks = DEFAULT_SEEKS, }; static const struct super_block sb __attribute__ ((unused)) = { .s_shrink = &shrinker, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_SUPER_BLOCK_S_SHRINK], [ AC_MSG_CHECKING([whether super_block has s_shrink]) ZFS_LINUX_TEST_RESULT([super_block_s_shrink], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SUPER_BLOCK_S_SHRINK, 1, [have super_block s_shrink]) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING([whether super_block has s_shrink pointer]) ZFS_LINUX_TEST_RESULT([super_block_s_shrink_ptr], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SUPER_BLOCK_S_SHRINK_PTR, 1, [have super_block s_shrink pointer]) ],[ AC_MSG_RESULT(no) ZFS_LINUX_TEST_ERROR([sb->s_shrink()]) ]) ]) ]) dnl # dnl # 3.12 API change dnl # The nid member was added to struct shrink_control to support dnl # NUMA-aware shrinkers. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_HAS_NID], [ ZFS_LINUX_TEST_SRC([shrink_control_nid], [ #include ],[ struct shrink_control sc __attribute__ ((unused)); unsigned long scnidsize __attribute__ ((unused)) = sizeof(sc.nid); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID], [ AC_MSG_CHECKING([whether shrink_control has nid]) ZFS_LINUX_TEST_RESULT([shrink_control_nid], [ AC_MSG_RESULT(yes) AC_DEFINE(SHRINK_CONTROL_HAS_NID, 1, [struct shrink_control has nid]) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SHRINKER_VARARG], [ ZFS_LINUX_TEST_SRC([register_shrinker_vararg], [ #include - unsigned long shrinker_cb(struct shrinker *shrink, + static unsigned long shrinker_cb(struct shrinker *shrink, struct shrink_control *sc) { return 0; } ],[ struct shrinker cache_shrinker = { .count_objects = shrinker_cb, .scan_objects = shrinker_cb, .seeks = DEFAULT_SEEKS, }; register_shrinker(&cache_shrinker, "vararg-reg-shrink-test"); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER_CALLBACK], [ ZFS_LINUX_TEST_SRC([shrinker_cb_shrink_control], [ #include - int shrinker_cb(struct shrinker *shrink, + static int shrinker_cb(struct shrinker *shrink, struct shrink_control *sc) { return 0; } ],[ struct shrinker cache_shrinker = { .shrink = shrinker_cb, .seeks = DEFAULT_SEEKS, }; register_shrinker(&cache_shrinker); ]) ZFS_LINUX_TEST_SRC([shrinker_cb_shrink_control_split], [ #include - unsigned long shrinker_cb(struct shrinker *shrink, + static unsigned long shrinker_cb(struct shrinker *shrink, struct shrink_control *sc) { return 0; } ],[ struct shrinker cache_shrinker = { .count_objects = shrinker_cb, .scan_objects = shrinker_cb, .seeks = DEFAULT_SEEKS, }; register_shrinker(&cache_shrinker); ]) ]) dnl # dnl # 6.7 API change dnl # register_shrinker has been replaced by shrinker_register. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER_REGISTER], [ ZFS_LINUX_TEST_SRC([shrinker_register], [ #include - unsigned long shrinker_cb(struct shrinker *shrink, + static unsigned long shrinker_cb(struct shrinker *shrink, struct shrink_control *sc) { return 0; } ],[ struct shrinker cache_shrinker = { .count_objects = shrinker_cb, .scan_objects = shrinker_cb, .seeks = DEFAULT_SEEKS, }; shrinker_register(&cache_shrinker); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[ dnl # dnl # 6.0 API change dnl # register_shrinker() becomes a var-arg function that takes dnl # a printf-style format string as args > 0 dnl # AC_MSG_CHECKING([whether new var-arg register_shrinker() exists]) ZFS_LINUX_TEST_RESULT([register_shrinker_vararg], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_REGISTER_SHRINKER_VARARG, 1, [register_shrinker is vararg]) dnl # We assume that the split shrinker callback exists if the dnl # vararg register_shrinker() exists, because the latter is dnl # a much more recent addition, and the macro test for the dnl # var-arg version only works if the callback is split AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK, 1, [cs->count_objects exists]) ],[ AC_MSG_RESULT(no) dnl # dnl # 3.0 - 3.11 API change dnl # cs->shrink(struct shrinker *, struct shrink_control *sc) dnl # AC_MSG_CHECKING([whether new 2-argument shrinker exists]) ZFS_LINUX_TEST_RESULT([shrinker_cb_shrink_control], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SINGLE_SHRINKER_CALLBACK, 1, [new shrinker callback wants 2 args]) ],[ AC_MSG_RESULT(no) dnl # dnl # 3.12 API change, dnl # cs->shrink() is logically split in to dnl # cs->count_objects() and cs->scan_objects() dnl # AC_MSG_CHECKING( [whether cs->count_objects callback exists]) ZFS_LINUX_TEST_RESULT( [shrinker_cb_shrink_control_split],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK, 1, [cs->count_objects exists]) ],[ AC_MSG_RESULT(no) AC_MSG_CHECKING( [whether shrinker_register exists]) ZFS_LINUX_TEST_RESULT([shrinker_register], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SHRINKER_REGISTER, 1, [shrinker_register exists]) dnl # We assume that the split shrinker dnl # callback exists if dnl # shrinker_register() exists, dnl # because the latter is a much more dnl # recent addition, and the macro dnl # test for shrinker_register() only dnl # works if the callback is split AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK, 1, [cs->count_objects exists]) ],[ AC_MSG_RESULT(no) ZFS_LINUX_TEST_ERROR([shrinker]) ]) ]) ]) ]) ]) dnl # dnl # 2.6.39 API change, dnl # Shrinker adjust to use common shrink_control structure. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_STRUCT], [ ZFS_LINUX_TEST_SRC([shrink_control_struct], [ #include ],[ struct shrink_control sc __attribute__ ((unused)); sc.nr_to_scan = 0; sc.gfp_mask = GFP_KERNEL; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SHRINK_CONTROL_STRUCT], [ AC_MSG_CHECKING([whether struct shrink_control exists]) ZFS_LINUX_TEST_RESULT([shrink_control_struct], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SHRINK_CONTROL_STRUCT, 1, [struct shrink_control exists]) ],[ ZFS_LINUX_TEST_ERROR([shrink_control]) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER], [ ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_SHRINK ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_SHRINK_PTR ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_HAS_NID ZFS_AC_KERNEL_SRC_SHRINKER_CALLBACK ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_STRUCT ZFS_AC_KERNEL_SRC_REGISTER_SHRINKER_VARARG ZFS_AC_KERNEL_SRC_SHRINKER_REGISTER ]) AC_DEFUN([ZFS_AC_KERNEL_SHRINKER], [ ZFS_AC_KERNEL_SUPER_BLOCK_S_SHRINK ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID ZFS_AC_KERNEL_SHRINKER_CALLBACK ZFS_AC_KERNEL_SHRINK_CONTROL_STRUCT ]) diff --git a/config/kernel-symlink.m4 b/config/kernel-symlink.m4 index a0333ed66a7c..804fceab28f0 100644 --- a/config/kernel-symlink.m4 +++ b/config/kernel-symlink.m4 @@ -1,53 +1,53 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SYMLINK], [ dnl # dnl # 6.3 API change that changed the first arg dnl # to struct mnt_idmap* dnl # ZFS_LINUX_TEST_SRC([symlink_mnt_idmap], [ #include #include - int tmp_symlink(struct mnt_idmap *idmap, + static int tmp_symlink(struct mnt_idmap *idmap, struct inode *inode ,struct dentry *dentry, const char *path) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .symlink = tmp_symlink, }; ],[]) dnl # dnl # 5.12 API change that added the struct user_namespace* arg dnl # to the front of this function type's arg list. dnl # ZFS_LINUX_TEST_SRC([symlink_userns], [ #include #include - int tmp_symlink(struct user_namespace *userns, + static int tmp_symlink(struct user_namespace *userns, struct inode *inode ,struct dentry *dentry, const char *path) { return 0; } static const struct inode_operations iops __attribute__ ((unused)) = { .symlink = tmp_symlink, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_SYMLINK], [ AC_MSG_CHECKING([whether iops->symlink() takes struct mnt_idmap*]) ZFS_LINUX_TEST_RESULT([symlink_mnt_idmap], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_SYMLINK_IDMAP, 1, [iops->symlink() takes struct mnt_idmap*]) ],[ AC_MSG_CHECKING([whether iops->symlink() takes struct user_namespace*]) ZFS_LINUX_TEST_RESULT([symlink_userns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_IOPS_SYMLINK_USERNS, 1, [iops->symlink() takes struct user_namespace*]) ],[ AC_MSG_RESULT(no) ]) ]) ]) diff --git a/config/kernel-timer.m4 b/config/kernel-timer.m4 index 403cff3f4189..c710e804be0b 100644 --- a/config/kernel-timer.m4 +++ b/config/kernel-timer.m4 @@ -1,75 +1,75 @@ dnl # 4.14-rc3 API change dnl # https://lwn.net/Articles/735887/ dnl # dnl # Check if timer_list.func get passed a timer_list or an unsigned long dnl # (older kernels). Also sanity check the from_timer() and timer_setup() dnl # macros are available as well, since they will be used in the same newer dnl # kernels that support the new timer_list.func signature. dnl # dnl # Also check for the existence of flags in struct timer_list, they were dnl # added in 4.1-rc8 via 0eeda71bc30d. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_TIMER_SETUP], [ ZFS_LINUX_TEST_SRC([timer_setup], [ #include struct my_task_timer { struct timer_list timer; int data; }; - void task_expire(struct timer_list *tl) + static void task_expire(struct timer_list *tl) { struct my_task_timer *task_timer = from_timer(task_timer, tl, timer); task_timer->data = 42; } ],[ struct my_task_timer task_timer; timer_setup(&task_timer.timer, task_expire, 0); ]) ZFS_LINUX_TEST_SRC([timer_list_function], [ #include - void task_expire(struct timer_list *tl) {} + static void task_expire(struct timer_list *tl) {} ],[ struct timer_list tl; tl.function = task_expire; ]) ZFS_LINUX_TEST_SRC([timer_list_flags], [ #include ],[ struct timer_list tl; tl.flags = 2; ]) ]) AC_DEFUN([ZFS_AC_KERNEL_TIMER_SETUP], [ AC_MSG_CHECKING([whether timer_setup() is available]) ZFS_LINUX_TEST_RESULT([timer_setup], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_KERNEL_TIMER_SETUP, 1, [timer_setup() is available]) ],[ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING([whether timer function expects timer_list]) ZFS_LINUX_TEST_RESULT([timer_list_function], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST, 1, [timer_list.function gets a timer_list]) ],[ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING([whether struct timer_list has flags]) ZFS_LINUX_TEST_RESULT([timer_list_flags], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_KERNEL_TIMER_LIST_FLAGS, 1, [struct timer_list has a flags member]) ],[ AC_MSG_RESULT(no) ]) ]) diff --git a/config/kernel-tmpfile.m4 b/config/kernel-tmpfile.m4 index cc18b8f65a88..7439514186e4 100644 --- a/config/kernel-tmpfile.m4 +++ b/config/kernel-tmpfile.m4 @@ -1,86 +1,86 @@ dnl # dnl # 3.11 API change dnl # Add support for i_op->tmpfile dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [ dnl # dnl # 6.3 API change dnl # The first arg is now struct mnt_idmap * dnl # ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_mnt_idmap], [ #include - int tmpfile(struct mnt_idmap *idmap, + static int tmpfile(struct mnt_idmap *idmap, struct inode *inode, struct file *file, umode_t mode) { return 0; } static struct inode_operations iops __attribute__ ((unused)) = { .tmpfile = tmpfile, }; ],[]) dnl # 6.1 API change dnl # use struct file instead of struct dentry dnl # ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [ #include - int tmpfile(struct user_namespace *userns, + static int tmpfile(struct user_namespace *userns, struct inode *inode, struct file *file, umode_t mode) { return 0; } static struct inode_operations iops __attribute__ ((unused)) = { .tmpfile = tmpfile, }; ],[]) dnl # dnl # 5.11 API change dnl # add support for userns parameter to tmpfile dnl # ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_dentry_userns], [ #include - int tmpfile(struct user_namespace *userns, + static int tmpfile(struct user_namespace *userns, struct inode *inode, struct dentry *dentry, umode_t mode) { return 0; } static struct inode_operations iops __attribute__ ((unused)) = { .tmpfile = tmpfile, }; ],[]) ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_dentry], [ #include - int tmpfile(struct inode *inode, struct dentry *dentry, + static int tmpfile(struct inode *inode, struct dentry *dentry, umode_t mode) { return 0; } static struct inode_operations iops __attribute__ ((unused)) = { .tmpfile = tmpfile, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [ AC_MSG_CHECKING([whether i_op->tmpfile() exists]) ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_mnt_idmap], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists]) AC_DEFINE(HAVE_TMPFILE_IDMAP, 1, [i_op->tmpfile() has mnt_idmap]) ], [ ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists]) AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns]) ],[ ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry_userns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists]) AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns]) AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature]) ],[ ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists]) AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature]) ],[ ZFS_LINUX_REQUIRE_API([i_op->tmpfile()], [3.11]) ]) ]) ]) ]) ]) diff --git a/config/kernel-vfs-direct_IO.m4 b/config/kernel-vfs-direct_IO.m4 index 82583d52fcbc..7b7b91f979f9 100644 --- a/config/kernel-vfs-direct_IO.m4 +++ b/config/kernel-vfs-direct_IO.m4 @@ -1,109 +1,109 @@ dnl # dnl # Check for direct IO interfaces. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO], [ ZFS_LINUX_TEST_SRC([direct_io_iter], [ #include - ssize_t test_direct_IO(struct kiocb *kiocb, + static ssize_t test_direct_IO(struct kiocb *kiocb, struct iov_iter *iter) { return 0; } static const struct address_space_operations aops __attribute__ ((unused)) = { .direct_IO = test_direct_IO, }; ],[]) ZFS_LINUX_TEST_SRC([direct_io_iter_offset], [ #include - ssize_t test_direct_IO(struct kiocb *kiocb, + static ssize_t test_direct_IO(struct kiocb *kiocb, struct iov_iter *iter, loff_t offset) { return 0; } static const struct address_space_operations aops __attribute__ ((unused)) = { .direct_IO = test_direct_IO, }; ],[]) ZFS_LINUX_TEST_SRC([direct_io_iter_rw_offset], [ #include - ssize_t test_direct_IO(int rw, struct kiocb *kiocb, + static ssize_t test_direct_IO(int rw, struct kiocb *kiocb, struct iov_iter *iter, loff_t offset) { return 0; } static const struct address_space_operations aops __attribute__ ((unused)) = { .direct_IO = test_direct_IO, }; ],[]) ZFS_LINUX_TEST_SRC([direct_io_iovec], [ #include - ssize_t test_direct_IO(int rw, struct kiocb *kiocb, + static ssize_t test_direct_IO(int rw, struct kiocb *kiocb, const struct iovec *iov, loff_t offset, unsigned long nr_segs) { return 0; } static const struct address_space_operations aops __attribute__ ((unused)) = { .direct_IO = test_direct_IO, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_VFS_DIRECT_IO], [ dnl # dnl # Linux 4.6.x API change dnl # AC_MSG_CHECKING([whether aops->direct_IO() uses iov_iter]) ZFS_LINUX_TEST_RESULT([direct_io_iter], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER, 1, [aops->direct_IO() uses iov_iter without rw]) ],[ AC_MSG_RESULT([no]) dnl # dnl # Linux 4.1.x API change dnl # AC_MSG_CHECKING( [whether aops->direct_IO() uses offset]) ZFS_LINUX_TEST_RESULT([direct_io_iter_offset], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER_OFFSET, 1, [aops->direct_IO() uses iov_iter with offset]) ],[ AC_MSG_RESULT([no]) dnl # dnl # Linux 3.16.x API change dnl # AC_MSG_CHECKING( [whether aops->direct_IO() uses rw and offset]) ZFS_LINUX_TEST_RESULT([direct_io_iter_rw_offset], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET, 1, [aops->direct_IO() uses iov_iter with ] [rw and offset]) ],[ AC_MSG_RESULT([no]) dnl # dnl # Ancient Linux API (predates git) dnl # AC_MSG_CHECKING( [whether aops->direct_IO() uses iovec]) ZFS_LINUX_TEST_RESULT([direct_io_iovec], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_VFS_DIRECT_IO_IOVEC, 1, [aops->direct_IO() uses iovec]) ],[ ZFS_LINUX_TEST_ERROR([direct IO]) AC_MSG_RESULT([no]) ]) ]) ]) ]) ]) diff --git a/config/kernel-vfs-iterate.m4 b/config/kernel-vfs-iterate.m4 index 172118eac87b..2e396daa1c0f 100644 --- a/config/kernel-vfs-iterate.m4 +++ b/config/kernel-vfs-iterate.m4 @@ -1,83 +1,83 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_ITERATE], [ ZFS_LINUX_TEST_SRC([file_operations_iterate_shared], [ #include - int iterate(struct file *filp, struct dir_context * context) + static int iterate(struct file *filp, struct dir_context * context) { return 0; } static const struct file_operations fops __attribute__ ((unused)) = { .iterate_shared = iterate, }; ],[]) ZFS_LINUX_TEST_SRC([file_operations_iterate], [ #include - int iterate(struct file *filp, + static int iterate(struct file *filp, struct dir_context *context) { return 0; } static const struct file_operations fops __attribute__ ((unused)) = { .iterate = iterate, }; #if defined(FMODE_KABI_ITERATE) #error "RHEL 7.5, FMODE_KABI_ITERATE interface" #endif ],[]) ZFS_LINUX_TEST_SRC([file_operations_readdir], [ #include - int readdir(struct file *filp, void *entry, + static int readdir(struct file *filp, void *entry, filldir_t func) { return 0; } static const struct file_operations fops __attribute__ ((unused)) = { .readdir = readdir, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_VFS_ITERATE], [ dnl # dnl # 4.7 API change dnl # AC_MSG_CHECKING([whether fops->iterate_shared() is available]) ZFS_LINUX_TEST_RESULT([file_operations_iterate_shared], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_VFS_ITERATE_SHARED, 1, [fops->iterate_shared() is available]) ],[ AC_MSG_RESULT(no) dnl # dnl # 3.11 API change dnl # dnl # RHEL 7.5 compatibility; the fops.iterate() method was dnl # added to the file_operations structure but in order to dnl # maintain KABI compatibility all callers must set dnl # FMODE_KABI_ITERATE which is checked in iterate_dir(). dnl # When detected ignore this interface and fallback to dnl # to using fops.readdir() to retain KABI compatibility. dnl # AC_MSG_CHECKING([whether fops->iterate() is available]) ZFS_LINUX_TEST_RESULT([file_operations_iterate], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_VFS_ITERATE, 1, [fops->iterate() is available]) ],[ AC_MSG_RESULT(no) dnl # dnl # readdir interface introduced dnl # AC_MSG_CHECKING([whether fops->readdir() is available]) ZFS_LINUX_TEST_RESULT([file_operations_readdir], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_VFS_READDIR, 1, [fops->readdir() is available]) ],[ ZFS_LINUX_TEST_ERROR([vfs_iterate]) ]) ]) ]) ]) diff --git a/config/kernel-vfs-rw-iterate.m4 b/config/kernel-vfs-rw-iterate.m4 index 000353ec15b0..cb20ed03099a 100644 --- a/config/kernel-vfs-rw-iterate.m4 +++ b/config/kernel-vfs-rw-iterate.m4 @@ -1,80 +1,80 @@ dnl # dnl # Linux 3.16 API dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_RW_ITERATE], [ ZFS_LINUX_TEST_SRC([file_operations_rw], [ #include - ssize_t test_read(struct kiocb *kiocb, struct iov_iter *to) + static ssize_t test_read(struct kiocb *kiocb, struct iov_iter *to) { return 0; } - ssize_t test_write(struct kiocb *kiocb, struct iov_iter *from) + static ssize_t test_write(struct kiocb *kiocb, struct iov_iter *from) { return 0; } static const struct file_operations fops __attribute__ ((unused)) = { .read_iter = test_read, .write_iter = test_write, }; ],[]) ZFS_LINUX_TEST_SRC([new_sync_rw], [ #include ],[ ssize_t ret __attribute__ ((unused)); struct file *filp = NULL; char __user *rbuf = NULL; const char __user *wbuf = NULL; size_t len = 0; loff_t ppos; ret = new_sync_read(filp, rbuf, len, &ppos); ret = new_sync_write(filp, wbuf, len, &ppos); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_VFS_RW_ITERATE], [ AC_MSG_CHECKING([whether fops->read/write_iter() are available]) ZFS_LINUX_TEST_RESULT([file_operations_rw], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_VFS_RW_ITERATE, 1, [fops->read/write_iter() are available]) dnl # dnl # Linux 4.1 API dnl # AC_MSG_CHECKING([whether new_sync_read/write() are available]) ZFS_LINUX_TEST_RESULT([new_sync_rw], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NEW_SYNC_READ, 1, [new_sync_read()/new_sync_write() are available]) ],[ AC_MSG_RESULT(no) ]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # Linux 4.1.x API dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_GENERIC_WRITE_CHECKS], [ ZFS_LINUX_TEST_SRC([generic_write_checks], [ #include ],[ struct kiocb *iocb = NULL; struct iov_iter *iov = NULL; generic_write_checks(iocb, iov); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_VFS_GENERIC_WRITE_CHECKS], [ AC_MSG_CHECKING([whether generic_write_checks() takes kiocb]) ZFS_LINUX_TEST_RESULT([generic_write_checks], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GENERIC_WRITE_CHECKS_KIOCB, 1, [generic_write_checks() takes kiocb]) ],[ AC_MSG_RESULT(no) ]) ]) diff --git a/config/kernel-writepage_t.m4 b/config/kernel-writepage_t.m4 index 3a0cffd98570..a82cf370c9d4 100644 --- a/config/kernel-writepage_t.m4 +++ b/config/kernel-writepage_t.m4 @@ -1,26 +1,26 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_WRITEPAGE_T], [ dnl # dnl # 6.3 API change dnl # The writepage_t function type now has its first argument as dnl # struct folio* instead of struct page* dnl # ZFS_LINUX_TEST_SRC([writepage_t_folio], [ #include - int putpage(struct folio *folio, + static int putpage(struct folio *folio, struct writeback_control *wbc, void *data) { return 0; } writepage_t func = putpage; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_WRITEPAGE_T], [ AC_MSG_CHECKING([whether int (*writepage_t)() takes struct folio*]) ZFS_LINUX_TEST_RESULT([writepage_t_folio], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_WRITEPAGE_T_FOLIO, 1, [int (*writepage_t)() takes struct folio*]) ],[ AC_MSG_RESULT(no) ]) ]) diff --git a/config/kernel-xattr-handler.m4 b/config/kernel-xattr-handler.m4 index 6b8a08dbcc80..32f58c70a500 100644 --- a/config/kernel-xattr-handler.m4 +++ b/config/kernel-xattr-handler.m4 @@ -1,477 +1,477 @@ dnl # dnl # 2.6.35 API change, dnl # The 'struct xattr_handler' was constified in the generic dnl # super_block structure. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_CONST_XATTR_HANDLER], [ ZFS_LINUX_TEST_SRC([const_xattr_handler], [ #include #include const struct xattr_handler xattr_test_handler = { .prefix = "test", .get = NULL, .set = NULL, }; const struct xattr_handler *xattr_handlers[] = { &xattr_test_handler, }; const struct super_block sb __attribute__ ((unused)) = { .s_xattr = xattr_handlers, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_CONST_XATTR_HANDLER], [ AC_MSG_CHECKING([whether super_block uses const struct xattr_handler]) ZFS_LINUX_TEST_RESULT([const_xattr_handler], [ AC_MSG_RESULT([yes]) ],[ ZFS_LINUX_TEST_ERROR([const xattr_handler]) ]) ]) dnl # dnl # 4.5 API change, dnl # struct xattr_handler added new member "name". dnl # xattr_handler which matches to whole name rather than prefix should use dnl # "name" instead of "prefix", e.g. "system.posix_acl_access" dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_NAME], [ ZFS_LINUX_TEST_SRC([xattr_handler_name], [ #include static const struct xattr_handler xops __attribute__ ((unused)) = { .name = XATTR_NAME_POSIX_ACL_ACCESS, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_NAME], [ AC_MSG_CHECKING([whether xattr_handler has name]) ZFS_LINUX_TEST_RESULT([xattr_handler_name], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1, [xattr_handler has name]) ],[ AC_MSG_RESULT(no) ]) ]) dnl # dnl # Supported xattr handler get() interfaces checked newest to oldest. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET], [ ZFS_LINUX_TEST_SRC([xattr_handler_get_dentry_inode], [ #include - int get(const struct xattr_handler *handler, + static int get(const struct xattr_handler *handler, struct dentry *dentry, struct inode *inode, const char *name, void *buffer, size_t size) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .get = get, }; ],[]) ZFS_LINUX_TEST_SRC([xattr_handler_get_xattr_handler], [ #include - int get(const struct xattr_handler *handler, + static int get(const struct xattr_handler *handler, struct dentry *dentry, const char *name, void *buffer, size_t size) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .get = get, }; ],[]) ZFS_LINUX_TEST_SRC([xattr_handler_get_dentry], [ #include - int get(struct dentry *dentry, const char *name, + static int get(struct dentry *dentry, const char *name, void *buffer, size_t size, int handler_flags) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .get = get, }; ],[]) ZFS_LINUX_TEST_SRC([xattr_handler_get_dentry_inode_flags], [ #include - int get(const struct xattr_handler *handler, + static int get(const struct xattr_handler *handler, struct dentry *dentry, struct inode *inode, const char *name, void *buffer, size_t size, int flags) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .get = get, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [ dnl # dnl # 4.7 API change, dnl # The xattr_handler->get() callback was changed to take both dnl # dentry and inode. dnl # AC_MSG_CHECKING([whether xattr_handler->get() wants dentry and inode]) ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry_inode], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_GET_DENTRY_INODE, 1, [xattr_handler->get() wants both dentry and inode]) ],[ dnl # dnl # 4.4 API change, dnl # The xattr_handler->get() callback was changed to take a dnl # attr_handler, and handler_flags argument was removed and dnl # should be accessed by handler->flags. dnl # AC_MSG_RESULT(no) AC_MSG_CHECKING( [whether xattr_handler->get() wants xattr_handler]) ZFS_LINUX_TEST_RESULT([xattr_handler_get_xattr_handler], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_GET_HANDLER, 1, [xattr_handler->get() wants xattr_handler]) ],[ dnl # dnl # 2.6.33 API change, dnl # The xattr_handler->get() callback was changed dnl # to take a dentry instead of an inode, and a dnl # handler_flags argument was added. dnl # AC_MSG_RESULT(no) AC_MSG_CHECKING( [whether xattr_handler->get() wants dentry]) ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_GET_DENTRY, 1, [xattr_handler->get() wants dentry]) ],[ dnl # dnl # Android API change, dnl # The xattr_handler->get() callback was dnl # changed to take dentry, inode and flags. dnl # AC_MSG_RESULT(no) AC_MSG_CHECKING( [whether xattr_handler->get() wants dentry and inode and flags]) ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry_inode_flags], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_GET_DENTRY_INODE_FLAGS, 1, [xattr_handler->get() wants dentry and inode and flags]) ],[ ZFS_LINUX_TEST_ERROR([xattr get()]) ]) ]) ]) ]) ]) dnl # dnl # Supported xattr handler set() interfaces checked newest to oldest. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET], [ ZFS_LINUX_TEST_SRC([xattr_handler_set_mnt_idmap], [ #include - int set(const struct xattr_handler *handler, + static int set(const struct xattr_handler *handler, struct mnt_idmap *idmap, struct dentry *dentry, struct inode *inode, const char *name, const void *buffer, size_t size, int flags) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .set = set, }; ],[]) ZFS_LINUX_TEST_SRC([xattr_handler_set_userns], [ #include - int set(const struct xattr_handler *handler, + static int set(const struct xattr_handler *handler, struct user_namespace *mnt_userns, struct dentry *dentry, struct inode *inode, const char *name, const void *buffer, size_t size, int flags) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .set = set, }; ],[]) ZFS_LINUX_TEST_SRC([xattr_handler_set_dentry_inode], [ #include - int set(const struct xattr_handler *handler, + static int set(const struct xattr_handler *handler, struct dentry *dentry, struct inode *inode, const char *name, const void *buffer, size_t size, int flags) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .set = set, }; ],[]) ZFS_LINUX_TEST_SRC([xattr_handler_set_xattr_handler], [ #include - int set(const struct xattr_handler *handler, + static int set(const struct xattr_handler *handler, struct dentry *dentry, const char *name, const void *buffer, size_t size, int flags) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .set = set, }; ],[]) ZFS_LINUX_TEST_SRC([xattr_handler_set_dentry], [ #include - int set(struct dentry *dentry, const char *name, + static int set(struct dentry *dentry, const char *name, const void *buffer, size_t size, int flags, int handler_flags) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .set = set, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [ dnl # dnl # 5.12 API change, dnl # The xattr_handler->set() callback was changed to 8 arguments, and dnl # struct user_namespace* was inserted as arg #2 dnl # dnl # 6.3 API change, dnl # The xattr_handler->set() callback 2nd arg is now struct mnt_idmap * dnl # AC_MSG_CHECKING([whether xattr_handler->set() wants dentry, inode, and mnt_idmap]) ZFS_LINUX_TEST_RESULT([xattr_handler_set_mnt_idmap], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_SET_IDMAP, 1, [xattr_handler->set() takes mnt_idmap]) ], [ AC_MSG_CHECKING([whether xattr_handler->set() wants dentry, inode, and user_namespace]) ZFS_LINUX_TEST_RESULT([xattr_handler_set_userns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_SET_USERNS, 1, [xattr_handler->set() takes user_namespace]) ],[ dnl # dnl # 4.7 API change, dnl # The xattr_handler->set() callback was changed to take both dnl # dentry and inode. dnl # AC_MSG_RESULT(no) AC_MSG_CHECKING([whether xattr_handler->set() wants dentry and inode]) ZFS_LINUX_TEST_RESULT([xattr_handler_set_dentry_inode], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_SET_DENTRY_INODE, 1, [xattr_handler->set() wants both dentry and inode]) ],[ dnl # dnl # 4.4 API change, dnl # The xattr_handler->set() callback was changed to take a dnl # xattr_handler, and handler_flags argument was removed and dnl # should be accessed by handler->flags. dnl # AC_MSG_RESULT(no) AC_MSG_CHECKING( [whether xattr_handler->set() wants xattr_handler]) ZFS_LINUX_TEST_RESULT([xattr_handler_set_xattr_handler], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_SET_HANDLER, 1, [xattr_handler->set() wants xattr_handler]) ],[ dnl # dnl # 2.6.33 API change, dnl # The xattr_handler->set() callback was changed dnl # to take a dentry instead of an inode, and a dnl # handler_flags argument was added. dnl # AC_MSG_RESULT(no) AC_MSG_CHECKING( [whether xattr_handler->set() wants dentry]) ZFS_LINUX_TEST_RESULT([xattr_handler_set_dentry], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_SET_DENTRY, 1, [xattr_handler->set() wants dentry]) ],[ ZFS_LINUX_TEST_ERROR([xattr set()]) ]) ]) ]) ]) ]) ]) dnl # dnl # Supported xattr handler list() interfaces checked newest to oldest. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_LIST], [ ZFS_LINUX_TEST_SRC([xattr_handler_list_simple], [ #include - bool list(struct dentry *dentry) { return 0; } + static bool list(struct dentry *dentry) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .list = list, }; ],[]) ZFS_LINUX_TEST_SRC([xattr_handler_list_xattr_handler], [ #include - size_t list(const struct xattr_handler *handler, + static size_t list(const struct xattr_handler *handler, struct dentry *dentry, char *list, size_t list_size, const char *name, size_t name_len) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .list = list, }; ],[]) ZFS_LINUX_TEST_SRC([xattr_handler_list_dentry], [ #include - size_t list(struct dentry *dentry, + static size_t list(struct dentry *dentry, char *list, size_t list_size, const char *name, size_t name_len, int handler_flags) { return 0; } static const struct xattr_handler xops __attribute__ ((unused)) = { .list = list, }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [ dnl # 4.5 API change, dnl # The xattr_handler->list() callback was changed to take only a dnl # dentry and it only needs to return if it's accessible. AC_MSG_CHECKING([whether xattr_handler->list() wants simple]) ZFS_LINUX_TEST_RESULT([xattr_handler_list_simple], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_LIST_SIMPLE, 1, [xattr_handler->list() wants simple]) ],[ dnl # dnl # 4.4 API change, dnl # The xattr_handler->list() callback was changed to take a dnl # xattr_handler, and handler_flags argument was removed dnl # and should be accessed by handler->flags. dnl # AC_MSG_RESULT(no) AC_MSG_CHECKING( [whether xattr_handler->list() wants xattr_handler]) ZFS_LINUX_TEST_RESULT([xattr_handler_list_xattr_handler], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_LIST_HANDLER, 1, [xattr_handler->list() wants xattr_handler]) ],[ dnl # dnl # 2.6.33 API change, dnl # The xattr_handler->list() callback was changed dnl # to take a dentry instead of an inode, and a dnl # handler_flags argument was added. dnl # AC_MSG_RESULT(no) AC_MSG_CHECKING( [whether xattr_handler->list() wants dentry]) ZFS_LINUX_TEST_RESULT([xattr_handler_list_dentry], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_XATTR_LIST_DENTRY, 1, [xattr_handler->list() wants dentry]) ],[ ZFS_LINUX_TEST_ERROR([xattr list()]) ]) ]) ]) ]) dnl # dnl # 3.7 API change, dnl # The posix_acl_{from,to}_xattr functions gained a new dnl # parameter: user_ns dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_FROM_XATTR_USERNS], [ ZFS_LINUX_TEST_SRC([posix_acl_from_xattr_userns], [ #include #include #include ],[ posix_acl_from_xattr(&init_user_ns, NULL, 0); ]) ]) AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_FROM_XATTR_USERNS], [ AC_MSG_CHECKING([whether posix_acl_from_xattr() needs user_ns]) ZFS_LINUX_TEST_RESULT([posix_acl_from_xattr_userns], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_POSIX_ACL_FROM_XATTR_USERNS, 1, [posix_acl_from_xattr() needs user_ns]) ],[ ZFS_LINUX_TEST_ERROR([posix_acl_from_xattr()]) ]) ]) dnl # dnl # 4.9 API change, dnl # iops->{set,get,remove}xattr and generic_{set,get,remove}xattr are dnl # removed. xattr operations will directly go through sb->s_xattr. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_SETXATTR], [ ZFS_LINUX_TEST_SRC([have_generic_setxattr], [ #include #include static const struct inode_operations iops __attribute__ ((unused)) = { .setxattr = generic_setxattr }; ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_GENERIC_SETXATTR], [ AC_MSG_CHECKING([whether generic_setxattr() exists]) ZFS_LINUX_TEST_RESULT([have_generic_setxattr], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GENERIC_SETXATTR, 1, [generic_setxattr() exists]) ],[ AC_MSG_RESULT(no) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR], [ ZFS_AC_KERNEL_SRC_CONST_XATTR_HANDLER ZFS_AC_KERNEL_SRC_XATTR_HANDLER_NAME ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET ZFS_AC_KERNEL_SRC_XATTR_HANDLER_LIST ZFS_AC_KERNEL_SRC_POSIX_ACL_FROM_XATTR_USERNS ZFS_AC_KERNEL_SRC_GENERIC_SETXATTR ]) AC_DEFUN([ZFS_AC_KERNEL_XATTR], [ ZFS_AC_KERNEL_CONST_XATTR_HANDLER ZFS_AC_KERNEL_XATTR_HANDLER_NAME ZFS_AC_KERNEL_XATTR_HANDLER_GET ZFS_AC_KERNEL_XATTR_HANDLER_SET ZFS_AC_KERNEL_XATTR_HANDLER_LIST ZFS_AC_KERNEL_POSIX_ACL_FROM_XATTR_USERNS ZFS_AC_KERNEL_GENERIC_SETXATTR ])