OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [fs/] [ext2/] [super.c] - Diff between revs 199 and 761

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 199 Rev 761
Line 273... Line 273...
}
}
 
 
static void ext2_setup_super (struct super_block * sb,
static void ext2_setup_super (struct super_block * sb,
                              struct ext2_super_block * es)
                              struct ext2_super_block * es)
{
{
printk("%s - %s:%s\n",__FILE__,__FUNCTION__,__LINE__);
 
        if (swab32(es->s_rev_level) > EXT2_MAX_SUPP_REV) {
        if (swab32(es->s_rev_level) > EXT2_MAX_SUPP_REV) {
                        printk ("EXT2-fs warning: revision level too high, "
                        printk ("EXT2-fs warning: revision level too high, "
                                "forcing read/only mode\n");
                                "forcing read/only mode\n");
                        sb->s_flags |= MS_RDONLY;
                        sb->s_flags |= MS_RDONLY;
        }
        }
Line 316... Line 315...
                if (test_opt (sb, CHECK)) {
                if (test_opt (sb, CHECK)) {
                        ext2_check_blocks_bitmap (sb);
                        ext2_check_blocks_bitmap (sb);
                        ext2_check_inodes_bitmap (sb);
                        ext2_check_inodes_bitmap (sb);
                }
                }
        }
        }
printk("%s - %s:%s\n",__FILE__,__FUNCTION__,__LINE__);
 
}
}
 
 
static int ext2_check_descriptors (struct super_block * sb)
static int ext2_check_descriptors (struct super_block * sb)
{
{
        int i;
        int i;
Line 381... Line 379...
        unsigned long logic_sb_block = 1;
        unsigned long logic_sb_block = 1;
        kdev_t dev = sb->s_dev;
        kdev_t dev = sb->s_dev;
        int db_count;
        int db_count;
        int i, j;
        int i, j;
 
 
printk("%s - %s:%d\n",__FILE__,__FUNCTION__,__LINE__);
 
        sb->u.ext2_sb.s_mount_opt = 0;
        sb->u.ext2_sb.s_mount_opt = 0;
        set_opt (sb->u.ext2_sb.s_mount_opt, CHECK_NORMAL);
        set_opt (sb->u.ext2_sb.s_mount_opt, CHECK_NORMAL);
        if (!parse_options ((char *) data, &sb_block, &resuid, &resgid,
        if (!parse_options ((char *) data, &sb_block, &resuid, &resgid,
            &sb->u.ext2_sb.s_mount_opt)) {
            &sb->u.ext2_sb.s_mount_opt)) {
                sb->s_dev = 0;
                sb->s_dev = 0;
                return NULL;
                return NULL;
        }
        }
 
 
printk("%s - %s:%d\n",__FILE__,__FUNCTION__,__LINE__);
 
        MOD_INC_USE_COUNT;
        MOD_INC_USE_COUNT;
        lock_super (sb);
        lock_super (sb);
        set_blocksize (dev, BLOCK_SIZE);
        set_blocksize (dev, BLOCK_SIZE);
        if (!(bh = bread (dev, sb_block, BLOCK_SIZE))) {
        if (!(bh = bread (dev, sb_block, BLOCK_SIZE))) {
                sb->s_dev = 0;
                sb->s_dev = 0;
                unlock_super (sb);
                unlock_super (sb);
                printk ("EXT2-fs: unable to read superblock\n");
                printk ("EXT2-fs: unable to read superblock\n");
                MOD_DEC_USE_COUNT;
                MOD_DEC_USE_COUNT;
                return NULL;
                return NULL;
        }
        }
printk("%s - %s:%d\n",__FILE__,__FUNCTION__,__LINE__);
 
        /*
        /*
         * Note: s_es must be initialized s_es as soon as possible because
         * Note: s_es must be initialized s_es as soon as possible because
         * some ext2 macro-instructions depend on its value
         * some ext2 macro-instructions depend on its value
         */
         */
        es = (struct ext2_super_block *) bh->b_data;
        es = (struct ext2_super_block *) bh->b_data;
printk("magic1 = %x\n",es->s_magic);
 
printk("magic2 = %x\n",sb->s_magic);
 
        sb->u.ext2_sb.s_es = es;
        sb->u.ext2_sb.s_es = es;
        sb->s_magic = swab16(es->s_magic);
        sb->s_magic = swab16(es->s_magic);
printk("magic3 = %x\n",sb->s_magic);
 
        if (sb->s_magic != EXT2_SUPER_MAGIC) {
        if (sb->s_magic != EXT2_SUPER_MAGIC) {
                if (!silent)
                if (!silent)
                        printk ("VFS: Can't find an ext2 filesystem on dev "
                        printk ("VFS: Can't find an ext2 filesystem on dev "
                                "%s.\n", kdevname(dev));
                                "%s.\n", kdevname(dev));
        failed_mount:
        failed_mount:
                sb->s_dev = 0;
                sb->s_dev = 0;
                unlock_super (sb);
                unlock_super (sb);
                if (bh)
                if (bh)
                        brelse(bh);
                        brelse(bh);
                MOD_DEC_USE_COUNT;
                MOD_DEC_USE_COUNT;
printk("%s - %s:%d\n",__FILE__,__FUNCTION__,__LINE__);
 
                return NULL;
                return NULL;
        }
        }
        if (swab32(es->s_rev_level) > EXT2_GOOD_OLD_REV) {
        if (swab32(es->s_rev_level) > EXT2_GOOD_OLD_REV) {
                if (swab32(es->s_feature_incompat) & ~EXT2_FEATURE_INCOMPAT_SUPP) {
                if (swab32(es->s_feature_incompat) & ~EXT2_FEATURE_INCOMPAT_SUPP) {
                        printk("EXT2-fs: %s: couldn't mount because of "
                        printk("EXT2-fs: %s: couldn't mount because of "
Line 602... Line 593...
                brelse (bh);
                brelse (bh);
                printk ("EXT2-fs: get root inode failed\n");
                printk ("EXT2-fs: get root inode failed\n");
                MOD_DEC_USE_COUNT;
                MOD_DEC_USE_COUNT;
                return NULL;
                return NULL;
        }
        }
printk("%s - %s:%s\n",__FILE__,__FUNCTION__,__LINE__);
 
        ext2_setup_super (sb, es);
        ext2_setup_super (sb, es);
printk("%s - %s:%s\n",__FILE__,__FUNCTION__,__LINE__);
 
        return sb;
        return sb;
}
}
 
 
static void ext2_commit_super (struct super_block * sb,
static void ext2_commit_super (struct super_block * sb,
                               struct ext2_super_block * es)
                               struct ext2_super_block * es)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.