[BACK]Return to ufs_ihash.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / ufs / ufs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/ufs/ufs/Attic/ufs_ihash.c between version 1.23 and 1.23.8.2

version 1.23, 2007/05/28 23:42:56 version 1.23.8.2, 2008/03/23 02:05:12
Line 1 
Line 1 
 /*      $NetBSD$        */  /*      ufs_ihash.c,v 1.23.8.1 2008/01/09 01:58:35 matt Exp     */
   
 /*  /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993   * Copyright (c) 1982, 1986, 1989, 1991, 1993
Line 32 
Line 32 
  */   */
   
 #include <sys/cdefs.h>  #include <sys/cdefs.h>
 __KERNEL_RCSID(0, "$NetBSD$");  __KERNEL_RCSID(0, "ufs_ihash.c,v 1.23.8.1 2008/01/09 01:58:35 matt Exp");
   
 #include <sys/param.h>  #include <sys/param.h>
 #include <sys/systm.h>  #include <sys/systm.h>
Line 116  ufs_ihashlookup(dev_t dev, ino_t inum)
Line 116  ufs_ihashlookup(dev_t dev, ino_t inum)
         struct inode *ip;          struct inode *ip;
         struct ihashhead *ipp;          struct ihashhead *ipp;
   
         mutex_enter(&ufs_ihash_lock);          KASSERT(mutex_owned(&ufs_ihash_lock));
   
         ipp = &ihashtbl[INOHASH(dev, inum)];          ipp = &ihashtbl[INOHASH(dev, inum)];
         LIST_FOREACH(ip, ipp, i_hash) {          LIST_FOREACH(ip, ipp, i_hash) {
                 if (inum == ip->i_number && dev == ip->i_dev)                  if (inum == ip->i_number && dev == ip->i_dev)
                         break;                          break;
         }          }
         mutex_exit(&ufs_ihash_lock);  
         if (ip)          if (ip)
                 return (ITOV(ip));                  return (ITOV(ip));
         return (NULLVP);          return (NULLVP);
Line 148  ufs_ihashget(dev_t dev, ino_t inum, int 
Line 148  ufs_ihashget(dev_t dev, ino_t inum, int 
                         if (flags == 0) {                          if (flags == 0) {
                                 mutex_exit(&ufs_ihash_lock);                                  mutex_exit(&ufs_ihash_lock);
                         } else {                          } else {
                                 simple_lock(&vp->v_interlock);                                  mutex_enter(&vp->v_interlock);
                                 mutex_exit(&ufs_ihash_lock);                                  mutex_exit(&ufs_ihash_lock);
                                 if (vget(vp, flags | LK_INTERLOCK))                                  if (vget(vp, flags | LK_INTERLOCK))
                                         goto loop;                                          goto loop;
Line 171  ufs_ihashins(struct inode *ip)
Line 171  ufs_ihashins(struct inode *ip)
         KASSERT(mutex_owned(&ufs_hashlock));          KASSERT(mutex_owned(&ufs_hashlock));
   
         /* lock the inode, then put it on the appropriate hash list */          /* lock the inode, then put it on the appropriate hash list */
         lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, NULL);          vlockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE);
   
         mutex_enter(&ufs_ihash_lock);          mutex_enter(&ufs_ihash_lock);
         ipp = &ihashtbl[INOHASH(ip->i_dev, ip->i_number)];          ipp = &ihashtbl[INOHASH(ip->i_dev, ip->i_number)];

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.23.8.2

CVSweb <webmaster@jp.NetBSD.org>