From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Whitehouse Date: Wed, 2 Nov 2016 09:37:00 +0000 Subject: [Cluster-devel] [PATCH v2 2/3] GFS2: Implement iomap for block_map In-Reply-To: <20161031200716.GM22126@dastard> References: <1477682971-4517-1-git-send-email-rpeterso@redhat.com> <1477682971-4517-3-git-send-email-rpeterso@redhat.com> <58146ADD.9010702@redhat.com> <20161031200716.GM22126@dastard> Message-ID: <5819B3BC.6080602@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, On 31/10/16 20:07, Dave Chinner wrote: > On Sat, Oct 29, 2016 at 10:24:45AM +0100, Steven Whitehouse wrote: >> On 28/10/16 20:29, Bob Peterson wrote: >>> + if (create) >>> + flags |= IOMAP_WRITE; >> Hmm, I wonder why IOMAP_WRITE and IOMAP_ZERO are separate flags from >> the iomap.flags field... Christoph, was there a specific reason for >> that? > They are different actions. IOMAP_WRITE requires allocation over > holes and conversion of unwritten extents to allow writing of > user data into the range. IOMAP_ZERO is for zeroing a range of a > file via iomap_zero_range() and it does not require allocation - it > skips holes and unwritten regions as they are already guaranteed to > contain zeros. > > One *could* allocate blocks with IOMAP_ZERO if desired (i.e. > implement IOMAP_ZERO as though it implied IOMAP_WRITE) and > iomap_zero_range_actor() will zero the allocated regions > appropriately, but it's not necessary to do if it is already known > what ranges of the file contain zeros... > > Cheers, > > Dave. That wasn't quite what I was getting at... we have two sets of flags. IOMAP_ZERO, IOMAP_WRITE and IOMAP_REPORT form one set that are passed as an argument to ->iomap_begin() and ->iomap_end() whereas we also have IOMAP_F_* which are set in the iomap.flags field. I guess perhaps the former is intended as the input flags to the functions, where as the latter are output flags from ->iomap_begin()? In that case I would expect that ->iomap_end() would view the iomap.flags as read only. Just trying to get my head around the intention here and then we can figure out the right thing to do gfs2-wise based on that, Steve.