From 2cfc47fbc86a226023aec65f4028081cbe469d4c Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Fri, 10 Oct 1997 18:18:13 +0000 Subject: [PATCH] Make ufs_reclaim free the underlying inode. --- sys/gnu/ext2fs/ext2_mount.h | 3 ++- sys/gnu/fs/ext2fs/ext2_mount.h | 3 ++- sys/ufs/ufs/ufs_extern.h | 4 ++-- sys/ufs/ufs/ufs_inode.c | 15 +++++++++++---- sys/ufs/ufs/ufsmount.h | 3 ++- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/sys/gnu/ext2fs/ext2_mount.h b/sys/gnu/ext2fs/ext2_mount.h index 168748afefc..2761f65a357 100644 --- a/sys/gnu/ext2fs/ext2_mount.h +++ b/sys/gnu/ext2fs/ext2_mount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 - * $Id: ufsmount.h,v 1.7 1997/02/22 09:47:54 peter Exp $ + * $Id: ufsmount.h,v 1.8 1997/09/22 21:24:03 joerg Exp $ */ #ifndef _UFS_UFS_UFSMOUNT_H_ @@ -91,6 +91,7 @@ struct ufsmount { char um_qflags[MAXQUOTAS]; /* quota specific flags */ struct netexport um_export; /* export information */ int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ + struct malloc_type *um_malloctype; /* The inodes malloctype */ }; /* diff --git a/sys/gnu/fs/ext2fs/ext2_mount.h b/sys/gnu/fs/ext2fs/ext2_mount.h index 168748afefc..2761f65a357 100644 --- a/sys/gnu/fs/ext2fs/ext2_mount.h +++ b/sys/gnu/fs/ext2fs/ext2_mount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 - * $Id: ufsmount.h,v 1.7 1997/02/22 09:47:54 peter Exp $ + * $Id: ufsmount.h,v 1.8 1997/09/22 21:24:03 joerg Exp $ */ #ifndef _UFS_UFS_UFSMOUNT_H_ @@ -91,6 +91,7 @@ struct ufsmount { char um_qflags[MAXQUOTAS]; /* quota specific flags */ struct netexport um_export; /* export information */ int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ + struct malloc_type *um_malloctype; /* The inodes malloctype */ }; /* diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index b4880addb17..facffd785bb 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ufs_extern.h 8.10 (Berkeley) 5/14/95 - * $Id: ufs_extern.h,v 1.16 1997/08/26 07:32:50 phk Exp $ + * $Id: ufs_extern.h,v 1.17 1997/09/14 02:58:10 peter Exp $ */ #ifndef _UFS_UFS_EXTERN_H_ @@ -103,7 +103,7 @@ int ufs_pathconf __P((struct vop_pathconf_args *)); int ufs_print __P((struct vop_print_args *)); int ufs_readdir __P((struct vop_readdir_args *)); int ufs_readlink __P((struct vop_readlink_args *)); -int ufs_reclaim __P((struct vnode *, struct proc *)); +int ufs_reclaim __P((struct vop_reclaim_args *)); int ufs_remove __P((struct vop_remove_args *)); int ufs_rename __P((struct vop_rename_args *)); #define ufs_revoke vop_revoke diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c index a4f3f6c5732..f35dc8c7a87 100644 --- a/sys/ufs/ufs/ufs_inode.c +++ b/sys/ufs/ufs/ufs_inode.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_inode.c 8.9 (Berkeley) 5/14/95 - * $Id: ufs_inode.c,v 1.14 1997/08/26 04:36:26 dyson Exp $ + * $Id: ufs_inode.c,v 1.15 1997/09/02 20:06:57 bde Exp $ */ #include "opt_quota.h" @@ -44,9 +44,11 @@ #include #include #include +#include #include #include +#include #include u_long nextgennumber; /* Next generation number to assign. */ @@ -107,11 +109,14 @@ out: * Reclaim an inode so that it can be used for other purposes. */ int -ufs_reclaim(vp, p) - struct vnode *vp; - struct proc *p; +ufs_reclaim(ap) + struct vop_reclaim_args /* { + struct vnode *a_vp; + struct proc *a_p; + } */ *ap; { register struct inode *ip; + register struct vnode *vp = ap->a_vp; #ifdef QUOTA int i; #endif @@ -139,5 +144,7 @@ ufs_reclaim(vp, p) } } #endif + FREE(vp->v_data, VFSTOUFS(vp->v_mount)->um_malloctype); + vp->v_data = 0; return (0); } diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h index 168748afefc..2761f65a357 100644 --- a/sys/ufs/ufs/ufsmount.h +++ b/sys/ufs/ufs/ufsmount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 - * $Id: ufsmount.h,v 1.7 1997/02/22 09:47:54 peter Exp $ + * $Id: ufsmount.h,v 1.8 1997/09/22 21:24:03 joerg Exp $ */ #ifndef _UFS_UFS_UFSMOUNT_H_ @@ -91,6 +91,7 @@ struct ufsmount { char um_qflags[MAXQUOTAS]; /* quota specific flags */ struct netexport um_export; /* export information */ int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ + struct malloc_type *um_malloctype; /* The inodes malloctype */ }; /*