aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/namei.c
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2006-06-25 08:47:24 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:03 -0400
commitabf5d15fd2e52517dd56a17a846d5a1f900b7db4 (patch)
treeea537760c201cea57b468044dc733e06781ece2b /fs/ufs/namei.c
parent5afb3145c9a733166174e1f5a07c46410b5c4091 (diff)
[PATCH] ufs: easy debug
Currently to turn on debug mode "user" has to edit ~10 files, to turn off he has to do it again. This patch introduce such changes: 1)turn on(off) debug messages via ".config" 2)remove unnecessary duplication of code 3)make "UFSD" macros more similar to function 4)fix some compiler warnings Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ufs/namei.c')
-rw-r--r--fs/ufs/namei.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c
index 364bb92b0917..abd5f23a426d 100644
--- a/fs/ufs/namei.c
+++ b/fs/ufs/namei.c
@@ -34,17 +34,6 @@
34#include "swab.h" /* will go away - see comment in mknod() */ 34#include "swab.h" /* will go away - see comment in mknod() */
35#include "util.h" 35#include "util.h"
36 36
37/*
38#undef UFS_NAMEI_DEBUG
39*/
40#define UFS_NAMEI_DEBUG
41
42#ifdef UFS_NAMEI_DEBUG
43#define UFSD(x) printk("(%s, %d), %s: ", __FILE__, __LINE__, __FUNCTION__); printk x;
44#else
45#define UFSD(x)
46#endif
47
48static inline int ufs_add_nondir(struct dentry *dentry, struct inode *inode) 37static inline int ufs_add_nondir(struct dentry *dentry, struct inode *inode)
49{ 38{
50 int err = ufs_add_link(dentry, inode); 39 int err = ufs_add_link(dentry, inode);
@@ -90,8 +79,13 @@ static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, stru
90static int ufs_create (struct inode * dir, struct dentry * dentry, int mode, 79static int ufs_create (struct inode * dir, struct dentry * dentry, int mode,
91 struct nameidata *nd) 80 struct nameidata *nd)
92{ 81{
93 struct inode * inode = ufs_new_inode(dir, mode); 82 struct inode *inode;
94 int err = PTR_ERR(inode); 83 int err;
84
85 UFSD("BEGIN\n");
86 inode = ufs_new_inode(dir, mode);
87 err = PTR_ERR(inode);
88
95 if (!IS_ERR(inode)) { 89 if (!IS_ERR(inode)) {
96 inode->i_op = &ufs_file_inode_operations; 90 inode->i_op = &ufs_file_inode_operations;
97 inode->i_fop = &ufs_file_operations; 91 inode->i_fop = &ufs_file_operations;
@@ -101,6 +95,7 @@ static int ufs_create (struct inode * dir, struct dentry * dentry, int mode,
101 err = ufs_add_nondir(dentry, inode); 95 err = ufs_add_nondir(dentry, inode);
102 unlock_kernel(); 96 unlock_kernel();
103 } 97 }
98 UFSD("END: err=%d\n", err);
104 return err; 99 return err;
105} 100}
106 101