Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp357502ybz; Thu, 30 Apr 2020 23:41:40 -0700 (PDT) X-Google-Smtp-Source: APiQypJZUDrWVFC/iesEBS/KBeDR4xMrH7ju0dmkwrnlLkFQ89kwO5GAehEARzNXOdG88McpILih X-Received: by 2002:a17:906:d291:: with SMTP id ay17mr1861678ejb.183.1588315299910; Thu, 30 Apr 2020 23:41:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588315299; cv=none; d=google.com; s=arc-20160816; b=CNa+GZpYFKjENaG2OhGiJZslkw87cKH6e0lK+hUcIvEYu5SxvoFVYG4IY8RxAGbuL+ XUspqhN16Z8mQDF+PHdtzR/Y/e14fNrPqtW8BvDlj9m9HRKK8InkaJIDP0TYhHQzqICd kDhC/GKceVWjnczN3pVYvTvmLQ3GI7Su+kI1ltaZ6kzTxfefDNOSm4IR6L0BckP4ioN5 zRQaMnJYflx8ZvFg/3ly/QDS+729Ylcr5BUNByx0dpGAkrnQJiHIb+2b+zbxOFBbIXB4 a/kT35CYBGwWKepENA2/uxCNOfjd4MwJYNaU8yz+jxFtmTv83XaCg837oPQfWV6Ye2M9 gqZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=/mcb2FvhqEDcRhiT/KLUXGr3wPUe4NuYg1JLX3+jiqE=; b=ycCSvZ+RWaggKGG4D8b0F4L5Smjeuxaj/MDotp5UDiBZbVBXFYee4sCGJU6JIiXTN5 E9/pLAn4vXRuMaQ4gWpwaXr8p+zyThmBkfp4ipFGOBjKLtL/Mx5yHfscQ9SG9OrW6s4j oCsZeEtOTWep8I4gptkwn2RW/YtHNkptQ1JX1aXwP7V/mTOIzIbBooblimUY0JAawH4A qJ2jWV8xyxVMDciC+Ngg8Jqyc8TfQxXlbpEUBT7OO9RAs3He8u9Z4Aovu8loR1pnESFp JJGeEAkwbxlESIIN0zMiHmdQg4yhCAXhjkbsMMjUdVZfCQwabLsn+n/kUMHYYUnxceFy 4t0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=ITMTdeWM; 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 o12si1187495edv.257.2020.04.30.23.41.16; Thu, 30 Apr 2020 23:41:39 -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=pass header.i=@cloud.ionos.com header.s=google header.b=ITMTdeWM; 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 S1728301AbgEAGjf (ORCPT + 99 others); Fri, 1 May 2020 02:39:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728287AbgEAGje (ORCPT ); Fri, 1 May 2020 02:39:34 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BD55C08ED7D for ; Thu, 30 Apr 2020 23:39:34 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id s8so124474wrt.9 for ; Thu, 30 Apr 2020 23:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=/mcb2FvhqEDcRhiT/KLUXGr3wPUe4NuYg1JLX3+jiqE=; b=ITMTdeWM0lw7Wru0eFXJAnEr1Q6q4HFk5v1XlpgZnZbtXLcf3eDkzjU1Bp+lmrZNXG r04sUX4E35L8ViJV/N47J1dNlqJhrdWkEypiTBASldElIUtzCm0wbRgGhdzPyB0sDBaH LmA1M3tEAM3xu0Mom5/2IrReXnIQPeu+YuGVpy0/n97ySJX978yvonOgogz2mjkcDwNY 5EaAbXb8Nsdj/6RVMYfucaVhGriNK0nMa2gUmlE1QSnASYuha9TSSXSOUbZknhZuj49U aN348T48UXISwMCg/bL1x1wBWSVN0upisb1oHtFw26Z9CcsTPs4tveBe1nLlFMj8LOlX 5Sag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=/mcb2FvhqEDcRhiT/KLUXGr3wPUe4NuYg1JLX3+jiqE=; b=J/fUm5BBh6l09ReOHsdAyePCblo7p/VFjyVLEeNTLPtEAqhOzHMfD8NYxwABwNnI1X HuAN80WZkAru+yR8My4zZZILtQNX25/KKh9oZ+Uz3oecbsscEvFt10sOHZukR/FA9QMT U75POPpduw51JCLcb+yMf6/lLd6BbmuPHHoKeyAhyBycPHqwWv9CB/1XUxgu2qBwigDG URjQX/HWkmxGFsa5v63unmjplYcZcv7VWkp/UyEPnLC1uQdQ1ZkRhfmnnYeI8MqHtk0Y QArycr7/NXCLMyRN4Zf2j4fTlFfdwLN08BLxCWj3/ZUb2pb1aM0LkOefwYPGb7C/bY7D b0ww== X-Gm-Message-State: AGi0PubD3ETjf3eYKnVhkoiMXqs8TaLYPQASp20nrC0HogTOMBEW4rcM zilEJpX2+qlv1MFjPZ/2tn8k0g== X-Received: by 2002:adf:f2c5:: with SMTP id d5mr2306494wrp.285.1588315172931; Thu, 30 Apr 2020 23:39:32 -0700 (PDT) Received: from ?IPv6:2001:16b8:48db:9b00:e80e:f5df:f780:7d57? ([2001:16b8:48db:9b00:e80e:f5df:f780:7d57]) by smtp.gmail.com with ESMTPSA id s9sm3225364wrg.27.2020.04.30.23.39.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Apr 2020 23:39:32 -0700 (PDT) Subject: Re: [RFC PATCH V2 1/9] include/linux/pagemap.h: introduce attach/clear_page_private To: Matthew Wilcox 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 References: <20200430214450.10662-1-guoqing.jiang@cloud.ionos.com> <20200430214450.10662-2-guoqing.jiang@cloud.ionos.com> <20200430221338.GY29705@bombadil.infradead.org> From: Guoqing Jiang Message-ID: <4c177757-7e27-420e-621b-98353ec43ea1@cloud.ionos.com> Date: Fri, 1 May 2020 08:39:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200430221338.GY29705@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/1/20 12:13 AM, Matthew Wilcox wrote: > 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. > */ Thanks you very much, Mattew! Will change them in next version. Best Regards, Guoqing