diff options
author | Josef Bacik <josef@toxicpanda.com> | 2022-10-19 10:50:55 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:42 +0100 |
commit | c52cc7b7acfb3290a0268538b82ac7cf18df7ca4 (patch) | |
tree | a156dd94c88b3c1cf3e04a70fd86585923bfda70 /fs/btrfs/super.c | |
parent | 7966a6b5959bbeb38b35d12b7a533c1dee8c432c (diff) | |
download | linux-stable-c52cc7b7acfb3290a0268538b82ac7cf18df7ca4.tar.gz linux-stable-c52cc7b7acfb3290a0268538b82ac7cf18df7ca4.tar.bz2 linux-stable-c52cc7b7acfb3290a0268538b82ac7cf18df7ca4.zip |
btrfs: add a BTRFS_FS_NEED_TRANS_COMMIT flag
Currently we are only using fs_info->pending_changes to indicate that we
need a transaction commit. The original users for this were removed
years ago and we don't have more usage in sight, so this is the only
remaining reason to have this field. Add a flag so we can remove this
code.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 3aeb2106e119..0839e4a1cfac 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1535,7 +1535,8 @@ int btrfs_sync_fs(struct super_block *sb, int wait) * Exit unless we have some pending changes * that need to go through commit */ - if (fs_info->pending_changes == 0) + if (!test_bit(BTRFS_FS_NEED_TRANS_COMMIT, + &fs_info->flags)) return 0; /* * A non-blocking test if the fs is frozen. We must not |