Received: by 10.213.65.68 with SMTP id h4csp370137imn; Tue, 13 Mar 2018 07:02:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELuYUBYlcgReVmCE1MGnQTGStPvNOKecJ1AiBzd3msD9RDwuEIBwc3O/OiY1ImonL7R6aHlZ X-Received: by 2002:a17:902:7e87:: with SMTP id c7-v6mr693087plm.138.1520949770558; Tue, 13 Mar 2018 07:02:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520949770; cv=none; d=google.com; s=arc-20160816; b=Qzfy62wLEVyB0feSRnPV71tyRIw5ee2TOOjxSJp0kim1CZVikh8As9ghoIDwjKgNpr J/2aJAa4yovJ427tY/2rGtauGbmjdCSokU90Tm2zjqN3zfTPrkB9JMIRMKnRNgh7k9w1 wE3dOL87yMVrl/63u+5iWuAVaGK5xMGkDSu/V+NWlIefCOthUMxMw1zB3ryqSgqrwc0n ti/pBdGbYAjz9SgkaJS1F7CgyZc2A+jMhR+pco6rOeUhYrWGeJXSYqonrajyij8r4S5D cpXydwGbBKAhPsNAGv0aNcLQc+3ErMoD61dGlWv5wP8HN2Wa4Vs3dIiDBnW883noczQc 46Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=c7XwEQF4XDkh6lGUOfLCsv8b+mb1lmt6s7JDZexOs1I=; b=UVA5056GWJavQxjQ0qOGx8MM/AXI6/QGUQ3B6amJhjQiYZuIsQs8rHU6b9vRfeHWiM qrbdCextBd5zSlT6TFoUzt5SOSS4iatAjJSV56BKjMLBWFuP1gSNU/a2v72xyw65DVML vF7pnwI+fzkP5S5MQRiWfIvcw48MnzOxhIix9MW8CHqewT5Xau4JQl/Ecg9EWbDOTGGm szAI3o8Zh8X6Kq2R633I58tGdz5fdtTec28LE9CNVpiPmctWiNEER3/qO+PjrjstosJB 7N5efiQ3uPq0hGSGHFP4cL8jqlKzrM+owdDr2IZQkJzMcXBtNFsOBuWok2Jr3CjLmlwD H9jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rLs5O+UA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z31-v6si159661plb.613.2018.03.13.07.02.21; Tue, 13 Mar 2018 07:02:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rLs5O+UA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932791AbeCMN77 (ORCPT + 99 others); Tue, 13 Mar 2018 09:59:59 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34974 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752197AbeCMN0n (ORCPT ); Tue, 13 Mar 2018 09:26:43 -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:Cc:To:From:Sender:Reply-To: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=c7XwEQF4XDkh6lGUOfLCsv8b+mb1lmt6s7JDZexOs1I=; b=rLs5O+UAgKTlCM+1Gk5ydK5U9 vKqQlRhaPVe3RlRbJ++I2jIcbvye8s3DYd4I6BetANG2DDyCmoLB1mX1xGG6a3Yhgp5tUljgZZD6t HFfqE0NbAa9lFGPsL1K6sJ3/BuTJT2XU0e8GlQA8eqmqXXu5RZq4f8HX6RbGjKs9LUCB/kIHc7d66 L4iKWLz/Ge8nCot8xHCslNBNWYsZ26g73Sg/uULlKVXiOIFYIoOeNjV0CHgN/dKeEw0+25vlSB7zi KoMkUQPNKgAEu9WUmFtY/icd30vPaNW8vTWbXkF5HZ/xzYKKA5dD4ZN8ESx8NXSPsNumZnnCTUOjR 9Iykv1CJg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1evjww-0004Z7-Jw; Tue, 13 Mar 2018 13:26:42 +0000 From: Matthew Wilcox To: Andrew Morton Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Ryusuke Konishi , linux-nilfs@vger.kernel.org Subject: [PATCH v9 05/61] Export __set_page_dirty Date: Tue, 13 Mar 2018 06:25:43 -0700 Message-Id: <20180313132639.17387-6-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180313132639.17387-1-willy@infradead.org> References: <20180313132639.17387-1-willy@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox XFS currently contains a copy-and-paste of __set_page_dirty(). Export it from buffer.c instead. Signed-off-by: Matthew Wilcox Acked-by: Jeff Layton --- fs/buffer.c | 3 ++- fs/xfs/xfs_aops.c | 15 ++------------- include/linux/mm.h | 1 + 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 17f13191a552..62bf5445c921 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -594,7 +594,7 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode); * * The caller must hold lock_page_memcg(). */ -static void __set_page_dirty(struct page *page, struct address_space *mapping, +void __set_page_dirty(struct page *page, struct address_space *mapping, int warn) { unsigned long flags; @@ -608,6 +608,7 @@ static void __set_page_dirty(struct page *page, struct address_space *mapping, } spin_unlock_irqrestore(&mapping->tree_lock, flags); } +EXPORT_SYMBOL_GPL(__set_page_dirty); /* * Add a page to the dirty page list. diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index a0afb6411417..f51350cb98a7 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1473,19 +1473,8 @@ xfs_vm_set_page_dirty( newly_dirty = !TestSetPageDirty(page); spin_unlock(&mapping->private_lock); - if (newly_dirty) { - /* sigh - __set_page_dirty() is static, so copy it here, too */ - unsigned long flags; - - spin_lock_irqsave(&mapping->tree_lock, flags); - if (page->mapping) { /* Race with truncate? */ - WARN_ON_ONCE(!PageUptodate(page)); - account_page_dirtied(page, mapping); - radix_tree_tag_set(&mapping->page_tree, - page_index(page), PAGECACHE_TAG_DIRTY); - } - spin_unlock_irqrestore(&mapping->tree_lock, flags); - } + if (newly_dirty) + __set_page_dirty(page, mapping, 1); unlock_page_memcg(page); if (newly_dirty) __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); diff --git a/include/linux/mm.h b/include/linux/mm.h index 4d02524a7998..7f7bb4c28497 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1456,6 +1456,7 @@ extern int try_to_release_page(struct page * page, gfp_t gfp_mask); extern void do_invalidatepage(struct page *page, unsigned int offset, unsigned int length); +void __set_page_dirty(struct page *, struct address_space *, int warn); int __set_page_dirty_nobuffers(struct page *page); int __set_page_dirty_no_writeback(struct page *page); int redirty_page_for_writepage(struct writeback_control *wbc, -- 2.16.1