From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 83DED385700C; Mon, 21 Aug 2023 08:33:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83DED385700C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1692606782; bh=adYQe5mEseyD8a+PtMRIwcCbCj4IPFxiPy5vhxSxUA8=; h=Date:From:To:Subject:Reply-To:References:In-Reply-To:From; b=wXPnyK4tmyEB4i/ZM0nbvMXvLXmE/q8XBB3qmPtrbLWHrTaYbf+O9822GYyIkGKFg zB7EkGcpuD8vsHq9dBCv0K7vkFPUmYIpS8Gy/fuBhrUykGHAUmypdpMtjnnx5hsRXj 7DcAvmtPZR4FJX4FyXcmaUGhW/zB4q5mf9GV+wl4= Received: by calimero.vinschen.de (Postfix, from userid 500) id C1EC9A80906; Mon, 21 Aug 2023 10:32:58 +0200 (CEST) Date: Mon, 21 Aug 2023 10:32:58 +0200 From: Corinna Vinschen To: cygwin-developers@cygwin.com Subject: Re: SEEK_HOLE Support in Cygwin? Message-ID: Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: On Aug 21 06:33, Cedric Blancher wrote: > On Thu, 10 Aug 2023 at 10:28, Corinna Vinschen > wrote: > > On Aug 10 04:43, Cedric Blancher wrote: > > > So this supports multiple holes in one file, right? > > > > Curious question. Cygwin supports sparse files for ages. Only the > > lseek options SEEK_HOLE and SEEK_DATA are new. > > Is SEEK_HOLE support enabled for MSFT NFSv3 client? NFSv3 doesn't return the FILE_SUPPORTS_SPARSE_FILES capability and doesn't support Windows sparse file functions. Sparsification is (correctly) the responsibility of the remote file system. > > But, yes, it supports what Windows supports. But note that Cygwin > > *only* switches files to sparse, if you seek by more than 128K beyond > > current EOF and then wrote something, or if you call truncate/ftruncate, > > raising the filesize by more than 128K. > > Where does the value of 128K come from? Is this a Windows limit, > kernel tunable, or something from Cygwin? Something from Cygwin. > > In contrast to Linux, one has to sparsify a file explicitely on WIndows, > > and that's Cygwin's strategy. > > Maybe add a O_SPARSEFILE to open/openat()? We won't add any non-standard or non-Linux open flags. You can use the chattr/lsattr tools. > > > Why is "sparse" not the default mount option? > > > > It was, at one point long ago. People complained that sparse file > > access is slower than standard file access, so the "sparse" mount option > > was added. > > Do you have any refs in the mailing list? Not without searching myself. Corinna