From nobody Fri Jun 17 19:24:10 2022 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 0F488843F65; Fri, 17 Jun 2022 19:24: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPprC5CF6z3C2K; Fri, 17 Jun 2022 19:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655493852; 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=Un74ZjMyB2+0VruQ1wC9Dx+33YwTouZ7xpDZG42IRo0=; b=bp3ZEk0ZxA9+G6MLCcBzJTtdlMKU/GZ5wGczCe2cwrn77ULdfMUD60LrKKTnNUmZplHe7V E8LrzthwB4dJd5SFtaBW64ILiT/AVKZei+Cwdmwb8aEfBkQCPpOhKFXmGrtDF+HWYBaQck dkoBG1rQeYGviZTbBiHasqf5vHAjIyo1gjXXFjMYEQDl8mgETx/ZjqxhTfbivE4C5rDWIR pK4Y5VegPUPzdrwtoRci6u7Y5oEiHw5RPxxoAX68+Hk+AFbzsq8kB0CHytQRlGNqvSoo1u j5lGH1h81xMGiX4LN/M4TeY/Rhf7ZA1cyi77VaBx9unuem5vegl03QRQd4VRkg== 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 A736A25358; Fri, 17 Jun 2022 19:24:10 +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 25HJOAwc096090; Fri, 17 Jun 2022 19:24:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJOAua096089; Fri, 17 Jun 2022 19:24:10 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:24:10 GMT Message-Id: <202206171924.25HJOAua096089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: a836accf4cca - stable/13 - linux(4): Microoptimize futimesat, utimes, utime. While here wrap long line. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a836accf4cca5f905238785355175d4fe620ae79 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655493852; 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=Un74ZjMyB2+0VruQ1wC9Dx+33YwTouZ7xpDZG42IRo0=; b=AUE3OSGWnuUC+ytXwacmhEF3N1qRy7uG/uKK0qPtEzBi4FaTqrogVsQ07O1qosV07ox5+K Krpb9bUnh0rp0NdGeWbj1kv/PqD3Fs/SCgTMygXvPviCXzF4NP4NPlS0SqlT6a9Y+kqKGp zFpDeDR4MZBPDNEGNs4IXl0sH2udr+eeR7ZSgGI02DIGg9+OYMQ4FQ5K8KoqxnahfzIoOo /9TlPCcB9WzhQSeIGismdUkDWTzlDr8IiyJDr2SoazuUwAR8eH5dJr1p6tzsnAvLEreuZH 7TgVCFWzO1XklJbSx5TECfum0EWlrH3yrsuff72cncmY/O25H8bTrWDkBmJHdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655493852; a=rsa-sha256; cv=none; b=CvHWp1fR45VmZhVvZzLpv9TGgMoEL2RB4usKyAF9x5e9Smun3ZLq2qxfxU7uIjSyLi4MqK JwtGqWSyw5Yi/rJuCmUK8nOcN7ccCwgDdCphsTwRkuo0JFV+ynsINvR7MCKcfMiNxDKDhL HGINmZdGC2WsSeeOdtktoiDSzjlt6gW3F8g/Ta9ET4LUj8F9atIbx1ftRhdgoj3ODjqgzi aWVQhPfYBCkzuDz756S+KkJIBNmPK77xB7/AA9OvFU/1xsLyAptHxPOErF+1aZrnaMK1mo 1PDp7AwR5qTK06unUgT/dU8tCvtAVJWJRzqUktEnclgQfMlFqfJPc0E++UcEZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=a836accf4cca5f905238785355175d4fe620ae79 commit a836accf4cca5f905238785355175d4fe620ae79 Author: Dmitry Chagin AuthorDate: 2021-05-31 19:54:18 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:22:17 +0000 linux(4): Microoptimize futimesat, utimes, utime. While here wrap long line. Differential Revision: https://reviews.freebsd.org/D30488 MFC after: 2 weeks (cherry picked from commit 2a0fa277f66b0dc81a97d0f7fc6dc91ff5a7fd9c) --- sys/compat/linux/linux_misc.c | 40 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 023d98f2ec34..17a45b5e5b7a 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -722,18 +722,10 @@ linux_utime(struct thread *td, struct linux_utime_args *args) struct l_utimbuf lut; char *fname; int error; - bool convpath; - - convpath = LUSECONVPATH(td); - if (convpath) - LCONVPATHEXIST(td, args->fname, &fname); if (args->times) { - if ((error = copyin(args->times, &lut, sizeof lut))) { - if (convpath) - LFREEPATH(fname); + if ((error = copyin(args->times, &lut, sizeof lut)) != 0) return (error); - } tv[0].tv_sec = lut.l_actime; tv[0].tv_usec = 0; tv[1].tv_sec = lut.l_modtime; @@ -742,10 +734,11 @@ linux_utime(struct thread *td, struct linux_utime_args *args) } else tvp = NULL; - if (!convpath) { + if (!LUSECONVPATH(td)) { error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE, tvp, UIO_SYSSPACE); } else { + LCONVPATHEXIST(td, args->fname, &fname); error = kern_utimesat(td, AT_FDCWD, fname, UIO_SYSSPACE, tvp, UIO_SYSSPACE); LFREEPATH(fname); @@ -762,17 +755,10 @@ linux_utimes(struct thread *td, struct linux_utimes_args *args) struct timeval tv[2], *tvp = NULL; char *fname; int error; - bool convpath; - - convpath = LUSECONVPATH(td); - if (convpath) - LCONVPATHEXIST(td, args->fname, &fname); if (args->tptr != NULL) { - if ((error = copyin(args->tptr, ltv, sizeof ltv))) { - LFREEPATH(fname); + if ((error = copyin(args->tptr, ltv, sizeof ltv)) != 0) return (error); - } tv[0].tv_sec = ltv[0].tv_sec; tv[0].tv_usec = ltv[0].tv_usec; tv[1].tv_sec = ltv[1].tv_sec; @@ -780,10 +766,11 @@ linux_utimes(struct thread *td, struct linux_utimes_args *args) tvp = tv; } - if (!convpath) { + if (!LUSECONVPATH(td)) { error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE, tvp, UIO_SYSSPACE); } else { + LCONVPATHEXIST(td, args->fname, &fname); error = kern_utimesat(td, AT_FDCWD, fname, UIO_SYSSPACE, tvp, UIO_SYSSPACE); LFREEPATH(fname); @@ -897,19 +884,12 @@ linux_futimesat(struct thread *td, struct linux_futimesat_args *args) struct timeval tv[2], *tvp = NULL; char *fname; int error, dfd; - bool convpath; - convpath = LUSECONVPATH(td); dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; - if (convpath) - LCONVPATHEXIST_AT(td, args->filename, &fname, dfd); if (args->utimes != NULL) { - if ((error = copyin(args->utimes, ltv, sizeof ltv))) { - if (convpath) - LFREEPATH(fname); + if ((error = copyin(args->utimes, ltv, sizeof ltv)) != 0) return (error); - } tv[0].tv_sec = ltv[0].tv_sec; tv[0].tv_usec = ltv[0].tv_usec; tv[1].tv_sec = ltv[1].tv_sec; @@ -917,11 +897,13 @@ linux_futimesat(struct thread *td, struct linux_futimesat_args *args) tvp = tv; } - if (!convpath) { + if (!LUSECONVPATH(td)) { error = kern_utimesat(td, dfd, args->filename, UIO_USERSPACE, tvp, UIO_SYSSPACE); } else { - error = kern_utimesat(td, dfd, fname, UIO_SYSSPACE, tvp, UIO_SYSSPACE); + LCONVPATHEXIST_AT(td, args->filename, &fname, dfd); + error = kern_utimesat(td, dfd, fname, UIO_SYSSPACE, + tvp, UIO_SYSSPACE); LFREEPATH(fname); } return (error);