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=-2.3 required=3.0 tests=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 04DD6ECE588 for ; Tue, 15 Oct 2019 12:17:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE75921928 for ; Tue, 15 Oct 2019 12:17:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727999AbfJOMRp (ORCPT ); Tue, 15 Oct 2019 08:17:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:36142 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725812AbfJOMRo (ORCPT ); Tue, 15 Oct 2019 08:17:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 43904B37A; Tue, 15 Oct 2019 12:17:43 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 51F55DA7E3; Tue, 15 Oct 2019 14:17:55 +0200 (CEST) Date: Tue, 15 Oct 2019 14:17:55 +0200 From: David Sterba To: Dennis Zhou Cc: David Sterba , Chris Mason , Josef Bacik , Omar Sandoval , kernel-team@fb.com, linux-btrfs@vger.kernel.org Subject: Re: [PATCH 03/19] btrfs: keep track of which extents have been discarded Message-ID: <20191015121755.GU2751@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Dennis Zhou , David Sterba , Chris Mason , Josef Bacik , Omar Sandoval , kernel-team@fb.com, linux-btrfs@vger.kernel.org References: <5875088b5f4ada0ef73f097b238935dd583d5b3e.1570479299.git.dennis@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5875088b5f4ada0ef73f097b238935dd583d5b3e.1570479299.git.dennis@kernel.org> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Mon, Oct 07, 2019 at 04:17:34PM -0400, Dennis Zhou wrote: > @@ -2165,6 +2173,7 @@ static bool try_merge_free_space(struct btrfs_free_space_ctl *ctl, > bool merged = false; > u64 offset = info->offset; > u64 bytes = info->bytes; > + bool is_trimmed = btrfs_free_space_trimmed(info); Please add a const in such cases. I've been doing that in other patches but as more iterations are expected, let's have it there from the beginning. > --- a/fs/btrfs/free-space-cache.h > +++ b/fs/btrfs/free-space-cache.h > @@ -6,6 +6,8 @@ > #ifndef BTRFS_FREE_SPACE_CACHE_H > #define BTRFS_FREE_SPACE_CACHE_H > > +#define BTRFS_FSC_TRIMMED (1UL << 0) Please add a comment