From patchwork Tue Mar 13 10:49:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10278173 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 0CDAA602BD for ; Tue, 13 Mar 2018 10:49:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDE0A28F27 for ; Tue, 13 Mar 2018 10:49:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2CCD28F3B; Tue, 13 Mar 2018 10:49:49 +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 4F8CC28F27 for ; Tue, 13 Mar 2018 10:49:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932691AbeCMKtq (ORCPT ); Tue, 13 Mar 2018 06:49:46 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37958 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932885AbeCMKto (ORCPT ); Tue, 13 Mar 2018 06:49:44 -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=ua5bBa8oEaIpJHDve781bp1g6bikVXEV6DdGV861bac=; b=GgW3j0vuYHKcYk0QeOKal9VOs 1mQwSMxwiL0jJkyWJS92StrIu7To/3T8F9ZpPdXIHmF2trYwwdI05V1KHlJSPSgFYqalcnAF+rDxc SELRgnh3MihE30WhxEUcouq6vXrQtzqRZ4CM5bJNtNHZkEhy7nvxv8fzBHmfS0952zv0zrV6m1Pmj NhCjtjLDbRVWTGSzgUFmkL5NAlrjHlctUFxNJ9inxw1q03iVGeiSyAfOX6+BUtUChRLVs8Cu3cHTS PXiELs3B3czIHOM7GhHMu0ddLDhMlUh6jk5Vmh6eRq0mJd27/CXbbpk1Cukg8JJcOpceKM2Nn2Tud lxuyVTl1w==; 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 1evhV1-0006G7-Qj for linux-xfs@vger.kernel.org; Tue, 13 Mar 2018 10:49:44 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 4/8] xfs: merge _xfs_log_force and xfs_log_force Date: Tue, 13 Mar 2018 11:49:23 +0100 Message-Id: <20180313104927.12926-5-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180313104927.12926-1-hch@lst.de> References: <20180313104927.12926-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 Switch to a single interface for flushing the whole log, which gives consistent trace point coverage, and removes the unused log_flushed argument for the previous _xfs_log_force callers. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/scrub/common.c | 2 +- fs/xfs/xfs_extent_busy.c | 3 +-- fs/xfs/xfs_log.c | 26 +++++--------------------- fs/xfs/xfs_log.h | 6 +----- 4 files changed, 8 insertions(+), 29 deletions(-) diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c index 8033ab9d8f47..ddcdda336402 100644 --- a/fs/xfs/scrub/common.c +++ b/fs/xfs/scrub/common.c @@ -619,7 +619,7 @@ xfs_scrub_checkpoint_log( { int error; - error = _xfs_log_force(mp, XFS_LOG_SYNC, NULL); + error = xfs_log_force(mp, XFS_LOG_SYNC); if (error) return error; xfs_ail_push_all_sync(mp->m_ail); diff --git a/fs/xfs/xfs_extent_busy.c b/fs/xfs/xfs_extent_busy.c index 1b439db95634..13e3d1a69e76 100644 --- a/fs/xfs/xfs_extent_busy.c +++ b/fs/xfs/xfs_extent_busy.c @@ -613,8 +613,7 @@ xfs_extent_busy_flush( DEFINE_WAIT (wait); int error; - trace_xfs_log_force(mp, 0, _THIS_IP_); - error = _xfs_log_force(mp, XFS_LOG_SYNC, NULL); + error = xfs_log_force(mp, XFS_LOG_SYNC); if (error) return; diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 3e5ba1ecc080..dbb0d69445e8 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -869,7 +869,7 @@ xfs_log_unmount_write(xfs_mount_t *mp) return 0; } - error = _xfs_log_force(mp, XFS_LOG_SYNC, NULL); + error = xfs_log_force(mp, XFS_LOG_SYNC); ASSERT(error || !(XLOG_FORCED_SHUTDOWN(log))); #ifdef DEBUG @@ -3304,16 +3304,16 @@ xlog_state_switch_iclogs( * not in the active nor dirty state. */ int -_xfs_log_force( +xfs_log_force( struct xfs_mount *mp, - uint flags, - int *log_flushed) + uint flags) { struct xlog *log = mp->m_log; struct xlog_in_core *iclog; xfs_lsn_t lsn; XFS_STATS_INC(mp, xs_log_force); + trace_xfs_log_force(mp, 0, _RET_IP_); xlog_cil_force(log); @@ -3362,8 +3362,6 @@ _xfs_log_force( if (xlog_state_release_iclog(log, iclog)) return -EIO; - if (log_flushed) - *log_flushed = 1; spin_lock(&log->l_icloglock); if (be64_to_cpu(iclog->ic_header.h_lsn) == lsn && iclog->ic_state != XLOG_STATE_DIRTY) @@ -3415,20 +3413,6 @@ _xfs_log_force( return 0; } -/* - * Wrapper for _xfs_log_force(), to be used when caller doesn't care - * about errors or whether the log was flushed or not. This is the normal - * interface to use when trying to unpin items or move the log forward. - */ -void -xfs_log_force( - xfs_mount_t *mp, - uint flags) -{ - trace_xfs_log_force(mp, 0, _RET_IP_); - _xfs_log_force(mp, flags, NULL); -} - /* * Force the in-core log to disk for a specific LSN. * @@ -4035,7 +4019,7 @@ xfs_log_force_umount( * to guarantee this. */ if (!logerror) - _xfs_log_force(mp, XFS_LOG_SYNC, NULL); + xfs_log_force(mp, XFS_LOG_SYNC); /* * mark the filesystem and the as in a shutdown state and wake diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h index bf212772595c..726dd9a330b4 100644 --- a/fs/xfs/xfs_log.h +++ b/fs/xfs/xfs_log.h @@ -129,11 +129,7 @@ xfs_lsn_t xfs_log_done(struct xfs_mount *mp, struct xlog_ticket *ticket, struct xlog_in_core **iclog, bool regrant); -int _xfs_log_force(struct xfs_mount *mp, - uint flags, - int *log_forced); -void xfs_log_force(struct xfs_mount *mp, - uint flags); +int xfs_log_force(struct xfs_mount *mp, uint flags); int _xfs_log_force_lsn(struct xfs_mount *mp, xfs_lsn_t lsn, uint flags,