Commit c2b3e1f7 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

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: default avatarJoe 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5f3726f9
...@@ -22,7 +22,8 @@ int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) ...@@ -22,7 +22,8 @@ int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd)
return -ENOMEM; return -ENOMEM;
fd->search_key = ptr; fd->search_key = ptr;
fd->key = ptr + tree->max_key_len + 2; fd->key = ptr + tree->max_key_len + 2;
dprint(DBG_BNODE_REFS, "find_init: %d (%p)\n", tree->cnid, __builtin_return_address(0)); hfs_dbg(BNODE_REFS, "find_init: %d (%p)\n",
tree->cnid, __builtin_return_address(0));
mutex_lock(&tree->tree_lock); mutex_lock(&tree->tree_lock);
return 0; return 0;
} }
...@@ -31,7 +32,8 @@ void hfs_find_exit(struct hfs_find_data *fd) ...@@ -31,7 +32,8 @@ void hfs_find_exit(struct hfs_find_data *fd)
{ {
hfs_bnode_put(fd->bnode); hfs_bnode_put(fd->bnode);
kfree(fd->search_key); kfree(fd->search_key);
dprint(DBG_BNODE_REFS, "find_exit: %d (%p)\n", fd->tree->cnid, __builtin_return_address(0)); hfs_dbg(BNODE_REFS, "find_exit: %d (%p)\n",
fd->tree->cnid, __builtin_return_address(0));
mutex_unlock(&fd->tree->tree_lock); mutex_unlock(&fd->tree->tree_lock);
fd->tree = NULL; fd->tree = NULL;
} }
......
...@@ -158,7 +158,7 @@ u32 hfs_vbm_search_free(struct super_block *sb, u32 goal, u32 *num_bits) ...@@ -158,7 +158,7 @@ u32 hfs_vbm_search_free(struct super_block *sb, u32 goal, u32 *num_bits)
} }
} }
dprint(DBG_BITMAP, "alloc_bits: %u,%u\n", pos, *num_bits); hfs_dbg(BITMAP, "alloc_bits: %u,%u\n", pos, *num_bits);
HFS_SB(sb)->free_ablocks -= *num_bits; HFS_SB(sb)->free_ablocks -= *num_bits;
hfs_bitmap_dirty(sb); hfs_bitmap_dirty(sb);
out: out:
...@@ -200,7 +200,7 @@ int hfs_clear_vbm_bits(struct super_block *sb, u16 start, u16 count) ...@@ -200,7 +200,7 @@ int hfs_clear_vbm_bits(struct super_block *sb, u16 start, u16 count)
if (!count) if (!count)
return 0; return 0;
dprint(DBG_BITMAP, "clear_bits: %u,%u\n", start, count); hfs_dbg(BITMAP, "clear_bits: %u,%u\n", start, count);
/* are all of the bits in range? */ /* are all of the bits in range? */
if ((start + count) > HFS_SB(sb)->fs_ablocks) if ((start + count) > HFS_SB(sb)->fs_ablocks)
return -2; return -2;
......
...@@ -100,7 +100,7 @@ void hfs_bnode_copy(struct hfs_bnode *dst_node, int dst, ...@@ -100,7 +100,7 @@ void hfs_bnode_copy(struct hfs_bnode *dst_node, int dst,
struct hfs_btree *tree; struct hfs_btree *tree;
struct page *src_page, *dst_page; struct page *src_page, *dst_page;
dprint(DBG_BNODE_MOD, "copybytes: %u,%u,%u\n", dst, src, len); hfs_dbg(BNODE_MOD, "copybytes: %u,%u,%u\n", dst, src, len);
if (!len) if (!len)
return; return;
tree = src_node->tree; tree = src_node->tree;
...@@ -120,7 +120,7 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len) ...@@ -120,7 +120,7 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len)
struct page *page; struct page *page;
void *ptr; void *ptr;
dprint(DBG_BNODE_MOD, "movebytes: %u,%u,%u\n", dst, src, len); hfs_dbg(BNODE_MOD, "movebytes: %u,%u,%u\n", dst, src, len);
if (!len) if (!len)
return; return;
src += node->page_offset; src += node->page_offset;
...@@ -138,16 +138,16 @@ void hfs_bnode_dump(struct hfs_bnode *node) ...@@ -138,16 +138,16 @@ void hfs_bnode_dump(struct hfs_bnode *node)
__be32 cnid; __be32 cnid;
int i, off, key_off; int i, off, key_off;
dprint(DBG_BNODE_MOD, "bnode: %d\n", node->this); hfs_dbg(BNODE_MOD, "bnode: %d\n", node->this);
hfs_bnode_read(node, &desc, 0, sizeof(desc)); hfs_bnode_read(node, &desc, 0, sizeof(desc));
dprint(DBG_BNODE_MOD, "%d, %d, %d, %d, %d\n", hfs_dbg(BNODE_MOD, "%d, %d, %d, %d, %d\n",
be32_to_cpu(desc.next), be32_to_cpu(desc.prev), be32_to_cpu(desc.next), be32_to_cpu(desc.prev),
desc.type, desc.height, be16_to_cpu(desc.num_recs)); desc.type, desc.height, be16_to_cpu(desc.num_recs));
off = node->tree->node_size - 2; off = node->tree->node_size - 2;
for (i = be16_to_cpu(desc.num_recs); i >= 0; off -= 2, i--) { for (i = be16_to_cpu(desc.num_recs); i >= 0; off -= 2, i--) {
key_off = hfs_bnode_read_u16(node, off); key_off = hfs_bnode_read_u16(node, off);
dprint(DBG_BNODE_MOD, " %d", key_off); hfs_dbg_cont(BNODE_MOD, " %d", key_off);
if (i && node->type == HFS_NODE_INDEX) { if (i && node->type == HFS_NODE_INDEX) {
int tmp; int tmp;
...@@ -155,17 +155,18 @@ void hfs_bnode_dump(struct hfs_bnode *node) ...@@ -155,17 +155,18 @@ void hfs_bnode_dump(struct hfs_bnode *node)
tmp = (hfs_bnode_read_u8(node, key_off) | 1) + 1; tmp = (hfs_bnode_read_u8(node, key_off) | 1) + 1;
else else
tmp = node->tree->max_key_len + 1; tmp = node->tree->max_key_len + 1;
dprint(DBG_BNODE_MOD, " (%d,%d", tmp, hfs_bnode_read_u8(node, key_off)); hfs_dbg_cont(BNODE_MOD, " (%d,%d",
tmp, hfs_bnode_read_u8(node, key_off));
hfs_bnode_read(node, &cnid, key_off + tmp, 4); hfs_bnode_read(node, &cnid, key_off + tmp, 4);
dprint(DBG_BNODE_MOD, ",%d)", be32_to_cpu(cnid)); hfs_dbg_cont(BNODE_MOD, ",%d)", be32_to_cpu(cnid));
} else if (i && node->type == HFS_NODE_LEAF) { } else if (i && node->type == HFS_NODE_LEAF) {
int tmp; int tmp;
tmp = hfs_bnode_read_u8(node, key_off); tmp = hfs_bnode_read_u8(node, key_off);
dprint(DBG_BNODE_MOD, " (%d)", tmp); hfs_dbg_cont(BNODE_MOD, " (%d)", tmp);
} }
} }
dprint(DBG_BNODE_MOD, "\n"); hfs_dbg_cont(BNODE_MOD, "\n");
} }
void hfs_bnode_unlink(struct hfs_bnode *node) 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,8 +258,8 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
node->this = cnid; node->this = cnid;
set_bit(HFS_BNODE_NEW, &node->flags); set_bit(HFS_BNODE_NEW, &node->flags);
atomic_set(&node->refcnt, 1); atomic_set(&node->refcnt, 1);
dprint(DBG_BNODE_REFS, "new_node(%d:%d): 1\n", hfs_dbg(BNODE_REFS, "new_node(%d:%d): 1\n",
node->tree->cnid, node->this); node->tree->cnid, node->this);
init_waitqueue_head(&node->lock_wq); init_waitqueue_head(&node->lock_wq);
spin_lock(&tree->hash_lock); spin_lock(&tree->hash_lock);
node2 = hfs_bnode_findhash(tree, cnid); node2 = hfs_bnode_findhash(tree, cnid);
...@@ -301,7 +302,7 @@ void hfs_bnode_unhash(struct hfs_bnode *node) ...@@ -301,7 +302,7 @@ void hfs_bnode_unhash(struct hfs_bnode *node)
{ {
struct hfs_bnode **p; struct hfs_bnode **p;
dprint(DBG_BNODE_REFS, "remove_node(%d:%d): %d\n", hfs_dbg(BNODE_REFS, "remove_node(%d:%d): %d\n",
node->tree->cnid, node->this, atomic_read(&node->refcnt)); node->tree->cnid, node->this, atomic_read(&node->refcnt));
for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)]; for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)];
*p && *p != node; p = &(*p)->next_hash) *p && *p != node; p = &(*p)->next_hash)
...@@ -443,8 +444,9 @@ void hfs_bnode_get(struct hfs_bnode *node) ...@@ -443,8 +444,9 @@ void hfs_bnode_get(struct hfs_bnode *node)
{ {
if (node) { if (node) {
atomic_inc(&node->refcnt); atomic_inc(&node->refcnt);
dprint(DBG_BNODE_REFS, "get_node(%d:%d): %d\n", hfs_dbg(BNODE_REFS, "get_node(%d:%d): %d\n",
node->tree->cnid, node->this, atomic_read(&node->refcnt)); node->tree->cnid, node->this,
atomic_read(&node->refcnt));
} }
} }
...@@ -455,8 +457,9 @@ void hfs_bnode_put(struct hfs_bnode *node) ...@@ -455,8 +457,9 @@ void hfs_bnode_put(struct hfs_bnode *node)
struct hfs_btree *tree = node->tree; struct hfs_btree *tree = node->tree;
int i; int i;
dprint(DBG_BNODE_REFS, "put_node(%d:%d): %d\n", hfs_dbg(BNODE_REFS, "put_node(%d:%d): %d\n",
node->tree->cnid, node->this, atomic_read(&node->refcnt)); node->tree->cnid, node->this,
atomic_read(&node->refcnt));
BUG_ON(!atomic_read(&node->refcnt)); BUG_ON(!atomic_read(&node->refcnt));
if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock)) if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock))
return; return;
......
...@@ -94,7 +94,8 @@ int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) ...@@ -94,7 +94,8 @@ int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len)
end_rec_off = tree->node_size - (node->num_recs + 1) * 2; end_rec_off = tree->node_size - (node->num_recs + 1) * 2;
end_off = hfs_bnode_read_u16(node, end_rec_off); end_off = hfs_bnode_read_u16(node, end_rec_off);
end_rec_off -= 2; end_rec_off -= 2;
dprint(DBG_BNODE_MOD, "insert_rec: %d, %d, %d, %d\n", rec, size, end_off, end_rec_off); hfs_dbg(BNODE_MOD, "insert_rec: %d, %d, %d, %d\n",
rec, size, end_off, end_rec_off);
if (size > end_rec_off - end_off) { if (size > end_rec_off - end_off) {
if (new_node) if (new_node)
panic("not enough room!\n"); panic("not enough room!\n");
...@@ -190,7 +191,8 @@ int hfs_brec_remove(struct hfs_find_data *fd) ...@@ -190,7 +191,8 @@ int hfs_brec_remove(struct hfs_find_data *fd)
mark_inode_dirty(tree->inode); mark_inode_dirty(tree->inode);
} }
hfs_bnode_dump(node); hfs_bnode_dump(node);
dprint(DBG_BNODE_MOD, "remove_rec: %d, %d\n", fd->record, fd->keylength + fd->entrylength); hfs_dbg(BNODE_MOD, "remove_rec: %d, %d\n",
fd->record, fd->keylength + fd->entrylength);
if (!--node->num_recs) { if (!--node->num_recs) {
hfs_bnode_unlink(node); hfs_bnode_unlink(node);
if (!node->parent) if (!node->parent)
...@@ -240,7 +242,7 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd) ...@@ -240,7 +242,7 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
if (IS_ERR(new_node)) if (IS_ERR(new_node))
return new_node; return new_node;
hfs_bnode_get(node); hfs_bnode_get(node);
dprint(DBG_BNODE_MOD, "split_nodes: %d - %d - %d\n", hfs_dbg(BNODE_MOD, "split_nodes: %d - %d - %d\n",
node->this, new_node->this, node->next); node->this, new_node->this, node->next);
new_node->next = node->next; new_node->next = node->next;
new_node->prev = node->this; new_node->prev = node->this;
...@@ -374,7 +376,8 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd) ...@@ -374,7 +376,8 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd)
newkeylen = (hfs_bnode_read_u8(node, 14) | 1) + 1; newkeylen = (hfs_bnode_read_u8(node, 14) | 1) + 1;
else else
fd->keylength = newkeylen = tree->max_key_len + 1; fd->keylength = newkeylen = tree->max_key_len + 1;
dprint(DBG_BNODE_MOD, "update_rec: %d, %d, %d\n", rec, fd->keylength, newkeylen); hfs_dbg(BNODE_MOD, "update_rec: %d, %d, %d\n",
rec, fd->keylength, newkeylen);
rec_off = tree->node_size - (rec + 2) * 2; rec_off = tree->node_size - (rec + 2) * 2;
end_rec_off = tree->node_size - (parent->num_recs + 1) * 2; end_rec_off = tree->node_size - (parent->num_recs + 1) * 2;
......
...@@ -316,7 +316,7 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -316,7 +316,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
u32 nidx; u32 nidx;
u8 *data, byte, m; u8 *data, byte, m;
dprint(DBG_BNODE_MOD, "btree_free_node: %u\n", node->this); hfs_dbg(BNODE_MOD, "btree_free_node: %u\n", node->this);
tree = node->tree; tree = node->tree;
nidx = node->this; nidx = node->this;
node = hfs_bnode_find(tree, 0); node = hfs_bnode_find(tree, 0);
......
...@@ -87,7 +87,8 @@ int hfs_cat_create(u32 cnid, struct inode *dir, struct qstr *str, struct inode * ...@@ -87,7 +87,8 @@ int hfs_cat_create(u32 cnid, struct inode *dir, struct qstr *str, struct inode *
int entry_size; int entry_size;
int err; int err;
dprint(DBG_CAT_MOD, "create_cat: %s,%u(%d)\n", str->name, cnid, inode->i_nlink); hfs_dbg(CAT_MOD, "create_cat: %s,%u(%d)\n",
str->name, cnid, inode->i_nlink);
if (dir->i_size >= HFS_MAX_VALENCE) if (dir->i_size >= HFS_MAX_VALENCE)
return -ENOSPC; return -ENOSPC;
...@@ -214,7 +215,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str) ...@@ -214,7 +215,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str)
struct list_head *pos; struct list_head *pos;
int res, type; int res, type;
dprint(DBG_CAT_MOD, "delete_cat: %s,%u\n", str ? str->name : NULL, cnid); hfs_dbg(CAT_MOD, "delete_cat: %s,%u\n", str ? str->name : NULL, cnid);
sb = dir->i_sb; sb = dir->i_sb;
res = hfs_find_init(HFS_SB(sb)->cat_tree, &fd); res = hfs_find_init(HFS_SB(sb)->cat_tree, &fd);
if (res) if (res)
...@@ -282,7 +283,8 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, struct qstr *src_name, ...@@ -282,7 +283,8 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, struct qstr *src_name,
int entry_size, type; int entry_size, type;
int err; int err;
dprint(DBG_CAT_MOD, "rename_cat: %u - %lu,%s - %lu,%s\n", cnid, src_dir->i_ino, src_name->name, hfs_dbg(CAT_MOD, "rename_cat: %u - %lu,%s - %lu,%s\n",
cnid, src_dir->i_ino, src_name->name,
dst_dir->i_ino, dst_name->name); dst_dir->i_ino, dst_name->name);
sb = src_dir->i_sb; sb = src_dir->i_sb;
err = hfs_find_init(HFS_SB(sb)->cat_tree, &src_fd); err = hfs_find_init(HFS_SB(sb)->cat_tree, &src_fd);
......
...@@ -205,11 +205,12 @@ static void hfs_dump_extent(struct hfs_extent *extent) ...@@ -205,11 +205,12 @@ static void hfs_dump_extent(struct hfs_extent *extent)
{ {
int i; int i;
dprint(DBG_EXTENT, " "); hfs_dbg(EXTENT, " ");
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
dprint(DBG_EXTENT, " %u:%u", be16_to_cpu(extent[i].block), hfs_dbg_cont(EXTENT, " %u:%u",
be16_to_cpu(extent[i].count)); be16_to_cpu(extent[i].block),
dprint(DBG_EXTENT, "\n"); be16_to_cpu(extent[i].count));
hfs_dbg_cont(EXTENT, "\n");
} }
static int hfs_add_extent(struct hfs_extent *extent, u16 offset, static int hfs_add_extent(struct hfs_extent *extent, u16 offset,
...@@ -404,10 +405,10 @@ int hfs_extend_file(struct inode *inode) ...@@ -404,10 +405,10 @@ int hfs_extend_file(struct inode *inode)
goto out; goto out;
} }
dprint(DBG_EXTENT, "extend %lu: %u,%u\n", inode->i_ino, start, len); hfs_dbg(EXTENT, "extend %lu: %u,%u\n", inode->i_ino, start, len);
if (HFS_I(inode)->alloc_blocks == HFS_I(inode)->first_blocks) { if (HFS_I(inode)->alloc_blocks == HFS_I(inode)->first_blocks) {
if (!HFS_I(inode)->first_blocks) { if (!HFS_I(inode)->first_blocks) {
dprint(DBG_EXTENT, "first extents\n"); hfs_dbg(EXTENT, "first extents\n");
/* no extents yet */ /* no extents yet */
HFS_I(inode)->first_extents[0].block = cpu_to_be16(start); HFS_I(inode)->first_extents[0].block = cpu_to_be16(start);
HFS_I(inode)->first_extents[0].count = cpu_to_be16(len); HFS_I(inode)->first_extents[0].count = cpu_to_be16(len);
...@@ -449,7 +450,7 @@ int hfs_extend_file(struct inode *inode) ...@@ -449,7 +450,7 @@ int hfs_extend_file(struct inode *inode)
return res; return res;
insert_extent: insert_extent:
dprint(DBG_EXTENT, "insert new extent\n"); hfs_dbg(EXTENT, "insert new extent\n");
res = hfs_ext_write_extent(inode); res = hfs_ext_write_extent(inode);
if (res) if (res)
goto out; goto out;
...@@ -474,8 +475,9 @@ void hfs_file_truncate(struct inode *inode) ...@@ -474,8 +475,9 @@ void hfs_file_truncate(struct inode *inode)
u32 size; u32 size;
int res; int res;
dprint(DBG_INODE, "truncate: %lu, %Lu -> %Lu\n", inode->i_ino, hfs_dbg(INODE, "truncate: %lu, %Lu -> %Lu\n",
(long long)HFS_I(inode)->phys_size, inode->i_size); inode->i_ino, (long long)HFS_I(inode)->phys_size,
inode->i_size);
if (inode->i_size > HFS_I(inode)->phys_size) { if (inode->i_size > HFS_I(inode)->phys_size) {
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
void *fsdata; void *fsdata;
......
...@@ -34,8 +34,18 @@ ...@@ -34,8 +34,18 @@
//#define DBG_MASK (DBG_CAT_MOD|DBG_BNODE_REFS|DBG_INODE|DBG_EXTENT) //#define DBG_MASK (DBG_CAT_MOD|DBG_BNODE_REFS|DBG_INODE|DBG_EXTENT)
#define DBG_MASK (0) #define DBG_MASK (0)
#define dprint(flg, fmt, args...) \ #define hfs_dbg(flg, fmt, ...) \
if (flg & DBG_MASK) printk(fmt , ## args) do { \
if (DBG_##flg & DBG_MASK) \
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
} while (0)
#define hfs_dbg_cont(flg, fmt, ...) \
do { \
if (DBG_##flg & DBG_MASK) \
printk(KERN_CONT fmt, ##__VA_ARGS__); \
} while (0)
/* /*
* struct hfs_inode_info * struct hfs_inode_info
......
...@@ -237,7 +237,7 @@ void hfs_delete_inode(struct inode *inode) ...@@ -237,7 +237,7 @@ void hfs_delete_inode(struct inode *inode)
{ {
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
dprint(DBG_INODE, "delete_inode: %lu\n", inode->i_ino); hfs_dbg(INODE, "delete_inode: %lu\n", inode->i_ino);
if (S_ISDIR(inode->i_mode)) { if (S_ISDIR(inode->i_mode)) {
HFS_SB(sb)->folder_count--; HFS_SB(sb)->folder_count--;
if (HFS_I(inode)->cat_key.ParID == cpu_to_be32(HFS_ROOT_CNID)) if (HFS_I(inode)->cat_key.ParID == cpu_to_be32(HFS_ROOT_CNID))
...@@ -418,7 +418,7 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc) ...@@ -418,7 +418,7 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc)
hfs_cat_rec rec; hfs_cat_rec rec;
int res; int res;
dprint(DBG_INODE, "hfs_write_inode: %lu\n", inode->i_ino); hfs_dbg(INODE, "hfs_write_inode: %lu\n", inode->i_ino);
res = hfs_ext_write_extent(inode); res = hfs_ext_write_extent(inode);
if (res) if (res)
return res; return res;
......
...@@ -166,7 +166,7 @@ int hfsplus_find_attr(struct super_block *sb, u32 cnid, ...@@ -166,7 +166,7 @@ int hfsplus_find_attr(struct super_block *sb, u32 cnid,
{ {
int err = 0; int err = 0;
dprint(DBG_ATTR_MOD, "find_attr: %s,%d\n", name ? name : NULL, cnid); hfs_dbg(ATTR_MOD, "find_attr: %s,%d\n", name ? name : NULL, cnid);
if (!HFSPLUS_SB(sb)->attr_tree) { if (!HFSPLUS_SB(sb)->attr_tree) {
printk(KERN_ERR "hfs: attributes file doesn't exist\n"); printk(KERN_ERR "hfs: attributes file doesn't exist\n");
...@@ -228,7 +228,7 @@ int hfsplus_create_attr(struct inode *inode, ...@@ -228,7 +228,7 @@ int hfsplus_create_attr(struct inode *inode,
int entry_size; int entry_size;
int err; int err;
dprint(DBG_ATTR_MOD, "create_attr: %s,%ld\n", hfs_dbg(ATTR_MOD, "create_attr: %s,%ld\n",
name ? name : NULL, inode->i_ino); name ? name : NULL, inode->i_ino);
if (!HFSPLUS_SB(sb)->attr_tree) { if (!HFSPLUS_SB(sb)->attr_tree) {
...@@ -328,7 +328,7 @@ int hfsplus_delete_attr(struct inode *inode, const char *name) ...@@ -328,7 +328,7 @@ int hfsplus_delete_attr(struct inode *inode, const char *name)
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
struct hfs_find_data fd; struct hfs_find_data fd;
dprint(DBG_ATTR_MOD, "delete_attr: %s,%ld\n", hfs_dbg(ATTR_MOD, "delete_attr: %s,%ld\n",
name ? name : NULL, inode->i_ino); name ? name : NULL, inode->i_ino);
if (!HFSPLUS_SB(sb)->attr_tree) { if (!HFSPLUS_SB(sb)->attr_tree) {
...@@ -369,7 +369,7 @@ int hfsplus_delete_all_attrs(struct inode *dir, u32 cnid) ...@@ -369,7 +369,7 @@ int hfsplus_delete_all_attrs(struct inode *dir, u32 cnid)
int err = 0; int err = 0;
struct hfs_find_data fd; struct hfs_find_data fd;
dprint(DBG_ATTR_MOD, "delete_all_attrs: %d\n", cnid); hfs_dbg(ATTR_MOD, "delete_all_attrs: %d\n", cnid);
if (!HFSPLUS_SB(dir->i_sb)->attr_tree) { if (!HFSPLUS_SB(dir->i_sb)->attr_tree) {
printk(KERN_ERR "hfs: attributes file doesn't exist\n"); printk(KERN_ERR "hfs: attributes file doesn't exist\n");
......
...@@ -22,7 +22,7 @@ int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) ...@@ -22,7 +22,7 @@ int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd)
return -ENOMEM; return -ENOMEM;
fd->search_key = ptr; fd->search_key = ptr;
fd->key = ptr + tree->max_key_len + 2; fd->key = ptr + tree->max_key_len + 2;
dprint(DBG_BNODE_REFS, "find_init: %d (%p)\n", hfs_dbg(BNODE_REFS, "find_init: %d (%p)\n",
tree->cnid, __builtin_return_address(0)); tree->cnid, __builtin_return_address(0));
switch (tree->cnid) { switch (tree->cnid) {
case HFSPLUS_CAT_CNID: case HFSPLUS_CAT_CNID:
...@@ -44,7 +44,7 @@ void hfs_find_exit(struct hfs_find_data *fd) ...@@ -44,7 +44,7 @@ void hfs_find_exit(struct hfs_find_data *fd)
{ {
hfs_bnode_put(fd->bnode); hfs_bnode_put(fd->bnode);
kfree(fd->search_key); kfree(fd->search_key);
dprint(DBG_BNODE_REFS, "find_exit: %d (%p)\n", hfs_dbg(BNODE_REFS, "find_exit: %d (%p)\n",
fd->tree->cnid, __builtin_return_address(0)); fd->tree->cnid, __builtin_return_address(0));
mutex_unlock(&fd->tree->tree_lock); mutex_unlock(&fd->tree->tree_lock);
fd->tree = NULL; fd->tree = NULL;
......
...@@ -30,7 +30,7 @@ int hfsplus_block_allocate(struct super_block *sb, u32 size, ...@@ -30,7 +30,7 @@ int hfsplus_block_allocate(struct super_block *sb, u32 size,
if (!len) if (!len)
return size; return size;
dprint(DBG_BITMAP, "block_allocate: %u,%u,%u\n", size, offset, len); hfs_dbg(BITMAP, "block_allocate: %u,%u,%u\n", size, offset, len);
mutex_lock(&sbi->alloc_mutex); mutex_lock(&sbi->alloc_mutex);
mapping = sbi->alloc_file->i_mapping; mapping = sbi->alloc_file->i_mapping;
page = read_mapping_page(mapping, offset / PAGE_CACHE_BITS, NULL); page = read_mapping_page(mapping, offset / PAGE_CACHE_BITS, NULL);
...@@ -89,14 +89,14 @@ int hfsplus_block_allocate(struct super_block *sb, u32 size, ...@@ -89,14 +89,14 @@ int hfsplus_block_allocate(struct super_block *sb, u32 size,
else else
end = pptr + ((size + 31) & (PAGE_CACHE_BITS - 1)) / 32; end = pptr + ((size + 31) & (PAGE_CACHE_BITS - 1)) / 32;
} }
dprint(DBG_BITMAP, "bitmap full\n"); hfs_dbg(BITMAP, "bitmap full\n");
start = size; start = size;
goto out; goto out;
found: found:
start = offset + (curr - pptr) * 32 + i; start = offset + (curr - pptr) * 32 + i;
if (start >= size) { if (start >= size) {
dprint(DBG_BITMAP, "bitmap full\n"); hfs_dbg(BITMAP, "bitmap full\n");
goto out; goto out;
} }
/* do any partial u32 at the start */ /* do any partial u32 at the start */
...@@ -154,7 +154,7 @@ int hfsplus_block_allocate(struct super_block *sb, u32 size, ...@@ -154,7 +154,7 @@ int hfsplus_block_allocate(struct super_block *sb, u32 size,
*max = offset + (curr - pptr) * 32 + i - start; *max = offset + (curr - pptr) * 32 + i - start;
sbi->free_blocks -= *max; sbi->free_blocks -= *max;
hfsplus_mark_mdb_dirty(sb); hfsplus_mark_mdb_dirty(sb);
dprint(DBG_BITMAP, "-> %u,%u\n", start, *max); hfs_dbg(BITMAP, "-> %u,%u\n", start, *max);
out: out:
mutex_unlock(&sbi->alloc_mutex); mutex_unlock(&sbi->alloc_mutex);
return start; return start;
...@@ -173,7 +173,7 @@ int hfsplus_block_free(struct super_block *sb, u32 offset, u32 count) ...@@ -173,7 +173,7 @@ int hfsplus_block_free(struct super_block *sb, u32 offset, u32 count)
if (!count) if (!count)
return 0; return 0;
dprint(DBG_BITMAP, "block_free: %u,%u\n", offset, count); hfs_dbg(BITMAP, "block_free: %u,%u\n", offset, count);
/* are all of the bits in range? */ /* are all of the bits in range? */
if ((offset + count) > sbi->total_blocks) if ((offset + count) > sbi->total_blocks)
return -ENOENT; return -ENOENT;
......
...@@ -130,7 +130,7 @@ void hfs_bnode_copy(struct hfs_bnode *dst_node, int dst, ...@@ -130,7 +130,7 @@ void hfs_bnode_copy(struct hfs_bnode *dst_node, int dst,
struct page **src_page, **dst_page; struct page **src_page, **dst_page;
int l; int l;
dprint(DBG_BNODE_MOD, "copybytes: %u,%u,%u\n", dst, src, len); hfs_dbg(BNODE_MOD, "copybytes: %u,%u,%u\n", dst, src, len);
if (!len) if (!len)
return; return;
tree = src_node->tree; tree = src_node->tree;
...@@ -188,7 +188,7 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len) ...@@ -188,7 +188,7 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len)
struct page **src_page, **dst_page; struct page **src_page, **dst_page;
int l; int l;
dprint(DBG_BNODE_MOD, "movebytes: %u,%u,%u\n", dst, src, len); hfs_dbg(BNODE_MOD, "movebytes: %u,%u,%u\n", dst, src, len);
if (!len) if (!len)
return; return;
src += node->page_offset; src += node->page_offset;
...@@ -302,16 +302,16 @@ void hfs_bnode_dump(struct hfs_bnode *node) ...@@ -302,16 +302,16 @@ void hfs_bnode_dump(struct hfs_bnode *node)
__be32 cnid; __be32 cnid;
int i, off, key_off; int i, off, key_off;
dprint(DBG_BNODE_MOD, "bnode: %d\n", node->this); hfs_dbg(BNODE_MOD, "bnode: %d\n", node->this);
hfs_bnode_read(node, &desc, 0, sizeof(desc)); hfs_bnode_read(node, &desc, 0, sizeof(desc));
dprint(DBG_BNODE_MOD, "%d, %d, %d, %d, %d\n", hfs_dbg(BNODE_MOD, "%d, %d, %d, %d, %d\n",
be32_to_cpu(desc.next), be32_to_cpu(desc.prev), be32_to_cpu(desc.next), be32_to_cpu(desc.prev),
desc.type, desc.height, be16_to_cpu(desc.num_recs)); desc.type, desc.height, be16_to_cpu(desc.num_recs));
off = node->tree->node_size - 2; off = node->tree->node_size - 2;
for (i = be16_to_cpu(desc.num_recs); i >= 0; off -= 2, i--) { for (i = be16_to_cpu(desc.num_recs); i >= 0; off -= 2, i--) {
key_off = hfs_bnode_read_u16(node, off); key_off = hfs_bnode_read_u16(node, off);
dprint(DBG_BNODE_MOD, " %d", key_off); hfs_dbg(BNODE_MOD, " %d", key_off);
if (i && node->type == HFS_NODE_INDEX) { if (i && node->type == HFS_NODE_INDEX) {
int tmp; int tmp;
...@@ -320,17 +320,17 @@ void hfs_bnode_dump(struct hfs_bnode *node) ...@@ -320,17 +320,17 @@ void hfs_bnode_dump(struct hfs_bnode *node)
tmp = hfs_bnode_read_u16(node, key_off) + 2; tmp = hfs_bnode_read_u16(node, key_off) + 2;
else else
tmp = node->tree->max_key_len + 2; tmp = node->tree->max_key_len + 2;
dprint(DBG_BNODE_MOD, " (%d", tmp); hfs_dbg_cont(BNODE_MOD, " (%d", tmp);
hfs_bnode_read(node, &cnid, key_off + tmp, 4); hfs_bnode_read(node, &cnid, key_off + tmp, 4);
dprint(DBG_BNODE_MOD, ",%d)", be32_to_cpu(cnid)); hfs_dbg_cont(BNODE_MOD, ",%d)", be32_to_cpu(cnid));
} else if (i && node->type == HFS_NODE_LEAF) { } else if (i && node->type == HFS_NODE_LEAF) {
int tmp; int tmp;
tmp = hfs_bnode_read_u16(node, key_off); tmp = hfs_bnode_read_u16(node, key_off);
dprint(DBG_BNODE_MOD, " (%d)", tmp); hfs_dbg_cont(BNODE_MOD, " (%d)", tmp);
} }
} }
dprint(DBG_BNODE_MOD, "\n"); hfs_dbg_cont(BNODE_MOD, "\n");
} }
void hfs_bnode_unlink(struct hfs_bnode *node) void hfs_bnode_unlink(struct hfs_bnode *node)
...@@ -366,7 +366,7 @@ void hfs_bnode_unlink(struct hfs_bnode *node) ...@@ -366,7 +366,7 @@ void hfs_bnode_unlink(struct hfs_bnode *node)
/* move down? */ /* move down? */
if (!node->prev && !node->next) if (!node->prev && !node->next)
dprint(DBG_BNODE_MOD, "hfs_btree_del_level\n"); hfs_dbg(BNODE_MOD, "hfs_btree_del_level\n");
if (!node->parent) { if (!node->parent) {
tree->root = 0; tree->root = 0;
tree->depth = 0; tree->depth = 0;
...@@ -425,8 +425,8 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) ...@@ -425,8 +425,8 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
node->this = cnid; node->this = cnid;
set_bit(HFS_BNODE_NEW, &node->flags); set_bit(HFS_BNODE_NEW, &node->flags);
atomic_set(&node->refcnt, 1); atomic_set(&node->refcnt, 1);
dprint(DBG_BNODE_REFS, "new_node(%d:%d): 1\n", hfs_dbg(BNODE_REFS, "new_node(%d:%d): 1\n",
node->tree->cnid, node->this); node->tree->cnid, node->this);
init_waitqueue_head(&node->lock_wq); init_waitqueue_head(&node->lock_wq);
spin_lock(&tree->hash_lock); spin_lock(&tree->hash_lock);
node2 = hfs_bnode_findhash(tree, cnid); node2 = hfs_bnode_findhash(tree, cnid);
...@@ -470,7 +470,7 @@ void hfs_bnode_unhash(struct hfs_bnode *node) ...@@ -470,7 +470,7 @@ void hfs_bnode_unhash(struct hfs_bnode *node)
{ {
struct hfs_bnode **p; struct hfs_bnode **p;
dprint(DBG_BNODE_REFS, "remove_node(%d:%d): %d\n", hfs_dbg(BNODE_REFS, "remove_node(%d:%d): %d\n",
node->tree->cnid, node->this, atomic_read(&node->refcnt)); node->tree->cnid, node->this, atomic_read(&node->refcnt));
for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)]; for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)];
*p && *p != node; p = &(*p)->next_hash) *p && *p != node; p = &(*p)->next_hash)
...@@ -620,7 +620,7 @@ void hfs_bnode_get(struct hfs_bnode *node) ...@@ -620,7 +620,7 @@ void hfs_bnode_get(struct hfs_bnode *node)
{ {
if (node) { if (node) {
atomic_inc(&node->refcnt); atomic_inc(&node->refcnt);
dprint(DBG_BNODE_REFS, "get_node(%d:%d): %d\n", hfs_dbg(BNODE_REFS, "get_node(%d:%d): %d\n",
node->tree->cnid, node->this, node->tree->cnid, node->this,
atomic_read(&node->refcnt)); atomic_read(&node->refcnt));
} }
...@@ -633,7 +633,7 @@ void hfs_bnode_put(struct hfs_bnode *node) ...@@ -633,7 +633,7 @@ void hfs_bnode_put(struct hfs_bnode *node)
struct hfs_btree *tree = node->tree; struct hfs_btree *tree = node->tree;
int i; int i;
dprint(DBG_BNODE_REFS, "put_node(%d:%d): %d\n", hfs_dbg(BNODE_REFS, "put_node(%d:%d): %d\n",
node->tree->cnid, node->this, node->tree->cnid, node->this,
atomic_read(&node->refcnt)); atomic_read(&node->refcnt));
BUG_ON(!atomic_read(&node->refcnt)); BUG_ON(!atomic_read(&node->refcnt));
......
...@@ -90,7 +90,7 @@ int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) ...@@ -90,7 +90,7 @@ int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len)
end_rec_off = tree->node_size - (node->num_recs + 1) * 2; end_rec_off = tree->node_size - (node->num_recs + 1) * 2;
end_off = hfs_bnode_read_u16(node, end_rec_off); end_off = hfs_bnode_read_u16(node, end_rec_off);
end_rec_off -= 2; end_rec_off -= 2;
dprint(DBG_BNODE_MOD, "insert_rec: %d, %d, %d, %d\n", hfs_dbg(BNODE_MOD, "insert_rec: %d, %d, %d, %d\n",
rec, size, end_off, end_rec_off); rec, size, end_off, end_rec_off);
if (size > end_rec_off - end_off) { if (size > end_rec_off - end_off) {
if (new_node) if (new_node)
...@@ -191,7 +191,7 @@ int hfs_brec_remove(struct hfs_find_data *fd) ...@@ -191,7 +191,7 @@ int hfs_brec_remove(struct hfs_find_data *fd)
mark_inode_dirty(tree->inode); mark_inode_dirty(tree->inode);
} }
hfs_bnode_dump(node); hfs_bnode_dump(node);
dprint(DBG_BNODE_MOD, "remove_rec: %d, %d\n", hfs_dbg(BNODE_MOD, "remove_rec: %d, %d\n",
fd->record, fd->keylength + fd->entrylength); fd->record, fd->keylength + fd->entrylength);
if (!--node->num_recs) { if (!--node->num_recs) {
hfs_bnode_unlink(node); hfs_bnode_unlink(node);
...@@ -244,7 +244,7 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd) ...@@ -244,7 +244,7 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
if (IS_ERR(new_node)) if (IS_ERR(new_node))
return new_node; return new_node;
hfs_bnode_get(node); hfs_bnode_get(node);
dprint(DBG_BNODE_MOD, "split_nodes: %d - %d - %d\n", hfs_dbg(BNODE_MOD, "split_nodes: %d - %d - %d\n",
node->this, new_node->this, node->next); node->this, new_node->this, node->next);
new_node->next = node->next; new_node->next = node->next;
new_node->prev = node->this; new_node->prev = node->this;
...@@ -379,7 +379,7 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd) ...@@ -379,7 +379,7 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd)
newkeylen = hfs_bnode_read_u16(node, 14) + 2; newkeylen = hfs_bnode_read_u16(node, 14) + 2;
else else
fd->keylength = newkeylen = tree->max_key_len + 2; fd->keylength = newkeylen = tree->max_key_len + 2;
dprint(DBG_BNODE_MOD, "update_rec: %d, %d, %d\n", hfs_dbg(BNODE_MOD, "update_rec: %d, %d, %d\n",
rec, fd->keylength, newkeylen); rec, fd->keylength, newkeylen);
rec_off = tree->node_size - (rec + 2) * 2; rec_off = tree->node_size - (rec + 2) * 2;
...@@ -391,7 +391,7 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd) ...@@ -391,7 +391,7 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd)
end_off = hfs_bnode_read_u16(parent, end_rec_off); end_off = hfs_bnode_read_u16(parent, end_rec_off);
if (end_rec_off - end_off < diff) { if (end_rec_off - end_off < diff) {
dprint(DBG_BNODE_MOD, "hfs: splitting index node.\n"); hfs_dbg(BNODE_MOD, "splitting index node\n");
fd->bnode = parent; fd->bnode = parent;
new_node = hfs_bnode_split(fd); new_node = hfs_bnode_split(fd);
if (IS_ERR(new_node)) if (IS_ERR(new_node))
......
...@@ -303,7 +303,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) ...@@ -303,7 +303,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
kunmap(*pagep); kunmap(*pagep);
nidx = node->next; nidx = node->next;
if (!nidx) { if (!nidx) {
dprint(DBG_BNODE_MOD, "hfs: create new bmap node.\n"); hfs_dbg(BNODE_MOD, "create new bmap node\n");
next_node = hfs_bmap_new_bmap(node, idx); next_node = hfs_bmap_new_bmap(node, idx);
} else } else
next_node = hfs_bnode_find(tree, nidx); next_node = hfs_bnode_find(tree, nidx);
...@@ -329,7 +329,7 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -329,7 +329,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
u32 nidx; u32 nidx;
u8 *data, byte, m; u8 *data, byte, m;
dprint(DBG_BNODE_MOD, "btree_free_node: %u\n", node->this); hfs_dbg(BNODE_MOD, "btree_free_node: %u\n", node->this);
BUG_ON(!node->this); BUG_ON(!node->this);
tree = node->tree; tree = node->tree;
nidx = node->this; nidx = node->this;
......
...@@ -212,7 +212,7 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir, ...@@ -212,7 +212,7 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir,
int entry_size; int entry_size;
int err; int err;
dprint(DBG_CAT_MOD, "create_cat: %s,%u(%d)\n", hfs_dbg(CAT_MOD, "create_cat: %s,%u(%d)\n",
str->name, cnid, inode->i_nlink); str->name, cnid, inode->i_nlink);
err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd);
if (err) if (err)
...@@ -271,8 +271,7 @@ int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str) ...@@ -271,8 +271,7 @@ int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str)
int err, off; int err, off;
u16 type; u16 type;
dprint(DBG_CAT_MOD, "delete_cat: %s,%u\n", hfs_dbg(CAT_MOD, "delete_cat: %s,%u\n", str ? str->name : NULL, cnid);
str ? str->name : NULL, cnid);
err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd);
if (err) if (err)
return err; return err;
...@@ -361,7 +360,7 @@ int hfsplus_rename_cat(u32 cnid, ...@@ -361,7 +360,7 @@ int hfsplus_rename_cat(u32 cnid,
int entry_size, type; int entry_size, type;
int err; int err;
dprint(DBG_CAT_MOD, "rename_cat: %u - %lu,%s - %lu,%s\n", hfs_dbg(CAT_MOD, "rename_cat: %u - %lu,%s - %lu,%s\n",
cnid, src_dir->i_ino, src_name->name, cnid, src_dir->i_ino, src_name->name,
dst_dir->i_ino, dst_name->name); dst_dir->i_ino, dst_name->name);
err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &src_fd); err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &src_fd);
......
...@@ -265,7 +265,7 @@ int hfsplus_get_block(struct inode *inode, sector_t iblock, ...@@ -265,7 +265,7 @@ int hfsplus_get_block(struct inode *inode, sector_t iblock,
mutex_unlock(&hip->extents_lock); mutex_unlock(&hip->extents_lock);
done: done:
dprint(DBG_EXTENT, "get_block(%lu): %llu - %u\n", hfs_dbg(EXTENT, "get_block(%lu): %llu - %u\n",
inode->i_ino, (long long)iblock, dblock); inode->i_ino, (long long)iblock, dblock);
mask = (1 << sbi->fs_shift) - 1; mask = (1 << sbi->fs_shift) - 1;
...@@ -288,11 +288,12 @@ static void hfsplus_dump_extent(struct hfsplus_extent *extent) ...@@ -288,11 +288,12 @@ static void hfsplus_dump_extent(struct hfsplus_extent *extent)
{ {
int i; int i;
dprint(DBG_EXTENT, " "); hfs_dbg(EXTENT, " ");
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
dprint(DBG_EXTENT, " %u:%u", be32_to_cpu(extent[i].start_block), hfs_dbg_cont(EXTENT, " %u:%u",
be32_to_cpu(extent[i].block_count)); be32_to_cpu(extent[i].start_block),
dprint(DBG_EXTENT, "\n"); be32_to_cpu(extent[i].block_count));
hfs_dbg_cont(EXTENT, "\n");
} }
static int hfsplus_add_extent(struct hfsplus_extent *extent, u32 offset, static int hfsplus_add_extent(struct hfsplus_extent *extent, u32 offset,
...@@ -349,7 +350,7 @@ static int hfsplus_free_extents(struct super_block *sb, ...@@ -349,7 +350,7 @@ static int hfsplus_free_extents(struct super_block *sb,
err = hfsplus_block_free(sb, start, count); err = hfsplus_block_free(sb, start, count);
if (err) { if (err) {
printk(KERN_ERR "hfs: can't free extent\n"); printk(KERN_ERR "hfs: can't free extent\n");
dprint(DBG_EXTENT, " start: %u count: %u\n", hfs_dbg(EXTENT, " start: %u count: %u\n",
start, count); start, count);
} }
extent->block_count = 0; extent->block_count = 0;
...@@ -360,7 +361,7 @@ static int hfsplus_free_extents(struct super_block *sb, ...@@ -360,7 +361,7 @@ static int hfsplus_free_extents(struct super_block *sb,
err = hfsplus_block_free(sb, start + count, block_nr); err = hfsplus_block_free(sb, start + count, block_nr);
if (err) { if (err) {
printk(KERN_ERR "hfs: can't free extent\n"); printk(KERN_ERR "hfs: can't free extent\n");
dprint(DBG_EXTENT, " start: %u count: %u\n", hfs_dbg(EXTENT, " start: %u count: %u\n",
start, count); start, count);
} }
extent->block_count = cpu_to_be32(count); extent->block_count = cpu_to_be32(count);
...@@ -459,11 +460,11 @@ int hfsplus_file_extend(struct inode *inode) ...@@ -459,11 +460,11 @@ int hfsplus_file_extend(struct inode *inode)
} }
} }
dprint(DBG_EXTENT, "extend %lu: %u,%u\n", inode->i_ino, start, len); hfs_dbg(EXTENT, "extend %lu: %u,%u\n", inode->i_ino, start, len);
if (hip->alloc_blocks <= hip->first_blocks) { if (hip->alloc_blocks <= hip->first_blocks) {
if (!hip->first_blocks) { if (!hip->first_blocks) {
dprint(DBG_EXTENT, "first extents\n"); hfs_dbg(EXTENT, "first extents\n");
/* no extents yet */ /* no extents yet */
hip->first_extents[0].start_block = cpu_to_be32(start); hip->first_extents[0].start_block = cpu_to_be32(start);
hip->first_extents[0].block_count = cpu_to_be32(len); hip->first_extents[0].block_count = cpu_to_be32(len);
...@@ -500,7 +501,7 @@ int hfsplus_file_extend(struct inode *inode) ...@@ -500,7 +501,7 @@ int hfsplus_file_extend(struct inode *inode)
return res; return res;
insert_extent: insert_extent:
dprint(DBG_EXTENT, "insert new extent\n"); hfs_dbg(EXTENT, "insert new extent\n");
res = hfsplus_ext_write_extent_locked(inode); res = hfsplus_ext_write_extent_locked(inode);
if (res) if (res)
goto out; goto out;
...@@ -525,9 +526,8 @@ void hfsplus_file_truncate(struct inode *inode) ...@@ -525,9 +526,8 @@ void hfsplus_file_truncate(struct inode *inode)
u32 alloc_cnt, blk_cnt, start; u32 alloc_cnt, blk_cnt, start;
int res; int res;
dprint(DBG_INODE, "truncate: %lu, %llu -> %llu\n", hfs_dbg(INODE, "truncate: %lu, %llu -> %llu\n",
inode->i_ino, (long long)hip->phys_size, inode->i_ino, (long long)hip->phys_size, inode->i_size);
inode->i_size);
if (inode->i_size > hip->phys_size) { if (inode->i_size > hip->phys_size) {
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
......
...@@ -32,9 +32,17 @@ ...@@ -32,9 +32,17 @@
#endif #endif
#define DBG_MASK (0) #define DBG_MASK (0)
#define dprint(flg, fmt, args...) \ #define hfs_dbg(flg, fmt, ...) \
if (flg & DBG_MASK) \ do { \
printk(fmt , ## args) if (DBG_##flg & DBG_MASK) \
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
} while (0)
#define hfs_dbg_cont(flg, fmt, ...) \
do { \
if (DBG_##flg & DBG_MASK) \
printk(KERN_CONT fmt, ##__VA_ARGS__); \
} while (0)
/* Runtime config options */ /* Runtime config options */
#define HFSPLUS_DEF_CR_TYPE 0x3F3F3F3F /* '????' */ #define HFSPLUS_DEF_CR_TYPE 0x3F3F3F3F /* '????' */
......
...@@ -145,7 +145,7 @@ static int hfsplus_write_inode(struct inode *inode, ...@@ -145,7 +145,7 @@ static int hfsplus_write_inode(struct inode *inode,
{ {
int err; int err;
dprint(DBG_INODE, "hfsplus_write_inode: %lu\n", inode->i_ino); hfs_dbg(INODE, "hfsplus_write_inode: %lu\n", inode->i_ino);
err = hfsplus_ext_write_extent(inode); err = hfsplus_ext_write_extent(inode);
if (err) if (err)
...@@ -160,7 +160,7 @@ static int hfsplus_write_inode(struct inode *inode, ...@@ -160,7 +160,7 @@ static int hfsplus_write_inode(struct inode *inode,
static void hfsplus_evict_inode(struct inode *inode) static void hfsplus_evict_inode(struct inode *inode)
{ {
dprint(DBG_INODE, "hfsplus_evict_inode: %lu\n", inode->i_ino); hfs_dbg(INODE, "hfsplus_evict_inode: %lu\n", inode->i_ino);
truncate_inode_pages(&inode->i_data, 0); truncate_inode_pages(&inode->i_data, 0);
clear_inode(inode); clear_inode(inode);
if (HFSPLUS_IS_RSRC(inode)) { if (HFSPLUS_IS_RSRC(inode)) {
...@@ -179,7 +179,7 @@ static int hfsplus_sync_fs(struct super_block *sb, int wait) ...@@ -179,7 +179,7 @@ static int hfsplus_sync_fs(struct super_block *sb, int wait)
if (!wait) if (!wait)
return 0; return 0;
dprint(DBG_SUPER, "hfsplus_sync_fs\n"); hfs_dbg(SUPER, "hfsplus_sync_fs\n");
/* /*
* Explicitly write out the special metadata inodes. * Explicitly write out the special metadata inodes.
...@@ -275,7 +275,7 @@ static void hfsplus_put_super(struct super_block *sb) ...@@ -275,7 +275,7 @@ static void hfsplus_put_super(struct super_block *sb)
{ {
struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb); struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
dprint(DBG_SUPER, "hfsplus_put_super\n"); hfs_dbg(SUPER, "hfsplus_put_super\n");
cancel_delayed_work_sync(&sbi->sync_work); cancel_delayed_work_sync(&sbi->sync_work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment