From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8164BC4338F for ; Mon, 23 Aug 2021 12:57:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 692D06121E for ; Mon, 23 Aug 2021 12:57:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237173AbhHWM6C (ORCPT ); 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-xfs@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.