aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-11-03 06:58:34 -0400
committerJosef Bacik <jbacik@fusionio.com>2012-12-12 17:15:23 -0500
commit31b1a2bd758f439fc945b3ac5899d890cb7e2dc6 (patch)
treea5659a8e51a780eb02a51c2f79c8e3c25d29bb92 /fs/btrfs/transaction.c
parent5269b67e3d809dcaa4c6763a343423bb1b7b3fe6 (diff)
fs/btrfs: use WARN
Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index bc1f52397334..f21f39f0b1a1 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -145,16 +145,12 @@ loop:
145 * the log must never go across transaction boundaries. 145 * the log must never go across transaction boundaries.
146 */ 146 */
147 smp_mb(); 147 smp_mb();
148 if (!list_empty(&fs_info->tree_mod_seq_list)) { 148 if (!list_empty(&fs_info->tree_mod_seq_list))
149 printk(KERN_ERR "btrfs: tree_mod_seq_list not empty when " 149 WARN(1, KERN_ERR "btrfs: tree_mod_seq_list not empty when "
150 "creating a fresh transaction\n"); 150 "creating a fresh transaction\n");
151 WARN_ON(1); 151 if (!RB_EMPTY_ROOT(&fs_info->tree_mod_log))
152 } 152 WARN(1, KERN_ERR "btrfs: tree_mod_log rb tree not empty when "
153 if (!RB_EMPTY_ROOT(&fs_info->tree_mod_log)) {
154 printk(KERN_ERR "btrfs: tree_mod_log rb tree not empty when "
155 "creating a fresh transaction\n"); 153 "creating a fresh transaction\n");
156 WARN_ON(1);
157 }
158 atomic_set(&fs_info->tree_mod_seq, 0); 154 atomic_set(&fs_info->tree_mod_seq, 0);
159 155
160 spin_lock_init(&cur_trans->commit_lock); 156 spin_lock_init(&cur_trans->commit_lock);