From nobody Sun Mar 10 00:59:49 2024 X-Original-To: freebsd-current@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 4TshQf2yxxz5Cr4T for ; Sun, 10 Mar 2024 01:00:10 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 4TshQd4N4yz4rwV; Sun, 10 Mar 2024 01:00:09 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b="DAV/CsZC"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2607:f8b0:4864:20::62d as permitted sender) smtp.mailfrom=rick.macklem@gmail.com Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1dd878da011so2421335ad.2; Sat, 09 Mar 2024 17:00:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710032408; x=1710637208; darn=freebsd.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=cS6eFDzkQlGaJmN1FI26T1fB/GQgsyBhZbc/b964gN8=; b=DAV/CsZC9fRwQ4GFUjvgXFvODxpF3Kp2Z8NKAnGELo/sIvnk28/VH9WdyqP4K82ofc iBsME6S/8K1WyI/OdZ81gn/3boEQxxyuLqG7oJv6HZmMfPWcCinhKdvwXwP0C+BMLViN /4SSNc3WkW9JofwWIAzOv4GkYL5ojOcup1kGhDHt6i2QWUjh7RwoI9GXJDh/3Xb7klup j9NAXCWck9M77IjCcCn1Dc6loufi3UtwkfaMo0adwnqYk1n/hyChiEncENnKbYdV4CBJ tGe23trq4NmxV+hg61a07sJ2GdQBr1za9xzAeazEFsc4Z/yq6SQLZeBtLieY2b64FfUu HsQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710032408; x=1710637208; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cS6eFDzkQlGaJmN1FI26T1fB/GQgsyBhZbc/b964gN8=; b=OGq94ft9r/H8kIhAaEn3jgiut7b0mj3gA/eaVL8tUHi9edkFTqX+dpBKHai8MuqNWG qw6aHrFssjaLDw2O7MNchZcbgm13+W+U3RP05HWRV4AzzvA57FdSttFUq+SiwjNrDuqZ 2fhleFhtFNWX9hZl2s2+6Xn8YRoJYZljhIhC1ThoOEimyQimh8JvzyKmECPM4YWonZxT fCXsycoTza3cUuHMb9wx8NWSUqAZz2f9eISwrtMoCVuqd+ueqiK1M8UAaJAfXF/mnw8I uY/t5CsGufyAg2pXtagkceG72GghSFWGAKzJE0fD2tkXhKlzQgw8/ANTGCOQCKGE2vU8 TBLQ== X-Forwarded-Encrypted: i=1; AJvYcCXONr7gm3MQdE6O9vHxcrhoJved3OcB00oNLwqGWiVYVBYkfPUngJwaLesayN4SiCpglnHcgPZz+mmsxWFCxXA= X-Gm-Message-State: AOJu0Yy19ATMetUXIPKndagRbFNrinsB6dRdqbIK5fl3fRJ5qiZfput0 YdZheqJTKsajrnS0VIAcLRINDbQhy0KAE0FEiYmMSCEq1Ab9GXSKMLFZjzGxRWXi7SoiALOmBwL 1bdjNLo8BVM7DCpw6bPUMzEzhYtCA3Es= X-Google-Smtp-Source: AGHT+IHisz8652R6ta7TuLlfLZXFFnKnQ6seT7QzSRylpTWvr3ftRyont8vPnUKZrMtzjmLz0pxBtMwOaqCTzuFGPKU= X-Received: by 2002:a17:903:2443:b0:1dd:6c28:4cfe with SMTP id l3-20020a170903244300b001dd6c284cfemr2033250pls.42.1710032407340; Sat, 09 Mar 2024 17:00:07 -0800 (PST) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 From: Rick Macklem Date: Sat, 9 Mar 2024 16:59:49 -0800 Message-ID: Subject: RFC: should a va_bytes option be added to vn_getsize_locked()? To: mjg@freebsd.org, Konstantin Belousov Cc: FreeBSD CURRENT Content-Type: text/plain; charset="UTF-8" X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.97 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.975]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_FROM(0.00)[gmail.com]; TAGGED_FROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::62d:from]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4TshQd4N4yz4rwV Hi, I would like to compare va_size to va_bytes in vn_generic_copy_file_range(), as a heuristic to check for a sparse file (only works for non-compressed file systems). The call to VOP_GETATTR(invp, ..) was replaced by vn_getsize_locked() in vn_generic_copy_file_range(). To get va_bytes I can either modify the code to again use VOP_GETATTR() or I could add an additional return argument to vn_getsize_locked(). Since vn_getsize_locked() is descibed as a first step towards not using VOP_GETATTR() it sounds like adding an agument to vn_getsize_locked() is not the preferred alternative, but I thought I'd ask. Thanks for any comments, rick