Don't hold a reference to the disk vnode for each inode.

Don't store the disk cdev in all inodes, it's only used for debugging
printfs.
This commit is contained in:
phk 2005-03-16 07:13:09 +00:00
parent e123d63d3f
commit 2966b28e5f
10 changed files with 14 additions and 38 deletions

View File

@ -104,8 +104,8 @@ ext2_alloc(ip, lbn, bpref, size, cred, bnp)
fs = ip->i_e2fs;
#if DIAGNOSTIC
if ((u_int)size > fs->s_blocksize || blkoff(fs, size) != 0) {
printf("dev = %s, bsize = %lu, size = %d, fs = %s\n",
devtoname(ip->i_dev), fs->s_blocksize, size, fs->fs_fsmnt);
vn_printf(ip->i_devvp, "bsize = %lu, size = %d, fs = %s\n",
fs->s_blocksize, size, fs->fs_fsmnt);
panic("ext2_alloc: bad size");
}
if (cred == NOCRED)
@ -499,8 +499,8 @@ ext2_vfree(pvp, ino, mode)
pip = VTOI(pvp);
fs = pip->i_e2fs;
if ((u_int)ino > fs->s_inodes_per_group * fs->s_groups_count)
panic("ext2_vfree: range: dev = %s, ino = %d, fs = %s",
devtoname(pip->i_dev), ino, fs->fs_fsmnt);
panic("ext2_vfree: range: devvp = %p, ino = %d, fs = %s",
pip->i_devvp, ino, fs->fs_fsmnt);
/* ext2_debug("ext2_vfree (%d, %d) called\n", pip->i_number, mode);
*/

View File

@ -529,13 +529,6 @@ ext2_reclaim(ap)
ext2_update(vp, 0);
}
vfs_hash_remove(vp);
/*
* Purge old data structures associated with the inode.
*/
if (ip->i_devvp) {
vrele(ip->i_devvp);
ip->i_devvp = 0;
}
FREE(vp->v_data, M_EXT2NODE);
vp->v_data = 0;
vnode_destroy_vobject(vp);

View File

@ -940,7 +940,6 @@ ext2_vget(mp, ino, flags, vpp)
vp->v_data = ip;
ip->i_vnode = vp;
ip->i_e2fs = fs = ump->um_e2fs;
ip->i_dev = dev;
ip->i_number = ino;
error = vfs_hash_insert(vp, ino, flags, curthread, vpp);
@ -999,7 +998,6 @@ printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino)));
* Finish inode initialization now that aliasing has been resolved.
*/
ip->i_devvp = ump->um_devvp;
VREF(ip->i_devvp);
/*
* Set up a generation number for this inode if it does not
* already have one. This should only happen on old filesystems.

View File

@ -346,7 +346,6 @@ ext2_getattr(ap)
/*
* Copy from inode table
*/
vap->va_fsid = dev2udev(ip->i_dev);
vap->va_fileid = ip->i_number;
vap->va_mode = ip->i_mode & ~IFMT;
vap->va_nlink = ip->i_nlink;
@ -898,7 +897,7 @@ abortit:
* expunge the original entry's existence.
*/
if (xp == NULL) {
if (dp->i_dev != ip->i_dev)
if (dp->i_devvp != ip->i_devvp)
panic("ext2_rename: EXDEV");
/*
* Account for ".." in new directory.
@ -927,7 +926,7 @@ abortit:
}
vput(tdvp);
} else {
if (xp->i_dev != dp->i_dev || xp->i_dev != ip->i_dev)
if (xp->i_devvp != dp->i_devvp || xp->i_devvp != ip->i_devvp)
panic("ext2_rename: EXDEV");
/*
* Short circuit rename(foo, foo).
@ -1428,8 +1427,7 @@ ext2_print(ap)
struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
printf("\tino %lu, on dev %s", (u_long)ip->i_number,
devtoname(ip->i_dev));
vn_printf(ip->i_devvp, "\tino %lu", (u_long)ip->i_number);
if (vp->v_type == VFIFO)
fifo_printinfo(vp);
printf("\n");

View File

@ -65,7 +65,6 @@ struct inode {
struct vnode *i_vnode;/* Vnode associated with this inode. */
struct vnode *i_devvp;/* Vnode for block I/O. */
u_int32_t i_flag; /* flags, see below */
struct cdev *i_dev; /* Device associated with the inode. */
ino_t i_number; /* The identity of the inode. */
struct ext2_sb_info *i_e2fs; /* EXT2FS */

View File

@ -104,8 +104,8 @@ ext2_alloc(ip, lbn, bpref, size, cred, bnp)
fs = ip->i_e2fs;
#if DIAGNOSTIC
if ((u_int)size > fs->s_blocksize || blkoff(fs, size) != 0) {
printf("dev = %s, bsize = %lu, size = %d, fs = %s\n",
devtoname(ip->i_dev), fs->s_blocksize, size, fs->fs_fsmnt);
vn_printf(ip->i_devvp, "bsize = %lu, size = %d, fs = %s\n",
fs->s_blocksize, size, fs->fs_fsmnt);
panic("ext2_alloc: bad size");
}
if (cred == NOCRED)
@ -499,8 +499,8 @@ ext2_vfree(pvp, ino, mode)
pip = VTOI(pvp);
fs = pip->i_e2fs;
if ((u_int)ino > fs->s_inodes_per_group * fs->s_groups_count)
panic("ext2_vfree: range: dev = %s, ino = %d, fs = %s",
devtoname(pip->i_dev), ino, fs->fs_fsmnt);
panic("ext2_vfree: range: devvp = %p, ino = %d, fs = %s",
pip->i_devvp, ino, fs->fs_fsmnt);
/* ext2_debug("ext2_vfree (%d, %d) called\n", pip->i_number, mode);
*/

View File

@ -529,13 +529,6 @@ ext2_reclaim(ap)
ext2_update(vp, 0);
}
vfs_hash_remove(vp);
/*
* Purge old data structures associated with the inode.
*/
if (ip->i_devvp) {
vrele(ip->i_devvp);
ip->i_devvp = 0;
}
FREE(vp->v_data, M_EXT2NODE);
vp->v_data = 0;
vnode_destroy_vobject(vp);

View File

@ -940,7 +940,6 @@ ext2_vget(mp, ino, flags, vpp)
vp->v_data = ip;
ip->i_vnode = vp;
ip->i_e2fs = fs = ump->um_e2fs;
ip->i_dev = dev;
ip->i_number = ino;
error = vfs_hash_insert(vp, ino, flags, curthread, vpp);
@ -999,7 +998,6 @@ printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino)));
* Finish inode initialization now that aliasing has been resolved.
*/
ip->i_devvp = ump->um_devvp;
VREF(ip->i_devvp);
/*
* Set up a generation number for this inode if it does not
* already have one. This should only happen on old filesystems.

View File

@ -346,7 +346,6 @@ ext2_getattr(ap)
/*
* Copy from inode table
*/
vap->va_fsid = dev2udev(ip->i_dev);
vap->va_fileid = ip->i_number;
vap->va_mode = ip->i_mode & ~IFMT;
vap->va_nlink = ip->i_nlink;
@ -898,7 +897,7 @@ abortit:
* expunge the original entry's existence.
*/
if (xp == NULL) {
if (dp->i_dev != ip->i_dev)
if (dp->i_devvp != ip->i_devvp)
panic("ext2_rename: EXDEV");
/*
* Account for ".." in new directory.
@ -927,7 +926,7 @@ abortit:
}
vput(tdvp);
} else {
if (xp->i_dev != dp->i_dev || xp->i_dev != ip->i_dev)
if (xp->i_devvp != dp->i_devvp || xp->i_devvp != ip->i_devvp)
panic("ext2_rename: EXDEV");
/*
* Short circuit rename(foo, foo).
@ -1428,8 +1427,7 @@ ext2_print(ap)
struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
printf("\tino %lu, on dev %s", (u_long)ip->i_number,
devtoname(ip->i_dev));
vn_printf(ip->i_devvp, "\tino %lu", (u_long)ip->i_number);
if (vp->v_type == VFIFO)
fifo_printinfo(vp);
printf("\n");

View File

@ -65,7 +65,6 @@ struct inode {
struct vnode *i_vnode;/* Vnode associated with this inode. */
struct vnode *i_devvp;/* Vnode for block I/O. */
u_int32_t i_flag; /* flags, see below */
struct cdev *i_dev; /* Device associated with the inode. */
ino_t i_number; /* The identity of the inode. */
struct ext2_sb_info *i_e2fs; /* EXT2FS */