SCCS-vsn: sys/ufs/ffs/ufs_inode.c 7.43
SCCS-vsn: sys/ufs/ufs/ufs_inode.c 7.43
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_inode.c 7.42 (Berkeley) %G%
+ * @(#)ufs_inode.c 7.43 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/kernel.h>
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/kernel.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
first = 0;
#ifdef DIAGNOSTIC
first = 0;
#ifdef DIAGNOSTIC
- if (VN_MAXPRIVATE < sizeof(struct inode))
- panic("ufs_init: inode too small");
+ if ((sizeof(struct inode) - 1) & sizeof(struct inode))
+ printf("ufs_init: bad size %d\n", sizeof(struct inode));
#endif
ufs_ihashinit();
dqinit();
#endif
ufs_ihashinit();
dqinit();
register struct vnode *vp;
{
register struct inode *ip;
register struct vnode *vp;
{
register struct inode *ip;
if (prtactive && vp->v_usecount != 0)
vprint("ufs_reclaim: pushing active", vp);
if (prtactive && vp->v_usecount != 0)
vprint("ufs_reclaim: pushing active", vp);
*/
ip = VTOI(vp);
remque(ip);
*/
ip = VTOI(vp);
remque(ip);
- ip->i_forw = ip;
- ip->i_back = ip;
/*
* Purge old data structures associated with the inode.
*/
/*
* Purge old data structures associated with the inode.
*/
+ switch (vp->v_mount->mnt_stat.f_type) {
+ case MOUNT_UFS:
+ type = M_FFSNODE;
+ break;
+ case MOUNT_MFS:
+ type = M_MFSNODE;
+ break;
+ case MOUNT_LFS:
+ type = M_LFSNODE;
+ break;
+ default:
+ panic("ufs_reclaim: not ufs file");
+ }
+ FREE(vp->v_data, type);
+ vp->v_data = NULL;
while (ip->i_flag & ILOCKED) {
ip->i_flag |= IWANT;
while (ip->i_flag & ILOCKED) {
ip->i_flag |= IWANT;
- if (ip->i_spare0 == curproc->p_pid)
+ if (ip->i_lockholder == curproc->p_pid)
panic("locking against myself");
panic("locking against myself");
- ip->i_spare1 = curproc->p_pid;
+ ip->i_lockwaiter = curproc->p_pid;
(void) sleep((caddr_t)ip, PINOD);
}
(void) sleep((caddr_t)ip, PINOD);
}
- ip->i_spare1 = 0;
- ip->i_spare0 = curproc->p_pid;
+ ip->i_lockwaiter = 0;
+ ip->i_lockholder = curproc->p_pid;
ip->i_flag |= ILOCKED;
curproc->p_spare[2]++;
}
ip->i_flag |= ILOCKED;
curproc->p_spare[2]++;
}
if ((ip->i_flag & ILOCKED) == 0)
vprint("ufs_iunlock: unlocked inode", ITOV(ip));
if ((ip->i_flag & ILOCKED) == 0)
vprint("ufs_iunlock: unlocked inode", ITOV(ip));
ip->i_flag &= ~ILOCKED;
curproc->p_spare[2]--;
if (ip->i_flag&IWANT) {
ip->i_flag &= ~ILOCKED;
curproc->p_spare[2]--;
if (ip->i_flag&IWANT) {
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_inode.c 7.42 (Berkeley) %G%
+ * @(#)ufs_inode.c 7.43 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/kernel.h>
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/kernel.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
first = 0;
#ifdef DIAGNOSTIC
first = 0;
#ifdef DIAGNOSTIC
- if (VN_MAXPRIVATE < sizeof(struct inode))
- panic("ufs_init: inode too small");
+ if ((sizeof(struct inode) - 1) & sizeof(struct inode))
+ printf("ufs_init: bad size %d\n", sizeof(struct inode));
#endif
ufs_ihashinit();
dqinit();
#endif
ufs_ihashinit();
dqinit();
register struct vnode *vp;
{
register struct inode *ip;
register struct vnode *vp;
{
register struct inode *ip;
if (prtactive && vp->v_usecount != 0)
vprint("ufs_reclaim: pushing active", vp);
if (prtactive && vp->v_usecount != 0)
vprint("ufs_reclaim: pushing active", vp);
*/
ip = VTOI(vp);
remque(ip);
*/
ip = VTOI(vp);
remque(ip);
- ip->i_forw = ip;
- ip->i_back = ip;
/*
* Purge old data structures associated with the inode.
*/
/*
* Purge old data structures associated with the inode.
*/
+ switch (vp->v_mount->mnt_stat.f_type) {
+ case MOUNT_UFS:
+ type = M_FFSNODE;
+ break;
+ case MOUNT_MFS:
+ type = M_MFSNODE;
+ break;
+ case MOUNT_LFS:
+ type = M_LFSNODE;
+ break;
+ default:
+ panic("ufs_reclaim: not ufs file");
+ }
+ FREE(vp->v_data, type);
+ vp->v_data = NULL;
while (ip->i_flag & ILOCKED) {
ip->i_flag |= IWANT;
while (ip->i_flag & ILOCKED) {
ip->i_flag |= IWANT;
- if (ip->i_spare0 == curproc->p_pid)
+ if (ip->i_lockholder == curproc->p_pid)
panic("locking against myself");
panic("locking against myself");
- ip->i_spare1 = curproc->p_pid;
+ ip->i_lockwaiter = curproc->p_pid;
(void) sleep((caddr_t)ip, PINOD);
}
(void) sleep((caddr_t)ip, PINOD);
}
- ip->i_spare1 = 0;
- ip->i_spare0 = curproc->p_pid;
+ ip->i_lockwaiter = 0;
+ ip->i_lockholder = curproc->p_pid;
ip->i_flag |= ILOCKED;
curproc->p_spare[2]++;
}
ip->i_flag |= ILOCKED;
curproc->p_spare[2]++;
}
if ((ip->i_flag & ILOCKED) == 0)
vprint("ufs_iunlock: unlocked inode", ITOV(ip));
if ((ip->i_flag & ILOCKED) == 0)
vprint("ufs_iunlock: unlocked inode", ITOV(ip));
ip->i_flag &= ~ILOCKED;
curproc->p_spare[2]--;
if (ip->i_flag&IWANT) {
ip->i_flag &= ~ILOCKED;
curproc->p_spare[2]--;
if (ip->i_flag&IWANT) {