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=-10.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 9F5FAC433E1 for ; Mon, 24 Aug 2020 19:33:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 773B8206BE for ; Mon, 24 Aug 2020 19:33:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=toxicpanda-com.20150623.gappssmtp.com header.i=@toxicpanda-com.20150623.gappssmtp.com header.b="cZpArxXL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726413AbgHXTdZ (ORCPT ); Mon, 24 Aug 2020 15:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbgHXTdY (ORCPT ); Mon, 24 Aug 2020 15:33:24 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21C29C061573 for ; Mon, 24 Aug 2020 12:33:24 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id y65so718361qtd.2 for ; Mon, 24 Aug 2020 12:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=51kP9Tifqbgd3Uyz9HqcjJGWpWdHZ2apFmWcYfbWByQ=; b=cZpArxXL14yz7I2zGy87ZKjyTQeiikaabE4c/UxB4d64VkhBvLVumjxm9n0twhHm+s jf/W1XVZTCTWoQAjqVRoylTK0wJD7g26WhG8EPT+JPQfcdMHAikfE0owmnbTwWZF/6+M CnfLcgyCSqMPlbbvUfJjhoQzyQbMG+h8psuFdV+orCynGMTdrwnco4NHyqEHnKCM3hV5 GR/xu/UUQlEPGRqXzNisKUx7rdnKsMDbT7UQADO1XY5ujEG/dn0XCHb1IkX6wC0tMsMI C4PqR/Iha07VfpTrwTd+uAoQZkQYbCP3a511EEtYNgbsiDWUtkzbsbVv0cd2LWrxgKTQ Wr6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=51kP9Tifqbgd3Uyz9HqcjJGWpWdHZ2apFmWcYfbWByQ=; b=ib9Fbla9m3mTbgq20vduTGbQS21AD/MkFvKxAKORv0hF0RkvWJ22xSaTjgDypp7ODR sz0UFyYJ1sBmIfFfFEsb/6evq4iD2XPzPwnFAclPiA5PZlAkxBJbdG9HRsICH2MJvlcX 8sY4plemQvCjuY7AgVKSdiLcAJcamksklzpzyTkTyDw9Dfe9X88rUJUV+MCSqsGsFvaF ybeB2qj1cKSe6GIFJtfx9uu7XRqULRFNn+4eTYmFZtL5n6//X4VwKnVhUmIVJnZcxdyz +gUDyRt2Lkk1cBe4NHWb+3MYcfDVDVqa/apOGJvrZ8ijp2feVUFds84tcrqT66jL3Mib OZEw== X-Gm-Message-State: AOAM533r/2cx6nfmH+9JqrEVB2CgSSOrNpqkg8z6aVOtVRRBOSMygPG8 5Mn8Dnv9iy/jcIyi5Z4otCs/xQ== X-Google-Smtp-Source: ABdhPJymbALVwQ+92K7/Kx4PwQy+Axcn5LRTFd6I+yOZ6Qk3mbyyw1qrGGRQofxKv3o2mvWYzTXqKg== X-Received: by 2002:ac8:3ae5:: with SMTP id x92mr6125835qte.139.1598297603305; Mon, 24 Aug 2020 12:33:23 -0700 (PDT) Received: from [192.168.1.45] (cpe-174-109-172-136.nc.res.rr.com. [174.109.172.136]) by smtp.gmail.com with ESMTPSA id x2sm7317766qki.46.2020.08.24.12.33.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Aug 2020 12:33:22 -0700 (PDT) Subject: Re: [PATCH v5 7/9] btrfs: optionally extend i_size in cow_file_range_inline() To: Omar Sandoval , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, Al Viro , Christoph Hellwig Cc: Dave Chinner , Jann Horn , Amir Goldstein , Aleksa Sarai , linux-api@vger.kernel.org, kernel-team@fb.com References: <602ed7659d19b2693cd1277fcea8dbe21928157f.1597993855.git.osandov@osandov.com> From: Josef Bacik Message-ID: Date: Mon, 24 Aug 2020 15:33:20 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <602ed7659d19b2693cd1277fcea8dbe21928157f.1597993855.git.osandov@osandov.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On 8/21/20 3:38 AM, Omar Sandoval wrote: > From: Omar Sandoval > > Currently, an inline extent is always created after i_size is extended > from btrfs_dirty_pages(). However, for encoded writes, we only want to > update i_size after we successfully created the inline extent. Add an > update_i_size parameter to cow_file_range_inline() and > insert_inline_extent() and pass in the size of the extent rather than > determining it from i_size. Since the start parameter is always passed > as 0, get rid of it and simplify the logic in these two functions. While > we're here, let's document the requirements for creating an inline > extent. > > Signed-off-by: Omar Sandoval Reviewed-by: Josef Bacik Thanks, Josef