]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT_IN_FILELOCK
#
+# LC_HAVE_IOV_ITER_IOVEC
+#
+# linux kernel v6.3-rc4-32-g6eb203e1a868
+# iov_iter: remove iov_iter_iovec()
+#
+AC_DEFUN([LC_SRC_HAVE_IOV_ITER_IOVEC], [
+ LB2_LINUX_TEST_SRC([iov_iter_iovec_exists], [
+ #include <linux/uio.h>
+ ],[
+ struct iovec iov __attribute__ ((unused));
+ struct iov_iter i = { };
+
+ iov = iov_iter_iovec(&i);
+ ],[-Werror])
+])
+AC_DEFUN([LC_HAVE_IOV_ITER_IOVEC], [
+ AC_MSG_CHECKING([if 'iov_iter_iovec' is available])
+ LB2_LINUX_TEST_RESULT([iov_iter_iovec_exists], [
+ AC_DEFINE(HAVE_IOV_ITER_IOVEC, 1,
+ ['iov_iter_iovec' is available])
+ ])
+]) # LC_HAVE_IOV_ITER_IOVEC
+
+#
+# LC_HAVE_IOVEC_WITH_IOV_MEMBER
+#
+# linux kernel v6.3-rc4-34-g747b1f65d39a
+# iov_iter: overlay struct iovec and ubuf/len
+# This renames iov_iter member iov to __iov and now __iov == __ubuf_iovec
+# And provides the iov_iter() accessor to return __iov or __ubuf_iovec
+#
+AC_DEFUN([LC_SRC_HAVE_IOVEC_WITH_IOV_MEMBER], [
+ LB2_LINUX_TEST_SRC([iov_iter_has___iov_member], [
+ #include <linux/uio.h>
+ ],[
+ struct iov_iter iter = { };
+ size_t len __attribute__ ((unused));
+
+ len = iter.__iov->iov_len;
+ ],[-Werror])
+])
+AC_DEFUN([LC_HAVE_IOVEC_WITH_IOV_MEMBER], [
+ AC_MSG_CHECKING([if 'iov_iter_iovec' is available])
+ LB2_LINUX_TEST_RESULT([iov_iter_has___iov_member], [
+ AC_DEFINE(HAVE___IOV_MEMBER, __iov,
+ ['struct iov_iter' has '__iov' member])
+ AC_DEFINE(HAVE_ITER_IOV, 1,
+ [iter_iov() is available])
+ ],[
+ AC_DEFINE(iter_iov(iter), (iter)->__iov,
+ ['iov_iter()' provides iov])
+ AC_DEFINE(__iov, iov,
+ ['struct iov_iter' has 'iov' member])
+ ])
+]) # LC_HAVE_IOVEC_WITH_IOV_MEMBER
+
+#
+# LC_HAVE_CLASS_CREATE_MODULE_ARG
+#
+# linux kernel v6.3-rc1-13-g1aaba11da9aa
+# driver core: class: remove module * from class_create()
+#
+AC_DEFUN([LC_SRC_HAVE_CLASS_CREATE_MODULE_ARG], [
+ LB2_LINUX_TEST_SRC([class_create_without_module_arg], [
+ #include <linux/device/class.h>
+ ],[
+ struct class *class __attribute__ ((unused));
+
+ class = class_create("empty");
+ if (IS_ERR(class))
+ /* checked */;
+ ],[-Werror])
+])
+AC_DEFUN([LC_HAVE_CLASS_CREATE_MODULE_ARG], [
+ AC_MSG_CHECKING([if 'class_create' does not have module arg])
+ LB2_LINUX_TEST_RESULT([class_create_without_module_arg], [
+ AC_DEFINE([ll_class_create(name)],
+ [class_create((name))],
+ ['class_create' does not have module arg])
+ ],[
+ AC_DEFINE([ll_class_create(name)],
+ [class_create(THIS_MODULE, (name))],
+ ['class_create' expects module arg])
+ ])
+]) # LC_HAVE_CLASS_CREATE_MODULE_ARG
+
+#
+# LC_HAVE_GET_EXPIRY_TIME64_T
+#
+# linux kernel v6.3-rc7-2433-gcf64b9bce950
+# SUNRPC: return proper error from get_expiry()
+#
+AC_DEFUN([LC_SRC_HAVE_GET_EXPIRY_TIME64_T], [
+ LB2_LINUX_TEST_SRC([get_expiry_with_time64_t], [
+ #include <linux/sunrpc/cache.h>
+ ],[
+ int err __attribute__ ((unused));
+
+ err = get_expiry((char **)NULL, (time64_t *)NULL);
+ ],[-Werror])
+])
+AC_DEFUN([LC_HAVE_GET_EXPIRY_TIME64_T], [
+ AC_MSG_CHECKING([if 'get_expiry' needs a time64_t arg])
+ LB2_LINUX_TEST_RESULT([get_expiry_with_time64_t], [
+ AC_DEFINE(HAVE_GET_EXPIRY_2ARGS, 1,
+ ['get_expiry' takes time64_t])
+ ])
+]) # LC_HAVE_GET_EXPIRY_TIME64_T
+
+#
# LC_PROG_LINUX
#
# Lustre linux kernel checks
LC_SRC_HAVE_LOCKS_LOCK_FILE_WAIT_IN_FILELOCK
LC_SRC_HAVE_U64_CAPABILITY
+ # 6.4
+ LC_SRC_HAVE_IOV_ITER_IOVEC
+ LC_SRC_HAVE_IOVEC_WITH_IOV_MEMBER
+ LC_SRC_HAVE_CLASS_CREATE_MODULE_ARG
+ LC_SRC_HAVE_GET_EXPIRY_TIME64_T
+
# kernel patch to extend integrity interface
LC_SRC_BIO_INTEGRITY_PREP_FN
])
LC_HAVE_LOCKS_LOCK_FILE_WAIT_IN_FILELOCK
LC_HAVE_U64_CAPABILITY
+ # 6.4
+ LC_HAVE_IOV_ITER_IOVEC
+ LC_HAVE_IOVEC_WITH_IOV_MEMBER
+ LC_HAVE_CLASS_CREATE_MODULE_ARG
+ LC_HAVE_GET_EXPIRY_TIME64_T
+
# kernel patch to extend integrity interface
LC_BIO_INTEGRITY_PREP_FN
])
# define SB_KERNMOUNT MS_KERNMOUNT
#endif
-#ifndef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
-static inline void iov_iter_reexpand(struct iov_iter *i, size_t count)
-{
- i->count = count;
-}
-
+#ifndef HAVE_IOV_ITER_IOVEC
static inline struct iovec iov_iter_iovec(const struct iov_iter *iter)
{
return (struct iovec) {
- .iov_base = iter->iov->iov_base + iter->iov_offset,
+ .iov_base = iter->__iov->iov_base + iter->iov_offset,
.iov_len = min(iter->count,
- iter->iov->iov_len - iter->iov_offset),
+ iter->__iov->iov_len - iter->iov_offset),
};
}
+#endif
+
+#ifndef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
+static inline void iov_iter_reexpand(struct iov_iter *i, size_t count)
+{
+ i->count = count;
+}
#define iov_for_each(iov, iter, start) \
for (iter = (start); \
count = result;
} else {
/* same calculation used in ll_get_user_pages */
- count = min_t(size_t, count, iter->iov->iov_len);
+ count = min_t(size_t, count, iter_iov(iter)->iov_len);
result = ll_allocate_dio_buffer(pvec, count);
/* allocate_dio_buffer returns number of pages or
* error, so do not set count = result
if (rc)
return rc;
- mdc_changelog_class = class_create(THIS_MODULE, MDC_CHANGELOG_DEV_NAME);
+ mdc_changelog_class = ll_class_create(MDC_CHANGELOG_DEV_NAME);
if (IS_ERR(mdc_changelog_class)) {
rc = PTR_ERR(mdc_changelog_class);
goto out_dev;
/* save the iovec pointer before it's modified by
* ll_dio_user_copy
*/
- struct iovec *tmp = (struct iovec *) sdio->csd_iter.iov;
+ struct iovec *tmp = (struct iovec *) sdio->csd_iter.__iov;
CDEBUG(D_VFSTRACE,
"finishing unaligned dio %s aio->cda_bytes %ld\n",
* because we have the unmodified iovec pointer
*/
OBD_FREE_PTR(tmp);
- sdio->csd_iter.iov = NULL;
+ sdio->csd_iter.__iov = NULL;
} else {
/* unaligned DIO does not get user pages, so it doesn't have to
* release them, but aligned I/O must
* separate thread requires a local copy of the iovec
*/
memcpy(&sdio->csd_iter, iter, sizeof(struct iov_iter));
- OBD_ALLOC_PTR(sdio->csd_iter.iov);
- if (sdio->csd_iter.iov == NULL) {
+ OBD_ALLOC_PTR(sdio->csd_iter.__iov);
+ if (sdio->csd_iter.__iov == NULL) {
cl_sub_dio_free(sdio);
sdio = NULL;
goto out;
}
- memcpy((void *) sdio->csd_iter.iov, iter->iov,
+ memcpy((void *) sdio->csd_iter.__iov, iter->__iov,
sizeof(struct iovec));
}
}
void cl_sub_dio_free(struct cl_sub_dio *sdio)
{
if (sdio) {
- void *tmp = (void *)sdio->csd_iter.iov;
+ void *tmp = (void *)sdio->csd_iter.__iov;
if (tmp) {
LASSERT(sdio->csd_unaligned);
oal_log_major = MAJOR(dev);
- oal_log_class = class_create(THIS_MODULE, LUSTRE_ACCESS_LOG_DIR_NAME);
+ oal_log_class = ll_class_create(LUSTRE_ACCESS_LOG_DIR_NAME);
if (IS_ERR(oal_log_class)) {
rc = PTR_ERR(oal_log_class);
goto out_dev;
#include "gss_api.h"
#include "gss_crypto.h"
+#ifndef HAVE_GET_EXPIRY_2ARGS
+static inline int __get_expiry2(char **bpp, time64_t *rvp)
+{
+ *rvp = get_expiry(bpp);
+ return *rvp ? 0 : -EINVAL;
+}
+#define get_expiry(ps, pt) __get_expiry2((ps), (pt))
+#endif
+
#define GSS_SVC_UPCALL_TIMEOUT (20)
static DEFINE_SPINLOCK(__ctx_index_lock);
* Directly return -EINVAL in this case.
*/
status = -EINVAL;
- goto out;
+ goto out;
}
rsii.h.flags = 0;
/* expiry */
- expiry = get_expiry(&mesg);
- if (expiry == 0)
+ status = get_expiry(&mesg, &expiry);
+ if (status)
goto out;
len = qword_get(&mesg, buf, mlen);
static int rsc_parse(struct cache_detail *cd, char *mesg, int mlen)
{
- char *buf = mesg;
- int len, rv, tmp_int;
- struct rsc rsci, *rscp = NULL;
+ char *buf = mesg;
+ int len, rv, tmp_int;
+ struct rsc rsci, *rscp = NULL;
time64_t expiry;
- int status = -EINVAL;
- struct gss_api_mech *gm = NULL;
+ int status = -EINVAL;
+ struct gss_api_mech *gm = NULL;
- memset(&rsci, 0, sizeof(rsci));
+ memset(&rsci, 0, sizeof(rsci));
- /* context handle */
- len = qword_get(&mesg, buf, mlen);
- if (len < 0) goto out;
- status = -ENOMEM;
- if (rawobj_alloc(&rsci.handle, buf, len))
- goto out;
-
- rsci.h.flags = 0;
- /* expiry */
- expiry = get_expiry(&mesg);
- status = -EINVAL;
- if (expiry == 0)
- goto out;
-
- /* remote flag */
- rv = get_int(&mesg, &tmp_int);
- if (rv) {
- CERROR("fail to get remote flag\n");
- goto out;
- }
- rsci.ctx.gsc_remote = (tmp_int != 0);
+ /* context handle */
+ len = qword_get(&mesg, buf, mlen);
+ if (len < 0)
+ goto out;
+
+ status = -ENOMEM;
+ if (rawobj_alloc(&rsci.handle, buf, len))
+ goto out;
+
+ rsci.h.flags = 0;
+ /* expiry */
+ status = get_expiry(&mesg, &expiry);
+ if (status)
+ goto out;
+
+ status = -EINVAL;
+ /* remote flag */
+ rv = get_int(&mesg, &tmp_int);
+ if (rv) {
+ CERROR("fail to get remote flag\n");
+ goto out;
+ }
+ rsci.ctx.gsc_remote = (tmp_int != 0);
/* root user flag */
rv = get_int(&mesg, &tmp_int);
}
rsci.ctx.gsc_usr_root = (tmp_int != 0);
- /* mds user flag */
- rv = get_int(&mesg, &tmp_int);
- if (rv) {
- CERROR("fail to get mds user flag\n");
- goto out;
- }
- rsci.ctx.gsc_usr_mds = (tmp_int != 0);
+ /* mds user flag */
+ rv = get_int(&mesg, &tmp_int);
+ if (rv) {
+ CERROR("fail to get mds user flag\n");
+ goto out;
+ }
+ rsci.ctx.gsc_usr_mds = (tmp_int != 0);
- /* oss user flag */
- rv = get_int(&mesg, &tmp_int);
- if (rv) {
- CERROR("fail to get oss user flag\n");
- goto out;
- }
- rsci.ctx.gsc_usr_oss = (tmp_int != 0);
+ /* oss user flag */
+ rv = get_int(&mesg, &tmp_int);
+ if (rv) {
+ CERROR("fail to get oss user flag\n");
+ goto out;
+ }
+ rsci.ctx.gsc_usr_oss = (tmp_int != 0);
- /* mapped uid */
- rv = get_int(&mesg, (int *) &rsci.ctx.gsc_mapped_uid);
- if (rv) {
- CERROR("fail to get mapped uid\n");
- goto out;
- }
+ /* mapped uid */
+ rv = get_int(&mesg, (int *) &rsci.ctx.gsc_mapped_uid);
+ if (rv) {
+ CERROR("fail to get mapped uid\n");
+ goto out;
+ }
- rscp = rsc_lookup(&rsci);
- if (!rscp)
- goto out;
-
- /* uid, or NEGATIVE */
- rv = get_int(&mesg, (int *) &rsci.ctx.gsc_uid);
- if (rv == -EINVAL)
- goto out;
- if (rv == -ENOENT) {
- CERROR("NOENT? set rsc entry negative\n");
+ rscp = rsc_lookup(&rsci);
+ if (!rscp)
+ goto out;
+
+ /* uid, or NEGATIVE */
+ rv = get_int(&mesg, (int *) &rsci.ctx.gsc_uid);
+ if (rv == -EINVAL)
+ goto out;
+ if (rv == -ENOENT) {
+ CERROR("NOENT? set rsc entry negative\n");
set_bit(CACHE_NEGATIVE, &rsci.h.flags);
- } else {
+ } else {
rawobj_t tmp_buf;
time64_t ctx_expiry;
* We want just the number of seconds into the future.
*/
expiry += ctx_expiry - ktime_get_real_seconds();
- }
+ }
- rsci.h.expiry_time = expiry;
- rscp = rsc_update(&rsci, rscp);
- status = 0;
+ rsci.h.expiry_time = expiry;
+ rscp = rsc_update(&rsci, rscp);
+ status = 0;
out:
- if (gm)
- lgss_mech_put(gm);
- rsc_free(&rsci);
- if (rscp)
- cache_put(&rscp->h, &rsc_cache);
- else
- status = -ENOMEM;
+ if (gm)
+ lgss_mech_put(gm);
+ rsc_free(&rsci);
+ if (rscp)
+ cache_put(&rscp->h, &rsc_cache);
+ else
+ status = -ENOMEM;
- if (status)
- CERROR("parse rsc error %d\n", status);
- return status;
+ if (status)
+ CERROR("parse rsc error %d\n", status);
+ return status;
}
static struct cache_detail rsc_cache = {