From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5159EECE595 for ; Mon, 14 Oct 2019 18:13:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EF3520873 for ; Mon, 14 Oct 2019 18:13:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732772AbfJNSNB (ORCPT ); Mon, 14 Oct 2019 14:13:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52338 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731926AbfJNSNB (ORCPT ); Mon, 14 Oct 2019 14:13:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 867D9A3CD89 for ; Mon, 14 Oct 2019 18:13:01 +0000 (UTC) Received: from bfoster.bos.redhat.com (dhcp-41-2.bos.redhat.com [10.18.41.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44AE95D6A9 for ; Mon, 14 Oct 2019 18:13:01 +0000 (UTC) From: Brian Foster To: linux-xfs@vger.kernel.org Subject: [RFC PATCH 2/3] xfs: fold grant space update into head check function Date: Mon, 14 Oct 2019 14:12:59 -0400 Message-Id: <20191014181300.15494-3-bfoster@redhat.com> In-Reply-To: <20191014181300.15494-1-bfoster@redhat.com> References: <20191014181300.15494-1-bfoster@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Mon, 14 Oct 2019 18:13:01 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org The grant space add helper is separate from the check helper that potentially queues the task until sufficient log reservation is available. Callers of xlog_grant_head_check() immediately update the grant head on return. To facilitate additional coordination between the grant head check and update, fold the space update into the checking function. No functional changes. Signed-off-by: Brian Foster --- fs/xfs/xfs_log.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 045ab648ca96..ce0aac89e675 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -342,6 +342,9 @@ xlog_grant_head_check( spin_unlock(&head->lock); } + if (!error) + xlog_grant_add_space(log, &head->grant, *need_bytes); + return error; } @@ -409,7 +412,6 @@ xfs_log_regrant( if (error) goto out_error; - xlog_grant_add_space(log, &log->l_write_head.grant, need_bytes); trace_xfs_log_regrant_exit(log, tic); xlog_verify_grant_tail(log); return 0; @@ -468,7 +470,6 @@ xfs_log_reserve( if (error) goto out_error; - xlog_grant_add_space(log, &log->l_reserve_head.grant, need_bytes); xlog_grant_add_space(log, &log->l_write_head.grant, need_bytes); trace_xfs_log_reserve_exit(log, tic); xlog_verify_grant_tail(log); -- 2.20.1