diff options
author | Nikolay Borisov <nborisov@suse.com> | 2018-02-08 18:25:18 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-26 15:09:34 +0200 |
commit | 45ae2c1841c31c90077cf427c09ea0e83e381026 (patch) | |
tree | aad724668ba992f9e3128796be555a78081898c7 /fs/btrfs/disk-io.c | |
parent | bf6d7d4900c0d0c15dcd1baa1b65e6519bf4abef (diff) |
btrfs: Document consistency of transaction->io_bgs list
The reason why io_bgs can be modified without holding any lock is
non-obvious. Document it and reference that documentation from the
respective call sites.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index dcfdb1f17f1b..08e33f316a86 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4346,6 +4346,10 @@ void btrfs_cleanup_dirty_bgs(struct btrfs_transaction *cur_trans, } spin_unlock(&cur_trans->dirty_bgs_lock); + /* + * Refer to the definition of io_bgs member for details why it's safe + * to use it without any locking + */ while (!list_empty(&cur_trans->io_bgs)) { cache = list_first_entry(&cur_trans->io_bgs, struct btrfs_block_group_cache, |