From patchwork Wed Feb 12 07:46:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 11377795 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC8061395 for ; Wed, 12 Feb 2020 07:47:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5598206DB for ; Wed, 12 Feb 2020 07:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728348AbgBLHrD (ORCPT ); Wed, 12 Feb 2020 02:47:03 -0500 Received: from mx2.suse.de ([195.135.220.15]:41038 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728322AbgBLHrD (ORCPT ); Wed, 12 Feb 2020 02:47:03 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 74B53AB95 for ; Wed, 12 Feb 2020 07:47:01 +0000 (UTC) From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs: Add comment for BTRFS_ROOT_REF_COWS Date: Wed, 12 Feb 2020 15:46:51 +0800 Message-Id: <20200212074651.33008-1-wqu@suse.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org This bit is being used in too many locations while there is still no good enough explaination for how this bit is used. Not to mention its name really doesn't make much sense. So this patch will add my explanation on this bit, considering only subvolume trees, along with its reloc trees have this bit, to me it looks like this bit shows whether tree blocks of a root can be shared. Signed-off-by: Qu Wenruo Reviewed-by: Josef Bacik --- fs/btrfs/ctree.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 36df977b64d9..61ab6e8c9a18 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -971,6 +971,15 @@ enum { * is used to tell us when more checks are required */ BTRFS_ROOT_IN_TRANS_SETUP, + + /* + * Whether tree blocks of a root can be shared. + * + * All subvolume trees, and their reloc trees, have this bit set. + * + * While all other trees, including essential trees like root, csum, + * extent, chunk trees, and log trees don't have this bit set. + */ BTRFS_ROOT_REF_COWS, BTRFS_ROOT_TRACK_DIRTY, BTRFS_ROOT_IN_RADIX,