/* * super.c * * Copyright (C) 2001-2002 Will Dyson <will_dyson@pobox.com> * * Licensed under the GNU GPL. See the file COPYING for details. *
*/
#include <linux/fs.h> #include <asm/page.h> /* for PAGE_SIZE */
#include"befs.h" #include"super.h"
/* * befs_load_sb -- Read from disk and properly byteswap all the fields * of the befs superblock
*/ int
befs_load_sb(struct super_block *sb, befs_super_block *disk_sb)
{ struct befs_sb_info *befs_sb = BEFS_SB(sb);
/* Check the byte order of the filesystem */ if (disk_sb->fs_byte_order == BEFS_BYTEORDER_NATIVE_LE)
befs_sb->byte_order = BEFS_BYTESEX_LE; elseif (disk_sb->fs_byte_order == BEFS_BYTEORDER_NATIVE_BE)
befs_sb->byte_order = BEFS_BYTESEX_BE;
if (befs_sb->block_size > PAGE_SIZE) {
befs_error(sb, "blocksize(%u) cannot be larger " "than system pagesize(%lu)", befs_sb->block_size,
PAGE_SIZE); return BEFS_ERR;
}
/* * block_shift and block_size encode the same information * in different ways as a consistency check.
*/
if ((1 << befs_sb->block_shift) != befs_sb->block_size) {
befs_error(sb, "block_shift disagrees with block_size. " "Corruption likely."); return BEFS_ERR;
}
/* ag_shift also encodes the same information as blocks_per_ag in a * different way, non-fatal consistency check
*/ if ((1 << befs_sb->ag_shift) != befs_sb->blocks_per_ag)
befs_error(sb, "ag_shift disagrees with blocks_per_ag.");
if (befs_sb->log_start != befs_sb->log_end ||
befs_sb->flags == BEFS_DIRTY) {
befs_error(sb, "Filesystem not clean! There are blocks in the " "journal. You must boot into BeOS and mount this " "volume to make it clean."); return BEFS_ERR;
}
return BEFS_OK;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.