From nobody Thu Apr 17 23:37:41 2025 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 4ZdvT22k97z5syt8; Thu, 17 Apr 2025 23:37:42 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZdvT22HQfz3QBW; Thu, 17 Apr 2025 23:37:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744933062; 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=vSSqG5u7gaWT3/ZTH682IoIkzSoozdUVzFBXr6QxLn0=; b=Y3HNshgmFPyHLw+mqWBkZgXiknF+IfOHv46lUu+s4/s8R2jStkud4C/kT2+mde4uIHiZgM H+uixoaKaBgpCtfP/+F9lTTBBMONjCI6CX7OgjKdp1nPNEPiRn2qbA5KtDkV/3ePZv5iCc EiX6gzAKJ2c7aqeX3v7wvxz6VYZ7P2CJr5AkKl8NkSeS0FxO6G0pNo6f8Fjjf0weZesjJR 6P5NJ03ELv2ug+pzYw2Asf13dDTIcef3R9aoCyrA9k9oy9gxEDeh6goOgi9oKZs5VxS5Sk BH6FlmTe7qIl+obzBMHJbqw/jlbHtTfxUZ0oaxbfH3sXGF2uFfmUZJXale9LSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744933062; a=rsa-sha256; cv=none; b=L9J0532x4ptx//I0R+FzJ7hcj3h0EtEjoy+Hl9mgKk25Ga/12DhQzdRhjRqPSx4L1bZDfs mwofWLORY3hg5TfNhE8AD0Q4iKQLcfgQ0irM2e/IPXPJSUFle4ECcYHLi+9L3lVvP0jc+o uSuooCevQFzfK83lKCMl3zACuDLur9yyhSkfTI+aJwyMD0dRlW+R3ATgzPJo1ZizVmxA63 mq1JWi/2CV6JIIj0Vo6oDHJlwNSEp+lSazkMtQhc1NGAHdfo24j8YUk/twNuUKROtqR416 mvTV4fhho4nUmEFAXxaaTMnBEseNitxVQKHIK3zPSIxxeFdQBQnl2Bi+vFxoew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744933062; 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=vSSqG5u7gaWT3/ZTH682IoIkzSoozdUVzFBXr6QxLn0=; b=dpaz4FEanL4ydEmyrtyfmG03+WfHLu37aK2GhCNmtlxLyghdYAYwVe8rRI44S5dAJLpp1r lFihU5WnRyli8IQxMeoLGmp9tsEz2+mXnGrLg9Ao3jk4S6v1t+V+wwmgfxCPrTA9ZutnDq 7tH71QMbGOxtMZd5VLsf87IxFn/12Jf8sSSpEkaooxw+2GWP34yvkXn/yFP5wO5iROdYcT Pa4ZmrH8Xp/unlRnMWCuB6OG1aEbKYpA3sM65w6ufPKavDABCf0XVYhOHmsGq0zGSlO8/t BSFMimakaKFXQ05iIGbFdVdUSI0uIegowdDY9ef3Dgh0qk1Ol5g9869fFEQktA== 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 4ZdvT21RQCz184H; Thu, 17 Apr 2025 23:37:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53HNbgAt089359; Thu, 17 Apr 2025 23:37:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53HNbfk6089355; Thu, 17 Apr 2025 23:37:41 GMT (envelope-from git) Date: Thu, 17 Apr 2025 23:37:41 GMT Message-Id: <202504172337.53HNbfk6089355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: d03aa29b82b8 - stable/14 - fusefs: minor refactor in the tests 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d03aa29b82b803b440886a2f864dcdafa184c4fb Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=d03aa29b82b803b440886a2f864dcdafa184c4fb commit d03aa29b82b803b440886a2f864dcdafa184c4fb Author: Alan Somers AuthorDate: 2024-12-24 21:54:42 +0000 Commit: Alan Somers CommitDate: 2025-04-17 20:14:57 +0000 fusefs: minor refactor in the tests Do more work in MockFS's constructor's member initializer list, instead of the body of the constructor. It's easier to read this way. Sponsored by: ConnectWise (cherry picked from commit 3f83f32d7d07afbb2dbff63fc6ec520f3341eec7) --- tests/sys/fs/fusefs/mockfs.cc | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index 023cecd0276f..502f22a1e980 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -421,7 +421,18 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, uint32_t kernel_minor_version, uint32_t max_write, bool async, bool noclusterr, unsigned time_gran, bool nointr, bool noatime, const char *fsname, const char *subtype) - : m_uniques(new std::unordered_set) + : m_daemon_id(NULL), + m_kernel_minor_version(kernel_minor_version), + m_kq(pm == KQ ? kqueue() : -1), + m_maxreadahead(max_readahead), + m_pid(getpid()), + m_uniques(new std::unordered_set), + m_pm(pm), + m_time_gran(time_gran), + m_child_pid(-1), + m_maxwrite(MIN(max_write, max_max_write)), + m_nready(-1), + m_quit(false) { struct sigaction sa; struct iovec *iov = NULL; @@ -429,20 +440,6 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, char fdstr[15]; const bool trueval = true; - m_daemon_id = NULL; - m_kernel_minor_version = kernel_minor_version; - m_maxreadahead = max_readahead; - m_maxwrite = MIN(max_write, max_max_write); - m_nready = -1; - m_pm = pm; - m_time_gran = time_gran; - m_quit = false; - - if (m_pm == KQ) - m_kq = kqueue(); - else - m_kq = -1; - /* * Kyua sets pwd to a testcase-unique tempdir; no need to use * mkdtemp @@ -467,9 +464,6 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, throw(std::system_error(errno, std::system_category(), "Couldn't open /dev/fuse")); - m_pid = getpid(); - m_child_pid = -1; - build_iovec(&iov, &iovlen, "fstype", __DECONST(void *, "fusefs"), -1); build_iovec(&iov, &iovlen, "fspath", __DECONST(void *, "mountpoint"), -1);