Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2636001ybz; Mon, 27 Apr 2020 01:17:57 -0700 (PDT) X-Google-Smtp-Source: APiQypK/Fuy6sWNi8R8MPQpMEhWNc3Z1SbR5bIGSxaFQkvhrIgg8/wVKBYZGzMALX9TaJ4XL5lP3 X-Received: by 2002:aa7:dc48:: with SMTP id g8mr17777682edu.33.1587975476946; Mon, 27 Apr 2020 01:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587975476; cv=none; d=google.com; s=arc-20160816; b=VMbby8ipz/brFtCDeSzGNJK3cLR6H4OIho5Isv3wjdLz/w7i4ExrVowkI0uNNHueZj C8CBNi5cUpmA1AvBssXC0cJN493yj20lw6cdWjaWvD/nsEe42uEx1FgagRkd9gnzOQbg vu4HCkG6s9grCoI43eHUod6UvkkEDF1QauzctyVsckKe9i/Yj2Oi38ArF0nT8rYXj0hx Y0RQKTrwZ11PuChmK/jOk/pmCdu3ckX01P2Ou6+03w46l7Yl/jkBfYzRKKmu7+P/t+hh FprGuVoTwgJP20f+pWoOTX3aVnNC3t5fPrxCarIR3xahsZACON9W0uhBwyjQcI4gMMzy HhwA== 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=qlm8OKyOV/HJAu3bA65vWCOmmjrUcu0xP6huIGZIaXI=; b=RMIfQN2ArQc98Zrvdkv1poApcDl6SHGn5hJUZYPA2BNEqfIWchhoAhd4YAjnklms47 hppui21B5wvASRuoEkNShWsgv3f1jq8l3ph96uh8t/8FuWBpt3bQFmfLxrirDyh4+QQw AQSfzPZtYjpBOzTO8DXXWCp48T0qquYK82j/tsTy765F40Xdr4C0YpXVPt6Lw6uwF2zY AleuBeghQ3wm/ZsqYBdIJcx9Q/j5LqFdOY9y3/0iLhFvu/BDraXdhEW7cKKFHaqY1hJ9 PI0o8qgzwRzWD+dCHen9iHhbyKo5TK8NtdaJRnlDRB/whbPMeZXpnrUwluCDX0ZuhA4/ yS6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=V4RZNddM; 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 a19si8288029ejs.131.2020.04.27.01.17.34; Mon, 27 Apr 2020 01:17:56 -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=V4RZNddM; 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 S1726790AbgD0IPx (ORCPT + 99 others); Mon, 27 Apr 2020 04:15:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbgD0IPw (ORCPT ); Mon, 27 Apr 2020 04:15:52 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42D9FC061A10 for ; Mon, 27 Apr 2020 01:15:52 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id k12so9911646wmj.3 for ; Mon, 27 Apr 2020 01:15:52 -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=qlm8OKyOV/HJAu3bA65vWCOmmjrUcu0xP6huIGZIaXI=; b=V4RZNddMJEAgB0Qn4YXncrFVThel5CoJI0JvjTD4yCVslyZDfoC00sJ18gxjb/7TlZ zZbNFli1x2HY0TLBeb0L8vjk+QosxpivU29rt2XlFkLr8TjFWRMME6SbwkeR2v7qPyJ1 znrGZzoLp/gCBLk9Ec9DYumtRr8V3V8rrBReqoo3OUjwBM7yrUe/epGDpYnew7il4dqd tENysIZaLdPITFGVxYLuV2QoSszSi9Ftu46BDFCiv5hDl+EURRawMmL2GnffWOcKRcV0 jhvFxNLuTybjUjIOON7GVLvkwfKx8aCEUqbJGPXW3Wk5xJrLGQS2CtRBVFK2nqAQkj0y 3qog== 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=qlm8OKyOV/HJAu3bA65vWCOmmjrUcu0xP6huIGZIaXI=; b=pHKPEdXAaNAh/VrBNhfondIq+q010XXRwouL9N8z0Yo23saXvOymg7W/OP45rveYZI jzph1acCWBAyexhBxUUygm/qMYJzbxjJKljqbl4TGQk7ymks6coFJO4hXGZgxcvla1+R +gsTFu3er8YZhyl4/bVVsQ498+p4MG0T9+fC8LwGVcRPu2A66z1DUuyXJs6WMbr+uWVO zNPFWWj77r/xDA8bMxcnCrbnXrtXy9+R2+P7/hSLjF35j1JYYjn7XWjRXl4esJBpwJva 7VuKKmxZKipmrc+BW7FfI2KXY7IJr1snOO9yxYhPxxoXIfW8kKDT/C67WibcHxgmKIXo 28jw== X-Gm-Message-State: AGi0PubMaUVKZHpg1e2EYrNLdFVD2MvP5sonBsaLajhJ7eObG3HTy/OY 6eOdFrhd9ruirRuyTjqS7BcISw== X-Received: by 2002:a7b:c4d1:: with SMTP id g17mr8240890wmk.158.1587975351044; Mon, 27 Apr 2020 01:15:51 -0700 (PDT) Received: from ?IPv6:2001:16b8:4886:8400:6d4b:554:cd7c:6b19? ([2001:16b8:4886:8400:6d4b:554:cd7c:6b19]) by smtp.gmail.com with ESMTPSA id u127sm14786776wme.8.2020.04.27.01.15.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Apr 2020 01:15:50 -0700 (PDT) Subject: Re: [RFC PATCH 6/9] iomap: use set/clear_fs_page_private To: Matthew Wilcox Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, david@fromorbit.com, "Darrick J. Wong" , linux-xfs@vger.kernel.org References: <20200426214925.10970-1-guoqing.jiang@cloud.ionos.com> <20200426214925.10970-7-guoqing.jiang@cloud.ionos.com> <20200427002631.GC29705@bombadil.infradead.org> From: Guoqing Jiang Message-ID: <9dc98fe6-f65e-55ee-5e3e-94f4bbc0e2c7@cloud.ionos.com> Date: Mon, 27 Apr 2020 10:15:49 +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: <20200427002631.GC29705@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 4/27/20 2:26 AM, 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. > >> @@ -556,11 +550,9 @@ iomap_migrate_page(struct address_space *mapping, struct page *newpage, >> >> if (page_has_private(page)) { >> ClearPagePrivate(page); >> - get_page(newpage); >> - set_page_private(newpage, page_private(page)); >> + set_fs_page_private(newpage, (void *)page_private(page)); >> set_page_private(page, 0); >> put_page(page); >> - SetPagePrivate(newpage); >> } > Same comment here as for the btrfs migrate page that Dave reviewed. Yes, thanks for the review. Thanks, Guoqing