From patchwork Fri May 18 12:34:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 10410359 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 522DE602CB for ; Fri, 18 May 2018 12:35:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40C3828936 for ; Fri, 18 May 2018 12:35:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3247728956; Fri, 18 May 2018 12:35:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 A6A8928936 for ; Fri, 18 May 2018 12:35:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752074AbeERMe2 (ORCPT ); Fri, 18 May 2018 08:34:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:39506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751897AbeERMeV (ORCPT ); Fri, 18 May 2018 08:34:21 -0400 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5CC9C20859; Fri, 18 May 2018 12:34:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526646861; bh=TfQiGejriUaA53U/w+p9rGW1q32MCqKMEYD6u7dPHAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jJQnuK/1CAztiZcm5FdVlT3MwXy0E3HitW+LMte4+vKdq350lPEIWDKgAxf8nBgEa eoax45o4pkOCTo+uL/4pDAmQUG71jhMCDb1Ksq97s48762EIZEVziUZWY1DXnDV2Z4 DBOamPryjubWisPqy3zydErAwPexSItieIYCi4rk= From: Jeff Layton To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: viro@ZenIV.linux.org.uk, willy@infradead.org, andres@anarazel.de Subject: [RFC PATCH 04/11] vfs: add errseq_t pointer to __sync_filesystem Date: Fri, 18 May 2018 08:34:08 -0400 Message-Id: <20180518123415.28181-5-jlayton@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518123415.28181-1-jlayton@kernel.org> References: <20180518123415.28181-1-jlayton@kernel.org> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jeff Layton ...and pass that to the sync_fs operation. Also, have __sync_filesystem return the error from sync_fs (if there is one). Signed-off-by: Jeff Layton --- fs/sync.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/sync.c b/fs/sync.c index fc0b7bd51ae6..c876fa414cae 100644 --- a/fs/sync.c +++ b/fs/sync.c @@ -28,14 +28,16 @@ * wait == 1 case since in that case write_inode() functions do * sync_dirty_buffer() and thus effectively write one block at a time. */ -static int __sync_filesystem(struct super_block *sb, int wait) +static int __sync_filesystem(struct super_block *sb, int wait, errseq_t *since) { + int ret = 0; + if (wait) sync_inodes_sb(sb); else writeback_inodes_sb(sb, WB_REASON_SYNC); - return call_sync_fs(sb, wait, NULL); + return call_sync_fs(sb, wait, since); } /* @@ -59,10 +61,10 @@ int sync_filesystem(struct super_block *sb, errseq_t *since) if (sb_rdonly(sb)) return 0; - ret = __sync_filesystem(sb, 0); + ret = __sync_filesystem(sb, 0, since); if (ret < 0) return ret; - return __sync_filesystem(sb, 1); + return __sync_filesystem(sb, 1, since); } EXPORT_SYMBOL(sync_filesystem);