Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp690592ybp; Wed, 9 Oct 2019 02:42:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGU+Awd+PH28dZRzzAdLsYhNYnuDG355qbMm00haz6iUl5LCWG1EAGLnzoEMFOMgeLUThN X-Received: by 2002:a17:906:f258:: with SMTP id gy24mr1905950ejb.25.1570614131309; Wed, 09 Oct 2019 02:42:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570614131; cv=none; d=google.com; s=arc-20160816; b=REPqFGcgHdEzTaYgwXGDbCXOS9/rJ1qQ3J0lx0ZobMZBqgCQIeQMpydLp4RwShLogp 9ZlWGMGRG1bmEcv5GpJ7hk3D9I8hf5ARnX40pb2ZBn7m5GSPzjMHPRDdhAg+4WxqkCL9 0+r5ud7j7XP1n+SXUY5081QGj8H5nWy5EBUirp9logZMptAjnFI9hPtPOk2vgr3Tqxdb u0RvJcOuHho4NaPeOUpAWYzFJlFZyL1jkVynOPV2fyht2wu/LG/Coa4YsLBcB7rH9irb rHvRb7T57id1yc0yY9xoG3ZA4ZbjRtX62WNSzLVVdqpZfmxqbeG3Bk0tEcfUVUpA2D/x L2VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RYuDZIbrxz2iKnv5yp3/syqgU8z4sOzoL7hyUzZxM38=; b=ZSgD784jXkwDkz16IlXCrqm9brUPzSnai+31M5h7kZKQuMS7v9bJJvWyFjGpKcV9PX 0Ebqofkec3/rf6TGZYJVZhJXZMbp3zkk2J0TULeS0Sor5ac9Yye5NcKADC5hbnm5UcKv fZTki+FfenliE/tTkNAsBmBPFXPTQAFPnQEmCAa+wIOUctSNNAzsTBH8Uc9knFAqDfLT /JBfsOgHPhN9tfqK81o/Yjree6Gps+/1q3pr/PMvZ4PYB0qTwVN8i9KJEof20br4iOz0 RcI6jGjdZ0QgkVvVz/UIXqIPPm9cJXwOVmcgdvrXfyprxMaYnWcpMiWY+Xly3G2WwAPJ 81pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mbobrowski-org.20150623.gappssmtp.com header.s=20150623 header.b=lAbaWFNg; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l16si795677ejx.141.2019.10.09.02.41.46; Wed, 09 Oct 2019 02:42:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mbobrowski-org.20150623.gappssmtp.com header.s=20150623 header.b=lAbaWFNg; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729863AbfJIJlh (ORCPT + 99 others); Wed, 9 Oct 2019 05:41:37 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:35298 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbfJIJlh (ORCPT ); Wed, 9 Oct 2019 05:41:37 -0400 Received: by mail-pl1-f194.google.com with SMTP id c3so800896plo.2 for ; Wed, 09 Oct 2019 02:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mbobrowski-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RYuDZIbrxz2iKnv5yp3/syqgU8z4sOzoL7hyUzZxM38=; b=lAbaWFNgu4uShqU246OAkXYF0FcdcnRRiE/h9BVKlEKUFiy5lkfUXZLspVdb3dVUJA +YdW6zkHmmdDCLfcT5W2qI3gkeDRlRIu5TQvmYwq355FFMd/DXWlB6wO6gJdQej6AaCd BWorwU4s4/P/uvO6bdy7Edsusl9MwO0B+JR5GFRvfuBCjW9eDhmTKPtuPg9mTNGW1avP r9qr8e6IPa0wP5obzlNqb0tG/ADdatVMTFJ/Gib/j9qHl4d/qKdIySZHt7HiFaWOpNFK qHIN6NGitN4rTx5XREFR2UvHeiuLd0dOAo80TBYs61VkzIzmYUr/6/iRfgXDZLPWUEES Zdyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RYuDZIbrxz2iKnv5yp3/syqgU8z4sOzoL7hyUzZxM38=; b=Yo/5tGpLpuvsMHhcElvwQ8MnWtuGcmOkKF9GOWYC4SmGPTEQ/n05eM4Wzg5kzN5h78 2KLQzJgGWST/2jOGgLhBFZ2QXOLcZ6bmTpRvwsDlrGoC7Z1Q4/kvOyiRfDemY4u3oA+0 aJw+20EZKzt5fTcDsaV2s4vY9FF6RK0F9SFI3YMDQa1wX5IW7ibp1ldzuehQZKGWKsdn E5YDI87Ty8JWb7aT3LdrsSjIc8wEB6YqSWsNfdubrmdK5lgf7NyXLC6cXpBHrHqQLGC2 SwESnRxB0XuMumZSjWI/fdym1FgrjEKvsOJOltWF6FI0Xxpg6Fq161DSwX7IUa59FDb9 HuCQ== X-Gm-Message-State: APjAAAUAuLvjcFgsn0Kvz5+Gp+1QShWSL1qwQC2YO+QJv9/vuUnlcdUZ 6VzIEHn+qLsXYgHuHaoDpAgB X-Received: by 2002:a17:902:b94b:: with SMTP id h11mr2240419pls.21.1570614096362; Wed, 09 Oct 2019 02:41:36 -0700 (PDT) Received: from poseidon.bobrowski.net ([114.78.226.167]) by smtp.gmail.com with ESMTPSA id c11sm2255972pfj.114.2019.10.09.02.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 02:41:35 -0700 (PDT) Date: Wed, 9 Oct 2019 20:41:29 +1100 From: Matthew Bobrowski To: Jan Kara Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, hch@infradead.org, david@fromorbit.com, darrick.wong@oracle.com Subject: Re: [PATCH v4 3/8] ext4: introduce new callback for IOMAP_REPORT operations Message-ID: <20191009094128.GF2125@poseidon.bobrowski.net> References: <20191008104209.GF5078@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008104209.GF5078@quack2.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Oct 08, 2019 at 12:42:09PM +0200, Jan Kara wrote: > On Thu 03-10-19 21:33:45, Matthew Bobrowski wrote: > The patch looks good to me. You can add: > > Reviewed-by: Jan Kara Thanks Jan! :) > It would just need small adjustments if you change patch 1 as I suggested: I will await what you say in response to what my thoughts were aronud ext4_set_iomap() before doing any updates here. > > +static u16 ext4_iomap_check_delalloc(struct inode *inode, > > + struct ext4_map_blocks *map) > > +{ > > + struct extent_status es; > > + ext4_lblk_t end = map->m_lblk + map->m_len - 1; > > + > > + ext4_es_find_extent_range(inode, &ext4_es_is_delayed, map->m_lblk, > > + end, &es); > > + > > + /* Entire range is a hole */ > > + if (!es.es_len || es.es_lblk > end) > > + return IOMAP_HOLE; > > + if (es.es_lblk <= map->m_lblk) { > > + ext4_lblk_t offset = 0; > > + > > + if (es.es_lblk < map->m_lblk) > > + offset = map->m_lblk - es.es_lblk; > > + map->m_lblk = es.es_lblk + offset; > > + map->m_len = es.es_len - offset; > > + return IOMAP_DELALLOC; > > + } > > + > > + /* Range starts with a hole */ > > + map->m_len = es.es_lblk - map->m_lblk; > > + return IOMAP_HOLE; > > +} > > This function would then be IMO better off to directly update 'iomap' as > needed after ext4_set_iomap() sets hole there. As mentioned in 1/8, it would be nice to leave all iomap setting up to ext4_set_iomap(), but if we're strongly against passing 'type', then I'm happy to change it and update this to pass an 'iomap'. ----