Add journal checksum patches. Also move
[ext4-patch-queue.git] / fs-ext4-use-bug_on.patch
blob64ef884ef8da1644b7e73e0080866f21fc744d5e
1 ext4: Use BUG_ON() instead of BUG()
3 From: Julia Lawall <julia@diku.dk>
5 if (...) BUG(); should be replaced with BUG_ON(...) when the test has no
6 side-effects to allow a definition of BUG_ON that drops the code completely.
8 The semantic patch that makes this change is as follows:
9 (http://www.emn.fr/x-info/coccinelle/)
11 // <smpl>
12 @ disable unlikely @ expression E,f; @@
15 if (<... f(...) ...>) { BUG(); }
17 - if (unlikely(E)) { BUG(); }
18 + BUG_ON(E);
21 @@ expression E,f; @@
24 if (<... f(...) ...>) { BUG(); }
26 - if (E) { BUG(); }
27 + BUG_ON(E);
29 // </smpl>
31 Signed-off-by: Julia Lawall <julia@diku.dk>
32 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
33 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
34 ---
36 fs/ext4/balloc.c | 3 +--
37 1 file changed, 1 insertion(+), 2 deletions(-)
39 Index: linux-2.6.26-rc4/fs/ext4/balloc.c
40 ===================================================================
41 --- linux-2.6.26-rc4.orig/fs/ext4/balloc.c 2008-05-29 10:52:31.000000000 -0700
42 +++ linux-2.6.26-rc4/fs/ext4/balloc.c 2008-05-29 10:52:33.000000000 -0700
43 @@ -409,8 +409,7 @@ restart:
44 prev = rsv;
46 printk("Window map complete.\n");
47 - if (bad)
48 - BUG();
49 + BUG_ON(bad);
51 #define rsv_window_dump(root, verbose) \
52 __rsv_window_dump((root), (verbose), __func__)