diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2012-11-03 06:58:34 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2012-12-12 17:15:23 -0500 |
commit | 31b1a2bd758f439fc945b3ac5899d890cb7e2dc6 (patch) | |
tree | a5659a8e51a780eb02a51c2f79c8e3c25d29bb92 /fs/btrfs/ctree.c | |
parent | 5269b67e3d809dcaa4c6763a343423bb1b7b3fe6 (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/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 100c274a1cfe..0e4adb00e9d9 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -1359,19 +1359,16 @@ noinline int btrfs_cow_block(struct btrfs_trans_handle *trans, | |||
1359 | u64 search_start; | 1359 | u64 search_start; |
1360 | int ret; | 1360 | int ret; |
1361 | 1361 | ||
1362 | if (trans->transaction != root->fs_info->running_transaction) { | 1362 | if (trans->transaction != root->fs_info->running_transaction) |
1363 | printk(KERN_CRIT "trans %llu running %llu\n", | 1363 | WARN(1, KERN_CRIT "trans %llu running %llu\n", |
1364 | (unsigned long long)trans->transid, | 1364 | (unsigned long long)trans->transid, |
1365 | (unsigned long long) | 1365 | (unsigned long long) |
1366 | root->fs_info->running_transaction->transid); | 1366 | root->fs_info->running_transaction->transid); |
1367 | WARN_ON(1); | 1367 | |
1368 | } | 1368 | if (trans->transid != root->fs_info->generation) |
1369 | if (trans->transid != root->fs_info->generation) { | 1369 | WARN(1, KERN_CRIT "trans %llu running %llu\n", |
1370 | printk(KERN_CRIT "trans %llu running %llu\n", | ||
1371 | (unsigned long long)trans->transid, | 1370 | (unsigned long long)trans->transid, |
1372 | (unsigned long long)root->fs_info->generation); | 1371 | (unsigned long long)root->fs_info->generation); |
1373 | WARN_ON(1); | ||
1374 | } | ||
1375 | 1372 | ||
1376 | if (!should_cow_block(trans, root, buf)) { | 1373 | if (!should_cow_block(trans, root, buf)) { |
1377 | *cow_ret = buf; | 1374 | *cow_ret = buf; |
@@ -3640,11 +3637,9 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans, | |||
3640 | btrfs_set_header_nritems(left, old_left_nritems + push_items); | 3637 | btrfs_set_header_nritems(left, old_left_nritems + push_items); |
3641 | 3638 | ||
3642 | /* fixup right node */ | 3639 | /* fixup right node */ |
3643 | if (push_items > right_nritems) { | 3640 | if (push_items > right_nritems) |
3644 | printk(KERN_CRIT "push items %d nr %u\n", push_items, | 3641 | WARN(1, KERN_CRIT "push items %d nr %u\n", push_items, |
3645 | right_nritems); | 3642 | right_nritems); |
3646 | WARN_ON(1); | ||
3647 | } | ||
3648 | 3643 | ||
3649 | if (push_items < right_nritems) { | 3644 | if (push_items < right_nritems) { |
3650 | push_space = btrfs_item_offset_nr(right, push_items - 1) - | 3645 | push_space = btrfs_item_offset_nr(right, push_items - 1) - |