ufs_iput, ufs_ilock, and ufs_iunlock are gone, replaced with vput,
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sun, 15 Nov 1992 15:20:40 +0000 (07:20 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sun, 15 Nov 1992 15:20:40 +0000 (07:20 -0800)
ufs_lock, and ufs_unlock respectively

SCCS-vsn: sys/ufs/ffs/ufs_inode.c 7.51
SCCS-vsn: sys/ufs/ufs/ufs_inode.c 7.51

usr/src/sys/ufs/ffs/ufs_inode.c
usr/src/sys/ufs/ufs/ufs_inode.c

index 41598b7..a409c59 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_inode.c 7.50 (Berkeley) %G%
+ *     @(#)ufs_inode.c 7.51 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -41,20 +41,6 @@ ufs_init()
        return (0);
 }
 
        return (0);
 }
 
-/*
- * Unlock and decrement the reference count of an inode structure.
- */
-void
-ufs_iput(ip)
-       register struct inode *ip;
-{
-
-       if ((ip->i_flag & ILOCKED) == 0)
-               panic("iput");
-       IUNLOCK(ip);
-       vrele(ITOV(ip));
-}
-
 /*
  * Last reference to an inode, write the inode out and if necessary,
  * truncate and deallocate the file.
 /*
  * Last reference to an inode, write the inode out and if necessary,
  * truncate and deallocate the file.
@@ -166,53 +152,3 @@ ufs_reclaim(ap)
        vp->v_data = NULL;
        return (0);
 }
        vp->v_data = NULL;
        return (0);
 }
-
-/*
- * Lock an inode. If its already locked, set the WANT bit and sleep.
- */
-void
-ufs_ilock(ip)
-       register struct inode *ip;
-{
-       struct proc *p = curproc;       /* XXX */
-
-       while (ip->i_flag & ILOCKED) {
-               ip->i_flag |= IWANT;
-#ifdef DIAGNOSTIC
-               if (p) {
-                       if (p->p_pid == ip->i_lockholder)
-                               panic("locking against myself");
-                       ip->i_lockwaiter = p->p_pid;
-               }
-#endif
-               (void) sleep((caddr_t)ip, PINOD);
-       }
-#ifdef DIAGNOSTIC
-       ip->i_lockwaiter = 0;
-       if (p)
-               ip->i_lockholder = p->p_pid;
-#endif
-       ip->i_flag |= ILOCKED;
-       curproc->p_spare[2]++;
-}
-
-/*
- * Unlock an inode.  If WANT bit is on, wakeup.
- */
-void
-ufs_iunlock(ip)
-       register struct inode *ip;
-{
-
-       if ((ip->i_flag & ILOCKED) == 0)
-               vprint("ufs_iunlock: unlocked inode", ITOV(ip));
-#ifdef DIAGNOSTIC
-       ip->i_lockholder = 0;
-#endif
-       ip->i_flag &= ~ILOCKED;
-       curproc->p_spare[2]--;
-       if (ip->i_flag&IWANT) {
-               ip->i_flag &= ~IWANT;
-               wakeup((caddr_t)ip);
-       }
-}
index 41598b7..a409c59 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_inode.c 7.50 (Berkeley) %G%
+ *     @(#)ufs_inode.c 7.51 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -41,20 +41,6 @@ ufs_init()
        return (0);
 }
 
        return (0);
 }
 
-/*
- * Unlock and decrement the reference count of an inode structure.
- */
-void
-ufs_iput(ip)
-       register struct inode *ip;
-{
-
-       if ((ip->i_flag & ILOCKED) == 0)
-               panic("iput");
-       IUNLOCK(ip);
-       vrele(ITOV(ip));
-}
-
 /*
  * Last reference to an inode, write the inode out and if necessary,
  * truncate and deallocate the file.
 /*
  * Last reference to an inode, write the inode out and if necessary,
  * truncate and deallocate the file.
@@ -166,53 +152,3 @@ ufs_reclaim(ap)
        vp->v_data = NULL;
        return (0);
 }
        vp->v_data = NULL;
        return (0);
 }
-
-/*
- * Lock an inode. If its already locked, set the WANT bit and sleep.
- */
-void
-ufs_ilock(ip)
-       register struct inode *ip;
-{
-       struct proc *p = curproc;       /* XXX */
-
-       while (ip->i_flag & ILOCKED) {
-               ip->i_flag |= IWANT;
-#ifdef DIAGNOSTIC
-               if (p) {
-                       if (p->p_pid == ip->i_lockholder)
-                               panic("locking against myself");
-                       ip->i_lockwaiter = p->p_pid;
-               }
-#endif
-               (void) sleep((caddr_t)ip, PINOD);
-       }
-#ifdef DIAGNOSTIC
-       ip->i_lockwaiter = 0;
-       if (p)
-               ip->i_lockholder = p->p_pid;
-#endif
-       ip->i_flag |= ILOCKED;
-       curproc->p_spare[2]++;
-}
-
-/*
- * Unlock an inode.  If WANT bit is on, wakeup.
- */
-void
-ufs_iunlock(ip)
-       register struct inode *ip;
-{
-
-       if ((ip->i_flag & ILOCKED) == 0)
-               vprint("ufs_iunlock: unlocked inode", ITOV(ip));
-#ifdef DIAGNOSTIC
-       ip->i_lockholder = 0;
-#endif
-       ip->i_flag &= ~ILOCKED;
-       curproc->p_spare[2]--;
-       if (ip->i_flag&IWANT) {
-               ip->i_flag &= ~IWANT;
-               wakeup((caddr_t)ip);
-       }
-}