diff options
author | Joe Perches <joe@perches.com> | 2013-04-30 18:27:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:04:05 -0400 |
commit | c2b3e1f76e5c90215bc7f740b376c0220eb8a8e3 (patch) | |
tree | 4ffbb3029d06909e05621ebb96b66052640f3ff7 /fs/hfs/bnode.c | |
parent | 5f3726f9457d5a863721353786e3395cdbd0f943 (diff) |
hfs/hfsplus: convert dprint to hfs_dbg
Use a more current logging style.
Rename macro and uses.
Add do {} while (0) to macro.
Add DBG_ to macro.
Add and use hfs_dbg_cont variant where appropriate.
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfs/bnode.c')
-rw-r--r-- | fs/hfs/bnode.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c index cdb41a1f6a64..869391902575 100644 --- a/fs/hfs/bnode.c +++ b/fs/hfs/bnode.c | |||
@@ -100,7 +100,7 @@ void hfs_bnode_copy(struct hfs_bnode *dst_node, int dst, | |||
100 | struct hfs_btree *tree; | 100 | struct hfs_btree *tree; |
101 | struct page *src_page, *dst_page; | 101 | struct page *src_page, *dst_page; |
102 | 102 | ||
103 | dprint(DBG_BNODE_MOD, "copybytes: %u,%u,%u\n", dst, src, len); | 103 | hfs_dbg(BNODE_MOD, "copybytes: %u,%u,%u\n", dst, src, len); |
104 | if (!len) | 104 | if (!len) |
105 | return; | 105 | return; |
106 | tree = src_node->tree; | 106 | tree = src_node->tree; |
@@ -120,7 +120,7 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len) | |||
120 | struct page *page; | 120 | struct page *page; |
121 | void *ptr; | 121 | void *ptr; |
122 | 122 | ||
123 | dprint(DBG_BNODE_MOD, "movebytes: %u,%u,%u\n", dst, src, len); | 123 | hfs_dbg(BNODE_MOD, "movebytes: %u,%u,%u\n", dst, src, len); |
124 | if (!len) | 124 | if (!len) |
125 | return; | 125 | return; |
126 | src += node->page_offset; | 126 | src += node->page_offset; |
@@ -138,16 +138,16 @@ void hfs_bnode_dump(struct hfs_bnode *node) | |||
138 | __be32 cnid; | 138 | __be32 cnid; |
139 | int i, off, key_off; | 139 | int i, off, key_off; |
140 | 140 | ||
141 | dprint(DBG_BNODE_MOD, "bnode: %d\n", node->this); | 141 | hfs_dbg(BNODE_MOD, "bnode: %d\n", node->this); |
142 | hfs_bnode_read(node, &desc, 0, sizeof(desc)); | 142 | hfs_bnode_read(node, &desc, 0, sizeof(desc)); |
143 | dprint(DBG_BNODE_MOD, "%d, %d, %d, %d, %d\n", | 143 | hfs_dbg(BNODE_MOD, "%d, %d, %d, %d, %d\n", |
144 | be32_to_cpu(desc.next), be32_to_cpu(desc.prev), | 144 | be32_to_cpu(desc.next), be32_to_cpu(desc.prev), |
145 | desc.type, desc.height, be16_to_cpu(desc.num_recs)); | 145 | desc.type, desc.height, be16_to_cpu(desc.num_recs)); |
146 | 146 | ||
147 | off = node->tree->node_size - 2; | 147 | off = node->tree->node_size - 2; |
148 | for (i = be16_to_cpu(desc.num_recs); i >= 0; off -= 2, i--) { | 148 | for (i = be16_to_cpu(desc.num_recs); i >= 0; off -= 2, i--) { |
149 | key_off = hfs_bnode_read_u16(node, off); | 149 | key_off = hfs_bnode_read_u16(node, off); |
150 | dprint(DBG_BNODE_MOD, " %d", key_off); | 150 | hfs_dbg_cont(BNODE_MOD, " %d", key_off); |
151 | if (i && node->type == HFS_NODE_INDEX) { | 151 | if (i && node->type == HFS_NODE_INDEX) { |
152 | int tmp; | 152 | int tmp; |
153 | 153 | ||
@@ -155,17 +155,18 @@ void hfs_bnode_dump(struct hfs_bnode *node) | |||
155 | tmp = (hfs_bnode_read_u8(node, key_off) | 1) + 1; | 155 | tmp = (hfs_bnode_read_u8(node, key_off) | 1) + 1; |
156 | else | 156 | else |
157 | tmp = node->tree->max_key_len + 1; | 157 | tmp = node->tree->max_key_len + 1; |
158 | dprint(DBG_BNODE_MOD, " (%d,%d", tmp, hfs_bnode_read_u8(node, key_off)); | 158 | hfs_dbg_cont(BNODE_MOD, " (%d,%d", |
159 | tmp, hfs_bnode_read_u8(node, key_off)); | ||
159 | hfs_bnode_read(node, &cnid, key_off + tmp, 4); | 160 | hfs_bnode_read(node, &cnid, key_off + tmp, 4); |
160 | dprint(DBG_BNODE_MOD, ",%d)", be32_to_cpu(cnid)); | 161 | hfs_dbg_cont(BNODE_MOD, ",%d)", be32_to_cpu(cnid)); |
161 | } else if (i && node->type == HFS_NODE_LEAF) { | 162 | } else if (i && node->type == HFS_NODE_LEAF) { |
162 | int tmp; | 163 | int tmp; |
163 | 164 | ||
164 | tmp = hfs_bnode_read_u8(node, key_off); | 165 | tmp = hfs_bnode_read_u8(node, key_off); |
165 | dprint(DBG_BNODE_MOD, " (%d)", tmp); | 166 | hfs_dbg_cont(BNODE_MOD, " (%d)", tmp); |
166 | } | 167 | } |
167 | } | 168 | } |
168 | dprint(DBG_BNODE_MOD, "\n"); | 169 | hfs_dbg_cont(BNODE_MOD, "\n"); |
169 | } | 170 | } |
170 | 171 | ||
171 | void hfs_bnode_unlink(struct hfs_bnode *node) | 172 | void hfs_bnode_unlink(struct hfs_bnode *node) |
@@ -257,8 +258,8 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) | |||
257 | node->this = cnid; | 258 | node->this = cnid; |
258 | set_bit(HFS_BNODE_NEW, &node->flags); | 259 | set_bit(HFS_BNODE_NEW, &node->flags); |
259 | atomic_set(&node->refcnt, 1); | 260 | atomic_set(&node->refcnt, 1); |
260 | dprint(DBG_BNODE_REFS, "new_node(%d:%d): 1\n", | 261 | hfs_dbg(BNODE_REFS, "new_node(%d:%d): 1\n", |
261 | node->tree->cnid, node->this); | 262 | node->tree->cnid, node->this); |
262 | init_waitqueue_head(&node->lock_wq); | 263 | init_waitqueue_head(&node->lock_wq); |
263 | spin_lock(&tree->hash_lock); | 264 | spin_lock(&tree->hash_lock); |
264 | node2 = hfs_bnode_findhash(tree, cnid); | 265 | node2 = hfs_bnode_findhash(tree, cnid); |
@@ -301,7 +302,7 @@ void hfs_bnode_unhash(struct hfs_bnode *node) | |||
301 | { | 302 | { |
302 | struct hfs_bnode **p; | 303 | struct hfs_bnode **p; |
303 | 304 | ||
304 | dprint(DBG_BNODE_REFS, "remove_node(%d:%d): %d\n", | 305 | hfs_dbg(BNODE_REFS, "remove_node(%d:%d): %d\n", |
305 | node->tree->cnid, node->this, atomic_read(&node->refcnt)); | 306 | node->tree->cnid, node->this, atomic_read(&node->refcnt)); |
306 | for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)]; | 307 | for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)]; |
307 | *p && *p != node; p = &(*p)->next_hash) | 308 | *p && *p != node; p = &(*p)->next_hash) |
@@ -443,8 +444,9 @@ void hfs_bnode_get(struct hfs_bnode *node) | |||
443 | { | 444 | { |
444 | if (node) { | 445 | if (node) { |
445 | atomic_inc(&node->refcnt); | 446 | atomic_inc(&node->refcnt); |
446 | dprint(DBG_BNODE_REFS, "get_node(%d:%d): %d\n", | 447 | hfs_dbg(BNODE_REFS, "get_node(%d:%d): %d\n", |
447 | node->tree->cnid, node->this, atomic_read(&node->refcnt)); | 448 | node->tree->cnid, node->this, |
449 | atomic_read(&node->refcnt)); | ||
448 | } | 450 | } |
449 | } | 451 | } |
450 | 452 | ||
@@ -455,8 +457,9 @@ void hfs_bnode_put(struct hfs_bnode *node) | |||
455 | struct hfs_btree *tree = node->tree; | 457 | struct hfs_btree *tree = node->tree; |
456 | int i; | 458 | int i; |
457 | 459 | ||
458 | dprint(DBG_BNODE_REFS, "put_node(%d:%d): %d\n", | 460 | hfs_dbg(BNODE_REFS, "put_node(%d:%d): %d\n", |
459 | node->tree->cnid, node->this, atomic_read(&node->refcnt)); | 461 | node->tree->cnid, node->this, |
462 | atomic_read(&node->refcnt)); | ||
460 | BUG_ON(!atomic_read(&node->refcnt)); | 463 | BUG_ON(!atomic_read(&node->refcnt)); |
461 | if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock)) | 464 | if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock)) |
462 | return; | 465 | return; |