#include <linux/fs.h>
],[
vfs_rename(NULL, NULL, NULL, NULL, NULL);
- ], [
- AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
- [kernel has vfs_rename with 5 args])
])
])
AC_DEFUN([LC_VFS_RENAME_5ARGS], [
LB2_LINUX_TEST_SRC([inode_ops_has_user_namespace_argument], [
#include <linux/fs.h>
],[
- ((struct inode_operations *)1)->getattr((struct user_namespace *)NULL,
- NULL, NULL, 0, 0);
+ struct inode_operations *iops = NULL;
+ struct user_namespace *user_ns = NULL;
+
+ iops->getattr(user_ns, NULL, NULL, 0, 0);
],[-Werror])
])
AC_DEFUN([LC_HAVE_USER_NAMESPACE_ARG], [
#define Q_COPY(out, in, member) (out)->member = (in)->member
-/* NOTE:
- * - in and out maybe a type of struct if_quotactl or struct obd_quotactl
- * - in and out need not be of the same type.
- */
-#define __QCTL_COPY(out, in, need_pname) \
+#define QCTL_COPY_NO_PNAME(out, in) \
do { \
Q_COPY(out, in, qc_cmd); \
Q_COPY(out, in, qc_type); \
Q_COPY(out, in, qc_stat); \
Q_COPY(out, in, qc_dqinfo); \
Q_COPY(out, in, qc_dqblk); \
- if (need_pname && LUSTRE_Q_CMD_IS_POOL(in->qc_cmd)) { \
+} while (0)
+
+/* NOTE:
+ * - in and out maybe a type of struct if_quotactl or struct obd_quotactl
+ * - in and out need not be of the same type.
+ */
+#define QCTL_COPY(out, in) \
+do { \
+ QCTL_COPY_NO_PNAME(out, in); \
+ if (LUSTRE_Q_CMD_IS_POOL(in->qc_cmd)) { \
size_t len = strnlen(in->qc_poolname, LOV_MAXPOOLNAME); \
\
memcpy(out->qc_poolname, in->qc_poolname, len); \
} \
} while (0)
-#define QCTL_COPY(out, in) __QCTL_COPY(out, in, true)
-#define QCTL_COPY_NO_PNAME(out, in) __QCTL_COPY(out, in, false)
-
/* Body of quota request used for quota acquire/release RPCs between quota
* master (aka QMT) and slaves (ak QSD). */
struct quota_body {
QCTL_COPY(oqctl, qctl);
rc = obd_quotactl(tgt->ltd_exp, oqctl);
if (rc == 0) {
- QCTL_COPY(qctl, oqctl);
+ QCTL_COPY_NO_PNAME(qctl, oqctl);
qctl->qc_valid = QC_MDTIDX;
qctl->obd_uuid = tgt->ltd_uuid;
}
QCTL_COPY(oqctl, qctl);
rc = obd_quotactl(tgt->ltd_exp, oqctl);
if (rc == 0) {
- QCTL_COPY(qctl, oqctl);
+ QCTL_COPY_NO_PNAME(qctl, oqctl);
qctl->qc_valid = QC_OSTIDX;
qctl->obd_uuid = tgt->ltd_uuid;
}
QCTL_COPY(oqctl, qctl);
rc = obd_quotactl(exp, oqctl);
if (rc == 0) {
- QCTL_COPY(qctl, oqctl);
+ QCTL_COPY_NO_PNAME(qctl, oqctl);
qctl->qc_valid = QC_MDTIDX;
qctl->obd_uuid = obd->u.cli.cl_target_uuid;
}