]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: return bool from btrfs_should_end_transaction
authorNikolay Borisov <nborisov@suse.com>
Tue, 24 Nov 2020 14:49:25 +0000 (16:49 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:54:16 +0000 (15:54 +0100)
Results in slightly smaller code.

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-11 (-11)
Function                                     old     new   delta
btrfs_should_end_transaction                  96      85     -11
Total: Before=20070, After=20059, chg -0.05%

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/transaction.c
fs/btrfs/transaction.h

index 10338363754ec33a9743b00cfc516ff54b1ccd84..238e5a2c06960efcfcc8c3afa5eaf25384c3df4f 100644 (file)
@@ -908,14 +908,14 @@ static bool should_end_transaction(struct btrfs_trans_handle *trans)
        return !!btrfs_block_rsv_check(&fs_info->global_block_rsv, 5);
 }
 
-int btrfs_should_end_transaction(struct btrfs_trans_handle *trans)
+bool btrfs_should_end_transaction(struct btrfs_trans_handle *trans)
 {
        struct btrfs_transaction *cur_trans = trans->transaction;
 
        smp_mb();
        if (cur_trans->state >= TRANS_STATE_COMMIT_START ||
            cur_trans->delayed_refs.flushing)
-               return 1;
+               return true;
 
        return should_end_transaction(trans);
 }
index 8241c050ba711de4758b1b54f354d7f37751d4ea..31ca81bad82214b6b6856bb4459f2c2cd9b9ec7d 100644 (file)
@@ -218,7 +218,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans);
 int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,
                                   int wait_for_unblock);
 int btrfs_end_transaction_throttle(struct btrfs_trans_handle *trans);
-int btrfs_should_end_transaction(struct btrfs_trans_handle *trans);
+bool btrfs_should_end_transaction(struct btrfs_trans_handle *trans);
 void btrfs_throttle(struct btrfs_fs_info *fs_info);
 int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans,
                                struct btrfs_root *root);