From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guoqing Jiang Subject: Re: [RFC PATCH V2 1/9] include/linux/pagemap.h: introduce attach/clear_page_private Date: Fri, 1 May 2020 08:39:31 +0200 Message-ID: <4c177757-7e27-420e-621b-98353ec43ea1@cloud.ionos.com> References: <20200430214450.10662-1-guoqing.jiang@cloud.ionos.com> <20200430214450.10662-2-guoqing.jiang@cloud.ionos.com> <20200430221338.GY29705@bombadil.infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20200430221338.GY29705@bombadil.infradead.org> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: linux-raid.ids 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1122AC47254 for ; Fri, 1 May 2020 06:39:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E443D208DB for ; Fri, 1 May 2020 06:39:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cloud.ionos.com header.i=@cloud.ionos.com header.b="ITMTdeWM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728212AbgEAGjf (ORCPT ); Fri, 1 May 2020 02:39:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728248AbgEAGje (ORCPT ); Fri, 1 May 2020 02:39:34 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38B40C08E934 for ; Thu, 30 Apr 2020 23:39:34 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id x17so10436886wrt.5 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=MvweylPLOxiX3BappnvJwSl8qVqc9YsAMJ39G98R5P9RF/gG2qcLzVn1aEpKxNYenS AW5zTIkUA3GGml9kT6fNFJh5j5baIS/nu7fTRKgmAJ+qCt3FeGODoqtfSiRhjrOMb/En ScA7rfpI9ZZqC2TBQ/d5aov4omv7eWvJ0DlwEJOzMvBFXew3/8vwpphse132wyY4NTKE 1aVvH5isVwGLzJ5YftHketA3wCaDZ9d5OW8MHOmEBJ6qNQk5sEgW+t2Dk9lI7AFJQTBa 3FwnWOsdw6hF2fxE+uOx1MyYtfq5rjlfr/zdT4l48VAiO+YAHkedgDezqhuMRq9+TFqU o1ZA== X-Gm-Message-State: AGi0PubPNoPvq/IT400EX5fpZTOm0Zcg5p3hRV7lBRChy03W3PkJmfZ4 utLxiLrfwg5OO+NiErFKkM3aDQ== X-Google-Smtp-Source: APiQypKr/Cov9lBLfeX8odUPVKbRN1IPp5JWnyg7FEbdsE5fkPQXlhR/GgRBnVvt0v2I8N4upI/E9Q== 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-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2E99C4724C for ; Fri, 1 May 2020 06:39:44 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7274B208C3 for ; Fri, 1 May 2020 06:39:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="Wt7ZuKb1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="ajE9W/V+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cloud.ionos.com header.i=@cloud.ionos.com header.b="ITMTdeWM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7274B208C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cloud.ionos.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jUPKo-00012e-V7; Fri, 01 May 2020 06:39:42 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUPKn-00012T-Cr for linux-f2fs-devel@lists.sourceforge.net; Fri, 01 May 2020 06:39:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: 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=/mcb2FvhqEDcRhiT/KLUXGr3wPUe4NuYg1JLX3+jiqE=; b=Wt7ZuKb1GqM8Kx3dueFXIk4v01 iuKMfiVKoufZ85ynGAPIl8+2mpETo7gAPxFao7tPVzV3nRPufhrLAjsc2KMYzPddOojEpx2lUvqyv x3QcGHSRDHZcg2NAiRt8cA3m2BahUgHGkp9ikv0YXxXwdguIW8riMj9oIvTOludfOC50=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: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=/mcb2FvhqEDcRhiT/KLUXGr3wPUe4NuYg1JLX3+jiqE=; b=ajE9W/V+gUFVY5hpjw9Rra9Zo1 sZaOGu2rJ/hOi4Xvte+6ZhaCyjLH6qMdaJrKZHYxR70gYV8+jQNLuoDC9yM08HGHdSfovnalT9m5Y FlQY3X5+wv4fcIz536saS9BWaN7cqSv5q8cAPrz3wDqQyvsACk5Q5YA+e8tvn4Jr7MDQ=; Received: from mail-wr1-f65.google.com ([209.85.221.65]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1jUPKl-004Cwh-Hj for linux-f2fs-devel@lists.sourceforge.net; Fri, 01 May 2020 06:39:41 +0000 Received: by mail-wr1-f65.google.com with SMTP id o27so5116998wra.12 for ; Thu, 30 Apr 2020 23:39:39 -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=oRADyYURuw57rtU56XJuAELXzZbeJVCyTOVP/7t4mz45VaPNqN7gTou6VHC4W654rZ vAknE0rDcLg6WecyE6BsAFRhRLUcLx5YIlaRJa4s5dYH1B5pnLS3c8YhZowEu+06loe8 JgXaBLdW7xQ67ErFaplq0TXCgXbfDXNC2HWzTti3cr5nE0PfqEW8MeridJR6+UBVzPHu tqF4MIOnMmpJHuBJPhvJzfsMYxLBjpf6DW4/DJdgxUL8ogBMRB4d14UpHyC0hwyEASsw EHCVaktUdQTHbrBcu9PpUXATu+anlQl3jwp1UDyGqtBCPzrN076zyc5bKffwMmZMBVvD vnYQ== X-Gm-Message-State: AGi0PubVJFRh2L5YGOwO9zYAGapuVqbPaexLQ9g2FSpO0AJU+393FOFm gZ/LjvFwzZEReCaSCsqldi7I0w== X-Google-Smtp-Source: APiQypKr/Cov9lBLfeX8odUPVKbRN1IPp5JWnyg7FEbdsE5fkPQXlhR/GgRBnVvt0v2I8N4upI/E9Q== 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) To: Matthew Wilcox 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-Language: en-US X-Headers-End: 1jUPKl-004Cwh-Hj Subject: Re: [f2fs-dev] [RFC PATCH V2 1/9] include/linux/pagemap.h: introduce attach/clear_page_private X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Brandenburg , Sebastian Andrzej Siewior , david@fromorbit.com, Song Liu , Yafang Shao , Mike Marshall , Andreas Gruenbacher , "Darrick J. Wong" , Chris Mason , hch@infradead.org, devel@lists.orangefs.org, Josef Bacik , linux-raid@vger.kernel.org, Alexander Viro , David Sterba , Jaegeuk Kim , Thomas Gleixner , Anton Altaparmakov , Andreas Dilger , Yang Shi , William Kucharski , linux-ntfs-dev@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, "Kirill A. Shutemov" , linux-fsdevel@vger.kernel.org, Andrew Morton , Roman Gushchin , linux-btrfs@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel