From nobody Fri Dec 13 14:05:59 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 4Y8rj326s9z5gcSr; Fri, 13 Dec 2024 14:05:59 +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 4Y8rj31c5hz4fQ4; Fri, 13 Dec 2024 14:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734098759; 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=L1R+Zhljuqsi/cs6tivHCJlFnQKzflRL8K81Z/f8jyI=; b=DTy9elAXHCy8MqA61h16br/r4X767ZyvT38OLItuSKBApEkOoAVq6AqxqcZ9FjhO2GPedD ls0psiZ1Mc1Vrok7XtEnNIAsL+yHZ55cX8k56aD3sxugKXbMG3cUs2lh7T5o2OTD74tN3g Nfy+zY/iqefYGvl7AOoZxIXopHeOpGwMNESKrMcYX5HHMKvdov16nJRekgW4tMISgaPD1a +RMG+4GxA+1glTMILEz+GsT7SbIOLgMQ6+trsudZAdPuac7cN1EdMCJyO9vFOK3o6VqDH9 yPlbFRcIUGILjHc6aOfJdC8bgvulHNjGBQzvRwVzbCnLAND2/1H2t+DVgpvi+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734098759; 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=L1R+Zhljuqsi/cs6tivHCJlFnQKzflRL8K81Z/f8jyI=; b=MeL4csbZ/W+qb98bRKcW9JZXSedvlhzruAe19p2pFHU43M07SCydDj95idkoRGoFdaMngG O0juHCFLXJjv0u0B8KF2ZyVggi1HNXU/3brxDhK93fEA4/jGLf+ITRDGHYB84jWP2WDLGO MBBrIIyM33zcsJiWS4rEE1oO3rCtPcVBNTdFppf+JcQ5SUbhH31cogFW0+CW3bm9hm8P+n 7AsgGcFGBa0IKukMpPeYKXn8r/lixJ9Tr8OUOq+V8jk6hugq2mip6EzueALYNciG/JB0Go lzdaCkykS02ttq/uJqKckL4snUV1Hh9X1/ejHgDplZatj2Hm+zufC+tupvYkXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734098759; a=rsa-sha256; cv=none; b=LDXRvQbgkAYRILOx1S2Z4c4FNBulUdg0pN2A98kWKxTegYDP11CShlVy1CxvbmIMQmDCXp OPhjY56k8lvvaOvWihgwWU/vxt4GWm9rwzOSK7iZFMmsRRQ871NSgRgm9O0tVQzVz+AHlS kAv1oDhdkhuDM7RTw1bTOKbd4BTt9gJIbSbRV0RrwmqT9Rb7R7PIdnYH5YnfxBCBpDpJo1 Owp7XWocArp9WfOCOActzmfJ7q+05VD5V0g9UinoLaaZBq6kXKCcO3TE6kyVx5yAGuzG7D rA9RFrBfhEqPNTSEqwzI3/ZjyhvrSljUk2yI5Y+NBUah7DAG2bK53DE0pAR7Kw== 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 4Y8rj31BpHzh1q; Fri, 13 Dec 2024 14:05:59 +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 4BDE5xg1023259; Fri, 13 Dec 2024 14:05:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BDE5x1K023256; Fri, 13 Dec 2024 14:05:59 GMT (envelope-from git) Date: Fri, 13 Dec 2024 14:05:59 GMT Message-Id: <202412131405.4BDE5x1K023256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: cf0ede720391 - main - 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/main X-Git-Reftype: branch X-Git-Commit: cf0ede720391de986e350f23229da21c13bc7e9d Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=cf0ede720391de986e350f23229da21c13bc7e9d commit cf0ede720391de986e350f23229da21c13bc7e9d Author: Olivier Certner AuthorDate: 2024-12-06 16:35:08 +0000 Commit: Olivier Certner CommitDate: 2024-12-13 14:04:42 +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 --- 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)