From nobody Tue Jan 24 22:10:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P1h4S0QXxz3bfFN; Tue, 24 Jan 2023 22:10:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1h4R5Xrzz4LTm; Tue, 24 Jan 2023 22:10:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QIRf8adSMSxW5HpuI1gDn2DFWQzp8yPImgQvEKqqtMI=; b=US8GAT6/Y9wtES9iqCpP3glQ2CZ10+CHKV3OrDzSbnpYb27Pb3vhFwuHC3OG9/y/OZf8Fj WsggLspm4uj9sZT5dQ230DUq/GWNieKvf7ABgfOKNzOSmc4Mwc0fAb+caa7ddYrUhQiCiG ZyLepXEUGCOQzWPSM7uuDiq78HGzZFdm/O8ornoQhR6VAozGcFQPWzXm/xQZaA9+qatVSR e0cRzleBeVVRwtmxfYcHQHueweFqjMKrb5CuomD+dRsYnNra1Z0pk0B7wtihV+dBHRJ3Ff 6tlWNxfMdCB3UL/gvd+3Alkxk6NBSx+e93y68aJEDR2UDyUFCMQ79QVPqLS3ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QIRf8adSMSxW5HpuI1gDn2DFWQzp8yPImgQvEKqqtMI=; b=xgFo/uwNz8CCfZL/9btjtVaWHTz947z5IHoVwgd+CGtCecE3PD8gW1OnMMT65dpjgnLxm3 LHLpgnVMyd/CtRIJ7JJb+PDfa5nMQQC84TMm0ANKuPmlhgsdKsljjz96hYEdNsBcWMAYXo tFlGUsLE/7PlTl3fEXSbsLK3iMDcoO9OHutv6hA3V8ya7a5CqcGXV5WXEByD2nl+jx5IfB hsNtNSOvmJuhZezY+RjgLt/HkS6oCGQ5/UuZ7rrK83xew5DHNj7S30Q29wyo3zsejEHHT6 +W7iH/JdB81QA+bEhtof3GPaSSWZz4CAFcmQK+Helv1NOursnrIj9Fap+SgS3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598247; a=rsa-sha256; cv=none; b=LwkTnYibE9fnFjkdHcn1+pq77YtDA8ACeecVfmq0/DvqCxzOx0GYX+lJxQLkC9wIQd26x8 GOGFPbklPD85L+CnAoJE3KjdDvluB0u5HzFbNTdbol4XNl9qppeemRE1IaGRj4oRXJWJdf pR7p4g63HFvL+62KJBJEDm/s2Mf4WOPhUKi51fnzsRx0cZCQ4X7oo1vJTvgGFkBjU2tOFT RmObN6wP18oaFVkBT0mvpP5gFv9tcA/cYc0M9cIWylmFmLiE+AC/kozi1S/MjcAqyX4cPd Y9m1H8qUCcWppEh+/J8+hj09UqRUEvVse4gxyecCs2mj570EODgOHoYuUwhYQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P1h4R2lZpzQTN; Tue, 24 Jan 2023 22:10:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30OMAlXM080531; Tue, 24 Jan 2023 22:10:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMAlNJ080530; Tue, 24 Jan 2023 22:10:47 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:10:47 GMT Message-Id: <202301242210.30OMAlNJ080530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: fc36322368f6 - stable/13 - stand: Work around upstream issues in the standalone environment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc36322368f68a29112b15e986d76054034fcdb6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fc36322368f68a29112b15e986d76054034fcdb6 commit fc36322368f68a29112b15e986d76054034fcdb6 Author: Warner Losh AuthorDate: 2022-07-08 23:34:46 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:23 +0000 stand: Work around upstream issues in the standalone environment There's a number of issues with including zfs_context.h from a standalone environment. First, sys/uio_imp.h isn't at all safe for this environment, so define its guard #defines so that its contents are skipped. Next, there's a problem including string.h to get the mem* routines, so just define them here. ZFS_MODULE_PARAM_ARGS isn't defined properly. I had wanted to define it when I was upstreaming changes to include/os/freebsd/spl/sys/zfs_context.h, but they ran into resistance so I'm defining that here now (it is also defined in zstd_shim.c, but that will disappear once the issues it works around are cleared). Finally, sys/sysmacros.h has to be included now before sys/atomic.h, but upstream includes it after so include it here so that the guards make the out-of-order includes in upstream irrelevant. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D35750 (cherry picked from commit faf25f48d601ae39f5752602f3020e2e92605625) --- stand/libsa/zfs/spl/sys/zfs_context.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/stand/libsa/zfs/spl/sys/zfs_context.h b/stand/libsa/zfs/spl/sys/zfs_context.h new file mode 100644 index 000000000000..48f164317611 --- /dev/null +++ b/stand/libsa/zfs/spl/sys/zfs_context.h @@ -0,0 +1,32 @@ +/* + * Copyright 2022, Netflix, Inc + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +/* TODO: openzfs/include/sys/uio_impl.h must not be included in stand */ +#ifndef _SYS_UIO_IMPL_H +#define _SYS_UIO_IMPL_H +#endif + +/* + * sys/atomic.h must be included after sys/sysmacros.h. The latter includes + * machine/atomic.h, which interferes. Sadly, upstream includes them in the + * wrong order, so we include it here to fix that. + */ +#include + +#include_next + +#define ZFS_MODULE_PARAM_ARGS void + +/* + * Not sure why I need these, but including the canonical stand.h fails because + * the normal string.h doesn't like all the other shenanigans in this environment. + */ +void *memcpy(void *dst, const void *src, size_t len); +void *memset(void *dest, int c, size_t len); +void *memmem(const void *big, size_t big_len, const void *little, + size_t little_len);