Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp52266lqe; Fri, 5 Apr 2024 12:16:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWhQIYiW1TIYLgSUUvpXoX0gBDQcAi8SoNcdnQYlNHsF72bNPTRqr6f0the9w51OACa9FswVO53jd3RBKAUAqXMlVYsu251UPJWe+i0zw== X-Google-Smtp-Source: AGHT+IG0dVNV0lZJyJsEFT1+c19q67W72qTbIMiIxKwKr4aF5UuLJku010JRwkI/0JunxDDrhPNF X-Received: by 2002:a05:6359:5590:b0:17b:f637:7bb with SMTP id ny16-20020a056359559000b0017bf63707bbmr3514293rwb.30.1712344589801; Fri, 05 Apr 2024 12:16:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712344589; cv=pass; d=google.com; s=arc-20160816; b=DLAMdo3NucnFbGc4kFMACcb/bUjIzxgIpNlY7rZMxrtl5EcX6UW6RY88dIWymBI/CH aqWw3esPGD2CG7fchscP8tOlO35NIBmMdOCCS1k0OGu2nvSCnuCojUfrvUQB4OVAnpr9 +v4jthZodcpRj6hzQ9FaLCmnysTldkR01k7bSDdCbE0413aV2Mg4AGS+J8mF1Nech0eH OV1ZQovHk5U88bUKk4rASI00Y+eOYjzC88D/a34s3dEefLJGf8HeKA69tOfuw837wfG/ nA+3UC+misiiCgKo8ZUsclym5CrzYi1LBD7vvIGe/VikI5l0+W+hgQtmGmMSgf2H7v6+ J0hQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=xy7rrQFx/ai4jiHF7erHWLhfU4NiOdULn/JTP2Sih9s=; fh=nhX+lvssxaJteAPunm8PNGRgGQGpxEuU3JRJiAiRkZc=; b=1CGHWtrXd7+mlLuUekeIfzwq5+vg5qdTPcfY16LBt25zStlMPUeAtfYDW9HJolr6ZG 2S9YZc7NgrJb6bGrJs0/hTH6hsW0tH4oNTfpmRjUvym7PDJXynYINYddBl8WYSeG+51Q CAkzmniRdiYsAWb/rLs+USA4I7RQInpmUrtH6rfRrGuq+g42v9gYbW6JtETqey8TX71m XrJGJZJsiskJAvHcWj3m13DvZBSqxUP76i34pmGnGoWTAsguK4O/Bi+ShPM3ZwviwC2J YFU3Mo2NksUaOYzPTYndQPgDoOv8EG1fPGFH8rKGa1UC1A2fnrItpKA7zbnbkZE9PGlQ QsiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HZ97vexP; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-133509-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133509-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n29-20020a634d5d000000b005e3cdf125easi1792152pgl.612.2024.04.05.12.16.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 12:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133509-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HZ97vexP; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-133509-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133509-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 91592B247CC for ; Fri, 5 Apr 2024 19:07:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BFFD172BD9; Fri, 5 Apr 2024 19:06:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="HZ97vexP" Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14F97172BB0 for ; Fri, 5 Apr 2024 19:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712344013; cv=none; b=e8EMQjEI5FRojvp1q20Ud4qfZR9HGt69cfM5gLAuxAPSlQjb4hLcppFGM5JGM53nnWYrKMclIk0wCdc0y4gzcd9Hmhmd8gOz0k6Y5y+kyGs2+iBCjFAooFAGUxj+dKoDKSVxZs43gcoA3WO8a2H3qfSn94x9XNNlC/EQVdQlam8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712344013; c=relaxed/simple; bh=cFa86Z8RRLF4vPDeov8Dfg04JBAwVybrO/2egSFq9GU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LRpRqymJj2et6kTz+YDJvCOwtdGlwVdovwLgOfmrawJ/2T4iWqZp3KXgHUHplMV71PMiza8XggQvOm61FpOnJ54bpDLNeaNzjBo0E4SBwFucoTp5v4yejU1/9ldcRZ1+BibGteHi7UdlPuidE3kk5JlJxh86vp3ziKA1HzHZpVQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=HZ97vexP; arc=none smtp.client-ip=91.218.175.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Fri, 5 Apr 2024 15:06:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1712344009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xy7rrQFx/ai4jiHF7erHWLhfU4NiOdULn/JTP2Sih9s=; b=HZ97vexPrKySNDCOlz9qANDAP2JyhZBo/XKrmr+lyOE6CHkjHxJYL3ItLuk9OGrZpDRot0 Q2UlJMp5dDfEit2UE6bzXAAdCDy+AAHKq7O1YfadBIDO1LT0kCLSqROgs2CrC0IoQX2GA0 sxKvTykI3035G7lRq82NPDS2a99O47w= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Andreas Dilger Cc: Sweet Tea Dorminy , Jonathan Corbet , Brian Foster , Chris Mason , Josef Bacik , David Sterba , Jaegeuk Kim , Chao Yu , Alexander Viro , Christian Brauner , Jan Kara , =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , linux-doc@vger.kernel.org, Linux Kernel Mailing List , linux-bcachefs@vger.kernel.org, linux-btrfs , linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel , kernel-team@meta.com Subject: Re: [PATCH v3 02/13] fiemap: update fiemap_fill_next_extent() signature Message-ID: <3bvnvw5lvlraveup3du7esp3v54wissngudpov3xzneajo2fji@hbqk52z2xp2z> References: <58f9c9eef8b0e33a8d46a3ad8a8db46890e1fbe8.1712126039.git.sweettea-kernel@dorminy.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Fri, Apr 05, 2024 at 01:05:01PM -0600, Andreas Dilger wrote: > On Apr 3, 2024, at 1:22 AM, Sweet Tea Dorminy wrote: > > > > Update the signature of fiemap_fill_next_extent() to allow passing a > > physical length. Update all callers to pass a 0 physical length -- since > > none set the EXTENT_HAS_PHYS_LEN flag, this value doesn't matter. > > Patch-structure-wise, it doesn't make sense to me to change all of the callers > to pass "0" as the argument to this function, and then submit a whole series > of per-filesystem patches that sets only FIEMAP_EXTENT_HAS_PHYS_LEN (but also > passes phys_len = 0, which is wrong AFAICS). > > A cleaner approach would be to rename the existing fiemap_fill_next_extent() > to fiemap_fill_next_extent_phys() that takes phys_len as an argument, and then > add a simple wrapper until all of the filesystems are updated: > > #define fiemap_fill_next_extent(info, logical, phys, log_len, flags, dev) \ > fiemap_fill_next_extent_phys(info, logical, phys, log_len, 0, flags, dev) > > Then the per-filesystem patches would involve changing over the callers to > use fiemap_fill_next_extent_phys() and setting FIEMAP_EXTENT_HAS_PHYS_LEN. Cleaner still would be to just have the callers initiaize and pass a struct fiemap_extent instead of passing around a whole bunch of integer parameters. You get more explicit naming, better typesafety - functions with a bunch of integer parametrs are not great from a type safety POV - and you can add and pass fields to fiemap_extent without having to update callers that aren't using it.