Skip to contentSkip to conversation

slight simplification in transaction.c

PATCH Premysl Hruby 1 participant 1 message Sep 10, 2009 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hi there,

While reading source, I found possible simplification in btrfs_record_root_in_trans

fs/btrfs/transaction.c +2 -5
index cdbb502..7cd7bf9 100644
@@ -123,12 +123,9 @@ int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans,
                return 0;
 
        mutex_lock(&root->fs_info->trans_mutex);
-       if (root->last_trans == trans->transid) {
-               mutex_unlock(&root->fs_info->trans_mutex);
-               return 0;
-       }
+       if (root->last_trans != trans->transid)
+               record_root_in_trans(trans, root);
 
-       record_root_in_trans(trans, root);
        mutex_unlock(&root->fs_info->trans_mutex);
        return 0;
 }
Signature · 3 lines
Premysl "Anydot" Hruby, http://www.redrum.cz/
-
I'm a signature virus. Please add me to your signature and help me spread!