From nobody Fri Jan 17 13:53:09 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 4YZLm61DmJz5l1LB; Fri, 17 Jan 2025 13:53:10 +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 4YZLm608Ljz3nmT; Fri, 17 Jan 2025 13:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121990; 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=J+LROAQLUmGzRwsrZOz3Nl8zoG9Bs4WFbUnnA37REN0=; b=wKRNQZ9qZknb8F7vQYFklnrnpDcX7zMMkC8kywyCFKrIBeJpCmBjXqp8EfuhAMWdCjVDaW d4gNPVlXSnZsWEydWgu28HWYUjfy8EbckgdF6UCJOQI7rmfGGcAF6KlM8Ok1O3XnXL12cq GAgDQZmiBgwi9WRPviAa4YiqiaBcQUfblqjVlK8AsnX9HQE/cW2YAKMsQFV0vIIoFGEkw0 foPXEFt0ZtUPieuf7/HTPWz8R9Rd7kSnMHFbxJgsuXkyC2TME4a2ebwFFhDvdkX6+btOvV OiOShRCrNJXvzUHGFeLuq6nnMqx3ods0yQ2W8U03uJla7CVAef25uS5iRxBOiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121990; 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=J+LROAQLUmGzRwsrZOz3Nl8zoG9Bs4WFbUnnA37REN0=; b=CZDlukMZ4PFGrMCREkmMEPiUavbiOHbKZV+Zq3NIqePIlimskoo5dAG+BAkw87VTEojCfC SHqxbsAa3x23eBT47mLA96TES7LCnG00nSdaqmT0zRx/zAB875LZv/1NSEPKa7vEQM5PP/ hcRQJ+12SsxWqsKkraql3CCgiWZJn+FvnSrmHOImHhBaXtrqYu5qead8kjXreTWsg7rGIM ZlMbSeD/zzsxdgpSgn85Gde3M8VhIhw3EQ86NeZOqU+TRQbT9xlnw7cY4rEtdcHNE346/Y 8+1mNC8B+tvMt4o7rgh8gXFSzEWrH9+J1V2rXay0/Z+GXhT0HrYyrst9rwS16Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737121990; a=rsa-sha256; cv=none; b=Sw09gNAI7Vap1Xc2ApP9Tb0hWkYgwIBdz0rBnW/Am9hEaaxRCO4xdmsr23Mb9VaCKGLf6a ++hdnGFSc//w3tYeT1pcigob5Y3+uJwxgFckSqJ46tBiJkWJjjscpSpaMUb4Pj93iILNH4 Qa5f555jhYa8np/Z971uh2zD9w/Vums0aIPVGvpCh4pgXK6t2xO+eF55FD5t6EZKbTkmss VfUlykepEPWGxWgPXZUjtPKhetp73jon9tHoMYFjr8iykyoMlBSC3OlAj2Mr2w0tUV7b9U 5I+RplkxA/px/u/DbqIMhNeC+JAZYGtDgPdD3sLBe73wsx0d51Ljh4HZChDdVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YZLm56l2dz5YS; Fri, 17 Jan 2025 13:53:09 +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 50HDr9pi022503; Fri, 17 Jan 2025 13:53:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HDr9rG022500; Fri, 17 Jan 2025 13:53:09 GMT (envelope-from git) Date: Fri, 17 Jan 2025 13:53:09 GMT Message-Id: <202501171353.50HDr9rG022500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 4634282f8908 - stable/14 - tarfs: 'struct tarfs_fid': Switch 'gen' to 'u_int', avoid packing 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: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4634282f8908406fa395a2b49a8e4c06c07830e4 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4634282f8908406fa395a2b49a8e4c06c07830e4 commit 4634282f8908406fa395a2b49a8e4c06c07830e4 Author: Olivier Certner AuthorDate: 2024-12-06 16:35:08 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 13:51:32 +0000 tarfs: 'struct tarfs_fid': Switch 'gen' to 'u_int', avoid packing As the 'gen' field in 'struct tarfs_node' (and then 'struct tarfs_fid') is filled with arc4random() which returns an unsigned int, change its type in both structures. This allows reordering fields in 'struct tarfs_fid' to reduce its size, finally avoiding the use of '__packed' to ensure it fits into 'struct fid'. While here, remove the 'data0' field which wasn't necessary from the start. Reviewed by: markj, rmacklem, des Approved by: markj (mentor) MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D47954 (cherry picked from commit cf0ede720391de986e350f23229da21c13bc7e9d) Sponsored by: The FreeBSD Foundation --- sys/fs/tarfs/tarfs.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/fs/tarfs/tarfs.h b/sys/fs/tarfs/tarfs.h index ffb95d2c0ac5..46fa8b55b3ad 100644 --- a/sys/fs/tarfs/tarfs.h +++ b/sys/fs/tarfs/tarfs.h @@ -74,7 +74,7 @@ struct tarfs_node { struct timespec mtime; struct timespec ctime; struct timespec birthtime; - unsigned long gen; + uint32_t gen; /* Block map */ size_t nblk; @@ -161,11 +161,10 @@ struct tarfs_zio { }; struct tarfs_fid { - u_short len; /* length of data in bytes */ - u_short data0; /* force alignment */ - ino_t ino; - unsigned long gen; -} __packed; + u_short len; /* length of data in bytes */ + uint32_t gen; + ino_t ino; +}; #define TARFS_NODE_LOCK(tnp) \ mtx_lock(&(tnp)->lock)