Received: by 10.223.164.202 with SMTP id h10csp656718wrb; Wed, 22 Nov 2017 13:09:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMacy7CoDMTIej4M4huw5uxeBMtyRQd0AzcjyRh0/ulPyfb6hvixMo7ZjJer5YoaxV8kSUQi X-Received: by 10.99.55.30 with SMTP id e30mr21743687pga.156.1511384993776; Wed, 22 Nov 2017 13:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511384993; cv=none; d=google.com; s=arc-20160816; b=0aQgqVfKJzS5IlhtchaLtW3SKOeKNzETeFjx/tb0UtRfYUcr35PeJxLerXZ7Lc0066 pd3cpzqSdw7D//EamcTWbXMZ/mrojT+31/Vj2hwxVtTgw1gQ+TIt/rR/LxEtkJeCteQm EeZxpE/v5WkV9qiS1weFjETSBlVaix9ez1Xs5o7oIYqQuSQJAqdyqgU/F4zyer5XtGZ6 Ra18qU2MDTfJ3zD69IP/RIAL9jI2DSNV+YhUxvFg/UpqK26xENhPcl0AcI7bvDNUfW01 kM8dGjbvD7dsGp2TTxpUgaR2o2R6hLHsuHHZi3JSnvP9f4tE9SqviR/EHPzZNLhM4qYw 7k1w== 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=OE8YxTERayBym6X7kkEPb/gbTu2Opy7Q8svslFqrOZk=; b=ohvRyygYBC2zHAQdDmC0+c0Gy2MYp+rehq4b7dTPipcBek7WohON9Jf+KM3fsH8Paf XtyqIIiYerps32XwVmAPwPZjBmqfk+J2VurrvOdKO5p1/k7qsWpPoRQ206FLbpqzwDJu aXtuQEfo/NGgT6P0LEO/mwXM5wulGydryJ9rxSU2aqt7HmNJqDUeL5tny27rYd76DUuB uG+ayj8REM632lfSAJDxINcm/LNhU+8ntga+ZP9CG6sChu4LkrJSkYeEtgEOT0o/kt4M 6A33vzVGMaSobpDOd2TsosEV+xrQk1jRvmi3fLDLRsGnqr+acd+ApwL7ovb7YSgxExeC HTvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dtMvhYmg; 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 e7si14371080plk.185.2017.11.22.13.09.42; Wed, 22 Nov 2017 13:09:53 -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=dtMvhYmg; 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 S1751963AbdKVVIW (ORCPT + 77 others); Wed, 22 Nov 2017 16:08:22 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:39390 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751725AbdKVVIQ (ORCPT ); Wed, 22 Nov 2017 16:08:16 -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=OE8YxTERayBym6X7kkEPb/gbTu2Opy7Q8svslFqrOZk=; b=dtMvhYmgZDXgdbPrcfa0c690x Ss0CGNWvm5FkZosU4PQJRi0N9kMGIPJqCWmPaqkJLD3wKb9tK0Pnrl4OnlvkkCEStjEFpiT+d3WMy u0zzAsaWUUstNteQkmtjCBkfIt4Omc+sjVUX4iEW2Uy24J6nBc21wGHDD9+KjksasegIQe/OjHcOT 3Vri5Ht8tSQm5NqTuINvp4Yq0ZwFnZp7kmrZMROzoZNIbQYIT/jNy1pXiSvce9cLPL6pitpzu+uHe KYCqWsrO0o3oQEb7aqPmfiYeduloAEvJd1t7GNqtzOlSLZ5WRVW+hfWQRR258p3ce4AeuH4/gkALj MQjExD2cg==; Received: from willy by bombadil.infradead.org with local (Exim 4.87 #1 (Red Hat Linux)) id 1eHcFk-0007sa-Ma; Wed, 22 Nov 2017 21:08:16 +0000 From: Matthew Wilcox To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Matthew Wilcox Subject: [PATCH 11/62] Export __set_page_dirty Date: Wed, 22 Nov 2017 13:06:48 -0800 Message-Id: <20171122210739.29916-12-willy@infradead.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171122210739.29916-1-willy@infradead.org> References: <20171122210739.29916-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 0736a6a2e2f0..fd894c2ae284 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -601,7 +601,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; @@ -615,6 +615,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 a3eeaba156c5..48b17d522fa1 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1459,19 +1459,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 ee073146aaa7..c692451245be 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1434,6 +1434,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.15.0 From 1584802403493062086@xxx Wed Nov 22 21:15:48 +0000 2017 X-GM-THRID: 1584802403493062086 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread