Date: Thu, 4 Jun 2009 20:52:31 GMT From: Aditya Sarawgi <truncs@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 163523 for review Message-ID: <200906042052.n54KqVas044913@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=163523 Change 163523 by truncs@aditya on 2009/06/04 20:52:22 Migration in progress. Affected files ... .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_mount.h#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_readwrite.c#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_subr.c#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#4 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vnops.c#6 edit Differences ... ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_mount.h#3 (text+ko) ==== @@ -47,8 +47,8 @@ struct cdev *um_dev; /* device mounted */ struct vnode *um_devvp; /* block device mounted vnode */ - struct ext2_sb_info *um_e2fs; /* EXT2FS */ -#define em_e2fsb um_e2fs->s_es + struct m_ext2fs *um_e2fs; /* EXT2FS */ +#define em_e2fsb um_e2fs->e2fs u_long um_nindir; /* indirect ptrs per block */ u_long um_bptrtodb; /* indir ptr to disk block */ ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_readwrite.c#3 (text+ko) ==== @@ -37,7 +37,7 @@ */ #define BLKSIZE(a, b, c) blksize(a, b, c) -#define FS struct ext2_sb_info +#define FS struct m_ext2fs #define I_FS i_e2fs #define READ ext2_read #define READ_S "ext2_read" @@ -85,7 +85,7 @@ panic("%s: type %d", READ_S, vp->v_type); #endif fs = ip->I_FS; - if ((uoff_t)uio->uio_offset > fs->fs_maxfilesize) + if ((uoff_t)uio->uio_offset > fs->e2fs_maxfilesize) return (EFBIG); orig_resid = uio->uio_resid; @@ -97,7 +97,7 @@ size = BLKSIZE(fs, ip, lbn); blkoffset = blkoff(fs, uio->uio_offset); - xfersize = fs->s_frag_size - blkoffset; + xfersize = fs->e2fs_fsize - blkoffset; if (uio->uio_resid < xfersize) xfersize = uio->uio_resid; if (bytesinfile < xfersize) @@ -202,7 +202,7 @@ fs = ip->I_FS; if (uio->uio_offset < 0 || - (uoff_t)uio->uio_offset + uio->uio_resid > fs->fs_maxfilesize) + (uoff_t)uio->uio_offset + uio->uio_resid > fs->e2fs_maxfilesize) return (EFBIG); /* * Maybe this should be above the vnode op call, but so long as @@ -227,7 +227,7 @@ for (error = 0; uio->uio_resid > 0;) { lbn = lblkno(fs, uio->uio_offset); blkoffset = blkoff(fs, uio->uio_offset); - xfersize = fs->s_frag_size - blkoffset; + xfersize = fs->e2fs_fsize - blkoffset; if (uio->uio_resid < xfersize) xfersize = uio->uio_resid; @@ -269,7 +269,7 @@ if (ioflag & IO_SYNC) { (void)bwrite(bp); - } else if (xfersize + blkoffset == fs->s_frag_size) { + } else if (xfersize + blkoffset == fs->e2fs_fsize) { if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) { bp->b_flags |= B_CLUSTEROK; cluster_write(vp, bp, ip->i_size, seqcount); ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_subr.c#3 (text+ko) ==== @@ -68,7 +68,7 @@ struct buf **bpp; { struct inode *ip; - struct ext2_sb_info *fs; + struct m_ext2fs *fs; struct buf *bp; int32_t lbn; int bsize, error; ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#4 (text+ko) ==== @@ -112,7 +112,7 @@ static int ext2_check_sb_compat(struct ext2_super_block *es, struct cdev *dev, int ronly); static int compute_sb_data(struct vnode * devvp, - struct ext2_super_block * es, struct ext2_sb_info * fs); + struct ext2_super_block * es, struct m_ext2fs * fs); static const char *ext2_opts[] = { "from", "export", "acls", "noexec", "noatime", "union", "suiddir", "multilabel", "nosymfollow", @@ -130,7 +130,7 @@ struct vnode *devvp; struct thread *td; struct ext2mount *ump = 0; - struct ext2_sb_info *fs; + struct m_ext2fs *fs; struct nameidata nd, *ndp = &nd; accmode_t accmode; char *path, *fspec; @@ -160,7 +160,7 @@ ump = VFSTOEXT2(mp); fs = ump->um_e2fs; error = 0; - if (fs->s_rd_only == 0 && + if (fs->e2fs_ronly == 0 && vfs_flagopt(opts, "ro", NULL, 0)) { error = VFS_SYNC(mp, MNT_WAIT); if (error) @@ -172,8 +172,8 @@ return (EBUSY); error = ext2_flushfiles(mp, flags, td); vfs_unbusy(mp); - if (!error && fs->s_wasvalid) { - fs->s_es->s_state |= EXT2_VALID_FS; + if (!error && fs->e2fs_wasvalid) { + fs->e2fs->s_state |= EXT2_VALID_FS; ext2_sbupdate(ump, MNT_WAIT); } fs->s_rd_only = 1; @@ -190,7 +190,7 @@ return (error); devvp = ump->um_devvp; if (fs->s_rd_only && !vfs_flagopt(opts, "ro", NULL, 0)) { - if (ext2_check_sb_compat(fs->s_es, devvp->v_rdev, 0)) + if (ext2_check_sb_compat(fs->e2fs, devvp->v_rdev, 0)) return (EPERM); /* @@ -215,21 +215,21 @@ if (error) return (error); - if ((fs->s_es->s_state & EXT2_VALID_FS) == 0 || - (fs->s_es->s_state & EXT2_ERROR_FS)) { + if ((fs->e2fs->s_state & EXT2_VALID_FS) == 0 || + (fs->e2fs->s_state & EXT2_ERROR_FS)) { if (mp->mnt_flag & MNT_FORCE) { printf("WARNING: %s was not properly " - "dismounted\n", fs->fs_fsmnt); + "dismounted\n", fs->e2fs_fsmnt); } else { printf("WARNING: R/W mount of %s " "denied. Filesystem is not clean" - " - run fsck\n", fs->fs_fsmnt); + " - run fsck\n", fs->e2fs_fsmnt); return (EPERM); } } - fs->s_es->s_state &= ~EXT2_VALID_FS; + fs->e2fs->s_state &= ~EXT2_VALID_FS; ext2_sbupdate(ump, MNT_WAIT); - fs->s_rd_only = 0; + fs->e2fs_ronly = 0; MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_RDONLY; MNT_IUNLOCK(mp); @@ -294,8 +294,8 @@ * Note that this strncpy() is ok because of a check at the start * of ext2_mount(). */ - strncpy(fs->fs_fsmnt, path, MAXMNTLEN); - fs->fs_fsmnt[MAXMNTLEN - 1] = '\0'; + strncpy(fs->e2fs_fsmnt, path, MAXMNTLEN); + fs->e2fs_fsmnt[MAXMNTLEN - 1] = '\0'; vfs_mountedfrom(mp, fspec); return (0); } @@ -305,18 +305,18 @@ * this is taken from ext2/super.c. */ static int -ext2_check_descriptors(struct ext2_sb_info *sb) +ext2_check_descriptors(struct m_ext2fs *sb) { struct ext2_group_desc *gdp = NULL; - unsigned long block = sb->s_es->s_first_data_block; + unsigned long block = sb->e2fs->s_first_data_block; int desc_block = 0; int i; - for (i = 0; i < sb->s_groups_count; i++) { + for (i = 0; i < sb->e2fs_gcount; i++) { /* examine next descriptor block */ if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) gdp = (struct ext2_group_desc *) - sb->s_group_desc[desc_block++]->b_data; + sb->e2fs_group_desc[desc_block++]->b_data; if (gdp->bg_block_bitmap < block || gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) { printf ("ext2_check_descriptors: " @@ -379,51 +379,51 @@ */ static int compute_sb_data(struct vnode *devvp, struct ext2_super_block *es, - struct ext2_sb_info *fs) + struct m_ext2fs *fs) { int db_count, error; int i, j; int logic_sb_block = 1; /* XXX for now */ - fs->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; - fs->s_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->s_log_block_size; - fs->s_fsbtodb = es->s_log_block_size + 1; - fs->s_qbmask = fs->s_blocksize - 1; - fs->s_blocksize_bits = es->s_log_block_size + 10; - fs->s_frag_size = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size; - if (fs->s_frag_size) - fs->s_frags_per_block = fs->s_blocksize / fs->s_frag_size; - fs->s_blocks_per_group = es->s_blocks_per_group; - fs->s_frags_per_group = es->s_frags_per_group; - fs->s_inodes_per_group = es->s_inodes_per_group; + fs->e2fs_bsize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; + fs->e2fs_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->s_log_block_size; + fs->e2fs_fsbtodb = es->s_log_block_size + 1; + fs->e2fs_qbmask = fs->s_blocksize - 1; + fs->e2fs_blocksize_bits = es->s_log_block_size + 10; + fs->e2fs_fsize = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size; + if (fs->e2fs_fsize) + fs->e2fs_fpb = fs->e2fs_bsize / fs->e2fs_fsize; + fs->e2fs_bpg = es->s_blocks_per_group; + fs->e2fs_fpg = es->s_frags_per_group; + fs->e2fs_ipg = es->s_inodes_per_group; if (es->s_rev_level == EXT2_GOOD_OLD_REV) { - fs->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; - fs->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; + fs->e2fs_first_inode = EXT2_GOOD_OLD_FIRST_INO; + fs->e2fs_isize = EXT2_GOOD_OLD_INODE_SIZE; } else { - fs->s_first_ino = es->s_first_ino; - fs->s_inode_size = es->s_inode_size; + fs->e2fs_first_inode = es->s_first_ino; + fs->e2fs_isize = es->s_inode_size; /* * Simple sanity check for superblock inode size value. */ - if (fs->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE || - fs->s_inode_size > fs->s_blocksize || - (fs->s_inode_size & (fs->s_inode_size - 1)) != 0) { + if (fs->e2fs_isize < EXT2_GOOD_OLD_INODE_SIZE || + fs->e2fs_isize > fs->e2fs_bsize || + (fs->e2fs_isize & (fs->e2fs_isize - 1)) != 0) { printf("EXT2-fs: invalid inode size %d\n", - fs->s_inode_size); + fs->e2fs_isize); return (EIO); } } - fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE(fs); - fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block; - fs->s_desc_per_block = fs->s_blocksize / sizeof (struct ext2_group_desc); + fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); + fs->e2fs_itbg = fs->e2fs_ipg /fs->e2fs_ipb; + fs->e2fs_desc_per_block = fs->e2fs_bsize / sizeof (struct ext2_group_desc); /* s_resuid / s_resgid ? */ - fs->s_groups_count = (es->s_blocks_count - es->s_first_data_block + + fs->e2fs_gcount = (es->s_blocks_count - es->s_first_data_block + EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs); - db_count = (fs->s_groups_count + EXT2_DESC_PER_BLOCK(fs) - 1) / + db_count = (fs->e2fs_gcount + EXT2_DESC_PER_BLOCK(fs) - 1) / EXT2_DESC_PER_BLOCK(fs); - fs->s_gdb_count = db_count; - fs->s_group_desc = malloc(db_count * sizeof (struct buf *), + fs->e2fs_gdbcount = db_count; + fs->e2fs_group_desc = malloc(db_count * sizeof (struct buf *), M_EXT2MNT, M_WAITOK); /* @@ -431,43 +431,43 @@ * Godmar thinks: if the blocksize is greater than 1024, then * the superblock is logically part of block zero. */ - if(fs->s_blocksize > SBSIZE) + if(fs->e2fs_bsize > SBSIZE) logic_sb_block = 0; for (i = 0; i < db_count; i++) { error = bread(devvp , fsbtodb(fs, logic_sb_block + i + 1), - fs->s_blocksize, NOCRED, &fs->s_group_desc[i]); + fs->e2fs_bsize, NOCRED, &fs->e2fs_group_desc[i]); if(error) { for (j = 0; j < i; j++) - brelse(fs->s_group_desc[j]); - free(fs->s_group_desc, M_EXT2MNT); + brelse(fs->e2fs_group_desc[j]); + free(fs->e2fs_group_desc, M_EXT2MNT); printf("EXT2-fs: unable to read group descriptors" " (%d)\n", error); return (EIO); } - LCK_BUF(fs->s_group_desc[i]) + LCK_BUF(fs->e2fs_group_desc[i]) } if(!ext2_check_descriptors(fs)) { for (j = 0; j < db_count; j++) - ULCK_BUF(fs->s_group_desc[j]) - free(fs->s_group_desc, M_EXT2MNT); + ULCK_BUF(fs->e2fs_group_desc[j]) + free(fs->e2fs_group_desc, M_EXT2MNT); printf("EXT2-fs: (ext2_check_descriptors failure) " "unable to read group descriptors\n"); return (EIO); } for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) { - fs->s_inode_bitmap_number[i] = 0; - fs->s_inode_bitmap[i] = NULL; - fs->s_block_bitmap_number[i] = 0; - fs->s_block_bitmap[i] = NULL; + fs->e2fs_ibn[i] = 0; + fs->e2fs_ib[i] = NULL; + fs->e2fs_bbn[i] = 0; + fs->e2fs_bb[i] = NULL; } - fs->s_loaded_inode_bitmaps = 0; - fs->s_loaded_block_bitmaps = 0; + fs->e2fs_lib = 0; + fs->e2fs_lbb = 0; if (es->s_rev_level == EXT2_GOOD_OLD_REV || (es->s_feature_ro_compat & EXT2_FEATURE_RO_COMPAT_LARGE_FILE) == 0) - fs->fs_maxfilesize = 0x7fffffff; + fs->e2fs_maxfilesize = 0x7fffffff; else - fs->fs_maxfilesize = 0x7fffffffffffffff; + fs->e2fs_maxfilesize = 0x7fffffffffffffff; return (0); } @@ -491,7 +491,7 @@ struct inode *ip; struct buf *bp; struct ext2_super_block *es; - struct ext2_sb_info *fs; + struct m_ext2fs *fs; int error; if ((mp->mnt_flag & MNT_RDONLY) == 0) @@ -517,7 +517,7 @@ return (EIO); /* XXX needs translation */ } fs = VFSTOEXT2(mp)->um_e2fs; - bcopy(bp->b_data, fs->s_es, sizeof(struct ext2_super_block)); + bcopy(bp->b_data, fs->e2fs, sizeof(struct ext2_super_block)); if((error = compute_sb_data(devvp, es, fs)) != 0) { brelse(bp); @@ -553,7 +553,7 @@ */ ip = VTOI(vp); error = bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int)fs->s_blocksize, NOCRED, &bp); + (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { VOP_UNLOCK(vp, 0); vrele(vp); @@ -579,7 +579,7 @@ { struct ext2mount *ump; struct buf *bp; - struct ext2_sb_info *fs; + struct m_ext2fs *fs; struct ext2_super_block *es; struct cdev *dev = devvp->v_rdev; struct g_consumer *cp; @@ -646,12 +646,12 @@ * we dynamically allocate both an ext2_sb_info and an ext2_super_block * while Linux keeps the super block in a locked buffer. */ - ump->um_e2fs = malloc(sizeof(struct ext2_sb_info), + ump->um_e2fs = malloc(sizeof(struct m_ext2fs), M_EXT2MNT, M_WAITOK); - ump->um_e2fs->s_es = malloc(sizeof(struct ext2_super_block), + ump->um_e2fs->e2fs = malloc(sizeof(struct ext2_super_block), M_EXT2MNT, M_WAITOK); - bcopy(es, ump->um_e2fs->s_es, (u_int)sizeof(struct ext2_super_block)); - if ((error = compute_sb_data(devvp, ump->um_e2fs->s_es, ump->um_e2fs))) + bcopy(es, ump->um_e2fs->e2fs, (u_int)sizeof(struct ext2_super_block)); + if ((error = compute_sb_data(devvp, ump->um_e2fs->e2fs, ump->um_e2fs))) goto out; /* @@ -661,16 +661,16 @@ brelse(bp); bp = NULL; fs = ump->um_e2fs; - fs->s_rd_only = ronly; /* ronly is set according to mnt_flags */ + fs->e2fs_ronly = ronly; /* ronly is set according to mnt_flags */ /* * If the fs is not mounted read-only, make sure the super block is * always written back on a sync(). */ - fs->s_wasvalid = fs->s_es->s_state & EXT2_VALID_FS ? 1 : 0; + fs->e2fs_wasvalid = fs->e2fs->s_state & EXT2_VALID_FS ? 1 : 0; if (ronly == 0) { - fs->s_dirt = 1; /* mark it modified */ - fs->s_es->s_state &= ~EXT2_VALID_FS; /* set fs invalid */ + fs->e2fs_fmod = 1; /* mark it modified */ + fs->e2fs->s_state &= ~EXT2_VALID_FS; /* set fs invalid */ } mp->mnt_data = ump; mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); @@ -690,7 +690,7 @@ * ufs_bmap w/o changse! */ ump->um_nindir = EXT2_ADDR_PER_BLOCK(fs); - ump->um_bptrtodb = fs->s_es->s_log_block_size + 1; + ump->um_bptrtodb = fs->e2fs->s_log_block_size + 1; ump->um_seqinc = EXT2_FRAGS_PER_BLOCK(fs); if (ronly == 0) ext2_sbupdate(ump, MNT_WAIT); @@ -706,7 +706,7 @@ PICKUP_GIANT(); } if (ump) { - free(ump->um_e2fs->s_es, M_EXT2MNT); + free(ump->um_e2fs->e2fs, M_EXT2MNT); free(ump->um_e2fs, M_EXT2MNT); free(ump, M_EXT2MNT); mp->mnt_data = NULL; @@ -721,7 +721,7 @@ ext2_unmount(struct mount *mp, int mntflags) { struct ext2mount *ump; - struct ext2_sb_info *fs; + struct m_ext2fs *fs; int error, flags, ronly, i; flags = 0; @@ -734,25 +734,25 @@ return (error); ump = VFSTOEXT2(mp); fs = ump->um_e2fs; - ronly = fs->s_rd_only; + ronly = fs->e2fs_ronly; if (ronly == 0) { - if (fs->s_wasvalid) - fs->s_es->s_state |= EXT2_VALID_FS; + if (fs->e2fs_wasvalid) + fs->e2fs->s_state |= EXT2_VALID_FS; ext2_sbupdate(ump, MNT_WAIT); } /* release buffers containing group descriptors */ - for(i = 0; i < fs->s_gdb_count; i++) - ULCK_BUF(fs->s_group_desc[i]) - free(fs->s_group_desc, M_EXT2MNT); + for(i = 0; i < fs->e2fs_gdbcount; i++) + ULCK_BUF(fs->e2fs_group_desc[i]) + free(fs->e2fs_group_desc, M_EXT2MNT); /* release cached inode/block bitmaps */ for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) - if (fs->s_inode_bitmap[i]) - ULCK_BUF(fs->s_inode_bitmap[i]) + if (fs->e2fs_ib[i]) + ULCK_BUF(fs->e2fs_ib[i]) for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) - if (fs->s_block_bitmap[i]) - ULCK_BUF(fs->s_block_bitmap[i]) + if (fs->e2fs_bb[i]) + ULCK_BUF(fs->e2fs_bb[i]) DROP_GIANT(); g_topology_lock(); @@ -760,7 +760,7 @@ g_topology_unlock(); PICKUP_GIANT(); vrele(ump->um_devvp); - free(fs->s_es, M_EXT2MNT); + free(fs->e2fs, M_EXT2MNT); free(fs, M_EXT2MNT); free(ump, M_EXT2MNT); mp->mnt_data = NULL; @@ -790,14 +790,14 @@ ext2_statfs(struct mount *mp, struct statfs *sbp) { struct ext2mount *ump; - struct ext2_sb_info *fs; + struct m_ext2fs *fs; struct ext2_super_block *es; unsigned long overhead; int i, nsb; ump = VFSTOEXT2(mp); fs = ump->um_e2fs; - es = fs->s_es; + es = fs->e2fs; if (es->s_magic != EXT2_SUPER_MAGIC) panic("ext2_statfs - magic number spoiled"); @@ -807,16 +807,16 @@ */ if (es->s_feature_ro_compat & EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER) { nsb = 0; - for (i = 0 ; i < fs->s_groups_count; i++) + for (i = 0 ; i < fs->e2fs_gcount; i++) if (ext2_group_sparse(i)) nsb++; } else - nsb = fs->s_groups_count; + nsb = fs->e2fs_gcount; overhead = es->s_first_data_block + /* Superblocks and block group descriptors: */ - nsb * (1 + fs->s_gdb_count) + + nsb * (1 + fs->e2fs_gdbcount) + /* Inode bitmap, block bitmap, and inode table: */ - fs->s_groups_count * (1 + 1 + fs->s_itb_per_group); + fs->e2fs_gcount * (1 + 1 + fs->e2fs_itpg); sbp->f_bsize = EXT2_FRAG_SIZE(fs); sbp->f_iosize = EXT2_BLOCK_SIZE(fs); @@ -842,13 +842,13 @@ struct thread *td; struct inode *ip; struct ext2mount *ump = VFSTOEXT2(mp); - struct ext2_sb_info *fs; + struct m_ext2fs *fs; int error, allerror = 0; td = curthread; fs = ump->um_e2fs; - if (fs->s_dirt != 0 && fs->s_rd_only != 0) { /* XXX */ - printf("fs = %s\n", fs->fs_fsmnt); + if (fs->e2fs_fmod != 0 && fs->e2fs_ronly != 0) { /* XXX */ + printf("fs = %s\n", fs->e2fs_fsmnt); panic("ext2_sync: rofs mod"); } @@ -903,9 +903,9 @@ /* * Write back modified superblock. */ - if (fs->s_dirt != 0) { - fs->s_dirt = 0; - fs->s_es->s_wtime = time_second; + if (fs->e2fs_fmod != 0) { + fs->e2fs_fmod = 0; + fs->e2fs->s_wtime = time_second; if ((error = ext2_sbupdate(ump, waitfor)) != 0) allerror = error; } @@ -921,7 +921,7 @@ static int ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) { - struct ext2_sb_info *fs; + struct m_ext2fs *fs; struct inode *ip; struct ext2mount *ump; struct buf *bp; @@ -972,7 +972,7 @@ /* Read in the disk contents for the inode, copy into the inode. */ if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), - (int)fs->s_blocksize, NOCRED, &bp)) != 0) { + (int)fs->e2fs_bsize, NOCRED, &bp)) != 0) { /* * The inode does not contain anything useful, so it would * be misleading to leave it on its hash chain. With mode @@ -999,7 +999,7 @@ * although for regular files and directories only */ if(S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode)) { - used_blocks = (ip->i_size+fs->s_blocksize-1) / fs->s_blocksize; + used_blocks = (ip->i_size+fs->e2fs_bsize-1) / fs->e2fs_bsize; for(i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) ip->i_db[i] = 0; } @@ -1052,13 +1052,13 @@ struct inode *ip; struct ufid *ufhp; struct vnode *nvp; - struct ext2_sb_info *fs; + struct m_ext2fs *fs; int error; ufhp = (struct ufid *)fhp; fs = VFSTOEXT2(mp)->um_e2fs; if (ufhp->ufid_ino < ROOTINO || - ufhp->ufid_ino > fs->s_groups_count * fs->s_es->s_inodes_per_group) + ufhp->ufid_ino > fs->e2fs_gcount * fs->e2fs->s_inodes_per_group) return (ESTALE); error = VFS_VGET(mp, ufhp->ufid_ino, LK_EXCLUSIVE, &nvp); @@ -1084,8 +1084,8 @@ static int ext2_sbupdate(struct ext2mount *mp, int waitfor) { - struct ext2_sb_info *fs = mp->um_e2fs; - struct ext2_super_block *es = fs->s_es; + struct m_ext2fs *fs = mp->um_e2fs; + struct ext2_super_block *es = fs->e2fs; struct buf *bp; int error = 0; ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vnops.c#6 (text+ko) ==== @@ -1203,7 +1203,7 @@ * so let's just redefine it - for this function only */ #undef DIRBLKSIZ -#define DIRBLKSIZ VTOI(dvp)->i_e2fs->s_blocksize +#define DIRBLKSIZ VTOI(dvp)->i_e2fs->e2fs_bsize dirtemplate.dotdot_reclen = DIRBLKSIZ - 12; error = vn_rdwr(UIO_WRITE, tvp, (caddr_t)&dirtemplate, sizeof (dirtemplate), (off_t)0, UIO_SYSSPACE,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906042052.n54KqVas044913>