Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2936ybz; Thu, 30 Apr 2020 15:18:27 -0700 (PDT) X-Google-Smtp-Source: APiQypJ9WflzggzjCyMEaDadExgn7kuXIUcbYjMPO9SsyXy+BtZDEhtO3xh9KzIzH8G6E9SPlp0Z X-Received: by 2002:a05:6402:48a:: with SMTP id k10mr1108495edv.98.1588285107228; Thu, 30 Apr 2020 15:18:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588285107; cv=none; d=google.com; s=arc-20160816; b=UQw5tUOn95CZ0SxccvdhCF5LFfXLhrV1Fcr4elFwLFv+gwRfPO1Sifi2RuCCBFeskS Ijv3WomPKcU2w5veCAWFu24d5RMf1glweiUkuWJMtRvWeXnmmyMkpTTIM+qBWTngm0ZY 4HgjoPDrea5COn2kdXaT4wLXhNBtMzT/8943QhV+SuXrNdLxc/mULq+Zk29LwYMlX6se rSd1McsSvVOTrWAfCLtqSRcv7b9YgOTE/GBpoyig3CBLJ5Qn94rWjyZblYhLmLqMkLnL JUjKTsBeUCUOKuxvnlS9hIQuGN51QO9SrCsqoxf3npaWEAPvyI398u38pj75rDmfZBU/ kN+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=bd0ZsvJx0qN41jGJdx6Q3uDOBTPr2hBuuON/tmj1OPE=; b=SH3cKT1qwY3zQAxFgU6d/3L3EE+2y0NfStLSc4tVqx6fIAykUhG6IUZ3baS72b8YoM KaniyumbYvkQ1FxvHm6BD1D04FZup164MQvXB/7qdNQwP+0dXVq6Ar0RogLcYC3Ol/+U RnFyQDPocHxougKuhcRNRIV7I/RR5pJVxozKXGPA1Tbjkl0klusxnTqVK+/sHM15oqHl A0THBdSDMWvdKerqRE6whFQaTRFrKNmzSiZXepcK2M40lzK6OEEU+I76+A23+M1tAREh /uxDPASrOFLsVND53UDZlV7RN8vbQLCG95Wn/uvZvzuUMUrdwhB+G8+EMrBf9mCBMfhb /Nng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Xh5T5/zf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si538866ejr.484.2020.04.30.15.18.03; Thu, 30 Apr 2020 15:18:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Xh5T5/zf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727980AbgD3WNq (ORCPT + 99 others); Thu, 30 Apr 2020 18:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726697AbgD3WNq (ORCPT ); Thu, 30 Apr 2020 18:13:46 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC367C035494; Thu, 30 Apr 2020 15:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bd0ZsvJx0qN41jGJdx6Q3uDOBTPr2hBuuON/tmj1OPE=; b=Xh5T5/zf36Iun9lfkNlEeXo/27 qpj6KB4345/Cc/m+7HWNU07yHSitTsHNxf43w29pLdFOLHOfVTYjI9tDCKGec6cEk83PJ5GqWyrFw xCVrZDz49/b0wB7Yapm/GbhfIo0w0D60cKkNHaoxbLCv70va07R3hB3AxdrLrli8dB87fDS0Ndm9j m+USiBB+G6dkvHAgLi3/Sy2qxmHFNVeKf9RAg+FPui7Hgtq0Ig17TaGN1/AGUg4WEKCDRMHpCrK7u 9rIqjC7QpANlp3+ie8aKQDzn2D4NAtlZhS85GUMY3G9CNKyyxd/3mIlLD0DRHnazAYqhFC6STfv7G vA7SVRlQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jUHR4-0007zt-IY; Thu, 30 Apr 2020 22:13:38 +0000 Date: Thu, 30 Apr 2020 15:13:38 -0700 From: Matthew Wilcox To: Guoqing Jiang Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, david@fromorbit.com, Andrew Morton , "Darrick J. Wong" , William Kucharski , "Kirill A. Shutemov" , Andreas Gruenbacher , Yang Shi , Yafang Shao , Song Liu , linux-raid@vger.kernel.org, Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, Alexander Viro , Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, Anton Altaparmakov , linux-ntfs-dev@lists.sourceforge.net, Mike Marshall , Martin Brandenburg , devel@lists.orangefs.org, Thomas Gleixner , Sebastian Andrzej Siewior , Roman Gushchin , Andreas Dilger Subject: Re: [RFC PATCH V2 1/9] include/linux/pagemap.h: introduce attach/clear_page_private Message-ID: <20200430221338.GY29705@bombadil.infradead.org> References: <20200430214450.10662-1-guoqing.jiang@cloud.ionos.com> <20200430214450.10662-2-guoqing.jiang@cloud.ionos.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200430214450.10662-2-guoqing.jiang@cloud.ionos.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 30, 2020 at 11:44:42PM +0200, Guoqing Jiang wrote: > +/** > + * attach_page_private - attach data to page's private field and set PG_private. > + * @page: page to be attached and set flag. > + * @data: data to attach to page's private field. > + * > + * Need to take reference as mm.h said "Setting PG_private should also increment > + * the refcount". > + */ I don't think this will read well when added to the API documentation. Try this: /** * attach_page_private - Attach private data to a page. * @page: Page to attach data to. * @data: Data to attach to page. * * Attaching private data to a page increments the page's reference count. * The data must be detached before the page will be freed. */ > +/** > + * clear_page_private - clear page's private field and PG_private. > + * @page: page to be cleared. > + * > + * The counterpart function of attach_page_private. > + * Return: private data of page or NULL if page doesn't have private data. > + */ Seems to me that the opposite of "attach" is "detach", not "clear". /** * detach_page_private - Detach private data from a page. * @page: Page to detach data from. * * Removes the data that was previously attached to the page and decrements * the refcount on the page. * * Return: Data that was attached to the page. */