diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-06-04 19:12:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:54:20 -0400 |
commit | f403d1dbac6d1ef28f553f3996d5bb5cea90ce15 (patch) | |
tree | 08e96ff86dcaf465b8e2ce4c27158b211f789188 | |
parent | 179b87fb186b524ec75a5d54c0d7f25e8d559415 (diff) |
fs/efs: add pr_fmt / use __func__
Also uniformize function arguments.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/efs/dir.c | 11 | ||||
-rw-r--r-- | fs/efs/efs.h | 6 | ||||
-rw-r--r-- | fs/efs/file.c | 12 | ||||
-rw-r--r-- | fs/efs/inode.c | 24 | ||||
-rw-r--r-- | fs/efs/namei.c | 8 | ||||
-rw-r--r-- | fs/efs/super.c | 23 |
6 files changed, 49 insertions, 35 deletions
diff --git a/fs/efs/dir.c b/fs/efs/dir.c index 46a9a607e4ac..7f970315b6c3 100644 --- a/fs/efs/dir.c +++ b/fs/efs/dir.c | |||
@@ -26,7 +26,8 @@ static int efs_readdir(struct file *file, struct dir_context *ctx) | |||
26 | int slot; | 26 | int slot; |
27 | 27 | ||
28 | if (inode->i_size & (EFS_DIRBSIZE-1)) | 28 | if (inode->i_size & (EFS_DIRBSIZE-1)) |
29 | pr_warn("EFS: WARNING: readdir(): directory size not a multiple of EFS_DIRBSIZE\n"); | 29 | pr_warn("%s(): directory size not a multiple of EFS_DIRBSIZE\n", |
30 | __func__); | ||
30 | 31 | ||
31 | /* work out where this entry can be found */ | 32 | /* work out where this entry can be found */ |
32 | block = ctx->pos >> EFS_DIRBSIZE_BITS; | 33 | block = ctx->pos >> EFS_DIRBSIZE_BITS; |
@@ -43,14 +44,15 @@ static int efs_readdir(struct file *file, struct dir_context *ctx) | |||
43 | bh = sb_bread(inode->i_sb, efs_bmap(inode, block)); | 44 | bh = sb_bread(inode->i_sb, efs_bmap(inode, block)); |
44 | 45 | ||
45 | if (!bh) { | 46 | if (!bh) { |
46 | pr_err("EFS: readdir(): failed to read dir block %d\n", block); | 47 | pr_err("%s(): failed to read dir block %d\n", |
48 | __func__, block); | ||
47 | break; | 49 | break; |
48 | } | 50 | } |
49 | 51 | ||
50 | dirblock = (struct efs_dir *) bh->b_data; | 52 | dirblock = (struct efs_dir *) bh->b_data; |
51 | 53 | ||
52 | if (be16_to_cpu(dirblock->magic) != EFS_DIRBLK_MAGIC) { | 54 | if (be16_to_cpu(dirblock->magic) != EFS_DIRBLK_MAGIC) { |
53 | pr_err("EFS: readdir(): invalid directory block\n"); | 55 | pr_err("%s(): invalid directory block\n", __func__); |
54 | brelse(bh); | 56 | brelse(bh); |
55 | break; | 57 | break; |
56 | } | 58 | } |
@@ -80,7 +82,8 @@ static int efs_readdir(struct file *file, struct dir_context *ctx) | |||
80 | 82 | ||
81 | /* sanity check */ | 83 | /* sanity check */ |
82 | if (nameptr - (char *) dirblock + namelen > EFS_DIRBSIZE) { | 84 | if (nameptr - (char *) dirblock + namelen > EFS_DIRBSIZE) { |
83 | pr_warn("EFS: directory entry %d exceeds directory block\n", slot); | 85 | pr_warn("directory entry %d exceeds directory block\n", |
86 | slot); | ||
84 | continue; | 87 | continue; |
85 | } | 88 | } |
86 | 89 | ||
diff --git a/fs/efs/efs.h b/fs/efs/efs.h index 5528926ac7f6..5bbf9612140c 100644 --- a/fs/efs/efs.h +++ b/fs/efs/efs.h | |||
@@ -7,6 +7,12 @@ | |||
7 | #ifndef _EFS_EFS_H_ | 7 | #ifndef _EFS_EFS_H_ |
8 | #define _EFS_EFS_H_ | 8 | #define _EFS_EFS_H_ |
9 | 9 | ||
10 | #ifdef pr_fmt | ||
11 | #undef pr_fmt | ||
12 | #endif | ||
13 | |||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
15 | |||
10 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
11 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
12 | 18 | ||
diff --git a/fs/efs/file.c b/fs/efs/file.c index a75c7100aa01..a37dcee46866 100644 --- a/fs/efs/file.c +++ b/fs/efs/file.c | |||
@@ -22,10 +22,8 @@ int efs_get_block(struct inode *inode, sector_t iblock, | |||
22 | /* | 22 | /* |
23 | * i have no idea why this happens as often as it does | 23 | * i have no idea why this happens as often as it does |
24 | */ | 24 | */ |
25 | pr_warn("EFS: bmap(): block %d >= %ld (filesize %ld)\n", | 25 | pr_warn("%s(): block %d >= %ld (filesize %ld)\n", |
26 | block, | 26 | __func__, block, inode->i_blocks, inode->i_size); |
27 | inode->i_blocks, | ||
28 | inode->i_size); | ||
29 | #endif | 27 | #endif |
30 | return 0; | 28 | return 0; |
31 | } | 29 | } |
@@ -38,7 +36,7 @@ int efs_get_block(struct inode *inode, sector_t iblock, | |||
38 | int efs_bmap(struct inode *inode, efs_block_t block) { | 36 | int efs_bmap(struct inode *inode, efs_block_t block) { |
39 | 37 | ||
40 | if (block < 0) { | 38 | if (block < 0) { |
41 | pr_warn("EFS: bmap(): block < 0\n"); | 39 | pr_warn("%s(): block < 0\n", __func__); |
42 | return 0; | 40 | return 0; |
43 | } | 41 | } |
44 | 42 | ||
@@ -48,8 +46,8 @@ int efs_bmap(struct inode *inode, efs_block_t block) { | |||
48 | /* | 46 | /* |
49 | * i have no idea why this happens as often as it does | 47 | * i have no idea why this happens as often as it does |
50 | */ | 48 | */ |
51 | pr_warn("EFS: bmap(): block %d >= %ld (filesize %ld)\n", | 49 | pr_warn("%s(): block %d >= %ld (filesize %ld)\n", |
52 | block, inode->i_blocks, inode->i_size); | 50 | __func__, block, inode->i_blocks, inode->i_size); |
53 | #endif | 51 | #endif |
54 | return 0; | 52 | return 0; |
55 | } | 53 | } |
diff --git a/fs/efs/inode.c b/fs/efs/inode.c index 54f1cbbf48a9..6c9684aa7158 100644 --- a/fs/efs/inode.c +++ b/fs/efs/inode.c | |||
@@ -89,7 +89,7 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino) | |||
89 | 89 | ||
90 | bh = sb_bread(inode->i_sb, block); | 90 | bh = sb_bread(inode->i_sb, block); |
91 | if (!bh) { | 91 | if (!bh) { |
92 | pr_warn("EFS: bread() failed at block %d\n", block); | 92 | pr_warn("%s() failed at block %d\n", __func__, block); |
93 | goto read_inode_error; | 93 | goto read_inode_error; |
94 | } | 94 | } |
95 | 95 | ||
@@ -130,7 +130,8 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino) | |||
130 | for(i = 0; i < EFS_DIRECTEXTENTS; i++) { | 130 | for(i = 0; i < EFS_DIRECTEXTENTS; i++) { |
131 | extent_copy(&(efs_inode->di_u.di_extents[i]), &(in->extents[i])); | 131 | extent_copy(&(efs_inode->di_u.di_extents[i]), &(in->extents[i])); |
132 | if (i < in->numextents && in->extents[i].cooked.ex_magic != 0) { | 132 | if (i < in->numextents && in->extents[i].cooked.ex_magic != 0) { |
133 | pr_warn("EFS: extent %d has bad magic number in inode %lu\n", i, inode->i_ino); | 133 | pr_warn("extent %d has bad magic number in inode %lu\n", |
134 | i, inode->i_ino); | ||
134 | brelse(bh); | 135 | brelse(bh); |
135 | goto read_inode_error; | 136 | goto read_inode_error; |
136 | } | 137 | } |
@@ -162,7 +163,7 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino) | |||
162 | init_special_inode(inode, inode->i_mode, device); | 163 | init_special_inode(inode, inode->i_mode, device); |
163 | break; | 164 | break; |
164 | default: | 165 | default: |
165 | pr_warn("EFS: unsupported inode mode %o\n", inode->i_mode); | 166 | pr_warn("unsupported inode mode %o\n", inode->i_mode); |
166 | goto read_inode_error; | 167 | goto read_inode_error; |
167 | break; | 168 | break; |
168 | } | 169 | } |
@@ -171,7 +172,7 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino) | |||
171 | return inode; | 172 | return inode; |
172 | 173 | ||
173 | read_inode_error: | 174 | read_inode_error: |
174 | pr_warn("EFS: failed to read inode %lu\n", inode->i_ino); | 175 | pr_warn("failed to read inode %lu\n", inode->i_ino); |
175 | iget_failed(inode); | 176 | iget_failed(inode); |
176 | return ERR_PTR(-EIO); | 177 | return ERR_PTR(-EIO); |
177 | } | 178 | } |
@@ -216,7 +217,7 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) { | |||
216 | 217 | ||
217 | /* if we only have one extent then nothing can be found */ | 218 | /* if we only have one extent then nothing can be found */ |
218 | if (in->numextents == 1) { | 219 | if (in->numextents == 1) { |
219 | pr_err("EFS: map_block() failed to map (1 extent)\n"); | 220 | pr_err("%s() failed to map (1 extent)\n", __func__); |
220 | return 0; | 221 | return 0; |
221 | } | 222 | } |
222 | 223 | ||
@@ -234,7 +235,7 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) { | |||
234 | } | 235 | } |
235 | } | 236 | } |
236 | 237 | ||
237 | pr_err("EFS: map_block() failed to map block %u (dir)\n", block); | 238 | pr_err("%s() failed to map block %u (dir)\n", __func__, block); |
238 | return 0; | 239 | return 0; |
239 | } | 240 | } |
240 | 241 | ||
@@ -262,7 +263,8 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) { | |||
262 | 263 | ||
263 | if (dirext == direxts) { | 264 | if (dirext == direxts) { |
264 | /* should never happen */ | 265 | /* should never happen */ |
265 | pr_err("EFS: couldn't find direct extent for indirect extent %d (block %u)\n", cur, block); | 266 | pr_err("couldn't find direct extent for indirect extent %d (block %u)\n", |
267 | cur, block); | ||
266 | if (bh) brelse(bh); | 268 | if (bh) brelse(bh); |
267 | return 0; | 269 | return 0; |
268 | } | 270 | } |
@@ -279,7 +281,8 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) { | |||
279 | 281 | ||
280 | bh = sb_bread(inode->i_sb, iblock); | 282 | bh = sb_bread(inode->i_sb, iblock); |
281 | if (!bh) { | 283 | if (!bh) { |
282 | pr_err("EFS: bread() failed at block %d\n", iblock); | 284 | pr_err("%s() failed at block %d\n", |
285 | __func__, iblock); | ||
283 | return 0; | 286 | return 0; |
284 | } | 287 | } |
285 | #ifdef DEBUG | 288 | #ifdef DEBUG |
@@ -294,7 +297,8 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) { | |||
294 | extent_copy(&(exts[ioffset]), &ext); | 297 | extent_copy(&(exts[ioffset]), &ext); |
295 | 298 | ||
296 | if (ext.cooked.ex_magic != 0) { | 299 | if (ext.cooked.ex_magic != 0) { |
297 | pr_err("EFS: extent %d has bad magic number in block %d\n", cur, iblock); | 300 | pr_err("extent %d has bad magic number in block %d\n", |
301 | cur, iblock); | ||
298 | if (bh) brelse(bh); | 302 | if (bh) brelse(bh); |
299 | return 0; | 303 | return 0; |
300 | } | 304 | } |
@@ -306,7 +310,7 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) { | |||
306 | } | 310 | } |
307 | } | 311 | } |
308 | if (bh) brelse(bh); | 312 | if (bh) brelse(bh); |
309 | pr_err("EFS: map_block() failed to map block %u (indir)\n", block); | 313 | pr_err("%s() failed to map block %u (indir)\n", __func__, block); |
310 | return 0; | 314 | return 0; |
311 | } | 315 | } |
312 | 316 | ||
diff --git a/fs/efs/namei.c b/fs/efs/namei.c index 527d0b914915..356c044e2cd3 100644 --- a/fs/efs/namei.c +++ b/fs/efs/namei.c | |||
@@ -23,20 +23,22 @@ static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int len) | |||
23 | efs_block_t block; | 23 | efs_block_t block; |
24 | 24 | ||
25 | if (inode->i_size & (EFS_DIRBSIZE-1)) | 25 | if (inode->i_size & (EFS_DIRBSIZE-1)) |
26 | pr_warn("EFS: WARNING: find_entry(): directory size not a multiple of EFS_DIRBSIZE\n"); | 26 | pr_warn("%s(): directory size not a multiple of EFS_DIRBSIZE\n", |
27 | __func__); | ||
27 | 28 | ||
28 | for(block = 0; block < inode->i_blocks; block++) { | 29 | for(block = 0; block < inode->i_blocks; block++) { |
29 | 30 | ||
30 | bh = sb_bread(inode->i_sb, efs_bmap(inode, block)); | 31 | bh = sb_bread(inode->i_sb, efs_bmap(inode, block)); |
31 | if (!bh) { | 32 | if (!bh) { |
32 | pr_err("EFS: find_entry(): failed to read dir block %d\n", block); | 33 | pr_err("%s(): failed to read dir block %d\n", |
34 | __func__, block); | ||
33 | return 0; | 35 | return 0; |
34 | } | 36 | } |
35 | 37 | ||
36 | dirblock = (struct efs_dir *) bh->b_data; | 38 | dirblock = (struct efs_dir *) bh->b_data; |
37 | 39 | ||
38 | if (be16_to_cpu(dirblock->magic) != EFS_DIRBLK_MAGIC) { | 40 | if (be16_to_cpu(dirblock->magic) != EFS_DIRBLK_MAGIC) { |
39 | pr_err("EFS: find_entry(): invalid directory block\n"); | 41 | pr_err("%s(): invalid directory block\n", __func__); |
40 | brelse(bh); | 42 | brelse(bh); |
41 | return(0); | 43 | return(0); |
42 | } | 44 | } |
diff --git a/fs/efs/super.c b/fs/efs/super.c index 059023226d55..cd1399e5fc83 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c | |||
@@ -134,7 +134,7 @@ static const struct export_operations efs_export_ops = { | |||
134 | 134 | ||
135 | static int __init init_efs_fs(void) { | 135 | static int __init init_efs_fs(void) { |
136 | int err; | 136 | int err; |
137 | pr_info("EFS: "EFS_VERSION" - http://aeschi.ch.eu.org/efs/\n"); | 137 | pr_info(EFS_VERSION" - http://aeschi.ch.eu.org/efs/\n"); |
138 | err = init_inodecache(); | 138 | err = init_inodecache(); |
139 | if (err) | 139 | if (err) |
140 | goto out1; | 140 | goto out1; |
@@ -179,7 +179,7 @@ static efs_block_t efs_validate_vh(struct volume_header *vh) { | |||
179 | csum += be32_to_cpu(cs); | 179 | csum += be32_to_cpu(cs); |
180 | } | 180 | } |
181 | if (csum) { | 181 | if (csum) { |
182 | pr_warn("EFS: SGI disklabel: checksum bad, label corrupted\n"); | 182 | pr_warn("SGI disklabel: checksum bad, label corrupted\n"); |
183 | return 0; | 183 | return 0; |
184 | } | 184 | } |
185 | 185 | ||
@@ -226,10 +226,10 @@ static efs_block_t efs_validate_vh(struct volume_header *vh) { | |||
226 | } | 226 | } |
227 | 227 | ||
228 | if (slice == -1) { | 228 | if (slice == -1) { |
229 | pr_notice("EFS: partition table contained no EFS partitions\n"); | 229 | pr_notice("partition table contained no EFS partitions\n"); |
230 | #ifdef DEBUG | 230 | #ifdef DEBUG |
231 | } else { | 231 | } else { |
232 | pr_info("EFS: using slice %d (type %s, offset 0x%x)\n", slice, | 232 | pr_info("using slice %d (type %s, offset 0x%x)\n", slice, |
233 | (pt_entry->pt_name) ? pt_entry->pt_name : "unknown", | 233 | (pt_entry->pt_name) ? pt_entry->pt_name : "unknown", |
234 | sblock); | 234 | sblock); |
235 | #endif | 235 | #endif |
@@ -267,7 +267,7 @@ static int efs_fill_super(struct super_block *s, void *d, int silent) | |||
267 | 267 | ||
268 | s->s_magic = EFS_SUPER_MAGIC; | 268 | s->s_magic = EFS_SUPER_MAGIC; |
269 | if (!sb_set_blocksize(s, EFS_BLOCKSIZE)) { | 269 | if (!sb_set_blocksize(s, EFS_BLOCKSIZE)) { |
270 | pr_err("EFS: device does not support %d byte blocks\n", | 270 | pr_err("device does not support %d byte blocks\n", |
271 | EFS_BLOCKSIZE); | 271 | EFS_BLOCKSIZE); |
272 | return -EINVAL; | 272 | return -EINVAL; |
273 | } | 273 | } |
@@ -276,7 +276,7 @@ static int efs_fill_super(struct super_block *s, void *d, int silent) | |||
276 | bh = sb_bread(s, 0); | 276 | bh = sb_bread(s, 0); |
277 | 277 | ||
278 | if (!bh) { | 278 | if (!bh) { |
279 | pr_err("EFS: cannot read volume header\n"); | 279 | pr_err("cannot read volume header\n"); |
280 | return -EINVAL; | 280 | return -EINVAL; |
281 | } | 281 | } |
282 | 282 | ||
@@ -294,13 +294,14 @@ static int efs_fill_super(struct super_block *s, void *d, int silent) | |||
294 | 294 | ||
295 | bh = sb_bread(s, sb->fs_start + EFS_SUPER); | 295 | bh = sb_bread(s, sb->fs_start + EFS_SUPER); |
296 | if (!bh) { | 296 | if (!bh) { |
297 | pr_err("EFS: cannot read superblock\n"); | 297 | pr_err("cannot read superblock\n"); |
298 | return -EINVAL; | 298 | return -EINVAL; |
299 | } | 299 | } |
300 | 300 | ||
301 | if (efs_validate_super(sb, (struct efs_super *) bh->b_data)) { | 301 | if (efs_validate_super(sb, (struct efs_super *) bh->b_data)) { |
302 | #ifdef DEBUG | 302 | #ifdef DEBUG |
303 | pr_warn("EFS: invalid superblock at block %u\n", sb->fs_start + EFS_SUPER); | 303 | pr_warn("invalid superblock at block %u\n", |
304 | sb->fs_start + EFS_SUPER); | ||
304 | #endif | 305 | #endif |
305 | brelse(bh); | 306 | brelse(bh); |
306 | return -EINVAL; | 307 | return -EINVAL; |
@@ -309,7 +310,7 @@ static int efs_fill_super(struct super_block *s, void *d, int silent) | |||
309 | 310 | ||
310 | if (!(s->s_flags & MS_RDONLY)) { | 311 | if (!(s->s_flags & MS_RDONLY)) { |
311 | #ifdef DEBUG | 312 | #ifdef DEBUG |
312 | pr_info("EFS: forcing read-only mode\n"); | 313 | pr_info("forcing read-only mode\n"); |
313 | #endif | 314 | #endif |
314 | s->s_flags |= MS_RDONLY; | 315 | s->s_flags |= MS_RDONLY; |
315 | } | 316 | } |
@@ -317,13 +318,13 @@ static int efs_fill_super(struct super_block *s, void *d, int silent) | |||
317 | s->s_export_op = &efs_export_ops; | 318 | s->s_export_op = &efs_export_ops; |
318 | root = efs_iget(s, EFS_ROOTINODE); | 319 | root = efs_iget(s, EFS_ROOTINODE); |
319 | if (IS_ERR(root)) { | 320 | if (IS_ERR(root)) { |
320 | pr_err("EFS: get root inode failed\n"); | 321 | pr_err("get root inode failed\n"); |
321 | return PTR_ERR(root); | 322 | return PTR_ERR(root); |
322 | } | 323 | } |
323 | 324 | ||
324 | s->s_root = d_make_root(root); | 325 | s->s_root = d_make_root(root); |
325 | if (!(s->s_root)) { | 326 | if (!(s->s_root)) { |
326 | pr_err("EFS: get root dentry failed\n"); | 327 | pr_err("get root dentry failed\n"); |
327 | return -ENOMEM; | 328 | return -ENOMEM; |
328 | } | 329 | } |
329 | 330 | ||