From patchwork Thu Feb 9 12:44:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9564493 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 9447560572 for ; Thu, 9 Feb 2017 13:04:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79DB12846D for ; Thu, 9 Feb 2017 13:04:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E7D928518; Thu, 9 Feb 2017 13:04:02 +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.9 required=2.0 tests=BAYES_00,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 703C92849B for ; Thu, 9 Feb 2017 13:04:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751726AbdBINEA (ORCPT ); Thu, 9 Feb 2017 08:04:00 -0500 Received: from mx2.suse.de ([195.135.220.15]:35796 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751835AbdBIND7 (ORCPT ); Thu, 9 Feb 2017 08:03:59 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 378DFADBE; Thu, 9 Feb 2017 12:44:44 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 2A8DB1E1122; Thu, 9 Feb 2017 13:44:43 +0100 (CET) From: Jan Kara To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Tejun Heo , Dan Williams , Thiago Jung Bauermann , NeilBrown , Jan Kara Subject: [PATCH 06/10] writeback: Move __inode_wait_for_state_bit Date: Thu, 9 Feb 2017 13:44:29 +0100 Message-Id: <20170209124433.2626-7-jack@suse.cz> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170209124433.2626-1-jack@suse.cz> References: <20170209124433.2626-1-jack@suse.cz> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move it up in fs/fs-writeback.c so that we don't have to use forward declarations. No code change. Signed-off-by: Jan Kara --- fs/fs-writeback.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index c9770de11650..23dc97cf2a50 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -99,6 +99,21 @@ static inline struct inode *wb_inode(struct list_head *head) EXPORT_TRACEPOINT_SYMBOL_GPL(wbc_writepage); +/* + * Wait for bit in inode->i_state to clear. Called with i_lock held. + * Caller must make sure inode cannot go away when we drop i_lock. + */ +static void __inode_wait_for_state_bit(struct inode *inode, int bit_nr) + __releases(inode->i_lock) + __acquires(inode->i_lock) +{ + while (inode->i_state & (1 << bit_nr)) { + spin_unlock(&inode->i_lock); + wait_on_bit(&inode->i_state, bit_nr, TASK_UNINTERRUPTIBLE); + spin_lock(&inode->i_lock); + } +} + static bool wb_io_lists_populated(struct bdi_writeback *wb) { if (wb_has_dirty_io(wb)) { @@ -1170,21 +1185,6 @@ static int write_inode(struct inode *inode, struct writeback_control *wbc) } /* - * Wait for bit in inode->i_state to clear. Called with i_lock held. - * Caller must make sure inode cannot go away when we drop i_lock. - */ -static void __inode_wait_for_state_bit(struct inode *inode, int bit_nr) - __releases(inode->i_lock) - __acquires(inode->i_lock) -{ - while (inode->i_state & (1 << bit_nr)) { - spin_unlock(&inode->i_lock); - wait_on_bit(&inode->i_state, bit_nr, TASK_UNINTERRUPTIBLE); - spin_lock(&inode->i_lock); - } -} - -/* * Wait for writeback on an inode to complete. Caller must have inode pinned. */ void inode_wait_for_writeback(struct inode *inode)