int ffs_mount (void) { int retval = 1; if ((((current_drive & 0x80) || (current_slice != 0)) && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_BSDFFS)) || part_length < (SBLOCK + (SBSIZE / DEV_BSIZE)) || !devread (SBLOCK, 0, SBSIZE, (char *) SUPERBLOCK) || SUPERBLOCK->fs_magic != FS_MAGIC) retval = 0; mapblock = -1; mapblock_offset = -1; return retval; }
int ufs2_mount (void) { int retval = 0; int i; sblockloc = -1; type = 0; if (! (((current_drive & 0x80) || (current_slice != 0)) && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_BSDFFS))) { for (i = 0; sblock_try[i] != -1; ++i) { if (! (part_length < (sblock_try[i] + (SBLOCKSIZE / DEV_BSIZE)) || ! devread (0, sblock_try[i], SBLOCKSIZE, (char *) SUPERBLOCK))) { if (SUPERBLOCK->fs_magic == FS_UFS2_MAGIC /* && (SUPERBLOCK->fs_sblockloc == sblockloc || (SUPERBLOCK->fs_old_flags & FS_FLAGS_UPDATED) == 0)*/) { type = 2; } else { continue; } retval = 1; sblockloc = sblock_try[i]; break; } } } mapblock = -1; mapblock_offset = -1; return retval; }