From patchwork Mon Feb 11 12:54:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10805675 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C0D81575 for ; Mon, 11 Feb 2019 12:54:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B3202A1FB for ; Mon, 11 Feb 2019 12:54:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FEBF2A206; Mon, 11 Feb 2019 12:54:52 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 2AEC62A1FB for ; Mon, 11 Feb 2019 12:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727619AbfBKMyv (ORCPT ); Mon, 11 Feb 2019 07:54:51 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35606 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727106AbfBKMyv (ORCPT ); Mon, 11 Feb 2019 07:54:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type: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=DpqczHR7evhtzjvSRHEZOg/mvV3W1eS92wEoouobNUk=; b=edSj6gQIjLZUoBkCLQelT+490X BFValw66G/9jyWArjmqgj7rYJ9Oe5nHix+gxwEjUnj8Fr7Y6X5kS7WfBM3e6e6jUb23v5B1E8GjTD gwke7UrlGxr+TSVqOkWZEKo2Q4l8ae6GimLghOK+cDE9++Kc1+F+eZK/irVpqDWzP/AhG2n+N52S3 yyHt4dIGONbHuEKgU+WPIkGzxpYzaD4O6y2idiSXuCZFtVIg22GjgUVtIp/fsT8Ncrz9LHeKS1KSr eo2Q+SGh1h78O6yIrqB92KqnZOfiM4YbmOhw+2XDNZzcocyirmq6RFZ3oYr2Fa0KBxqMyj2x1lQj2 YkxBvJCQ==; Received: from 089144210182.atnat0019.highway.a1.net ([89.144.210.182] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtB6o-0003VI-Ly; Mon, 11 Feb 2019 12:54:51 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Cc: Brian Foster Subject: [PATCH 07/10] xfs: move stat accounting to xfs_bmapi_convert_delalloc Date: Mon, 11 Feb 2019 13:54:24 +0100 Message-Id: <20190211125427.16577-8-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211125427.16577-1-hch@lst.de> References: <20190211125427.16577-1-hch@lst.de> MIME-Version: 1.0 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 This way we can actually count how many bytes got converted and how many calls we need, unlike in the caller which doesn't have the detailed view. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster --- fs/xfs/libxfs/xfs_bmap.c | 3 +++ fs/xfs/xfs_iomap.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index d9d66e1856d7..dc3f0608377d 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -4513,6 +4513,9 @@ xfs_bmapi_convert_delalloc( goto out_finish; } + XFS_STATS_ADD(mp, xs_xstrat_bytes, XFS_FSB_TO_B(mp, bma.length)); + XFS_STATS_INC(mp, xs_xstrat_quick); + ASSERT(!isnullstartblock(bma.got.br_startblock)); ASSERT(bma.got.br_startblock || XFS_IS_REALTIME_INODE(ip)); *imap = bma.got; diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 39be741cac5a..15da53b5fb53 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -707,9 +707,6 @@ xfs_iomap_write_allocate( map_start_fsb = imap->br_startoff; map_count_fsb = imap->br_blockcount; - XFS_STATS_ADD(mp, xs_xstrat_bytes, - XFS_FSB_TO_B(mp, imap->br_blockcount)); - while (true) { /* * Allocate in a loop because it may take several attempts to @@ -741,7 +738,6 @@ xfs_iomap_write_allocate( if ((offset_fsb >= imap->br_startoff) && (offset_fsb < (imap->br_startoff + imap->br_blockcount))) { - XFS_STATS_INC(mp, xs_xstrat_quick); xfs_trim_extent(imap, map_start_fsb, map_count_fsb); ASSERT(offset_fsb >= imap->br_startoff && offset_fsb < imap->br_startoff + imap->br_blockcount);