From: =?UTF-8?Q?Andreas_Gr=C3=BCnbacher?= Subject: Re: [PATCH 4/6] vfs: Add iomap_seek_hole and iomap_seek_data helpers Date: Wed, 28 Jun 2017 00:49:27 +0200 Message-ID: References: <20170627214828.1029-1-hch@lst.de> <20170627214828.1029-5-hch@lst.de> <20170627224326.GA12755@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: Andreas Gruenbacher , Jan Kara , Linux FS-devel Mailing List , linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org To: Christoph Hellwig Return-path: In-Reply-To: <20170627224326.GA12755@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-ext4.vger.kernel.org 2017-06-28 0:43 GMT+02:00 Christoph Hellwig : > On Wed, Jun 28, 2017 at 12:14:57AM +0200, Andreas Gr=C3=BCnbacher wrote: >> This shouldn't be true anymore now that the actors don't recompute the >> length; the above three lines should be obsolete. > > Indeed. > >> This comment makes more sense in iomap_seek_hole now. > > Or just drop it.. > > What about the incremental patch below? Ok. > diff --git a/fs/iomap.c b/fs/iomap.c > index c90cda33994b..432eed8f091f 100644 > --- a/fs/iomap.c > +++ b/fs/iomap.c > @@ -626,9 +626,6 @@ iomap_seek_hole(struct inode *inode, loff_t offset, c= onst struct iomap_ops *ops) > length -=3D ret; > } > > - /* The last segment can extend beyond the end of the file. */ > - if (length <=3D 0) > - return min(offset, size); > return offset; > } > EXPORT_SYMBOL_GPL(iomap_seek_hole); > @@ -675,7 +672,6 @@ iomap_seek_data(struct inode *inode, loff_t offset, c= onst struct iomap_ops *ops) > length -=3D ret; > } > > - /* There is an implicit hole at the end of the file. */ > if (length <=3D 0) > return -ENXIO; > return offset; Thanks, Andreas