From nobody Tue Dec 24 21:56:13 2024 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 4YHpcY4WN7z5hvDd; Tue, 24 Dec 2024 21:56:13 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YHpcY3dfyz4Srl; Tue, 24 Dec 2024 21:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735077373; 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=y6DmZdggUp1Q8Cq0z9Z/zDDEsd3NgLiAgF1OQsUuJrk=; b=ALHsOFqWsrR3W5ExfXBdltulqJR73TxniduUBAqRUObRFTqKtZLvXjBWu6ngt2sg4SYeGU QIYzXvRy8URkHM/00T3KC4864r5R1IAL6jIbBpFBqa8ZZRUJdlxlxRAEwUpYcYIcI8FaBZ u/U4hXPRG7E8WAakxwfxx0+HJ3fUAycTsd/9fI8a4TSaf9BUrEAmCqQEdmtWO3ZjY5wER+ gQHpslSG3cse4yN3J9mr3dmNlxnmCEsRhlGBKv7ks4G+eX8DfiP8vj+zvfs17eY4EsIUhr azMN5V/ZhAUIZP58a1m/PW1rCALNCh1uct54Bjd5TSDlcWfjqc179SiNHKlEfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735077373; 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=y6DmZdggUp1Q8Cq0z9Z/zDDEsd3NgLiAgF1OQsUuJrk=; b=o0jPGpBwJoabhWIWwe6LcFkEvYcdzTXFxs2ofO6D3Bk6OAP3YX8ac4yb7dYEPURoZZ9jAT ArP48vbfLjIQavwdmJoh5V6VFyXYnoEKMD+eQdMlL1cqBVWORNvSATtJmqw9qe4gGI0KtY /CJ7+Lx9oAdhIaP/KNmgWMU+dCHO5t2k24B7LJLdmpGvXlApL9S6JFWywh+rpEZqbz5TBy ndBsz+THysxBC8bvcm5oawo7UbWbctRaLpTSlIIvZ3Ga1bUBX960lW0+K9AFulEJ/zDvaY xn92qOxfXbQukasYZO39EQTxUWjuMpcp/PPBVM9idfG0Obai53h3BgvwLbAacg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735077373; a=rsa-sha256; cv=none; b=iAmf2dLi2EmDFeSkFIFnFA28cUugDuRypcQb9PVMmwR8NWVZ2xhQWdAwb08yv7eaXzebm9 Pj7noRRA6ja7LULr2jpVkGb/lDu9CIS7/PdCapeq0hF6AvXU3iFzQ4csfpaKv75dr/HT7q 1I+FK4q8v1WsOrG5efPw/+A94wMbS/NuiOIwzTOXHn3CvWnF2NpxmjDJnyiLLMkTcJ+buX bdcI3CjhrzChIaIvA800FvT3udEeJ4EGMRzWjsnK255xYWOZ3oWv/9Zajx4CJtdObtsiYI ZKlbXI8kuMVBJFx9+amoY/oS+ITH+Fs6opeG+P7DUrZJWclrHv7ImEOudGkFHg== 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 4YHpcY3BBtzwkm; Tue, 24 Dec 2024 21:56:13 +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 4BOLuDVb092116; Tue, 24 Dec 2024 21:56:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BOLuDGo092113; Tue, 24 Dec 2024 21:56:13 GMT (envelope-from git) Date: Tue, 24 Dec 2024 21:56:13 GMT Message-Id: <202412242156.4BOLuDGo092113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 3f83f32d7d07 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 3f83f32d7d07afbb2dbff63fc6ec520f3341eec7 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=3f83f32d7d07afbb2dbff63fc6ec520f3341eec7 commit 3f83f32d7d07afbb2dbff63fc6ec520f3341eec7 Author: Alan Somers AuthorDate: 2024-12-24 21:54:42 +0000 Commit: Alan Somers CommitDate: 2024-12-24 21:55:48 +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 --- 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);