Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp778321lqh; Thu, 28 Mar 2024 16:50:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVW4ncbw9B22If5VqGIUg6pFx0V6umR7wR2S2BlirrEHWIbvkFKvqIrpA3pqze6Wv1HJ/k+9KwwJP4lHHfxh3+RSdgzGdTDrV46r1Qo7A== X-Google-Smtp-Source: AGHT+IGbm6CGeHep4MDj5ogs2LY5ppwi7Pa8jHD1tHbPg831JIDbkJVNNQ7Ds4bFuu36GXJC7JzD X-Received: by 2002:a17:903:11d2:b0:1de:f93f:4410 with SMTP id q18-20020a17090311d200b001def93f4410mr1070194plh.8.1711669849010; Thu, 28 Mar 2024 16:50:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711669848; cv=pass; d=google.com; s=arc-20160816; b=zwejR0rMPpuhZATG2CqD2ljIhjDUcJcKP33x+StRp0SEPS4qTdnTaBbouUvMn46Dz5 jG4k05eF0V1/bz7cfJbaep5HQ8IGzWTF2HUh8Ph1EgQbmdDYYQdbEFcYBZt28T5A2o73 YYocVFItwnkJik/OLHu3ZwuBTxmHr0vvFTSPvrpLukKkT6CCzFR03s2RWoHpflex2ReT fbkcGHJ6gQ8GFRebpwvVkmMoOMvKhT1N+FBezWEn87j0oxZlBjEDh832gsqWiq/G8fVX gbzBsbRTI8K/xwc+B+utPgL1KzDuQBGdnxsgf9Xwt+fWHzBrluvqajljPAm7vFLPZ8Q9 XUew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=3Vn/NzwmdIpWsn5nWXict56VBOKf11qYNjS4a8/2VBk=; fh=zaNS7a0ivRt0Jtyv5L6ZQWkVjRrFTtwidT0IM+uzgbQ=; b=sglyujRy3qi1BT2ybSa08C7hSoen/w3ySpFM647IbbY4N33RW8Wl9odgALqUakNstg kG2xKnnFEyLnaaBpRn5Bnj1CnZcx1+1bXyYswUhcRNDOz6bSF2lWv73FvJ7FiM8FOHz4 bC0hCscOJOn08kRsQfWxg3JdTa+XJDF4qaq36qjJA1rgXNteK+vkON2v4fDY3oUQXoeY 3XbB05iVofrQeC7omUJMvrjZ6KeKV4+MCsugwXkkGDF8rTZ1homDCvJI909xspER+CUQ Fu0VVr4fawAfJaca/t+f9NOvbquVZ7UMgjgOEvQmqMS753wRAj3/ZjNlEWlU9xkLzmQ7 mLDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MUx9Vye0; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-123837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123837-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c4-20020a170903234400b001e0ccfd7816si2465611plh.532.2024.03.28.16.50.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 16:50:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MUx9Vye0; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-123837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123837-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1938DB232B2 for ; Thu, 28 Mar 2024 23:50:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC55813958C; Thu, 28 Mar 2024 23:50:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MUx9Vye0" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C61E383AC for ; Thu, 28 Mar 2024 23:50:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711669836; cv=none; b=Rr1SZ4Fh9KUu/+4FHDZSXg4BV44hI8b9JpoH5H7IpQNOXVFqgifhxGkcD5XoV9HmCJ83VAZrogw+5LAG6mu83gLQfE0PVX6+QkEo4abLs1Wd2pooj3k1lAEHOn7HweEeD/uRaUeHTVr4CZ4iwPEHzn0xcJWU2Pv9Dm4NMQSwrE4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711669836; c=relaxed/simple; bh=rnAgD8QyYSqlHtwiyhdPnjbT9pkWQMe2yKGBxL3Qi4o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PfhP61ttpF8qi5pwidX2hFdRzlPH9NOLNF9d4v0yBQ5kRLOmZYEh6HYZk8tQ6IF/WYcyTaTW3RBYlkvqyuQGVxGKTcQy4LjQXuGKyBTroHMW2y9Go8p86cXjsJhDYYGD0XlJXit8u/ylw5WbudMXBpb+FWOf3Hlq8owKBkBUHlo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=MUx9Vye0; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711669833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3Vn/NzwmdIpWsn5nWXict56VBOKf11qYNjS4a8/2VBk=; b=MUx9Vye00a4q//ScfnW5slHP1ebvL1z74ZOBDFeQOlcW5KQ+q2YjR3gv9y/xpQWBvjX+z+ lt3Ec/STCQoADISoigKDeDLxapOC4CwvYcfOlRdVPJp61Vw7p9zo9dLCwECGRMqjL+BdCA qi+uTMxeLyoYuqS+0tw1M5XsrMLa1+Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-592-0Y4hxj8HM0-5DFISrRGQsg-1; Thu, 28 Mar 2024 19:50:30 -0400 X-MC-Unique: 0Y4hxj8HM0-5DFISrRGQsg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F0FE9101A523; Thu, 28 Mar 2024 23:50:29 +0000 (UTC) Received: from redhat.com (unknown [10.2.16.33]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45A5C200A384; Thu, 28 Mar 2024 23:50:27 +0000 (UTC) Date: Thu, 28 Mar 2024 18:50:21 -0500 From: Eric Blake To: Stefan Hajnoczi Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Alasdair Kergon , Mikulas Patocka , dm-devel@lists.linux.dev, David Teigland , Mike Snitzer , Jens Axboe , Christoph Hellwig , Joe Thornber Subject: Re: [RFC 1/9] block: add llseek(SEEK_HOLE/SEEK_DATA) support Message-ID: References: <20240328203910.2370087-1-stefanha@redhat.com> <20240328203910.2370087-2-stefanha@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240328203910.2370087-2-stefanha@redhat.com> User-Agent: NeoMutt/20240201 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 On Thu, Mar 28, 2024 at 04:39:02PM -0400, Stefan Hajnoczi wrote: > The SEEK_HOLE/SEEK_DATA interface is used by userspace applications to > detect sparseness. This makes copying and backup applications faster and > reduces space consumption because only ranges that do not contain data > can be skipped. s/only // > > Handle SEEK_HOLE/SEEK_DATA for block devices. No block drivers implement > the new callback yet so the entire block device will appear to contain > data. Later patches will add support to drivers so this actually becomes > useful. > > Signed-off-by: Stefan Hajnoczi > --- > include/linux/blkdev.h | 7 +++++++ > block/fops.c | 43 +++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 49 insertions(+), 1 deletion(-) > -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org