From nobody Fri Apr 28 08:57:09 2023 X-Original-To: dev-commits-src-main@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 4Q761K3LnPz48C26; Fri, 28 Apr 2023 08:57:09 +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 4Q761K23t1z4RPv; Fri, 28 Apr 2023 08:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682672229; 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=o8UfBKFCgWvAmSsWOwyKosDWn7sdFI+VoyYU229WEeo=; b=PW5gIlB2NGKIyqqul5QBu90+Hf2+J527kYZcmm7eHqvKu7rwWghwG7kDnmxGRud9FedI45 1vqv/Z+g/iqB4sCR6MMoaK/uuxiRbWtfA9xAh36OcOBW9xmbwv6gbZKjsE8tmSafS1TJ3z 5UxN576mAf40Vw06szFHpV+yb2MpjkHsMvxRGORms4NSsYKquC4CEoCEPrpkmv0IQWzgyi Q7E1W5T2lT66Gmuj/nj/nK7veIMeHQwLXXu3E8lAHyf29e3NynNskRRRA5VFcis9iOdUmV jhvu70TuCi+78WWXblyQd40Vcw/yXHhCqzKLrya5ydaRf/kHnyDyGd91iYHCMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682672229; 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=o8UfBKFCgWvAmSsWOwyKosDWn7sdFI+VoyYU229WEeo=; b=LxHXENbwYOwZ5hfOKrRu3L29wpFDlxW0HSxcBJ0kSStrEKDMS0uBx/kUHnRDfua/PljVSc Ewa10tBcQYXgU4ZgXWttkWiQlda5lOkuBjZdS+2vizFgxKZFEcFEtDOMs2dal0Qtuv5te+ BAyYX1NWmkpWmopsteAU6lSdyyDU3OOQzzLMhbRHki3OsRR+6hGM2LDggdojTZRPuLPF8+ clZFUdS+vNNBXMx84j/P/K21QnKR6iInUHoXmYj29DYFjL6pdyDkxxKsVpnUNfbPyDvF0i hN1bxoex56e4WAhac0FPVrLI44eMFtoG15EpIyJE35X/13Uy89hkgv/arlghmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682672229; a=rsa-sha256; cv=none; b=hCQNkN1kP+bF57f/WyqWgr8KwzhcjgAxeSuyPu1jk7h4z3DpMqvnDJUQwSvdTnwvAkZann F2u8KB2lE3lrDtI+sEIcAclDJD/ppGWVdQrhBcF2TtpQAppz2eSN2jtvRvChs61l4Pysrl tijHAZ3pyE2noyWY5V3obXTCSviXLdaR4+2kSFCk1YGI8GUpBEN8duSae1MaaJNGQtvKJB akRx0+9HDJNYGmjG3IzcRM1l/xQuctvZ9bpQdh5ZA2T9iF53wg1zPhm+GZADNF0iYbnusT 8RKlSHFwf5/No4A05lpAHTQVRGXMf4o4UZNlcOJl23QggYFNZMjZQT2vhsrRgw== 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 4Q761K0sBPzt06; Fri, 28 Apr 2023 08:57:09 +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 33S8v9jr017927; Fri, 28 Apr 2023 08:57:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33S8v9aF017926; Fri, 28 Apr 2023 08:57:09 GMT (envelope-from git) Date: Fri, 28 Apr 2023 08:57:09 GMT Message-Id: <202304280857.33S8v9aF017926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: e9204c5c2c5c - main - linux(4): Move statx_copyout() close to linux_statx() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9204c5c2c5c471ad2182ec6358a46be74c9ebb6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e9204c5c2c5c471ad2182ec6358a46be74c9ebb6 commit e9204c5c2c5c471ad2182ec6358a46be74c9ebb6 Author: Dmitry Chagin AuthorDate: 2023-04-28 08:54:59 +0000 Commit: Dmitry Chagin CommitDate: 2023-04-28 08:54:59 +0000 linux(4): Move statx_copyout() close to linux_statx() Just for future changes of the conditional Linuxulator build. We need a small refactoring of the MI code to help porting Linuxulator to other platforms. --- sys/compat/linux/linux_stats.c | 67 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 219f4a602eb4..04589c33547b 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -165,39 +165,6 @@ newstat_copyout(struct stat *buf, void *ubuf) return (copyout(&tbuf, ubuf, sizeof(tbuf))); } -static int -statx_copyout(struct stat *buf, void *ubuf) -{ - struct l_statx tbuf; - - bzero(&tbuf, sizeof(tbuf)); - tbuf.stx_mask = STATX_ALL; - tbuf.stx_blksize = buf->st_blksize; - tbuf.stx_attributes = 0; - tbuf.stx_nlink = buf->st_nlink; - tbuf.stx_uid = buf->st_uid; - tbuf.stx_gid = buf->st_gid; - tbuf.stx_mode = buf->st_mode; - tbuf.stx_ino = buf->st_ino; - tbuf.stx_size = buf->st_size; - tbuf.stx_blocks = buf->st_blocks; - - tbuf.stx_atime.tv_sec = buf->st_atim.tv_sec; - tbuf.stx_atime.tv_nsec = buf->st_atim.tv_nsec; - tbuf.stx_btime.tv_sec = buf->st_birthtim.tv_sec; - tbuf.stx_btime.tv_nsec = buf->st_birthtim.tv_nsec; - tbuf.stx_ctime.tv_sec = buf->st_ctim.tv_sec; - tbuf.stx_ctime.tv_nsec = buf->st_ctim.tv_nsec; - tbuf.stx_mtime.tv_sec = buf->st_mtim.tv_sec; - tbuf.stx_mtime.tv_nsec = buf->st_mtim.tv_nsec; - - tbuf.stx_rdev_major = buf->st_rdev >> 8; - tbuf.stx_rdev_minor = buf->st_rdev & 0xff; - tbuf.stx_dev_major = buf->st_dev >> 8; - tbuf.stx_dev_minor = buf->st_dev & 0xff; - - return (copyout(&tbuf, ubuf, sizeof(tbuf))); -} #ifdef LINUX_LEGACY_SYSCALLS int @@ -753,6 +720,40 @@ linux_syncfs(struct thread *td, struct linux_syncfs_args *args) return (error); } +static int +statx_copyout(struct stat *buf, void *ubuf) +{ + struct l_statx tbuf; + + bzero(&tbuf, sizeof(tbuf)); + tbuf.stx_mask = STATX_ALL; + tbuf.stx_blksize = buf->st_blksize; + tbuf.stx_attributes = 0; + tbuf.stx_nlink = buf->st_nlink; + tbuf.stx_uid = buf->st_uid; + tbuf.stx_gid = buf->st_gid; + tbuf.stx_mode = buf->st_mode; + tbuf.stx_ino = buf->st_ino; + tbuf.stx_size = buf->st_size; + tbuf.stx_blocks = buf->st_blocks; + + tbuf.stx_atime.tv_sec = buf->st_atim.tv_sec; + tbuf.stx_atime.tv_nsec = buf->st_atim.tv_nsec; + tbuf.stx_btime.tv_sec = buf->st_birthtim.tv_sec; + tbuf.stx_btime.tv_nsec = buf->st_birthtim.tv_nsec; + tbuf.stx_ctime.tv_sec = buf->st_ctim.tv_sec; + tbuf.stx_ctime.tv_nsec = buf->st_ctim.tv_nsec; + tbuf.stx_mtime.tv_sec = buf->st_mtim.tv_sec; + tbuf.stx_mtime.tv_nsec = buf->st_mtim.tv_nsec; + + tbuf.stx_rdev_major = buf->st_rdev >> 8; + tbuf.stx_rdev_minor = buf->st_rdev & 0xff; + tbuf.stx_dev_major = buf->st_dev >> 8; + tbuf.stx_dev_minor = buf->st_dev & 0xff; + + return (copyout(&tbuf, ubuf, sizeof(tbuf))); +} + int linux_statx(struct thread *td, struct linux_statx_args *args) {