diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-08-08 17:20:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 18:57:21 -0400 |
commit | a9814c5d2dae4b6a3052321a6cb8f2dcc0b3e30b (patch) | |
tree | 31fd6dc45391701bb0148aadaf3bad03034245de | |
parent | dd70edbde2627f47df118d899de6bbb55abcfdbf (diff) |
fs/ufs: convert printk to pr_foo()
Use current logging functions.
- no level printk under CONFIG_UFS_DEBUG converted to pr_debug
- no level printk elsewhere converted to pr_err
- add DDEBUG flag in Makefile
- coalesce formats
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/ufs/Makefile | 1 | ||||
-rw-r--r-- | fs/ufs/super.c | 263 |
2 files changed, 131 insertions, 133 deletions
diff --git a/fs/ufs/Makefile b/fs/ufs/Makefile index dd39980437fc..4d0e02b022b3 100644 --- a/fs/ufs/Makefile +++ b/fs/ufs/Makefile | |||
@@ -6,3 +6,4 @@ obj-$(CONFIG_UFS_FS) += ufs.o | |||
6 | 6 | ||
7 | ufs-objs := balloc.o cylinder.o dir.o file.o ialloc.o inode.o \ | 7 | ufs-objs := balloc.o cylinder.o dir.o file.o ialloc.o inode.o \ |
8 | namei.o super.o symlink.o truncate.o util.o | 8 | namei.o super.o symlink.o truncate.o util.o |
9 | ccflags-$(CONFIG_UFS_DEBUG) += -DDEBUG | ||
diff --git a/fs/ufs/super.c b/fs/ufs/super.c index b879f1ba3439..9778b9fb82df 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c | |||
@@ -172,73 +172,73 @@ static void ufs_print_super_stuff(struct super_block *sb, | |||
172 | { | 172 | { |
173 | u32 magic = fs32_to_cpu(sb, usb3->fs_magic); | 173 | u32 magic = fs32_to_cpu(sb, usb3->fs_magic); |
174 | 174 | ||
175 | printk("ufs_print_super_stuff\n"); | 175 | pr_debug("ufs_print_super_stuff\n"); |
176 | printk(" magic: 0x%x\n", magic); | 176 | pr_debug(" magic: 0x%x\n", magic); |
177 | if (fs32_to_cpu(sb, usb3->fs_magic) == UFS2_MAGIC) { | 177 | if (fs32_to_cpu(sb, usb3->fs_magic) == UFS2_MAGIC) { |
178 | printk(" fs_size: %llu\n", (unsigned long long) | 178 | pr_debug(" fs_size: %llu\n", (unsigned long long) |
179 | fs64_to_cpu(sb, usb3->fs_un1.fs_u2.fs_size)); | 179 | fs64_to_cpu(sb, usb3->fs_un1.fs_u2.fs_size)); |
180 | printk(" fs_dsize: %llu\n", (unsigned long long) | 180 | pr_debug(" fs_dsize: %llu\n", (unsigned long long) |
181 | fs64_to_cpu(sb, usb3->fs_un1.fs_u2.fs_dsize)); | 181 | fs64_to_cpu(sb, usb3->fs_un1.fs_u2.fs_dsize)); |
182 | printk(" bsize: %u\n", | 182 | pr_debug(" bsize: %u\n", |
183 | fs32_to_cpu(sb, usb1->fs_bsize)); | 183 | fs32_to_cpu(sb, usb1->fs_bsize)); |
184 | printk(" fsize: %u\n", | 184 | pr_debug(" fsize: %u\n", |
185 | fs32_to_cpu(sb, usb1->fs_fsize)); | 185 | fs32_to_cpu(sb, usb1->fs_fsize)); |
186 | printk(" fs_volname: %s\n", usb2->fs_un.fs_u2.fs_volname); | 186 | pr_debug(" fs_volname: %s\n", usb2->fs_un.fs_u2.fs_volname); |
187 | printk(" fs_sblockloc: %llu\n", (unsigned long long) | 187 | pr_debug(" fs_sblockloc: %llu\n", (unsigned long long) |
188 | fs64_to_cpu(sb, usb2->fs_un.fs_u2.fs_sblockloc)); | 188 | fs64_to_cpu(sb, usb2->fs_un.fs_u2.fs_sblockloc)); |
189 | printk(" cs_ndir(No of dirs): %llu\n", (unsigned long long) | 189 | pr_debug(" cs_ndir(No of dirs): %llu\n", (unsigned long long) |
190 | fs64_to_cpu(sb, usb2->fs_un.fs_u2.cs_ndir)); | 190 | fs64_to_cpu(sb, usb2->fs_un.fs_u2.cs_ndir)); |
191 | printk(" cs_nbfree(No of free blocks): %llu\n", | 191 | pr_debug(" cs_nbfree(No of free blocks): %llu\n", |
192 | (unsigned long long) | 192 | (unsigned long long) |
193 | fs64_to_cpu(sb, usb2->fs_un.fs_u2.cs_nbfree)); | 193 | fs64_to_cpu(sb, usb2->fs_un.fs_u2.cs_nbfree)); |
194 | printk(KERN_INFO" cs_nifree(Num of free inodes): %llu\n", | 194 | pr_info(" cs_nifree(Num of free inodes): %llu\n", |
195 | (unsigned long long) | 195 | (unsigned long long) |
196 | fs64_to_cpu(sb, usb3->fs_un1.fs_u2.cs_nifree)); | 196 | fs64_to_cpu(sb, usb3->fs_un1.fs_u2.cs_nifree)); |
197 | printk(KERN_INFO" cs_nffree(Num of free frags): %llu\n", | 197 | pr_info(" cs_nffree(Num of free frags): %llu\n", |
198 | (unsigned long long) | 198 | (unsigned long long) |
199 | fs64_to_cpu(sb, usb3->fs_un1.fs_u2.cs_nffree)); | 199 | fs64_to_cpu(sb, usb3->fs_un1.fs_u2.cs_nffree)); |
200 | printk(KERN_INFO" fs_maxsymlinklen: %u\n", | 200 | pr_info(" fs_maxsymlinklen: %u\n", |
201 | fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen)); | 201 | fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen)); |
202 | } else { | 202 | } else { |
203 | printk(" sblkno: %u\n", fs32_to_cpu(sb, usb1->fs_sblkno)); | 203 | pr_debug(" sblkno: %u\n", fs32_to_cpu(sb, usb1->fs_sblkno)); |
204 | printk(" cblkno: %u\n", fs32_to_cpu(sb, usb1->fs_cblkno)); | 204 | pr_debug(" cblkno: %u\n", fs32_to_cpu(sb, usb1->fs_cblkno)); |
205 | printk(" iblkno: %u\n", fs32_to_cpu(sb, usb1->fs_iblkno)); | 205 | pr_debug(" iblkno: %u\n", fs32_to_cpu(sb, usb1->fs_iblkno)); |
206 | printk(" dblkno: %u\n", fs32_to_cpu(sb, usb1->fs_dblkno)); | 206 | pr_debug(" dblkno: %u\n", fs32_to_cpu(sb, usb1->fs_dblkno)); |
207 | printk(" cgoffset: %u\n", | 207 | pr_debug(" cgoffset: %u\n", |
208 | fs32_to_cpu(sb, usb1->fs_cgoffset)); | 208 | fs32_to_cpu(sb, usb1->fs_cgoffset)); |
209 | printk(" ~cgmask: 0x%x\n", | 209 | pr_debug(" ~cgmask: 0x%x\n", |
210 | ~fs32_to_cpu(sb, usb1->fs_cgmask)); | 210 | ~fs32_to_cpu(sb, usb1->fs_cgmask)); |
211 | printk(" size: %u\n", fs32_to_cpu(sb, usb1->fs_size)); | 211 | pr_debug(" size: %u\n", fs32_to_cpu(sb, usb1->fs_size)); |
212 | printk(" dsize: %u\n", fs32_to_cpu(sb, usb1->fs_dsize)); | 212 | pr_debug(" dsize: %u\n", fs32_to_cpu(sb, usb1->fs_dsize)); |
213 | printk(" ncg: %u\n", fs32_to_cpu(sb, usb1->fs_ncg)); | 213 | pr_debug(" ncg: %u\n", fs32_to_cpu(sb, usb1->fs_ncg)); |
214 | printk(" bsize: %u\n", fs32_to_cpu(sb, usb1->fs_bsize)); | 214 | pr_debug(" bsize: %u\n", fs32_to_cpu(sb, usb1->fs_bsize)); |
215 | printk(" fsize: %u\n", fs32_to_cpu(sb, usb1->fs_fsize)); | 215 | pr_debug(" fsize: %u\n", fs32_to_cpu(sb, usb1->fs_fsize)); |
216 | printk(" frag: %u\n", fs32_to_cpu(sb, usb1->fs_frag)); | 216 | pr_debug(" frag: %u\n", fs32_to_cpu(sb, usb1->fs_frag)); |
217 | printk(" fragshift: %u\n", | 217 | pr_debug(" fragshift: %u\n", |
218 | fs32_to_cpu(sb, usb1->fs_fragshift)); | 218 | fs32_to_cpu(sb, usb1->fs_fragshift)); |
219 | printk(" ~fmask: %u\n", ~fs32_to_cpu(sb, usb1->fs_fmask)); | 219 | pr_debug(" ~fmask: %u\n", ~fs32_to_cpu(sb, usb1->fs_fmask)); |
220 | printk(" fshift: %u\n", fs32_to_cpu(sb, usb1->fs_fshift)); | 220 | pr_debug(" fshift: %u\n", fs32_to_cpu(sb, usb1->fs_fshift)); |
221 | printk(" sbsize: %u\n", fs32_to_cpu(sb, usb1->fs_sbsize)); | 221 | pr_debug(" sbsize: %u\n", fs32_to_cpu(sb, usb1->fs_sbsize)); |
222 | printk(" spc: %u\n", fs32_to_cpu(sb, usb1->fs_spc)); | 222 | pr_debug(" spc: %u\n", fs32_to_cpu(sb, usb1->fs_spc)); |
223 | printk(" cpg: %u\n", fs32_to_cpu(sb, usb1->fs_cpg)); | 223 | pr_debug(" cpg: %u\n", fs32_to_cpu(sb, usb1->fs_cpg)); |
224 | printk(" ipg: %u\n", fs32_to_cpu(sb, usb1->fs_ipg)); | 224 | pr_debug(" ipg: %u\n", fs32_to_cpu(sb, usb1->fs_ipg)); |
225 | printk(" fpg: %u\n", fs32_to_cpu(sb, usb1->fs_fpg)); | 225 | pr_debug(" fpg: %u\n", fs32_to_cpu(sb, usb1->fs_fpg)); |
226 | printk(" csaddr: %u\n", fs32_to_cpu(sb, usb1->fs_csaddr)); | 226 | pr_debug(" csaddr: %u\n", fs32_to_cpu(sb, usb1->fs_csaddr)); |
227 | printk(" cssize: %u\n", fs32_to_cpu(sb, usb1->fs_cssize)); | 227 | pr_debug(" cssize: %u\n", fs32_to_cpu(sb, usb1->fs_cssize)); |
228 | printk(" cgsize: %u\n", fs32_to_cpu(sb, usb1->fs_cgsize)); | 228 | pr_debug(" cgsize: %u\n", fs32_to_cpu(sb, usb1->fs_cgsize)); |
229 | printk(" fstodb: %u\n", | 229 | pr_debug(" fstodb: %u\n", |
230 | fs32_to_cpu(sb, usb1->fs_fsbtodb)); | 230 | fs32_to_cpu(sb, usb1->fs_fsbtodb)); |
231 | printk(" nrpos: %u\n", fs32_to_cpu(sb, usb3->fs_nrpos)); | 231 | pr_debug(" nrpos: %u\n", fs32_to_cpu(sb, usb3->fs_nrpos)); |
232 | printk(" ndir %u\n", | 232 | pr_debug(" ndir %u\n", |
233 | fs32_to_cpu(sb, usb1->fs_cstotal.cs_ndir)); | 233 | fs32_to_cpu(sb, usb1->fs_cstotal.cs_ndir)); |
234 | printk(" nifree %u\n", | 234 | pr_debug(" nifree %u\n", |
235 | fs32_to_cpu(sb, usb1->fs_cstotal.cs_nifree)); | 235 | fs32_to_cpu(sb, usb1->fs_cstotal.cs_nifree)); |
236 | printk(" nbfree %u\n", | 236 | pr_debug(" nbfree %u\n", |
237 | fs32_to_cpu(sb, usb1->fs_cstotal.cs_nbfree)); | 237 | fs32_to_cpu(sb, usb1->fs_cstotal.cs_nbfree)); |
238 | printk(" nffree %u\n", | 238 | pr_debug(" nffree %u\n", |
239 | fs32_to_cpu(sb, usb1->fs_cstotal.cs_nffree)); | 239 | fs32_to_cpu(sb, usb1->fs_cstotal.cs_nffree)); |
240 | } | 240 | } |
241 | printk("\n"); | 241 | pr_debug("\n"); |
242 | } | 242 | } |
243 | 243 | ||
244 | /* | 244 | /* |
@@ -247,38 +247,38 @@ static void ufs_print_super_stuff(struct super_block *sb, | |||
247 | static void ufs_print_cylinder_stuff(struct super_block *sb, | 247 | static void ufs_print_cylinder_stuff(struct super_block *sb, |
248 | struct ufs_cylinder_group *cg) | 248 | struct ufs_cylinder_group *cg) |
249 | { | 249 | { |
250 | printk("\nufs_print_cylinder_stuff\n"); | 250 | pr_debug("\nufs_print_cylinder_stuff\n"); |
251 | printk("size of ucg: %zu\n", sizeof(struct ufs_cylinder_group)); | 251 | pr_debug("size of ucg: %zu\n", sizeof(struct ufs_cylinder_group)); |
252 | printk(" magic: %x\n", fs32_to_cpu(sb, cg->cg_magic)); | 252 | pr_debug(" magic: %x\n", fs32_to_cpu(sb, cg->cg_magic)); |
253 | printk(" time: %u\n", fs32_to_cpu(sb, cg->cg_time)); | 253 | pr_debug(" time: %u\n", fs32_to_cpu(sb, cg->cg_time)); |
254 | printk(" cgx: %u\n", fs32_to_cpu(sb, cg->cg_cgx)); | 254 | pr_debug(" cgx: %u\n", fs32_to_cpu(sb, cg->cg_cgx)); |
255 | printk(" ncyl: %u\n", fs16_to_cpu(sb, cg->cg_ncyl)); | 255 | pr_debug(" ncyl: %u\n", fs16_to_cpu(sb, cg->cg_ncyl)); |
256 | printk(" niblk: %u\n", fs16_to_cpu(sb, cg->cg_niblk)); | 256 | pr_debug(" niblk: %u\n", fs16_to_cpu(sb, cg->cg_niblk)); |
257 | printk(" ndblk: %u\n", fs32_to_cpu(sb, cg->cg_ndblk)); | 257 | pr_debug(" ndblk: %u\n", fs32_to_cpu(sb, cg->cg_ndblk)); |
258 | printk(" cs_ndir: %u\n", fs32_to_cpu(sb, cg->cg_cs.cs_ndir)); | 258 | pr_debug(" cs_ndir: %u\n", fs32_to_cpu(sb, cg->cg_cs.cs_ndir)); |
259 | printk(" cs_nbfree: %u\n", fs32_to_cpu(sb, cg->cg_cs.cs_nbfree)); | 259 | pr_debug(" cs_nbfree: %u\n", fs32_to_cpu(sb, cg->cg_cs.cs_nbfree)); |
260 | printk(" cs_nifree: %u\n", fs32_to_cpu(sb, cg->cg_cs.cs_nifree)); | 260 | pr_debug(" cs_nifree: %u\n", fs32_to_cpu(sb, cg->cg_cs.cs_nifree)); |
261 | printk(" cs_nffree: %u\n", fs32_to_cpu(sb, cg->cg_cs.cs_nffree)); | 261 | pr_debug(" cs_nffree: %u\n", fs32_to_cpu(sb, cg->cg_cs.cs_nffree)); |
262 | printk(" rotor: %u\n", fs32_to_cpu(sb, cg->cg_rotor)); | 262 | pr_debug(" rotor: %u\n", fs32_to_cpu(sb, cg->cg_rotor)); |
263 | printk(" frotor: %u\n", fs32_to_cpu(sb, cg->cg_frotor)); | 263 | pr_debug(" frotor: %u\n", fs32_to_cpu(sb, cg->cg_frotor)); |
264 | printk(" irotor: %u\n", fs32_to_cpu(sb, cg->cg_irotor)); | 264 | pr_debug(" irotor: %u\n", fs32_to_cpu(sb, cg->cg_irotor)); |
265 | printk(" frsum: %u, %u, %u, %u, %u, %u, %u, %u\n", | 265 | pr_debug(" frsum: %u, %u, %u, %u, %u, %u, %u, %u\n", |
266 | fs32_to_cpu(sb, cg->cg_frsum[0]), fs32_to_cpu(sb, cg->cg_frsum[1]), | 266 | fs32_to_cpu(sb, cg->cg_frsum[0]), fs32_to_cpu(sb, cg->cg_frsum[1]), |
267 | fs32_to_cpu(sb, cg->cg_frsum[2]), fs32_to_cpu(sb, cg->cg_frsum[3]), | 267 | fs32_to_cpu(sb, cg->cg_frsum[2]), fs32_to_cpu(sb, cg->cg_frsum[3]), |
268 | fs32_to_cpu(sb, cg->cg_frsum[4]), fs32_to_cpu(sb, cg->cg_frsum[5]), | 268 | fs32_to_cpu(sb, cg->cg_frsum[4]), fs32_to_cpu(sb, cg->cg_frsum[5]), |
269 | fs32_to_cpu(sb, cg->cg_frsum[6]), fs32_to_cpu(sb, cg->cg_frsum[7])); | 269 | fs32_to_cpu(sb, cg->cg_frsum[6]), fs32_to_cpu(sb, cg->cg_frsum[7])); |
270 | printk(" btotoff: %u\n", fs32_to_cpu(sb, cg->cg_btotoff)); | 270 | pr_debug(" btotoff: %u\n", fs32_to_cpu(sb, cg->cg_btotoff)); |
271 | printk(" boff: %u\n", fs32_to_cpu(sb, cg->cg_boff)); | 271 | pr_debug(" boff: %u\n", fs32_to_cpu(sb, cg->cg_boff)); |
272 | printk(" iuseoff: %u\n", fs32_to_cpu(sb, cg->cg_iusedoff)); | 272 | pr_debug(" iuseoff: %u\n", fs32_to_cpu(sb, cg->cg_iusedoff)); |
273 | printk(" freeoff: %u\n", fs32_to_cpu(sb, cg->cg_freeoff)); | 273 | pr_debug(" freeoff: %u\n", fs32_to_cpu(sb, cg->cg_freeoff)); |
274 | printk(" nextfreeoff: %u\n", fs32_to_cpu(sb, cg->cg_nextfreeoff)); | 274 | pr_debug(" nextfreeoff: %u\n", fs32_to_cpu(sb, cg->cg_nextfreeoff)); |
275 | printk(" clustersumoff %u\n", | 275 | pr_debug(" clustersumoff %u\n", |
276 | fs32_to_cpu(sb, cg->cg_u.cg_44.cg_clustersumoff)); | 276 | fs32_to_cpu(sb, cg->cg_u.cg_44.cg_clustersumoff)); |
277 | printk(" clusteroff %u\n", | 277 | pr_debug(" clusteroff %u\n", |
278 | fs32_to_cpu(sb, cg->cg_u.cg_44.cg_clusteroff)); | 278 | fs32_to_cpu(sb, cg->cg_u.cg_44.cg_clusteroff)); |
279 | printk(" nclusterblks %u\n", | 279 | pr_debug(" nclusterblks %u\n", |
280 | fs32_to_cpu(sb, cg->cg_u.cg_44.cg_nclusterblks)); | 280 | fs32_to_cpu(sb, cg->cg_u.cg_44.cg_nclusterblks)); |
281 | printk("\n"); | 281 | pr_debug("\n"); |
282 | } | 282 | } |
283 | #else | 283 | #else |
284 | # define ufs_print_super_stuff(sb, usb1, usb2, usb3) /**/ | 284 | # define ufs_print_super_stuff(sb, usb1, usb2, usb3) /**/ |
@@ -316,7 +316,7 @@ void ufs_error (struct super_block * sb, const char * function, | |||
316 | case UFS_MOUNT_ONERROR_LOCK: | 316 | case UFS_MOUNT_ONERROR_LOCK: |
317 | case UFS_MOUNT_ONERROR_UMOUNT: | 317 | case UFS_MOUNT_ONERROR_UMOUNT: |
318 | case UFS_MOUNT_ONERROR_REPAIR: | 318 | case UFS_MOUNT_ONERROR_REPAIR: |
319 | printk (KERN_CRIT "UFS-fs error (device %s): %s: %s\n", | 319 | pr_crit("UFS-fs error (device %s): %s: %s\n", |
320 | sb->s_id, function, error_buf); | 320 | sb->s_id, function, error_buf); |
321 | } | 321 | } |
322 | } | 322 | } |
@@ -340,7 +340,7 @@ void ufs_panic (struct super_block * sb, const char * function, | |||
340 | vsnprintf (error_buf, sizeof(error_buf), fmt, args); | 340 | vsnprintf (error_buf, sizeof(error_buf), fmt, args); |
341 | va_end (args); | 341 | va_end (args); |
342 | sb->s_flags |= MS_RDONLY; | 342 | sb->s_flags |= MS_RDONLY; |
343 | printk (KERN_CRIT "UFS-fs panic (device %s): %s: %s\n", | 343 | pr_crit("UFS-fs panic (device %s): %s: %s\n", |
344 | sb->s_id, function, error_buf); | 344 | sb->s_id, function, error_buf); |
345 | } | 345 | } |
346 | 346 | ||
@@ -352,7 +352,7 @@ void ufs_warning (struct super_block * sb, const char * function, | |||
352 | va_start (args, fmt); | 352 | va_start (args, fmt); |
353 | vsnprintf (error_buf, sizeof(error_buf), fmt, args); | 353 | vsnprintf (error_buf, sizeof(error_buf), fmt, args); |
354 | va_end (args); | 354 | va_end (args); |
355 | printk (KERN_WARNING "UFS-fs warning (device %s): %s: %s\n", | 355 | pr_warn("UFS-fs warning (device %s): %s: %s\n", |
356 | sb->s_id, function, error_buf); | 356 | sb->s_id, function, error_buf); |
357 | } | 357 | } |
358 | 358 | ||
@@ -464,14 +464,12 @@ static int ufs_parse_options (char * options, unsigned * mount_options) | |||
464 | ufs_set_opt (*mount_options, ONERROR_UMOUNT); | 464 | ufs_set_opt (*mount_options, ONERROR_UMOUNT); |
465 | break; | 465 | break; |
466 | case Opt_onerror_repair: | 466 | case Opt_onerror_repair: |
467 | printk("UFS-fs: Unable to do repair on error, " | 467 | pr_err("UFS-fs: Unable to do repair on error, will lock lock instead\n"); |
468 | "will lock lock instead\n"); | ||
469 | ufs_clear_opt (*mount_options, ONERROR); | 468 | ufs_clear_opt (*mount_options, ONERROR); |
470 | ufs_set_opt (*mount_options, ONERROR_REPAIR); | 469 | ufs_set_opt (*mount_options, ONERROR_REPAIR); |
471 | break; | 470 | break; |
472 | default: | 471 | default: |
473 | printk("UFS-fs: Invalid option: \"%s\" " | 472 | pr_err("UFS-fs: Invalid option: \"%s\" or missing value\n", p); |
474 | "or missing value\n", p); | ||
475 | return 0; | 473 | return 0; |
476 | } | 474 | } |
477 | } | 475 | } |
@@ -788,8 +786,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent) | |||
788 | 786 | ||
789 | #ifndef CONFIG_UFS_FS_WRITE | 787 | #ifndef CONFIG_UFS_FS_WRITE |
790 | if (!(sb->s_flags & MS_RDONLY)) { | 788 | if (!(sb->s_flags & MS_RDONLY)) { |
791 | printk("ufs was compiled with read-only support, " | 789 | pr_err("ufs was compiled with read-only support, can't be mounted as read-write\n"); |
792 | "can't be mounted as read-write\n"); | ||
793 | return -EROFS; | 790 | return -EROFS; |
794 | } | 791 | } |
795 | #endif | 792 | #endif |
@@ -812,12 +809,12 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent) | |||
812 | sbi->s_mount_opt = 0; | 809 | sbi->s_mount_opt = 0; |
813 | ufs_set_opt (sbi->s_mount_opt, ONERROR_LOCK); | 810 | ufs_set_opt (sbi->s_mount_opt, ONERROR_LOCK); |
814 | if (!ufs_parse_options ((char *) data, &sbi->s_mount_opt)) { | 811 | if (!ufs_parse_options ((char *) data, &sbi->s_mount_opt)) { |
815 | printk("wrong mount options\n"); | 812 | pr_err("wrong mount options\n"); |
816 | goto failed; | 813 | goto failed; |
817 | } | 814 | } |
818 | if (!(sbi->s_mount_opt & UFS_MOUNT_UFSTYPE)) { | 815 | if (!(sbi->s_mount_opt & UFS_MOUNT_UFSTYPE)) { |
819 | if (!silent) | 816 | if (!silent) |
820 | printk("You didn't specify the type of your ufs filesystem\n\n" | 817 | pr_err("You didn't specify the type of your ufs filesystem\n\n" |
821 | "mount -t ufs -o ufstype=" | 818 | "mount -t ufs -o ufstype=" |
822 | "sun|sunx86|44bsd|ufs2|5xbsd|old|hp|nextstep|nextstep-cd|openstep ...\n\n" | 819 | "sun|sunx86|44bsd|ufs2|5xbsd|old|hp|nextstep|nextstep-cd|openstep ...\n\n" |
823 | ">>>WARNING<<< Wrong ufstype may corrupt your filesystem, " | 820 | ">>>WARNING<<< Wrong ufstype may corrupt your filesystem, " |
@@ -900,7 +897,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent) | |||
900 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; | 897 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; |
901 | if (!(sb->s_flags & MS_RDONLY)) { | 898 | if (!(sb->s_flags & MS_RDONLY)) { |
902 | if (!silent) | 899 | if (!silent) |
903 | printk(KERN_INFO "ufstype=old is supported read-only\n"); | 900 | pr_info("ufstype=old is supported read-only\n"); |
904 | sb->s_flags |= MS_RDONLY; | 901 | sb->s_flags |= MS_RDONLY; |
905 | } | 902 | } |
906 | break; | 903 | break; |
@@ -916,7 +913,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent) | |||
916 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; | 913 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; |
917 | if (!(sb->s_flags & MS_RDONLY)) { | 914 | if (!(sb->s_flags & MS_RDONLY)) { |
918 | if (!silent) | 915 | if (!silent) |
919 | printk(KERN_INFO "ufstype=nextstep is supported read-only\n"); | 916 | pr_info("ufstype=nextstep is supported read-only\n"); |
920 | sb->s_flags |= MS_RDONLY; | 917 | sb->s_flags |= MS_RDONLY; |
921 | } | 918 | } |
922 | break; | 919 | break; |
@@ -932,7 +929,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent) | |||
932 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; | 929 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; |
933 | if (!(sb->s_flags & MS_RDONLY)) { | 930 | if (!(sb->s_flags & MS_RDONLY)) { |
934 | if (!silent) | 931 | if (!silent) |
935 | printk(KERN_INFO "ufstype=nextstep-cd is supported read-only\n"); | 932 | pr_info("ufstype=nextstep-cd is supported read-only\n"); |
936 | sb->s_flags |= MS_RDONLY; | 933 | sb->s_flags |= MS_RDONLY; |
937 | } | 934 | } |
938 | break; | 935 | break; |
@@ -948,7 +945,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent) | |||
948 | flags |= UFS_DE_44BSD | UFS_UID_44BSD | UFS_ST_44BSD | UFS_CG_44BSD; | 945 | flags |= UFS_DE_44BSD | UFS_UID_44BSD | UFS_ST_44BSD | UFS_CG_44BSD; |
949 | if (!(sb->s_flags & MS_RDONLY)) { | 946 | if (!(sb->s_flags & MS_RDONLY)) { |
950 | if (!silent) | 947 | if (!silent) |
951 | printk(KERN_INFO "ufstype=openstep is supported read-only\n"); | 948 | pr_info("ufstype=openstep is supported read-only\n"); |
952 | sb->s_flags |= MS_RDONLY; | 949 | sb->s_flags |= MS_RDONLY; |
953 | } | 950 | } |
954 | break; | 951 | break; |
@@ -963,19 +960,19 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent) | |||
963 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; | 960 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; |
964 | if (!(sb->s_flags & MS_RDONLY)) { | 961 | if (!(sb->s_flags & MS_RDONLY)) { |
965 | if (!silent) | 962 | if (!silent) |
966 | printk(KERN_INFO "ufstype=hp is supported read-only\n"); | 963 | pr_info("ufstype=hp is supported read-only\n"); |
967 | sb->s_flags |= MS_RDONLY; | 964 | sb->s_flags |= MS_RDONLY; |
968 | } | 965 | } |
969 | break; | 966 | break; |
970 | default: | 967 | default: |
971 | if (!silent) | 968 | if (!silent) |
972 | printk("unknown ufstype\n"); | 969 | pr_err("unknown ufstype\n"); |
973 | goto failed; | 970 | goto failed; |
974 | } | 971 | } |
975 | 972 | ||
976 | again: | 973 | again: |
977 | if (!sb_set_blocksize(sb, block_size)) { | 974 | if (!sb_set_blocksize(sb, block_size)) { |
978 | printk(KERN_ERR "UFS: failed to set blocksize\n"); | 975 | pr_err("UFS: failed to set blocksize\n"); |
979 | goto failed; | 976 | goto failed; |
980 | } | 977 | } |
981 | 978 | ||
@@ -1034,7 +1031,7 @@ again: | |||
1034 | goto again; | 1031 | goto again; |
1035 | } | 1032 | } |
1036 | if (!silent) | 1033 | if (!silent) |
1037 | printk("ufs_read_super: bad magic number\n"); | 1034 | pr_err("ufs_read_super: bad magic number\n"); |
1038 | goto failed; | 1035 | goto failed; |
1039 | 1036 | ||
1040 | magic_found: | 1037 | magic_found: |
@@ -1048,33 +1045,33 @@ magic_found: | |||
1048 | uspi->s_fshift = fs32_to_cpu(sb, usb1->fs_fshift); | 1045 | uspi->s_fshift = fs32_to_cpu(sb, usb1->fs_fshift); |
1049 | 1046 | ||
1050 | if (!is_power_of_2(uspi->s_fsize)) { | 1047 | if (!is_power_of_2(uspi->s_fsize)) { |
1051 | printk(KERN_ERR "ufs_read_super: fragment size %u is not a power of 2\n", | 1048 | pr_err("ufs_read_super: fragment size %u is not a power of 2\n", |
1052 | uspi->s_fsize); | 1049 | uspi->s_fsize); |
1053 | goto failed; | 1050 | goto failed; |
1054 | } | 1051 | } |
1055 | if (uspi->s_fsize < 512) { | 1052 | if (uspi->s_fsize < 512) { |
1056 | printk(KERN_ERR "ufs_read_super: fragment size %u is too small\n", | 1053 | pr_err("ufs_read_super: fragment size %u is too small\n", |
1057 | uspi->s_fsize); | 1054 | uspi->s_fsize); |
1058 | goto failed; | 1055 | goto failed; |
1059 | } | 1056 | } |
1060 | if (uspi->s_fsize > 4096) { | 1057 | if (uspi->s_fsize > 4096) { |
1061 | printk(KERN_ERR "ufs_read_super: fragment size %u is too large\n", | 1058 | pr_err("ufs_read_super: fragment size %u is too large\n", |
1062 | uspi->s_fsize); | 1059 | uspi->s_fsize); |
1063 | goto failed; | 1060 | goto failed; |
1064 | } | 1061 | } |
1065 | if (!is_power_of_2(uspi->s_bsize)) { | 1062 | if (!is_power_of_2(uspi->s_bsize)) { |
1066 | printk(KERN_ERR "ufs_read_super: block size %u is not a power of 2\n", | 1063 | pr_err("ufs_read_super: block size %u is not a power of 2\n", |
1067 | uspi->s_bsize); | 1064 | uspi->s_bsize); |
1068 | goto failed; | 1065 | goto failed; |
1069 | } | 1066 | } |
1070 | if (uspi->s_bsize < 4096) { | 1067 | if (uspi->s_bsize < 4096) { |
1071 | printk(KERN_ERR "ufs_read_super: block size %u is too small\n", | 1068 | pr_err("ufs_read_super: block size %u is too small\n", |
1072 | uspi->s_bsize); | 1069 | uspi->s_bsize); |
1073 | goto failed; | 1070 | goto failed; |
1074 | } | 1071 | } |
1075 | if (uspi->s_bsize / uspi->s_fsize > 8) { | 1072 | if (uspi->s_bsize / uspi->s_fsize > 8) { |
1076 | printk(KERN_ERR "ufs_read_super: too many fragments per block (%u)\n", | 1073 | pr_err("ufs_read_super: too many fragments per block (%u)\n", |
1077 | uspi->s_bsize / uspi->s_fsize); | 1074 | uspi->s_bsize / uspi->s_fsize); |
1078 | goto failed; | 1075 | goto failed; |
1079 | } | 1076 | } |
1080 | if (uspi->s_fsize != block_size || uspi->s_sbsize != super_block_size) { | 1077 | if (uspi->s_fsize != block_size || uspi->s_sbsize != super_block_size) { |
@@ -1113,20 +1110,21 @@ magic_found: | |||
1113 | UFSD("fs is DEC OSF/1\n"); | 1110 | UFSD("fs is DEC OSF/1\n"); |
1114 | break; | 1111 | break; |
1115 | case UFS_FSACTIVE: | 1112 | case UFS_FSACTIVE: |
1116 | printk("ufs_read_super: fs is active\n"); | 1113 | pr_err("ufs_read_super: fs is active\n"); |
1117 | sb->s_flags |= MS_RDONLY; | 1114 | sb->s_flags |= MS_RDONLY; |
1118 | break; | 1115 | break; |
1119 | case UFS_FSBAD: | 1116 | case UFS_FSBAD: |
1120 | printk("ufs_read_super: fs is bad\n"); | 1117 | pr_err("ufs_read_super: fs is bad\n"); |
1121 | sb->s_flags |= MS_RDONLY; | 1118 | sb->s_flags |= MS_RDONLY; |
1122 | break; | 1119 | break; |
1123 | default: | 1120 | default: |
1124 | printk("ufs_read_super: can't grok fs_clean 0x%x\n", usb1->fs_clean); | 1121 | pr_err("ufs_read_super: can't grok fs_clean 0x%x\n", |
1122 | usb1->fs_clean); | ||
1125 | sb->s_flags |= MS_RDONLY; | 1123 | sb->s_flags |= MS_RDONLY; |
1126 | break; | 1124 | break; |
1127 | } | 1125 | } |
1128 | } else { | 1126 | } else { |
1129 | printk("ufs_read_super: fs needs fsck\n"); | 1127 | pr_err("ufs_read_super: fs needs fsck\n"); |
1130 | sb->s_flags |= MS_RDONLY; | 1128 | sb->s_flags |= MS_RDONLY; |
1131 | } | 1129 | } |
1132 | 1130 | ||
@@ -1299,7 +1297,7 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data) | |||
1299 | if (!(new_mount_opt & UFS_MOUNT_UFSTYPE)) { | 1297 | if (!(new_mount_opt & UFS_MOUNT_UFSTYPE)) { |
1300 | new_mount_opt |= ufstype; | 1298 | new_mount_opt |= ufstype; |
1301 | } else if ((new_mount_opt & UFS_MOUNT_UFSTYPE) != ufstype) { | 1299 | } else if ((new_mount_opt & UFS_MOUNT_UFSTYPE) != ufstype) { |
1302 | printk("ufstype can't be changed during remount\n"); | 1300 | pr_err("ufstype can't be changed during remount\n"); |
1303 | unlock_ufs(sb); | 1301 | unlock_ufs(sb); |
1304 | return -EINVAL; | 1302 | return -EINVAL; |
1305 | } | 1303 | } |
@@ -1328,8 +1326,7 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data) | |||
1328 | * fs was mounted as ro, remounting rw | 1326 | * fs was mounted as ro, remounting rw |
1329 | */ | 1327 | */ |
1330 | #ifndef CONFIG_UFS_FS_WRITE | 1328 | #ifndef CONFIG_UFS_FS_WRITE |
1331 | printk("ufs was compiled with read-only support, " | 1329 | pr_err("ufs was compiled with read-only support, can't be mounted as read-write\n"); |
1332 | "can't be mounted as read-write\n"); | ||
1333 | unlock_ufs(sb); | 1330 | unlock_ufs(sb); |
1334 | return -EINVAL; | 1331 | return -EINVAL; |
1335 | #else | 1332 | #else |
@@ -1338,12 +1335,12 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data) | |||
1338 | ufstype != UFS_MOUNT_UFSTYPE_44BSD && | 1335 | ufstype != UFS_MOUNT_UFSTYPE_44BSD && |
1339 | ufstype != UFS_MOUNT_UFSTYPE_SUNx86 && | 1336 | ufstype != UFS_MOUNT_UFSTYPE_SUNx86 && |
1340 | ufstype != UFS_MOUNT_UFSTYPE_UFS2) { | 1337 | ufstype != UFS_MOUNT_UFSTYPE_UFS2) { |
1341 | printk("this ufstype is read-only supported\n"); | 1338 | pr_err("this ufstype is read-only supported\n"); |
1342 | unlock_ufs(sb); | 1339 | unlock_ufs(sb); |
1343 | return -EINVAL; | 1340 | return -EINVAL; |
1344 | } | 1341 | } |
1345 | if (!ufs_read_cylinder_structures(sb)) { | 1342 | if (!ufs_read_cylinder_structures(sb)) { |
1346 | printk("failed during remounting\n"); | 1343 | pr_err("failed during remounting\n"); |
1347 | unlock_ufs(sb); | 1344 | unlock_ufs(sb); |
1348 | return -EPERM; | 1345 | return -EPERM; |
1349 | } | 1346 | } |