From patchwork Tue Mar 13 14:35:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10279195 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 DB246603B5 for ; Tue, 13 Mar 2018 14:36:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC3B728A4E for ; Tue, 13 Mar 2018 14:36:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C14BA29045; Tue, 13 Mar 2018 14:36:27 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 B39E429029 for ; Tue, 13 Mar 2018 14:36:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932544AbeCMOgX (ORCPT ); Tue, 13 Mar 2018 10:36:23 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60996 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932533AbeCMOgW (ORCPT ); Tue, 13 Mar 2018 10:36:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=TgnZtyqawWYW554StxONsor+a0QZE2lMMdiEdpE4OSg=; b=YXkUtlndPbu4+HZHozczl5evM RPjEdRpq7QA7IAtgIu1Zik8HoRXsMvAcPC+7tXMT9GGCjHaB+njfMdKNvkvkB2/CJ2X8j4GObPcKk GDQXLsJXOyp2uFFOnBe6sKeOfaPTvHoP93GMnVj+WjuwX7WijhipToUuvr5F29PZ/xnSMYS/Jbl5v ApY3w2wBuAF9T8mTPirpqfbQhsP+5NTfIVhp5R+lsG3kuXr4t8m8QASbvmvGaaeDd89x5KaKGengT raE4NWZMbSfh88IwcnZpzChzCxRdwFkK1yZI18Hr0gYlWpHssxXB87BW6GIK8I18ACIDjPXvBCh66 4WsIWB8Vw==; Received: from 77.117.139.172.wireless.dyn.drei.com ([77.117.139.172] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1evl2L-0004bn-Bj for linux-xfs@vger.kernel.org; Tue, 13 Mar 2018 14:36:21 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 5/8] xfs: minor cleanup for xfs_get_blocks Date: Tue, 13 Mar 2018 15:35:58 +0100 Message-Id: <20180313143601.30028-6-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180313143601.30028-1-hch@lst.de> References: <20180313143601.30028-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 Simplify the control flow a bit in preparation for O_ATOMIC-related changes. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_aops.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index c79a3ca20ef8..19eadc807056 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1335,17 +1335,16 @@ xfs_get_blocks( &nimaps, 0); if (error) goto out_unlock; - - if (nimaps) { - trace_xfs_get_blocks_found(ip, offset, size, - imap.br_state == XFS_EXT_UNWRITTEN ? - XFS_IO_UNWRITTEN : XFS_IO_OVERWRITE, &imap); - xfs_iunlock(ip, lockmode); - } else { + if (!nimaps) { trace_xfs_get_blocks_notfound(ip, offset, size); goto out_unlock; } + trace_xfs_get_blocks_found(ip, offset, size, + imap.br_state == XFS_EXT_UNWRITTEN ? + XFS_IO_UNWRITTEN : XFS_IO_OVERWRITE, &imap); + xfs_iunlock(ip, lockmode); + /* trim mapping down to size requested */ xfs_map_trim_size(inode, iblock, bh_result, &imap, offset, size);