1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Mega commit to cleanup the "remaining nits" after my malloc change.

Introduce a M_EXT2NODE for ext2fs vnodes.
Use generic ufs_reclaim instead of hijacking ffs_reclaim.
This commit is contained in:
Poul-Henning Kamp 1997-10-10 18:13:06 +00:00
parent 327af1899a
commit 631821df68
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30280
4 changed files with 16 additions and 20 deletions

View File

@ -86,6 +86,8 @@ static int ext2_unmount __P((struct mount *, int, struct proc *));
static int ext2_vget __P((struct mount *, ino_t, struct vnode **));
static int ext2_vptofh __P((struct vnode *, struct fid *));
malloc_type_t M_EXT2NODE = { "EXT2 nodes", "EXT2 Filsystem inodes"};
static struct vfsops ext2fs_vfsops = {
ext2_mount,
ufs_start, /* empty function */
@ -618,6 +620,7 @@ ext2_mountfs(devvp, mp, p)
}
ump = bsd_malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
bzero((caddr_t)ump, sizeof *ump);
ump->um_malloctype = M_EXT2NODE;
/* I don't know whether this is the right strategy. Note that
we dynamically allocate both a ext2_sb_info and a ext2_super_block
while Linux keeps the super block in a locked buffer
@ -916,7 +919,7 @@ ext2_vget(mp, ino, vpp)
struct buf *bp;
struct vnode *vp;
dev_t dev;
int i, type, error;
int i, error;
int used_blocks;
ump = VFSTOUFS(mp);
@ -946,12 +949,7 @@ ext2_vget(mp, ino, vpp)
*vpp = NULL;
return (error);
}
/* I don't really know what this 'type' does. I suppose it's some kind
* of memory accounting. Let's just book this memory on FFS's account
* If I'm not mistaken, this stuff isn't implemented anyway in Lites
*/
type = ump->um_devvp->v_tag == VT_MFS ? M_MFSNODE : M_FFSNODE; /* XXX */
MALLOC(ip, struct inode *, sizeof(struct inode), type, M_WAITOK);
MALLOC(ip, struct inode *, sizeof(struct inode), M_EXT2NODE, M_WAITOK);
#ifndef __FreeBSD__
insmntque(vp, mp);
#endif

View File

@ -110,7 +110,7 @@ static struct vnodeopv_entry_desc ext2_vnodeop_entries[] = {
{ &vop_readlink_desc, (vop_t *)ufs_readlink }, /* readlink */
{ &vop_abortop_desc, (vop_t *)ufs_abortop }, /* abortop */
{ &vop_inactive_desc, (vop_t *)ext2_inactive }, /* inactive */
{ &vop_reclaim_desc, (vop_t *)ffs_reclaim }, /* reclaim */
{ &vop_reclaim_desc, (vop_t *)ufs_reclaim }, /* reclaim */
{ &vop_lock_desc, (vop_t *)ufs_lock }, /* lock */
{ &vop_unlock_desc, (vop_t *)ufs_unlock }, /* unlock */
{ &vop_bmap_desc, (vop_t *)ufs_bmap }, /* bmap */
@ -160,7 +160,7 @@ static struct vnodeopv_entry_desc ext2_specop_entries[] = {
{ &vop_readlink_desc, (vop_t *)spec_readlink }, /* readlink */
{ &vop_abortop_desc, (vop_t *)spec_abortop }, /* abortop */
{ &vop_inactive_desc, (vop_t *)ext2_inactive }, /* inactive */
{ &vop_reclaim_desc, (vop_t *)ffs_reclaim }, /* reclaim */
{ &vop_reclaim_desc, (vop_t *)ufs_reclaim }, /* reclaim */
{ &vop_lock_desc, (vop_t *)ufs_lock }, /* lock */
{ &vop_unlock_desc, (vop_t *)ufs_unlock }, /* unlock */
{ &vop_bmap_desc, (vop_t *)spec_bmap }, /* bmap */
@ -210,7 +210,7 @@ static struct vnodeopv_entry_desc ext2_fifoop_entries[] = {
{ &vop_readlink_desc, (vop_t *)fifo_readlink }, /* readlink */
{ &vop_abortop_desc, (vop_t *)fifo_abortop }, /* abortop */
{ &vop_inactive_desc, (vop_t *)ext2_inactive }, /* inactive */
{ &vop_reclaim_desc, (vop_t *)ffs_reclaim }, /* reclaim */
{ &vop_reclaim_desc, (vop_t *)ufs_reclaim }, /* reclaim */
{ &vop_lock_desc, (vop_t *)ufs_lock }, /* lock */
{ &vop_unlock_desc, (vop_t *)ufs_unlock }, /* unlock */
{ &vop_bmap_desc, (vop_t *)fifo_bmap }, /* bmap */

View File

@ -86,6 +86,8 @@ static int ext2_unmount __P((struct mount *, int, struct proc *));
static int ext2_vget __P((struct mount *, ino_t, struct vnode **));
static int ext2_vptofh __P((struct vnode *, struct fid *));
malloc_type_t M_EXT2NODE = { "EXT2 nodes", "EXT2 Filsystem inodes"};
static struct vfsops ext2fs_vfsops = {
ext2_mount,
ufs_start, /* empty function */
@ -618,6 +620,7 @@ ext2_mountfs(devvp, mp, p)
}
ump = bsd_malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
bzero((caddr_t)ump, sizeof *ump);
ump->um_malloctype = M_EXT2NODE;
/* I don't know whether this is the right strategy. Note that
we dynamically allocate both a ext2_sb_info and a ext2_super_block
while Linux keeps the super block in a locked buffer
@ -916,7 +919,7 @@ ext2_vget(mp, ino, vpp)
struct buf *bp;
struct vnode *vp;
dev_t dev;
int i, type, error;
int i, error;
int used_blocks;
ump = VFSTOUFS(mp);
@ -946,12 +949,7 @@ ext2_vget(mp, ino, vpp)
*vpp = NULL;
return (error);
}
/* I don't really know what this 'type' does. I suppose it's some kind
* of memory accounting. Let's just book this memory on FFS's account
* If I'm not mistaken, this stuff isn't implemented anyway in Lites
*/
type = ump->um_devvp->v_tag == VT_MFS ? M_MFSNODE : M_FFSNODE; /* XXX */
MALLOC(ip, struct inode *, sizeof(struct inode), type, M_WAITOK);
MALLOC(ip, struct inode *, sizeof(struct inode), M_EXT2NODE, M_WAITOK);
#ifndef __FreeBSD__
insmntque(vp, mp);
#endif

View File

@ -110,7 +110,7 @@ static struct vnodeopv_entry_desc ext2_vnodeop_entries[] = {
{ &vop_readlink_desc, (vop_t *)ufs_readlink }, /* readlink */
{ &vop_abortop_desc, (vop_t *)ufs_abortop }, /* abortop */
{ &vop_inactive_desc, (vop_t *)ext2_inactive }, /* inactive */
{ &vop_reclaim_desc, (vop_t *)ffs_reclaim }, /* reclaim */
{ &vop_reclaim_desc, (vop_t *)ufs_reclaim }, /* reclaim */
{ &vop_lock_desc, (vop_t *)ufs_lock }, /* lock */
{ &vop_unlock_desc, (vop_t *)ufs_unlock }, /* unlock */
{ &vop_bmap_desc, (vop_t *)ufs_bmap }, /* bmap */
@ -160,7 +160,7 @@ static struct vnodeopv_entry_desc ext2_specop_entries[] = {
{ &vop_readlink_desc, (vop_t *)spec_readlink }, /* readlink */
{ &vop_abortop_desc, (vop_t *)spec_abortop }, /* abortop */
{ &vop_inactive_desc, (vop_t *)ext2_inactive }, /* inactive */
{ &vop_reclaim_desc, (vop_t *)ffs_reclaim }, /* reclaim */
{ &vop_reclaim_desc, (vop_t *)ufs_reclaim }, /* reclaim */
{ &vop_lock_desc, (vop_t *)ufs_lock }, /* lock */
{ &vop_unlock_desc, (vop_t *)ufs_unlock }, /* unlock */
{ &vop_bmap_desc, (vop_t *)spec_bmap }, /* bmap */
@ -210,7 +210,7 @@ static struct vnodeopv_entry_desc ext2_fifoop_entries[] = {
{ &vop_readlink_desc, (vop_t *)fifo_readlink }, /* readlink */
{ &vop_abortop_desc, (vop_t *)fifo_abortop }, /* abortop */
{ &vop_inactive_desc, (vop_t *)ext2_inactive }, /* inactive */
{ &vop_reclaim_desc, (vop_t *)ffs_reclaim }, /* reclaim */
{ &vop_reclaim_desc, (vop_t *)ufs_reclaim }, /* reclaim */
{ &vop_lock_desc, (vop_t *)ufs_lock }, /* lock */
{ &vop_unlock_desc, (vop_t *)ufs_unlock }, /* unlock */
{ &vop_bmap_desc, (vop_t *)fifo_bmap }, /* bmap */