Received: by 10.223.185.116 with SMTP id b49csp4151969wrg; Mon, 19 Feb 2018 12:06:23 -0800 (PST) X-Google-Smtp-Source: AH8x226x/GDvJyypzMr1WBWEzMdWVtOFxE3bKysrt4Qkgc5VHCk+oTgwIL9UQ3j6rBxB+g5Yi/rE X-Received: by 10.101.82.195 with SMTP id z3mr13383229pgp.308.1519070783154; Mon, 19 Feb 2018 12:06:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519070783; cv=none; d=google.com; s=arc-20160816; b=G9ffvr/ojH9MjHMqH60IglZpcXJbTXLoj4z+GaettoybKXYKCjEg37NY723c/1LEVx 1hNtZmy7g7mLSlXa0JS7KWYNQ/+Z5WR/j48ts0PZA+ImTOc6zoBxtSK8TXo8KyFuN7eM Z56LYJQ8Dljbq76VEB7lgyahKLZBY8Da+pScDhw19yq6eKDgTwLmIGStbige0Ckd9vLk T/OBFvs03lCaQCHjmVMU2Vdyr1gyWoIgngGDhuWZxdrtTkA1to4iHbp8UqKTZXscCvoM h1GlbHKxztSfX1MdQaj573ft/pg2KTs49ykj8a71QmbZqBZV6ARfwBz8V1Isv1FwNzQZ f6QQ== 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=O4IUa3TUQQ1xsdkZtSN0dcLV/fVQoiinv55cfcD8nZE=; b=HVGEJ35rrWodGurknP3pmTlsRCznAVmdidfz3+Hx2zE/pdeNKShSKWYAhXmeqlqOsv bPYRfC1rBAR4rmlUyNcogH17kGVrieKz8XfS2FDppJEZ6RAwjcUcH5VztwfIZvx4nKoK SMZiKO55ghbHNuHAk/zdmhnesetTPxMn1XnMFuW02BwvVN+Z02mkfBJ9VKyVMsNDtQFK 1eAWkNX1tB2vqL0vgpiGB35TysxF4yyDcrc09AcfEIzZS/DpH4kYwi2ElsNKpHjIJpbH ZWJKIQzVzGlfXKeg+I0ybX3BNRFmi9xVt4UHu35QJsrFsHVF3oAjBvqR7oZWA3i67VDT +EMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=UVePpxnZ; 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 j3-v6si4861276plk.506.2018.02.19.12.06.09; Mon, 19 Feb 2018 12:06:23 -0800 (PST) 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=UVePpxnZ; 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 S932093AbeBSUEs (ORCPT + 99 others); Mon, 19 Feb 2018 15:04:48 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44526 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753583AbeBSTqG (ORCPT ); Mon, 19 Feb 2018 14:46:06 -0500 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=O4IUa3TUQQ1xsdkZtSN0dcLV/fVQoiinv55cfcD8nZE=; b=UVePpxnZU7E7NaOo2HE7YoN8x 00GS6DPoFP6wnkES59mTD2rVDYLCfnLViPknZ5gljq3JrAHiS4xty/XNCM6jQK9FZGWsNfxOMpi99 4aC9WXlyaLdU4bxnWafQzS/5x8P2E6xBvgzT6VvaTFml2LhZQRYpTG9+Y9XrEjb7jCAVKLhuC41bj 7qzhkRFFIsarcZHcA3oDugJGPYwBRskfC7omQyTIaUeIu9SaL/lGozuIJzTRSIdqA1diCYcbiX7DA KaNqWLQz8qoxMcLjx5AlBwBwi5w7cA8SNq0SAVx2Wu1OmEs2FVCEgb9CVC9YbG9dKYeQoBwwUmfLE rkZ/3cRAw==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1enrO1-0001kA-0v; Mon, 19 Feb 2018 19:46:05 +0000 From: Matthew Wilcox To: Andrew Morton Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v7 05/61] Export __set_page_dirty Date: Mon, 19 Feb 2018 11:45:00 -0800 Message-Id: <20180219194556.6575-6-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180219194556.6575-1-willy@infradead.org> References: <20180219194556.6575-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 --- 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 9a73924db22f..0b487cdb7124 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 9c6a830da0ee..31f2c4895a46 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1472,19 +1472,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 ad06d42adb1a..47b0fb0a6e41 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1454,6 +1454,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