Received: by 10.213.65.68 with SMTP id h4csp143725imn; Mon, 26 Mar 2018 17:30:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Gpu2RSS6N1g5xsukKnDD33gejKJwvt80oIo9PUqjSL6jiH16zuoXwVk/Gi55EEnCViMhT X-Received: by 2002:a17:902:7288:: with SMTP id d8-v6mr3628935pll.79.1522110623105; Mon, 26 Mar 2018 17:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522110623; cv=none; d=google.com; s=arc-20160816; b=PgyWK0d5RbnIHnyuBQ8P0EchsHyn5uM6JT7IMaBsmE+lbB33BhHIUkuSo1TR1mo49p 2P7Z/K4/poeTR5T1+p/PnAUFeyrEnFOZ03YWYZ9E5dNwLX8a/+aONeZ+4g78TuImeBt3 AHpUT63NVFAYgfWWIjaMMfY1xrxx9G/QRqx/TRXCcUcUn3I23wsma2bBA7T6V8RWzFXQ Tt7h3Jst3x/Z5QqqDDrqCfd3tH1fSFLgbM0fK0K/2L9crHBGjYX0TZufqprLFz6WuJSK c1EDzj899aOHIUUV6TkFEdZkxtBwdYhBTCGhbDbf5v9uyP2W2QYpMKGXYb7lmH5e34i8 GFtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=1W8cZ1tudT+OE4CD0hhPYfrp8/9Tuk5tvw1ZXxAYwVI=; b=t8GPb8jaUlKKrcbxsgXLsNUtOhIHqOEJzUbU4fgCabLh8QaSBzGu5TLnTPzPyKfNaf yDqRFT1OhA7bCJRinUt601SEXtv/I874YLaVNg7hw2c/0CFZE3X2Ws8hHsMqkgo2ABtG rEO5vgD3j/x0UBMeXeyBjKrkz+lECjDDTO26A6M+rxzBHmPAr6xeu6NtoV7Hx5G4RGdT 945NGSEl1dhqkWxZOqr0iCB9oD5MGQcl7w8ISJJUwpl9iTlzLoxQHTf6hyMv/FkatrQq MRW6z/Fq+TcHSlndEqo99TQEEnKL7fMleBa/KOAmlTHIra2aVN0adW2rVhMz8tepQxfc 0MXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=nEgOoTmZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7si3813pgn.327.2018.03.26.17.30.08; Mon, 26 Mar 2018 17:30:23 -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=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=nEgOoTmZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752084AbeC0A3N (ORCPT + 99 others); Mon, 26 Mar 2018 20:29:13 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:54086 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751776AbeC0A3L (ORCPT ); Mon, 26 Mar 2018 20:29:11 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2R08HMl066065; Tue, 27 Mar 2018 00:28:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=1W8cZ1tudT+OE4CD0hhPYfrp8/9Tuk5tvw1ZXxAYwVI=; b=nEgOoTmZA02DpHgoIN/Ay8iRXqHWX5Oo6ApTgu1TSPNYdmuaODr9gF5iDqj/8ZPppxfy e9eiXK2sAkW4P5N3ZzEbeKDd45viXiacqecysHqacwdnNjU4iWpGuM0GFC6FeRRqxLFe +B9+I8LXRovVhs6fHsOd3MzdHkwmUMnd353lpPQ4DkdvEKgk4LBzNQkBV1MxC2cTknYu 4s27qFA5h5W2mxkGLJKR4xOoaodiFmN6JP0A0CcCuoM0gyexCmNeZnL/f5pu0edDURSa Umd0uPSlkYyUmFnSDmCTCGH3o4o2tGo7CWW4nPpuI4l97h2W4NaXCnAcvxBCWJiCjMqy 5Q== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2gyaweg3m7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Mar 2018 00:28:44 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2R0Sh7h006486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Mar 2018 00:28:44 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2R0SgMh009834; Tue, 27 Mar 2018 00:28:42 GMT Received: from localhost (/10.159.239.252) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Mar 2018 00:28:42 +0000 Date: Mon, 26 Mar 2018 17:28:41 -0700 From: "Darrick J. Wong" To: Matthew Wilcox Cc: Andrew Morton , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Ryusuke Konishi , linux-nilfs@vger.kernel.org Subject: Re: [PATCH v9 05/61] Export __set_page_dirty Message-ID: <20180327002841.GI4807@magnolia> References: <20180313132639.17387-1-willy@infradead.org> <20180313132639.17387-6-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180313132639.17387-6-willy@infradead.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8844 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803260238 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 13, 2018 at 06:25:43AM -0700, Matthew Wilcox wrote: > 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 Looks ok, Reviewed-by: Darrick J. Wong --D > --- > 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 >