Skip to content

Commit

Permalink
exofs: Trivial: fix some indentation and debug prints
Browse files Browse the repository at this point in the history
I stumbled on some of these prints in log files so, might
just submit the fixes.

* All i_ino prints in exofs should be hex
* All OSD_ERR prints should end with a "\n"

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
  • Loading branch information
Boaz Harrosh committed Mar 15, 2011
1 parent 2c722c9 commit 0a93551
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions fs/exofs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static void exofs_check_page(struct page *page)

Ebadsize:
EXOFS_ERR("ERROR [exofs_check_page]: "
"size of directory #%lu is not a multiple of chunk size",
"size of directory(0x%lx) is not a multiple of chunk size\n",
dir->i_ino
);
goto fail;
Expand All @@ -142,17 +142,17 @@ static void exofs_check_page(struct page *page)
goto bad_entry;
bad_entry:
EXOFS_ERR(
"ERROR [exofs_check_page]: bad entry in directory #%lu: %s - "
"offset=%lu, inode=%llu, rec_len=%d, name_len=%d",
"ERROR [exofs_check_page]: bad entry in directory(0x%lx): %s - "
"offset=%lu, inode=0x%llu, rec_len=%d, name_len=%d\n",
dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs,
_LLU(le64_to_cpu(p->inode_no)),
rec_len, p->name_len);
goto fail;
Eend:
p = (struct exofs_dir_entry *)(kaddr + offs);
EXOFS_ERR("ERROR [exofs_check_page]: "
"entry in directory #%lu spans the page boundary"
"offset=%lu, inode=%llu",
"entry in directory(0x%lx) spans the page boundary"
"offset=%lu, inode=0x%llx\n",
dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs,
_LLU(le64_to_cpu(p->inode_no)));
fail:
Expand Down Expand Up @@ -261,9 +261,8 @@ exofs_readdir(struct file *filp, void *dirent, filldir_t filldir)
struct page *page = exofs_get_page(inode, n);

if (IS_ERR(page)) {
EXOFS_ERR("ERROR: "
"bad page in #%lu",
inode->i_ino);
EXOFS_ERR("ERROR: bad page in directory(0x%lx)\n",
inode->i_ino);
filp->f_pos += PAGE_CACHE_SIZE - offset;
return PTR_ERR(page);
}
Expand All @@ -283,7 +282,8 @@ exofs_readdir(struct file *filp, void *dirent, filldir_t filldir)
for (; (char *)de <= limit; de = exofs_next_entry(de)) {
if (de->rec_len == 0) {
EXOFS_ERR("ERROR: "
"zero-length directory entry");
"zero-length entry in directory(0x%lx)\n",
inode->i_ino);
exofs_put_page(page);
return -EIO;
}
Expand Down Expand Up @@ -342,9 +342,9 @@ struct exofs_dir_entry *exofs_find_entry(struct inode *dir,
kaddr += exofs_last_byte(dir, n) - reclen;
while ((char *) de <= kaddr) {
if (de->rec_len == 0) {
EXOFS_ERR(
"ERROR: exofs_find_entry: "
"zero-length directory entry");
EXOFS_ERR("ERROR: zero-length entry in "
"directory(0x%lx)\n",
dir->i_ino);
exofs_put_page(page);
goto out;
}
Expand Down Expand Up @@ -472,7 +472,8 @@ int exofs_add_link(struct dentry *dentry, struct inode *inode)
}
if (de->rec_len == 0) {
EXOFS_ERR("ERROR: exofs_add_link: "
"zero-length directory entry");
"zero-length entry in directory(0x%lx)\n",
inode->i_ino);
err = -EIO;
goto out_unlock;
}
Expand All @@ -491,7 +492,8 @@ int exofs_add_link(struct dentry *dentry, struct inode *inode)
exofs_put_page(page);
}

EXOFS_ERR("exofs_add_link: BAD dentry=%p or inode=%p", dentry, inode);
EXOFS_ERR("exofs_add_link: BAD dentry=%p or inode=0x%lx\n",
dentry, inode->i_ino);
return -EINVAL;

got_it:
Expand Down Expand Up @@ -542,7 +544,8 @@ int exofs_delete_entry(struct exofs_dir_entry *dir, struct page *page)
while (de < dir) {
if (de->rec_len == 0) {
EXOFS_ERR("ERROR: exofs_delete_entry:"
"zero-length directory entry");
"zero-length entry in directory(0x%lx)\n",
inode->i_ino);
err = -EIO;
goto out;
}
Expand Down

0 comments on commit 0a93551

Please sign in to comment.