diff options
Diffstat (limited to 'fs/umsdos/check.c')
-rw-r--r-- | fs/umsdos/check.c | 82 |
1 files changed, 43 insertions, 39 deletions
diff --git a/fs/umsdos/check.c b/fs/umsdos/check.c index a97f1cb91..41740fd42 100644 --- a/fs/umsdos/check.c +++ b/fs/umsdos/check.c @@ -13,6 +13,7 @@ #include <linux/ptrace.h> #include <linux/mman.h> #include <linux/mm.h> +#include <linux/umsdos_fs.h> #include <asm/system.h> @@ -65,49 +66,52 @@ void check_page_tables (void) void check_sb (struct super_block *sb, const char c) { if (sb) { - Printk ((" (has %c_sb=%d, %d)", - c, MAJOR (sb->s_dev), MINOR (sb->s_dev))); + printk (" (has %c_sb=%d, %d)", + c, MAJOR (sb->s_dev), MINOR (sb->s_dev)); } else { - Printk ((" (%c_sb is NULL)", c)); + printk (" (%c_sb is NULL)", c); } } /* * check an inode */ +extern struct inode_operations umsdos_rdir_inode_operations; void check_inode (struct inode *inode) { if (inode) { - Printk ((KERN_DEBUG "* inode is %lu (i_count=%d)", - inode->i_ino, inode->i_count)); + printk (KERN_DEBUG "* inode is %lu (i_count=%d)", + inode->i_ino, inode->i_count); check_sb (inode->i_sb, 'i'); if (inode->i_dentry.next) { /* FIXME: does this work ? */ - Printk ((" (has i_dentry)")); + printk (" (has i_dentry)"); } else { - Printk ((" (NO i_dentry)")); + printk (" (NO i_dentry)"); } + printk (" (i_patched=%d)", inode->u.umsdos_i.i_patched); + if (inode->i_op == NULL) { - Printk ((" (i_op is NULL)\n")); + printk (" (i_op is NULL)\n"); } else if (inode->i_op == &umsdos_dir_inode_operations) { - Printk ((" (i_op is umsdos_dir_inode_operations)\n")); + printk (" (i_op is umsdos_dir_inode_operations)\n"); } else if (inode->i_op == &umsdos_file_inode_operations) { - Printk ((" (i_op is umsdos_file_inode_operations)\n")); + printk (" (i_op is umsdos_file_inode_operations)\n"); } else if (inode->i_op == &umsdos_file_inode_operations_no_bmap) { - Printk ((" (i_op is umsdos_file_inode_operations_no_bmap)\n")); + printk (" (i_op is umsdos_file_inode_operations_no_bmap)\n"); } else if (inode->i_op == &umsdos_file_inode_operations_readpage) { - Printk ((" (i_op is umsdos_file_inode_operations_readpage)\n")); + printk (" (i_op is umsdos_file_inode_operations_readpage)\n"); } else if (inode->i_op == &umsdos_rdir_inode_operations) { - Printk ((" (i_op is umsdos_rdir_inode_operations)\n")); + printk (" (i_op is umsdos_rdir_inode_operations)\n"); } else if (inode->i_op == &umsdos_symlink_inode_operations) { - Printk ((" (i_op is umsdos_symlink_inode_operations)\n")); + printk (" (i_op is umsdos_symlink_inode_operations)\n"); } else { - Printk ((" (i_op is UNKNOWN: %p)\n", inode->i_op)); + printk ((" (i_op is UNKNOWN: %p)\n", inode->i_op)); } } else { - Printk ((KERN_DEBUG "* inode is NULL\n")); + printk (KERN_DEBUG "* inode is NULL\n"); } } @@ -125,40 +129,40 @@ void checkd_inode (struct inode *inode) return; } - Printk ((KERN_DEBUG "checkd_inode: inode %lu\n", inode->i_ino)); + printk (KERN_DEBUG "checkd_inode: inode %lu\n", inode->i_ino); cur = inode->i_dentry.next; while (count++ < 10) { PRINTK (("1...")); if (!cur) { - Printk ((KERN_ERR "checkd_inode: *** NULL reached. exit.\n")); + printk (KERN_ERR "checkd_inode: *** NULL reached. exit.\n"); return; } PRINTK (("2...")); ret = list_entry (cur, struct dentry, d_alias); PRINTK (("3...")); if (cur == cur->next) { - Printk ((KERN_DEBUG "checkd_inode: *** cur=cur->next: normal exit.\n")); + printk (KERN_DEBUG "checkd_inode: *** cur=cur->next: normal exit.\n"); return; } PRINTK (("4...")); if (!ret) { - Printk ((KERN_ERR "checkd_inode: *** ret dentry is NULL. exit.\n")); + printk (KERN_ERR "checkd_inode: *** ret dentry is NULL. exit.\n"); return; } PRINTK (("5... (ret=%p)...", ret)); PRINTK (("5.1.. (ret->d_dname=%p)...", &(ret->d_name))); PRINTK (("5.1.1. (ret->d_dname.len=%d)...", (int) ret->d_name.len)); PRINTK (("5.1.2. (ret->d_dname.name=%c)...", ret->d_name.name)); - Printk ((KERN_DEBUG "checkd_inode: i_dentry is %.*s\n", (int) ret->d_name.len, ret->d_name.name)); + printk (KERN_DEBUG "checkd_inode: i_dentry is %.*s\n", (int) ret->d_name.len, ret->d_name.name); PRINTK (("6...")); cur = cur->next; PRINTK (("7...")); #if 1 - Printk ((KERN_DEBUG "checkd_inode: *** finished after count 1 (operator forced)\n")); + printk (KERN_DEBUG "checkd_inode: *** finished after count 1 (operator forced)\n"); return; #endif } - Printk ((KERN_ERR "checkd_inode: *** OVER LIMIT (loop?) !\n")); + printk (KERN_ERR "checkd_inode: *** OVER LIMIT (loop?) !\n"); return; } @@ -170,19 +174,19 @@ void checkd_inode (struct inode *inode) void check_dent_int (struct dentry *dentry, int parent) { if (parent) { - Printk ((KERN_DEBUG "* parent(%d) dentry: %.*s\n", - parent, (int) dentry->d_name.len, dentry->d_name.name)); + printk (KERN_DEBUG "* parent(%d) dentry: %.*s\n", + parent, (int) dentry->d_name.len, dentry->d_name.name); } else { - Printk ((KERN_DEBUG "* checking dentry: %.*s\n", - (int) dentry->d_name.len, dentry->d_name.name)); + printk (KERN_DEBUG "* checking dentry: %.*s\n", + (int) dentry->d_name.len, dentry->d_name.name); } check_inode (dentry->d_inode); - Printk ((KERN_DEBUG "* d_count=%d", dentry->d_count)); + printk (KERN_DEBUG "* d_count=%d", dentry->d_count); check_sb (dentry->d_sb, 'd'); if (dentry->d_op == NULL) { - Printk ((" (d_op is NULL)\n")); + printk (" (d_op is NULL)\n"); } else { - Printk ((" (d_op is UNKNOWN: %p)\n", dentry->d_op)); + printk (" (d_op is UNKNOWN: %p)\n", dentry->d_op); } } @@ -194,35 +198,35 @@ void check_dent_int (struct dentry *dentry, int parent) void check_dentry_path (struct dentry *dentry, const char *desc) { int count=0; - Printk ((KERN_DEBUG "*** check_dentry_path: %.60s\n", desc)); + printk (KERN_DEBUG "*** check_dentry_path: %.60s\n", desc); if (!dentry) { - Printk ((KERN_DEBUG "*** checking dentry... it is NULL !\n")); + printk (KERN_DEBUG "*** checking dentry... it is NULL !\n"); return; } if (IS_ERR(dentry)) { - Printk ((KERN_DEBUG "*** checking dentry... it is ERR(%ld) !\n", - PTR_ERR(dentry))); + printk (KERN_DEBUG "*** checking dentry... it is ERR(%ld) !\n", + PTR_ERR(dentry)); return; } while (dentry && count < 10) { check_dent_int (dentry, count++); if (dentry == dentry->d_parent) { - Printk ((KERN_DEBUG "*** end checking dentry (root reached ok)\n")); + printk (KERN_DEBUG "*** end checking dentry (root reached ok)\n"); break; } dentry = dentry->d_parent; } if (count >= 10) { /* if infinite loop detected */ - Printk ((KERN_ERR - "*** WARNING ! INFINITE LOOP ! check_dentry_path aborted !\n")); + printk (KERN_ERR + "*** WARNING ! INFINITE LOOP ! check_dentry_path aborted !\n"); } if (!dentry) { - Printk ((KERN_ERR - "*** WARNING ! NULL dentry ! check_dentry_path aborted !\n")); + printk (KERN_ERR + "*** WARNING ! NULL dentry ! check_dentry_path aborted !\n"); } } #else |