Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2550174ybz; Sun, 26 Apr 2020 22:54:42 -0700 (PDT) X-Google-Smtp-Source: APiQypLVBklW2ycHWd58buBBOIM/pEfV80XLTseDhsAU+tscdNA+wN2QtyGl9uJjqATwprowmFKz X-Received: by 2002:aa7:c04a:: with SMTP id k10mr3170362edo.241.1587966882021; Sun, 26 Apr 2020 22:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587966882; cv=none; d=google.com; s=arc-20160816; b=bSxsM/3Ehe2GO1avKGAh9rWSmlKpHshZtKWwiqNGCFAPFxISwNiy1B19xGFQbvMTSL 9L5RuoKuy7oTg4nWQv/F9cBiPMQ7AnKliu+hfE+StbfpoaJ3lFfnT4MY+DEjm+1sobI5 bhVUREhM5bPXeOZYCZ5wK4reych1dYh73UbuZ68WeNhe2bnr3X5ZS5YuC8TQKKLqPS7b t5PEeDnarXE8P/WI6u7uAcdX2dNh3GrmEKjUNRt2i8AjrBCiue9jDHkQbRsrlIy/G0t1 RFI/qtKW8m+Kc0LeGTwKQoU9Pjfm4UIA53xju/e5LqzYLmVosA28G5UzisVVJrazgXRU Qonw== 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=LQVtzGaomYtG7V/jX0MqKImKPB9VkLmtjmhmXgAH0Xc=; b=xNwv3Y8PXq9qLje6Qec9xC10ZKNI/A0jb3sdjvSIZqCLSeVvNhf9cYTtRMUvFFUPYq Ea91lxi1KUJxR80Y+ZzkVNvjpzOXHxnEZcVI/+jsR2bBvAJQoEwdZQaydBhmbNOOq7pt 0WC9B5FsmEjilH8vl/QRVAba+taVbszo0wvPXl6Wv/O84qYWJwtGsI5EmqbSquz8/+cz MBnA4neSpZt3akDzl0T6z9jslZWPk5FO8osRegQzZrX+wkLgqPkiaswlo52Qr2dx4s4s Fj1P4v9dT9Q5h8endo24mekLyyUpiDaAyiCVpBfdzEb65UMt6NBwMS4bjY5so3jSMyXC V/Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Lm4Tu30h; 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 l21si6860672eds.265.2020.04.26.22.54.18; Sun, 26 Apr 2020 22:54:42 -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=Lm4Tu30h; 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 S1726470AbgD0Fw5 (ORCPT + 99 others); Mon, 27 Apr 2020 01:52:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726221AbgD0Fw5 (ORCPT ); Mon, 27 Apr 2020 01:52:57 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42D63C061A0F; Sun, 26 Apr 2020 22:52:57 -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=LQVtzGaomYtG7V/jX0MqKImKPB9VkLmtjmhmXgAH0Xc=; b=Lm4Tu30hpSl+D6HEWWAScRDmtt jEUap9jlU3mOipiBhzFXsGaa0TyCihkJXduNfgNxTU2yikcSbjuO3C4cIv4/T11IisHHZto5q8uGh sKJ6gECuN90WXQKLegzyzObDogzxAEQ9Gpi1co4E8SVbc4VbwrhnKfFg4B+a3szinI8z/eh3/mcXt gfK34E4urHi205PEvNFymGPB6mQ/MaCRwFZ4yrb6ga62i397JNSdkPDnMjtReS1ytuDrBSH8EDF/c TYWbj5yjm5MUJTtj2/7APAB2btVxovtErHyhdesBTGK3Mt+n14gARrO3Zy8fREzDu8qD3e515MWIK tjryPzJA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSwhL-0004dg-5C; Mon, 27 Apr 2020 05:52:55 +0000 Date: Sun, 26 Apr 2020 22:52:55 -0700 From: Christoph Hellwig To: Guoqing Jiang Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, david@fromorbit.com, willy@infradead.org, Andrew Morton , "Darrick J. Wong" , William Kucharski , "Kirill A. Shutemov" , Andreas Gruenbacher , Yang Shi , Yafang Shao Subject: Re: [RFC PATCH 1/9] include/linux/pagemap.h: introduce set/clear_fs_page_private Message-ID: <20200427055255.GA16709@infradead.org> References: <20200426214925.10970-1-guoqing.jiang@cloud.ionos.com> <20200426214925.10970-2-guoqing.jiang@cloud.ionos.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200426214925.10970-2-guoqing.jiang@cloud.ionos.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Why not attach_page_private and clear_page_private as that conveys the use case a little better? > +static inline void *set_fs_page_private(struct page *page, void *data) > +{ > + get_page(page); > + set_page_private(page, (unsigned long)data); > + SetPagePrivate(page); > + > + return data; > +} > + > +static inline void *clear_fs_page_private(struct page *page) > +{ > + void *data = (void *)page_private(page); > + > + if (!PagePrivate(page)) > + return NULL; > + ClearPagePrivate(page); > + set_page_private(page, 0); > + put_page(page); > + > + return data; > +} Can you add kerneldoc comments describing them, including why we take the refernces? Also what is the point of the return value of set_fs_page_private?