diff options
author | Joe Perches <joe@perches.com> | 2012-02-15 18:56:43 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-26 19:39:24 -0400 |
commit | 9c261b33a9c417ccaf07f41796be278d09d02d49 (patch) | |
tree | 6cf47f47364647dfbba845c0fd3f05539072175a /fs/jffs2/dir.c | |
parent | bf011f2ed53d587fdd8148c173c4f09ed77bdf1a (diff) |
jffs2: Convert most D1/D2 macros to jffs2_dbg
D1 and D2 macros are mostly uses to emit debugging messages.
Convert the logging uses of D1 & D2 to jffs2_dbg(level, fmt, ...)
to be a bit more consistent style with the rest of the kernel.
All jffs2_dbg output is now at KERN_DEBUG where some of
the previous uses were emitted at various KERN_<LEVEL>s.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2/dir.c')
-rw-r--r-- | fs/jffs2/dir.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 973ac5822bd7..01a07af0021d 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -79,7 +79,7 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target, | |||
79 | uint32_t ino = 0; | 79 | uint32_t ino = 0; |
80 | struct inode *inode = NULL; | 80 | struct inode *inode = NULL; |
81 | 81 | ||
82 | D1(printk(KERN_DEBUG "jffs2_lookup()\n")); | 82 | jffs2_dbg(1, "jffs2_lookup()\n"); |
83 | 83 | ||
84 | if (target->d_name.len > JFFS2_MAX_NAME_LEN) | 84 | if (target->d_name.len > JFFS2_MAX_NAME_LEN) |
85 | return ERR_PTR(-ENAMETOOLONG); | 85 | return ERR_PTR(-ENAMETOOLONG); |
@@ -119,21 +119,22 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
119 | struct jffs2_full_dirent *fd; | 119 | struct jffs2_full_dirent *fd; |
120 | unsigned long offset, curofs; | 120 | unsigned long offset, curofs; |
121 | 121 | ||
122 | D1(printk(KERN_DEBUG "jffs2_readdir() for dir_i #%lu\n", filp->f_path.dentry->d_inode->i_ino)); | 122 | jffs2_dbg(1, "jffs2_readdir() for dir_i #%lu\n", |
123 | filp->f_path.dentry->d_inode->i_ino); | ||
123 | 124 | ||
124 | f = JFFS2_INODE_INFO(inode); | 125 | f = JFFS2_INODE_INFO(inode); |
125 | 126 | ||
126 | offset = filp->f_pos; | 127 | offset = filp->f_pos; |
127 | 128 | ||
128 | if (offset == 0) { | 129 | if (offset == 0) { |
129 | D1(printk(KERN_DEBUG "Dirent 0: \".\", ino #%lu\n", inode->i_ino)); | 130 | jffs2_dbg(1, "Dirent 0: \".\", ino #%lu\n", inode->i_ino); |
130 | if (filldir(dirent, ".", 1, 0, inode->i_ino, DT_DIR) < 0) | 131 | if (filldir(dirent, ".", 1, 0, inode->i_ino, DT_DIR) < 0) |
131 | goto out; | 132 | goto out; |
132 | offset++; | 133 | offset++; |
133 | } | 134 | } |
134 | if (offset == 1) { | 135 | if (offset == 1) { |
135 | unsigned long pino = parent_ino(filp->f_path.dentry); | 136 | unsigned long pino = parent_ino(filp->f_path.dentry); |
136 | D1(printk(KERN_DEBUG "Dirent 1: \"..\", ino #%lu\n", pino)); | 137 | jffs2_dbg(1, "Dirent 1: \"..\", ino #%lu\n", pino); |
137 | if (filldir(dirent, "..", 2, 1, pino, DT_DIR) < 0) | 138 | if (filldir(dirent, "..", 2, 1, pino, DT_DIR) < 0) |
138 | goto out; | 139 | goto out; |
139 | offset++; | 140 | offset++; |
@@ -146,16 +147,18 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
146 | curofs++; | 147 | curofs++; |
147 | /* First loop: curofs = 2; offset = 2 */ | 148 | /* First loop: curofs = 2; offset = 2 */ |
148 | if (curofs < offset) { | 149 | if (curofs < offset) { |
149 | D2(printk(KERN_DEBUG "Skipping dirent: \"%s\", ino #%u, type %d, because curofs %ld < offset %ld\n", | 150 | jffs2_dbg(2, "Skipping dirent: \"%s\", ino #%u, type %d, because curofs %ld < offset %ld\n", |
150 | fd->name, fd->ino, fd->type, curofs, offset)); | 151 | fd->name, fd->ino, fd->type, curofs, offset); |
151 | continue; | 152 | continue; |
152 | } | 153 | } |
153 | if (!fd->ino) { | 154 | if (!fd->ino) { |
154 | D2(printk(KERN_DEBUG "Skipping deletion dirent \"%s\"\n", fd->name)); | 155 | jffs2_dbg(2, "Skipping deletion dirent \"%s\"\n", |
156 | fd->name); | ||
155 | offset++; | 157 | offset++; |
156 | continue; | 158 | continue; |
157 | } | 159 | } |
158 | D2(printk(KERN_DEBUG "Dirent %ld: \"%s\", ino #%u, type %d\n", offset, fd->name, fd->ino, fd->type)); | 160 | jffs2_dbg(2, "Dirent %ld: \"%s\", ino #%u, type %d\n", |
161 | offset, fd->name, fd->ino, fd->type); | ||
159 | if (filldir(dirent, fd->name, strlen(fd->name), offset, fd->ino, fd->type) < 0) | 162 | if (filldir(dirent, fd->name, strlen(fd->name), offset, fd->ino, fd->type) < 0) |
160 | break; | 163 | break; |
161 | offset++; | 164 | offset++; |
@@ -184,12 +187,12 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry, | |||
184 | 187 | ||
185 | c = JFFS2_SB_INFO(dir_i->i_sb); | 188 | c = JFFS2_SB_INFO(dir_i->i_sb); |
186 | 189 | ||
187 | D1(printk(KERN_DEBUG "jffs2_create()\n")); | 190 | jffs2_dbg(1, "%s()\n", __func__); |
188 | 191 | ||
189 | inode = jffs2_new_inode(dir_i, mode, ri); | 192 | inode = jffs2_new_inode(dir_i, mode, ri); |
190 | 193 | ||
191 | if (IS_ERR(inode)) { | 194 | if (IS_ERR(inode)) { |
192 | D1(printk(KERN_DEBUG "jffs2_new_inode() failed\n")); | 195 | jffs2_dbg(1, "jffs2_new_inode() failed\n"); |
193 | jffs2_free_raw_inode(ri); | 196 | jffs2_free_raw_inode(ri); |
194 | return PTR_ERR(inode); | 197 | return PTR_ERR(inode); |
195 | } | 198 | } |
@@ -217,9 +220,9 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry, | |||
217 | 220 | ||
218 | jffs2_free_raw_inode(ri); | 221 | jffs2_free_raw_inode(ri); |
219 | 222 | ||
220 | D1(printk(KERN_DEBUG "jffs2_create: Created ino #%lu with mode %o, nlink %d(%d). nrpages %ld\n", | 223 | jffs2_dbg(1, "%s(): Created ino #%lu with mode %o, nlink %d(%d). nrpages %ld\n", |
221 | inode->i_ino, inode->i_mode, inode->i_nlink, | 224 | __func__, inode->i_ino, inode->i_mode, inode->i_nlink, |
222 | f->inocache->pino_nlink, inode->i_mapping->nrpages)); | 225 | f->inocache->pino_nlink, inode->i_mapping->nrpages); |
223 | 226 | ||
224 | d_instantiate(dentry, inode); | 227 | d_instantiate(dentry, inode); |
225 | unlock_new_inode(inode); | 228 | unlock_new_inode(inode); |
@@ -369,7 +372,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char | |||
369 | goto fail; | 372 | goto fail; |
370 | } | 373 | } |
371 | 374 | ||
372 | D1(printk(KERN_DEBUG "jffs2_symlink: symlink's target '%s' cached\n", (char *)f->target)); | 375 | jffs2_dbg(1, "%s(): symlink's target '%s' cached\n", |
376 | __func__, (char *)f->target); | ||
373 | 377 | ||
374 | /* No data here. Only a metadata node, which will be | 378 | /* No data here. Only a metadata node, which will be |
375 | obsoleted by the first data write | 379 | obsoleted by the first data write |