@@ -340,31 +340,36 @@ ffs_oldfscompat_read(struct fs *fs, ufs2_daddr_t sblockloc)
340
340
fs -> fs_old_flags |= FS_FLAGS_UPDATED ;
341
341
fs -> fs_sblockloc = sblockloc ;
342
342
}
343
- /*
344
- * If not yet done, update UFS1 superblock with new wider fields.
345
- */
346
- if (fs -> fs_magic == FS_UFS1_MAGIC && fs -> fs_maxbsize != fs -> fs_bsize ) {
347
- fs -> fs_maxbsize = fs -> fs_bsize ;
348
- fs -> fs_time = fs -> fs_old_time ;
349
- fs -> fs_size = fs -> fs_old_size ;
350
- fs -> fs_dsize = fs -> fs_old_dsize ;
351
- fs -> fs_csaddr = fs -> fs_old_csaddr ;
352
- fs -> fs_cstotal .cs_ndir = fs -> fs_old_cstotal .cs_ndir ;
353
- fs -> fs_cstotal .cs_nbfree = fs -> fs_old_cstotal .cs_nbfree ;
354
- fs -> fs_cstotal .cs_nifree = fs -> fs_old_cstotal .cs_nifree ;
355
- fs -> fs_cstotal .cs_nffree = fs -> fs_old_cstotal .cs_nffree ;
356
- }
357
- if (fs -> fs_magic == FS_UFS1_MAGIC &&
358
- fs -> fs_old_inodefmt < FS_44INODEFMT ) {
359
- fs -> fs_maxfilesize = ((uint64_t )1 << 31 ) - 1 ;
360
- fs -> fs_qbmask = ~fs -> fs_bmask ;
361
- fs -> fs_qfmask = ~fs -> fs_fmask ;
362
- }
363
- if (fs -> fs_magic == FS_UFS1_MAGIC ) {
343
+ switch (fs -> fs_magic ) {
344
+ case FS_UFS2_MAGIC :
345
+ /* No changes for now */
346
+ break ;
347
+
348
+ case FS_UFS1_MAGIC :
349
+ /*
350
+ * If not yet done, update UFS1 superblock with new wider fields
351
+ */
352
+ if (fs -> fs_maxbsize != fs -> fs_bsize ) {
353
+ fs -> fs_maxbsize = fs -> fs_bsize ;
354
+ fs -> fs_time = fs -> fs_old_time ;
355
+ fs -> fs_size = fs -> fs_old_size ;
356
+ fs -> fs_dsize = fs -> fs_old_dsize ;
357
+ fs -> fs_csaddr = fs -> fs_old_csaddr ;
358
+ fs -> fs_cstotal .cs_ndir = fs -> fs_old_cstotal .cs_ndir ;
359
+ fs -> fs_cstotal .cs_nbfree = fs -> fs_old_cstotal .cs_nbfree ;
360
+ fs -> fs_cstotal .cs_nifree = fs -> fs_old_cstotal .cs_nifree ;
361
+ fs -> fs_cstotal .cs_nffree = fs -> fs_old_cstotal .cs_nffree ;
362
+ }
363
+ if (fs -> fs_old_inodefmt < FS_44INODEFMT ) {
364
+ fs -> fs_maxfilesize = ((uint64_t )1 << 31 ) - 1 ;
365
+ fs -> fs_qbmask = ~fs -> fs_bmask ;
366
+ fs -> fs_qfmask = ~fs -> fs_fmask ;
367
+ }
364
368
fs -> fs_save_maxfilesize = fs -> fs_maxfilesize ;
365
369
maxfilesize = (uint64_t )0x80000000 * fs -> fs_bsize - 1 ;
366
370
if (fs -> fs_maxfilesize > maxfilesize )
367
371
fs -> fs_maxfilesize = maxfilesize ;
372
+ break ;
368
373
}
369
374
/* Compatibility for old filesystems */
370
375
if (fs -> fs_avgfilesize <= 0 )
@@ -426,9 +431,8 @@ static int prttimechgs = 0;
426
431
#ifdef _KERNEL
427
432
SYSCTL_NODE (_vfs , OID_AUTO , ffs , CTLFLAG_RW | CTLFLAG_MPSAFE , 0 ,
428
433
"FFS filesystem" );
429
-
430
434
SYSCTL_INT (_vfs_ffs , OID_AUTO , prttimechgs , CTLFLAG_RWTUN , & prttimechgs , 0 ,
431
- "print UFS1 time changes made to inodes" );
435
+ "print UFS1 time changes made to inodes" );
432
436
#endif /* _KERNEL */
433
437
bool
434
438
ffs_oldfscompat_inode_read (struct fs * fs , union dinodep dp , time_t now )
0 commit comments