Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp962296pxb; Thu, 26 Aug 2021 20:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQhvLFj7bWOMcSJ1BTXChGxBRgj37BhzbJ2kmik0hiQjj1X+W0ghMe5LCopYirVT6ZulTt X-Received: by 2002:a02:7a14:: with SMTP id a20mr6209606jac.27.1630034619659; Thu, 26 Aug 2021 20:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630034619; cv=none; d=google.com; s=arc-20160816; b=0SuM3mCRZJZQnTTtl4Vc+BYvHUNFHYmzekuHSZKNskgj1BZnt37RzELokBrWpB1vEQ gwF/ZL40lh9bQckR0w0o3eU7gApraHof4bV7Xw0CecSNqOicK+UcgDw4Z56YdQmrf3d5 TFNXDFPFEZmBLe1isys3i+kXmTOdTwwe8Dkvm8M0nqmT7PVZifiBurKjeq+42PDgVWjL LcsKFiYivLVbVG8CsbjnZY/2Zh2ysv3Sj+PwI6hK60EtgbtUvg6hPgBVbR/NPy6tE8/p a6V3BTPZ7URMYMHzakt7/Aert/GDO+VXmnwl0SC7GzwqYP5M4yhepyE/JZSEnUUo9mMW MkMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject:ironport-hdrordr; bh=WhUoYywYbiXy8653H1ko7u1W2MAWiPbbZ5um4arRaMQ=; b=YLakmkIPAjxIT2TZs7dIBhyIzVTf7oHTDYXH8jlW7JKi+OhCmQ2nm+AJM99OxMcO1S 29WExy7f8BovdXY8nhpKgOaU1v74ZaP47BCgabvhI/UKly4+M40QUDdB6uHGl2un9LVr p9wUfPHtqUozW++xdr8b9OeUFKvgxJ64wIQYEtT7XCoGYEwIvlq+C4NgGe8PLHBhv5dV h43vTwQ2TIdOWp830BGIcIqEGs1Q8xmGFQoR9oBVw4abZj2N/h0xirQ1vvKrtQq2S1rU Cy0q20OjrFF6bA6IG6bZOA2ZhaGoFmyKmccPkq4kwAAQZaNC/btKZToOca3OcZknOXjr eKIA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x6si5451770ilu.80.2021.08.26.20.23.28; Thu, 26 Aug 2021 20:23: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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244155AbhH0DXO (ORCPT + 99 others); Thu, 26 Aug 2021 23:23:14 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:32690 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243968AbhH0DXO (ORCPT ); Thu, 26 Aug 2021 23:23:14 -0400 IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AdJlzS6DX1wrl1s/lHemQ55DYdb4zR+YMi2TD?= =?us-ascii?q?tnoBLSC9F/b0qynAppomPGDP4gr5NEtApTniAtjkfZq/z+8X3WB5B97LMzUO01?= =?us-ascii?q?HYTr2Kg7GD/xTQXwX69sN4kZxrarVCDrTLZmRSvILX5xaZHr8brOW6zA=3D=3D?= X-IronPort-AV: E=Sophos;i="5.84,355,1620662400"; d="scan'208";a="113546519" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 27 Aug 2021 11:22:23 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id 821B24D0D4BA; Fri, 27 Aug 2021 11:22:23 +0800 (CST) Received: from G08CNEXCHPEKD09.g08.fujitsu.local (10.167.33.85) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 27 Aug 2021 11:22:24 +0800 Received: from [192.168.22.65] (10.167.225.141) by G08CNEXCHPEKD09.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.23 via Frontend Transport; Fri, 27 Aug 2021 11:22:22 +0800 Subject: Re: [PATCH v7 3/8] fsdax: Replace mmap entry in case of CoW To: Christoph Hellwig , Dan Williams CC: "Darrick J. Wong" , linux-xfs , david , linux-fsdevel , Linux Kernel Mailing List , Linux NVDIMM , Goldwyn Rodrigues , Al Viro , Matthew Wilcox , Goldwyn Rodrigues , Ritesh Harjani References: <20210816060359.1442450-1-ruansy.fnst@fujitsu.com> <20210816060359.1442450-4-ruansy.fnst@fujitsu.com> <20210823125715.GA15536@lst.de> From: Shiyang Ruan Message-ID: Date: Fri, 27 Aug 2021 11:22:21 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210823125715.GA15536@lst.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-yoursite-MailScanner-ID: 821B24D0D4BA.AF7AB X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@fujitsu.com X-Spam-Status: No Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/8/23 20:57, Christoph Hellwig wrote: > On Thu, Aug 19, 2021 at 03:54:01PM -0700, Dan Williams wrote: >> >> static void *dax_insert_entry(struct xa_state *xas, struct vm_fault *vmf, >> const struct iomap_iter *iter, void >> *entry, pfn_t pfn, >> unsigned long flags) >> >> >>> { >>> + struct address_space *mapping = vmf->vma->vm_file->f_mapping; >>> void *new_entry = dax_make_entry(pfn, flags); >>> + bool dirty = insert_flags & DAX_IF_DIRTY; >>> + bool cow = insert_flags & DAX_IF_COW; >> >> ...and then calculate these flags from the source data. I'm just >> reacting to "yet more flags". > > Except for the overly long line above that seems like a good idea. > The iomap_iter didn't exist for most of the time this patch has been > around. > So should I reuse the iter->flags to pass the insert_flags? (left shift it to higher bits) -- Thanks, Ruan.