Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1835861pxb; Mon, 23 Aug 2021 05:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIHi5BcIXzlQLA+w54JYfr14d4B1i6bmj+j71/MgDbebM3g9p79b+UvIg1UaI0iTh93qA2 X-Received: by 2002:a02:c6c3:: with SMTP id r3mr29895617jan.7.1629723546788; Mon, 23 Aug 2021 05:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629723546; cv=none; d=google.com; s=arc-20160816; b=UZbsTIxm9cgq7QIS4xFxonNi+Nm4OLFRZjsa3q7GRgW3hNOURHdh2VcVc2x6R+Ij0a 7TSuFH/F7ekjGLvIhyi9N0Rnd2UyVl2UZADAO4xmo7YfuYe6daxmqqz5uziocqekgAib zL40bzbVRWRC6XjjbkYGLUVMcwDH/lCeLWo3RsMgSzPth2n2mTJj4SYLxF5LEgijeyLh EyCc4KgyMCxy5qZty8sNmX+TXWa1cBONnOWT1NO1uSPJ1MTnu5yNd+JE9tGUBODarpKF xVj0UWO6uhnALYkHRSZK2L5Vg8bdq6nXe/k2mj+9UEwEqXkJhIbfnki9VrxGLrKCIGf9 QwsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=nK6AZgwgpuSAv5VFNiwoPKGozzkpyu6gIovctka9RhA=; b=h/RMV2im4WCg/280/4nhAqYyV+4Ovu10VnrnWyTM/gTqaXULVYu1LI/1Zy9Tc8YoMV UNZGPuC/aTiSu7xn3MLmS3pOslyO7300sW7XMjQ/Pc9m9+TZ45aF0C7LdmakGVrt2PYG TINR1JSOXOGrHShXO6RsRWb30UAeXEOo442wUEZxREbZ9IpaSmq/OqYHCUQ5isxROSjT P5sWRRbnUnP8dEo0D76AVu/WwOg+qeWwcmjiaRhsIUpXVauoPVf0kM19V1LcYR8POOeV Yisn7oCBxOH/oY2fvgz+4gbFMbrmnX7xC7Veo2oUWrvNqqGqUoPV+/9NQA2LuhoTG8h6 RKhQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c203si17366453iof.54.2021.08.23.05.58.55; Mon, 23 Aug 2021 05:59:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237190AbhHWM6C (ORCPT + 99 others); Mon, 23 Aug 2021 08:58:02 -0400 Received: from verein.lst.de ([213.95.11.211]:47802 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236320AbhHWM6B (ORCPT ); Mon, 23 Aug 2021 08:58:01 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id E108167357; Mon, 23 Aug 2021 14:57:15 +0200 (CEST) Date: Mon, 23 Aug 2021 14:57:15 +0200 From: Christoph Hellwig To: Dan Williams Cc: Shiyang Ruan , "Darrick J. Wong" , Christoph Hellwig , linux-xfs , david , linux-fsdevel , Linux Kernel Mailing List , Linux NVDIMM , Goldwyn Rodrigues , Al Viro , Matthew Wilcox , Goldwyn Rodrigues , Ritesh Harjani Subject: Re: [PATCH v7 3/8] fsdax: Replace mmap entry in case of CoW Message-ID: <20210823125715.GA15536@lst.de> References: <20210816060359.1442450-1-ruansy.fnst@fujitsu.com> <20210816060359.1442450-4-ruansy.fnst@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.