Commit 0a935519 authored by Boaz Harrosh's avatar Boaz Harrosh

exofs: Trivial: fix some indentation and debug prints

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: default avatarBoaz Harrosh <bharrosh@panasas.com>
parent 2c722c9a
...@@ -124,7 +124,7 @@ static void exofs_check_page(struct page *page) ...@@ -124,7 +124,7 @@ static void exofs_check_page(struct page *page)
Ebadsize: Ebadsize:
EXOFS_ERR("ERROR [exofs_check_page]: " 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 dir->i_ino
); );
goto fail; goto fail;
...@@ -142,8 +142,8 @@ static void exofs_check_page(struct page *page) ...@@ -142,8 +142,8 @@ static void exofs_check_page(struct page *page)
goto bad_entry; goto bad_entry;
bad_entry: bad_entry:
EXOFS_ERR( EXOFS_ERR(
"ERROR [exofs_check_page]: bad entry in directory #%lu: %s - " "ERROR [exofs_check_page]: bad entry in directory(0x%lx): %s - "
"offset=%lu, inode=%llu, rec_len=%d, name_len=%d", "offset=%lu, inode=0x%llu, rec_len=%d, name_len=%d\n",
dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs, dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs,
_LLU(le64_to_cpu(p->inode_no)), _LLU(le64_to_cpu(p->inode_no)),
rec_len, p->name_len); rec_len, p->name_len);
...@@ -151,8 +151,8 @@ static void exofs_check_page(struct page *page) ...@@ -151,8 +151,8 @@ static void exofs_check_page(struct page *page)
Eend: Eend:
p = (struct exofs_dir_entry *)(kaddr + offs); p = (struct exofs_dir_entry *)(kaddr + offs);
EXOFS_ERR("ERROR [exofs_check_page]: " EXOFS_ERR("ERROR [exofs_check_page]: "
"entry in directory #%lu spans the page boundary" "entry in directory(0x%lx) spans the page boundary"
"offset=%lu, inode=%llu", "offset=%lu, inode=0x%llx\n",
dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs, dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs,
_LLU(le64_to_cpu(p->inode_no))); _LLU(le64_to_cpu(p->inode_no)));
fail: fail:
...@@ -261,9 +261,8 @@ exofs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -261,9 +261,8 @@ exofs_readdir(struct file *filp, void *dirent, filldir_t filldir)
struct page *page = exofs_get_page(inode, n); struct page *page = exofs_get_page(inode, n);
if (IS_ERR(page)) { if (IS_ERR(page)) {
EXOFS_ERR("ERROR: " EXOFS_ERR("ERROR: bad page in directory(0x%lx)\n",
"bad page in #%lu", inode->i_ino);
inode->i_ino);
filp->f_pos += PAGE_CACHE_SIZE - offset; filp->f_pos += PAGE_CACHE_SIZE - offset;
return PTR_ERR(page); return PTR_ERR(page);
} }
...@@ -283,7 +282,8 @@ exofs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -283,7 +282,8 @@ exofs_readdir(struct file *filp, void *dirent, filldir_t filldir)
for (; (char *)de <= limit; de = exofs_next_entry(de)) { for (; (char *)de <= limit; de = exofs_next_entry(de)) {
if (de->rec_len == 0) { if (de->rec_len == 0) {
EXOFS_ERR("ERROR: " EXOFS_ERR("ERROR: "
"zero-length directory entry"); "zero-length entry in directory(0x%lx)\n",
inode->i_ino);
exofs_put_page(page); exofs_put_page(page);
return -EIO; return -EIO;
} }
...@@ -342,9 +342,9 @@ struct exofs_dir_entry *exofs_find_entry(struct inode *dir, ...@@ -342,9 +342,9 @@ struct exofs_dir_entry *exofs_find_entry(struct inode *dir,
kaddr += exofs_last_byte(dir, n) - reclen; kaddr += exofs_last_byte(dir, n) - reclen;
while ((char *) de <= kaddr) { while ((char *) de <= kaddr) {
if (de->rec_len == 0) { if (de->rec_len == 0) {
EXOFS_ERR( EXOFS_ERR("ERROR: zero-length entry in "
"ERROR: exofs_find_entry: " "directory(0x%lx)\n",
"zero-length directory entry"); dir->i_ino);
exofs_put_page(page); exofs_put_page(page);
goto out; goto out;
} }
...@@ -472,7 +472,8 @@ int exofs_add_link(struct dentry *dentry, struct inode *inode) ...@@ -472,7 +472,8 @@ int exofs_add_link(struct dentry *dentry, struct inode *inode)
} }
if (de->rec_len == 0) { if (de->rec_len == 0) {
EXOFS_ERR("ERROR: exofs_add_link: " EXOFS_ERR("ERROR: exofs_add_link: "
"zero-length directory entry"); "zero-length entry in directory(0x%lx)\n",
inode->i_ino);
err = -EIO; err = -EIO;
goto out_unlock; goto out_unlock;
} }
...@@ -491,7 +492,8 @@ int exofs_add_link(struct dentry *dentry, struct inode *inode) ...@@ -491,7 +492,8 @@ int exofs_add_link(struct dentry *dentry, struct inode *inode)
exofs_put_page(page); 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; return -EINVAL;
got_it: got_it:
...@@ -542,7 +544,8 @@ int exofs_delete_entry(struct exofs_dir_entry *dir, struct page *page) ...@@ -542,7 +544,8 @@ int exofs_delete_entry(struct exofs_dir_entry *dir, struct page *page)
while (de < dir) { while (de < dir) {
if (de->rec_len == 0) { if (de->rec_len == 0) {
EXOFS_ERR("ERROR: exofs_delete_entry:" EXOFS_ERR("ERROR: exofs_delete_entry:"
"zero-length directory entry"); "zero-length entry in directory(0x%lx)\n",
inode->i_ino);
err = -EIO; err = -EIO;
goto out; goto out;
} }
......
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