From nobody Tue Aug 30 14:58:35 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 4MH9Rd5X19z4Zfxm; Tue, 30 Aug 2022 14:58:37 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MH9Rd1Vvqz3tnL; Tue, 30 Aug 2022 14:58:37 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf1-x133.google.com with SMTP id m7so6982667lfq.8; Tue, 30 Aug 2022 07:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc; bh=/P2Vwn4hknn0rcblgY+DfYkHoTTd0g6+TZFoW/3S+zs=; b=M4uiQroIW2UXBUcbb/epdPGkW/C5C3D5Y4If1O7M2/KCH313nPOdNwrL96iITl426+ 2dLy6+eha2R3/OrpjXDYubkA6QRxufioB8s+5yWbv3wAqgVzQYn0Bk40IYkP97D9KXWU y2cGziTlfonmW2pN+dqgVFeTMKHmDE+5sOOzYhSGvDvEtoDx9YU6xHJ7nFT3Uxgfiz5f KGtpsJgilIh9FW0E4Dt6gp1Si/+i2eXCPszA/6uAI6RhIHhjWw6AbnblS1XLwHln5iSu LRimtz007MWUOZmhjLabQfX9pQDw00+06bw+AnDsci7wj2lku07DXEpyAqJ0H9gdKB+F xLig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc; bh=/P2Vwn4hknn0rcblgY+DfYkHoTTd0g6+TZFoW/3S+zs=; b=N7xsaWFVONFm/w1wE9qJI+Yc7wIOo8iP+1nyrg2kUiBdQ4qS6dGEjixvfBBW6RTGfr H8+t5+LrCYdHavlZ1n+An2IX0CVTXDVjd23sj29ACWrd7O62eKfrG/pPyCtDcKReof3l w57VYypy9ggM1GH2/1VVVv7Lb4Kehdan+TATGhr3eQ1I6jncH5iCdDGeuew7kIGdiUEZ whD35Pz8x4TaCGbOvH5v/ytfrqDmkv1y9WOJTKPhfa3uYpvYHp+z3axt6eEbKR+ckE8X 9SfJwvnB6tZOil/H9lbusm+YzKJJIsP6wGOIXzG6oVMcaIi9jubrAPdGkTWwCSd2FC8z NKiA== X-Gm-Message-State: ACgBeo3z/6Z/nPiEfL83pTWEfc5AnUnGwDxIGR5G3SDwqIfHv4VYoJ7M kinHGMzy5eYblq9/aPeJOrJAubBFw5I0OfRQGk2lK/N7 X-Google-Smtp-Source: AA6agR4NF0t2jik2oDoNLXOIqo0orSvZBVuPBZqG7peZCFMHPQCJG2GKiHmDO4r4SqfsdJbfPJEH/SVSIX7lBGWopz0= X-Received: by 2002:a05:6512:252c:b0:494:6d21:a6d7 with SMTP id be44-20020a056512252c00b004946d21a6d7mr3143953lfb.517.1661871515725; Tue, 30 Aug 2022 07:58:35 -0700 (PDT) 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 Received: by 2002:a05:6520:14d:b0:211:6cae:be17 with HTTP; Tue, 30 Aug 2022 07:58:35 -0700 (PDT) In-Reply-To: <202208301453.27UEroGr037461@gitrepo.freebsd.org> References: <202208301453.27UEroGr037461@gitrepo.freebsd.org> From: Mateusz Guzik Date: Tue, 30 Aug 2022 16:58:35 +0200 Message-ID: Subject: Re: git: 35b7759c05cb - main - cp: Fix build without VM_AND_BUFFER_CACHE_SYNCHRONIZED. To: Alexander Motin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4MH9Rd1Vvqz3tnL X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=M4uiQroI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::133 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.24 / 15.00]; NEURAL_HAM_LONG(-0.95)[-0.953]; NEURAL_HAM_SHORT(-0.93)[-0.926]; NEURAL_SPAM_MEDIUM(0.64)[0.635]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::133:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-ThisMailContainsUnwantedMimeParts: N On 8/30/22, Alexander Motin wrote: > The branch main has been updated by mav: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=35b7759c05cbc65c06d87141da79f0f80af0f458 > > commit 35b7759c05cbc65c06d87141da79f0f80af0f458 > Author: Alexander Motin > AuthorDate: 2022-08-30 14:51:21 +0000 > Commit: Alexander Motin > CommitDate: 2022-08-30 14:51:21 +0000 > > cp: Fix build without VM_AND_BUFFER_CACHE_SYNCHRONIZED. > > It allows to not use mmap() for small files, which is not helpful > in case of ZFS. Should be no functional change. > This should be of no use thanks to copy_file_range > MFC after: 1 week > --- > bin/cp/utils.c | 19 +++++++++---------- > 1 file changed, 9 insertions(+), 10 deletions(-) > > diff --git a/bin/cp/utils.c b/bin/cp/utils.c > index e7ae0c9dd733..07de0495ba9e 100644 > --- a/bin/cp/utils.c > +++ b/bin/cp/utils.c > @@ -99,13 +99,12 @@ copy_file(const FTSENT *entp, int dne) > static char *buf = NULL; > static size_t bufsize; > struct stat *fs; > - ssize_t rcount, wcount; > - size_t wresid; > + ssize_t wcount; > off_t wtotal; > int ch, checkch, from_fd, rval, to_fd; > - char *bufp; > #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED > - char *p; > + size_t wresid; > + char *bufp, *p; > #endif > int use_copy_file_range = 1; > > @@ -234,18 +233,18 @@ copy_file(const FTSENT *entp, int dne) > wtotal = 0; > do { > if (use_copy_file_range) { > - rcount = copy_file_range(from_fd, NULL, > + wcount = copy_file_range(from_fd, NULL, > to_fd, NULL, SSIZE_MAX, 0); > - if (rcount < 0 && errno == EINVAL) { > + if (wcount < 0 && errno == EINVAL) { > /* Prob a non-seekable FD */ > use_copy_file_range = 0; > } > } > if (!use_copy_file_range) { > - rcount = copy_fallback(from_fd, to_fd, > + wcount = copy_fallback(from_fd, to_fd, > buf, bufsize); > } > - wtotal += rcount; > + wtotal += wcount; > if (info) { > info = 0; > (void)fprintf(stderr, > @@ -253,8 +252,8 @@ copy_file(const FTSENT *entp, int dne) > entp->fts_path, to.p_path, > cp_pct(wtotal, fs->st_size)); > } > - } while (rcount > 0); > - if (rcount < 0) { > + } while (wcount > 0); > + if (wcount < 0) { > warn("%s", entp->fts_path); > rval = 1; > } > > -- Mateusz Guzik