diff options
author | Evgeniy Dushistov <dushistov@mail.ru> | 2006-06-25 08:47:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:01:03 -0400 |
commit | abf5d15fd2e52517dd56a17a846d5a1f900b7db4 (patch) | |
tree | ea537760c201cea57b468044dc733e06781ece2b /fs/ufs/ialloc.c | |
parent | 5afb3145c9a733166174e1f5a07c46410b5c4091 (diff) |
[PATCH] ufs: easy debug
Currently to turn on debug mode "user" has to edit ~10 files, to turn off he
has to do it again.
This patch introduce such changes:
1)turn on(off) debug messages via ".config"
2)remove unnecessary duplication of code
3)make "UFSD" macros more similar to function
4)fix some compiler warnings
Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ufs/ialloc.c')
-rw-r--r-- | fs/ufs/ialloc.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index 2da0ffda82cc..ad017fa2dd21 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c | |||
@@ -34,14 +34,6 @@ | |||
34 | #include "swab.h" | 34 | #include "swab.h" |
35 | #include "util.h" | 35 | #include "util.h" |
36 | 36 | ||
37 | #undef UFS_IALLOC_DEBUG | ||
38 | |||
39 | #ifdef UFS_IALLOC_DEBUG | ||
40 | #define UFSD(x) printk("(%s, %d), %s: ", __FILE__, __LINE__, __FUNCTION__); printk x; | ||
41 | #else | ||
42 | #define UFSD(x) | ||
43 | #endif | ||
44 | |||
45 | /* | 37 | /* |
46 | * NOTE! When we get the inode, we're the only people | 38 | * NOTE! When we get the inode, we're the only people |
47 | * that have access to it, and as such there are no | 39 | * that have access to it, and as such there are no |
@@ -68,7 +60,7 @@ void ufs_free_inode (struct inode * inode) | |||
68 | int is_directory; | 60 | int is_directory; |
69 | unsigned ino, cg, bit; | 61 | unsigned ino, cg, bit; |
70 | 62 | ||
71 | UFSD(("ENTER, ino %lu\n", inode->i_ino)) | 63 | UFSD("ENTER, ino %lu\n", inode->i_ino); |
72 | 64 | ||
73 | sb = inode->i_sb; | 65 | sb = inode->i_sb; |
74 | uspi = UFS_SB(sb)->s_uspi; | 66 | uspi = UFS_SB(sb)->s_uspi; |
@@ -130,7 +122,7 @@ void ufs_free_inode (struct inode * inode) | |||
130 | 122 | ||
131 | sb->s_dirt = 1; | 123 | sb->s_dirt = 1; |
132 | unlock_super (sb); | 124 | unlock_super (sb); |
133 | UFSD(("EXIT\n")) | 125 | UFSD("EXIT\n"); |
134 | } | 126 | } |
135 | 127 | ||
136 | /* | 128 | /* |
@@ -155,7 +147,7 @@ struct inode * ufs_new_inode(struct inode * dir, int mode) | |||
155 | unsigned cg, bit, i, j, start; | 147 | unsigned cg, bit, i, j, start; |
156 | struct ufs_inode_info *ufsi; | 148 | struct ufs_inode_info *ufsi; |
157 | 149 | ||
158 | UFSD(("ENTER\n")) | 150 | UFSD("ENTER\n"); |
159 | 151 | ||
160 | /* Cannot create files in a deleted directory */ | 152 | /* Cannot create files in a deleted directory */ |
161 | if (!dir || !dir->i_nlink) | 153 | if (!dir || !dir->i_nlink) |
@@ -227,7 +219,7 @@ cg_found: | |||
227 | goto failed; | 219 | goto failed; |
228 | } | 220 | } |
229 | } | 221 | } |
230 | UFSD(("start = %u, bit = %u, ipg = %u\n", start, bit, uspi->s_ipg)) | 222 | UFSD("start = %u, bit = %u, ipg = %u\n", start, bit, uspi->s_ipg); |
231 | if (ubh_isclr (UCPI_UBH(ucpi), ucpi->c_iusedoff, bit)) | 223 | if (ubh_isclr (UCPI_UBH(ucpi), ucpi->c_iusedoff, bit)) |
232 | ubh_setbit (UCPI_UBH(ucpi), ucpi->c_iusedoff, bit); | 224 | ubh_setbit (UCPI_UBH(ucpi), ucpi->c_iusedoff, bit); |
233 | else { | 225 | else { |
@@ -287,14 +279,14 @@ cg_found: | |||
287 | return ERR_PTR(-EDQUOT); | 279 | return ERR_PTR(-EDQUOT); |
288 | } | 280 | } |
289 | 281 | ||
290 | UFSD(("allocating inode %lu\n", inode->i_ino)) | 282 | UFSD("allocating inode %lu\n", inode->i_ino); |
291 | UFSD(("EXIT\n")) | 283 | UFSD("EXIT\n"); |
292 | return inode; | 284 | return inode; |
293 | 285 | ||
294 | failed: | 286 | failed: |
295 | unlock_super (sb); | 287 | unlock_super (sb); |
296 | make_bad_inode(inode); | 288 | make_bad_inode(inode); |
297 | iput (inode); | 289 | iput (inode); |
298 | UFSD(("EXIT (FAILED)\n")) | 290 | UFSD("EXIT (FAILED)\n"); |
299 | return ERR_PTR(-ENOSPC); | 291 | return ERR_PTR(-ENOSPC); |
300 | } | 292 | } |