Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2551771ybz; Sun, 26 Apr 2020 22:58:02 -0700 (PDT) X-Google-Smtp-Source: APiQypKHznZ3i6hgV0428fa250BpIXcYx/e+9iDyStYRmYbZtNVU4c9Hw+RNXXBOt/rigzXWQmgH X-Received: by 2002:a17:906:374b:: with SMTP id e11mr19105864ejc.283.1587967082594; Sun, 26 Apr 2020 22:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587967082; cv=none; d=google.com; s=arc-20160816; b=mvwGTfSlSRmGhG/bmP67F8lS8eAcyOBaQgLAZag8M+ILnk9VPLDCI++LTVXFODll1F UDkR0FBqPooeSHe0NnKn5T682pPTpMZ7oJSNqWLyEuF9mY2ACKbLLg9xo9eL4z6vFOGa TjpOvzEksoCEFrvRty5qH34rtRHWg9ZDZVSqXtMFjhj3tapumC3nOZbx+uLzidNPaB+s JghNST+CJ3Q3yvKdCW7OF51zWD2/jYic5JQPiR21TX+UHKs9WJGDHqBg5ur6HGx2t1IX W5iEFOtj21dUzJYy2jl3iRlKSPngC0AE53/Zf35QQi+WMDohlHsUh9wVfhMQsvhSaDPK m4ig== 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=R3+pbJIQteflo4uZ0aWi5kA4IXjwF0WSfqzTyP9nDZg=; b=JqT7GfcCTWgUSL6GzOX5BneLBIDQ+icHWNChLtOpBOTCVzsxLFWNv7zJ6eKOQp+Chh AIvYpk21JegZ3p8J3bbyLulJ1opxtoDvXYakH57s/3GaoclU2ARDrun7a/cG/5ShR4fY 3WtAeah1othssRQfFrxdgUmetyY4k/nPOLcGKoIGvKQVRWK1OM+5IRoMmKmzfRFM1Kmx RmVI2W7wX4iq0ILKBeEDnZlSWAHrO1CLC9WPqE7gHfy88qRGeF9SEG0LlJADaxrH5CgL PQQMvvTwtfG3UGU2sRp3HrEpvHlKwXvSiFS/FoB0xru9D51Yds+BD2DJUFsZ5/hWM7Dd r/8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OUvliz3A; 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 e23si7093342edq.517.2020.04.26.22.57.40; Sun, 26 Apr 2020 22:58:02 -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=OUvliz3A; 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 S1726512AbgD0Fzk (ORCPT + 99 others); Mon, 27 Apr 2020 01:55:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726221AbgD0Fzk (ORCPT ); Mon, 27 Apr 2020 01:55:40 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CB4EC061A0F; Sun, 26 Apr 2020 22:55:40 -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=R3+pbJIQteflo4uZ0aWi5kA4IXjwF0WSfqzTyP9nDZg=; b=OUvliz3ACGuJUvGnnk2irZ8Szf 9mbtz2wa6iso5Tmx8uHxbTcc5bK75uyEgtUyHO9bYMO6d9++UD8fKtQaSSHI7F0RO01IgnnrKrjxe Y6kY8Y0/Tpyz0sWBIo/Lkzxy9aO3E4QOvDjNGizxw1uwrMF53voV7aFTSzqJmpiXYURbw0jLz0SaS OMjV0MyEmIDXJoiRzUp65JvWRAc3qbuM44hKw5K6yzrggdfV/AJ1PuzY87hnexeytyes6F4F0Ics9 8oHSLZIheBvCMwKDGTTjDSsCrgYJulBU3fvLUgxmvQ0ws5gVr8S+8e7lJ0atbqiyVHZpTZFhCvWh6 i7BtMSRg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSwk0-0007pN-6J; Mon, 27 Apr 2020 05:55:40 +0000 Date: Sun, 26 Apr 2020 22:55:40 -0700 From: Christoph Hellwig To: Matthew Wilcox Cc: Guoqing Jiang , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, david@fromorbit.com, "Darrick J. Wong" , linux-xfs@vger.kernel.org Subject: Re: [RFC PATCH 6/9] iomap: use set/clear_fs_page_private Message-ID: <20200427055540.GC16709@infradead.org> References: <20200426214925.10970-1-guoqing.jiang@cloud.ionos.com> <20200426214925.10970-7-guoqing.jiang@cloud.ionos.com> <20200427002631.GC29705@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200427002631.GC29705@bombadil.infradead.org> 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 On Sun, Apr 26, 2020 at 05:26:31PM -0700, Matthew Wilcox wrote: > On Sun, Apr 26, 2020 at 11:49:22PM +0200, Guoqing Jiang wrote: > > @@ -59,24 +59,18 @@ iomap_page_create(struct inode *inode, struct page *page) > > * migrate_page_move_mapping() assumes that pages with private data have > > * their count elevated by 1. > > */ > > - get_page(page); > > - set_page_private(page, (unsigned long)iop); > > - SetPagePrivate(page); > > - return iop; > > + return (struct iomap_page *)set_fs_page_private(page, iop); > > } > > This cast is unnecessary. void * will be automatically cast to the > appropriate pointer type. I also find the pattern eather strange. A: attach_page_private(page, iop); return iop; explains the intent much better.