]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
btrfs: update comment for BTRFS_RESERVE_NO_FLUSH
authorFilipe Manana <fdmanana@suse.com>
Mon, 2 Feb 2026 16:47:02 +0000 (16:47 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:55:53 +0000 (18:55 +0200)
The comment is incomplete as BTRFS_RESERVE_NO_FLUSH is used for more
reasons than currently holding a transaction handle open. Update the
comment with all the other reasons and give some details.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.h

index 0703f24b23f70d6be7a4b374a119c23160d4dfdd..6f96cf48d7dad2fb340726c3fdf861a5f4e6abd3 100644 (file)
@@ -21,7 +21,24 @@ struct btrfs_block_group;
  * The higher the level, the more methods we try to reclaim space.
  */
 enum btrfs_reserve_flush_enum {
-       /* If we are in the transaction, we can't flush anything.*/
+       /*
+        * Used when we can't flush or don't need:
+        *
+        * 1) We are holding a transaction handle open, so we can't flush as
+        *    that could deadlock.
+        *
+        * 2) For a nowait write we don't want to block when reserving delalloc.
+        *
+        * 3) Joining a transaction or attaching a transaction, we don't want
+        *    to wait and we don't need to reserve anything (any needed space
+        *    was reserved before in a dedicated block reserve, or we rely on
+        *    the global block reserve, see btrfs_init_root_block_rsv()).
+        *
+        * 4) Starting a transaction when we don't need to reserve space, as
+        *    we don't need it because we previously reserved in a dedicated
+        *    block reserve or rely on the global block reserve, like the above
+        *    case.
+        */
        BTRFS_RESERVE_NO_FLUSH,
 
        /*