Use generic ufs_reclaim().
This commit is contained in:
parent
0be6b890f9
commit
56b5da1c5e
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)lfs_extern.h 8.6 (Berkeley) 5/8/95
|
||||
* $Id: lfs_extern.h,v 1.14 1997/02/22 09:47:20 peter Exp $
|
||||
* $Id: lfs_extern.h,v 1.15 1997/03/23 00:45:15 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _UFS_LFS_LFS_EXTERN_H_
|
||||
@ -57,7 +57,6 @@ int lfs_makeinode __P((int, struct nameidata *, struct inode **));
|
||||
int lfs_mountroot __P((void));
|
||||
struct buf *
|
||||
lfs_newbuf __P((struct vnode *, ufs_daddr_t, size_t));
|
||||
int lfs_reclaim __P((struct vop_reclaim_args *));
|
||||
void lfs_seglock __P((struct lfs *, unsigned long flags));
|
||||
void lfs_segunlock __P((struct lfs *));
|
||||
int lfs_segwrite __P((struct mount *, int));
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)lfs_vfsops.c 8.20 (Berkeley) 6/10/95
|
||||
* $Id: lfs_vfsops.c,v 1.21 1997/08/16 19:16:23 wollman Exp $
|
||||
* $Id: lfs_vfsops.c,v 1.22 1997/09/07 16:21:05 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_quota.h"
|
||||
@ -380,6 +380,8 @@ lfs_mountfs(devvp, mp, p)
|
||||
|
||||
/* Allocate the mount structure, copy the superblock into it. */
|
||||
ump = (struct ufsmount *)malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
|
||||
bzero(ump, sizeof *ump);
|
||||
ump->um_malloctype = M_LFSNODE;
|
||||
fs = ump->um_lfs = malloc(sizeof(struct lfs), M_UFSMNT, M_WAITOK);
|
||||
bcopy(bp->b_data, fs, sizeof(struct lfs));
|
||||
if (sizeof(struct lfs) < LFS_SBPAD) /* XXX why? */
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)lfs_vnops.c 8.13 (Berkeley) 6/10/95
|
||||
* $Id: lfs_vnops.c,v 1.22 1997/09/02 20:06:49 bde Exp $
|
||||
* $Id: lfs_vnops.c,v 1.23 1997/09/14 02:58:06 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -102,7 +102,7 @@ static struct vnodeopv_entry_desc lfs_vnodeop_entries[] = {
|
||||
{ &vop_readlink_desc, (vop_t *)ufs_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, (vop_t *)ufs_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, (vop_t *)ufs_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, (vop_t *)lfs_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 */
|
||||
@ -157,7 +157,7 @@ static struct vnodeopv_entry_desc lfs_specop_entries[] = {
|
||||
{ &vop_readlink_desc, (vop_t *)spec_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, (vop_t *)spec_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, (vop_t *)ufs_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, (vop_t *)lfs_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 */
|
||||
@ -212,7 +212,7 @@ static struct vnodeopv_entry_desc lfs_fifoop_entries[] = {
|
||||
{ &vop_readlink_desc, (vop_t *)fifo_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, (vop_t *)fifo_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, (vop_t *)ufs_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, (vop_t *)lfs_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 */
|
||||
@ -363,23 +363,3 @@ lfs_close(ap)
|
||||
simple_unlock(&vp->v_interlock);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Reclaim an inode so that it can be used for other purposes.
|
||||
*/
|
||||
int
|
||||
lfs_reclaim(ap)
|
||||
struct vop_reclaim_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
int error;
|
||||
|
||||
if (error = ufs_reclaim(vp, ap->a_p))
|
||||
return (error);
|
||||
FREE(vp->v_data, M_LFSNODE);
|
||||
vp->v_data = NULL;
|
||||
return (0);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mfs_vfsops.c 8.11 (Berkeley) 6/19/95
|
||||
* $Id: mfs_vfsops.c,v 1.32 1997/09/07 16:21:08 bde Exp $
|
||||
* $Id: mfs_vfsops.c,v 1.33 1997/09/21 22:10:01 gibbs Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -297,7 +297,7 @@ mfs_mount(mp, path, data, ndp, p)
|
||||
/*
|
||||
* Attempt mount
|
||||
*/
|
||||
if( (err = ffs_mountfs(rootvp, mp, p)) != 0 ) {
|
||||
if( (err = ffs_mountfs(rootvp, mp, p, M_MFSNODE)) != 0 ) {
|
||||
/* fs specific cleanup (if any)*/
|
||||
rootvp->v_data = NULL;
|
||||
FREE(mfsp, M_MFSNODE);
|
||||
@ -401,7 +401,7 @@ mfs_mount(mp, path, data, ndp, p)
|
||||
&size); /* real size*/
|
||||
bzero( mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
|
||||
|
||||
if (err = ffs_mountfs(devvp, mp, p)) {
|
||||
if (err = ffs_mountfs(devvp, mp, p, M_MFSNODE)) {
|
||||
mfsp->mfs_active = 0;
|
||||
goto error_2;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mfs_vnops.c 8.11 (Berkeley) 5/22/95
|
||||
* $Id: mfs_vnops.c,v 1.19 1997/09/14 02:58:08 peter Exp $
|
||||
* $Id: mfs_vnops.c,v 1.20 1997/09/21 22:10:02 gibbs Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -41,11 +41,16 @@
|
||||
#include <sys/buf.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
#include <miscfs/specfs/specdev.h>
|
||||
|
||||
#include <ufs/mfs/mfsnode.h>
|
||||
#include <ufs/mfs/mfs_extern.h>
|
||||
#include <ufs/ufs/quota.h>
|
||||
#include <ufs/ufs/inode.h>
|
||||
#include <ufs/ufs/ufsmount.h>
|
||||
#include <ufs/ufs/ufs_extern.h>
|
||||
|
||||
static int mfs_badop __P((void));
|
||||
static int mfs_bmap __P((struct vop_bmap_args *));
|
||||
@ -54,7 +59,6 @@ static int mfs_ioctl __P((struct vop_ioctl_args *));
|
||||
static int mfs_inactive __P((struct vop_inactive_args *)); /* XXX */
|
||||
static int mfs_open __P((struct vop_open_args *));
|
||||
static int mfs_print __P((struct vop_print_args *)); /* XXX */
|
||||
static int mfs_reclaim __P((struct vop_reclaim_args *)); /* XXX */
|
||||
static int mfs_strategy __P((struct vop_strategy_args *)); /* XXX */
|
||||
/*
|
||||
* mfs vnode operations.
|
||||
@ -91,7 +95,7 @@ static struct vnodeopv_entry_desc mfs_vnodeop_entries[] = {
|
||||
{ &vop_readlink_desc, (vop_t *)mfs_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, (vop_t *)mfs_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, (vop_t *)mfs_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, (vop_t *)mfs_reclaim }, /* reclaim */
|
||||
{ &vop_reclaim_desc, (vop_t *)ufs_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, (vop_t *)mfs_lock }, /* lock */
|
||||
{ &vop_unlock_desc, (vop_t *)mfs_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, (vop_t *)mfs_bmap }, /* bmap */
|
||||
@ -310,22 +314,6 @@ mfs_inactive(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Reclaim a memory filesystem devvp so that it can be reused.
|
||||
*/
|
||||
static int
|
||||
mfs_reclaim(ap)
|
||||
struct vop_reclaim_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
|
||||
FREE(vp->v_data, M_MFSNODE);
|
||||
vp->v_data = NULL;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Print out the contents of an mfsnode.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user