From patchwork Tue Jun 27 22:43:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9813199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AF4F3603F2 for ; Tue, 27 Jun 2017 22:43:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2004280B0 for ; Tue, 27 Jun 2017 22:43:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 969C3280FC; Tue, 27 Jun 2017 22:43:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DAFC280CF for ; Tue, 27 Jun 2017 22:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753939AbdF0Wna (ORCPT ); Tue, 27 Jun 2017 18:43:30 -0400 Received: from verein.lst.de ([213.95.11.211]:46221 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbdF0Wn3 (ORCPT ); Tue, 27 Jun 2017 18:43:29 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id A6C2D7F1BD; Wed, 28 Jun 2017 00:43:27 +0200 (CEST) Date: Wed, 28 Jun 2017 00:43:27 +0200 From: Christoph Hellwig To: Andreas =?iso-8859-1?Q?Gr=FCnbacher?= Cc: Christoph Hellwig , Andreas Gruenbacher , Jan Kara , Linux FS-devel Mailing List , linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH 4/6] vfs: Add iomap_seek_hole and iomap_seek_data helpers Message-ID: <20170627224326.GA12755@lst.de> References: <20170627214828.1029-1-hch@lst.de> <20170627214828.1029-5-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Jun 28, 2017 at 12:14:57AM +0200, Andreas Grünbacher 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? --- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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, const struct iomap_ops *ops) length -= ret; } - /* The last segment can extend beyond the end of the file. */ - if (length <= 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, const struct iomap_ops *ops) length -= ret; } - /* There is an implicit hole at the end of the file. */ if (length <= 0) return -ENXIO; return offset;