* slight simplification in transaction.c
@ 2009-09-10 21:04 Premysl Hruby
0 siblings, 0 replies; only message in thread
From: Premysl Hruby @ 2009-09-10 21:04 UTC (permalink / raw)
To: linux-btrfs
Hi there,
While reading source, I found possible simplification
in btrfs_record_root_in_trans
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index cdbb502..7cd7bf9 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -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;
}
--
Premysl "Anydot" Hruby, http://www.redrum.cz/
-
I'm a signature virus. Please add me to your signature and help me spread!
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-10 21:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-10 21:04 slight simplification in transaction.c Premysl Hruby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox