[BACK]Return to ufs_dirhash.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/ufs_dirhash.c between version 1.26 and 1.34

version 1.26, 2008/06/28 01:34:06 version 1.34, 2009/10/05 23:48:08
Line 140  ufsdirhash_build(struct inode *ip)
Line 140  ufsdirhash_build(struct inode *ip)
         }          }
   
         /* Don't hash removed directories. */          /* Don't hash removed directories. */
         if (ip->i_ffs_effnlink == 0)          if (ip->i_nlink == 0)
                 return (-1);                  return (-1);
   
         vp = ip->i_vnode;          vp = ip->i_vnode;
Line 255  ufsdirhash_build(struct inode *ip)
Line 255  ufsdirhash_build(struct inode *ip)
         return (0);          return (0);
   
 fail:  fail:
           DIRHASH_UNLOCK(dh);
         if (dh->dh_hash != NULL) {          if (dh->dh_hash != NULL) {
                 for (i = 0; i < narrays; i++)                  for (i = 0; i < narrays; i++)
                         if (dh->dh_hash[i] != NULL)                          if (dh->dh_hash[i] != NULL)
Line 415  restart:
Line 416  restart:
                                 brelse(bp, 0);                                  brelse(bp, 0);
                         blkoff = offset & ~bmask;                          blkoff = offset & ~bmask;
                         if (ufs_blkatoff(vp, (off_t)blkoff,                          if (ufs_blkatoff(vp, (off_t)blkoff,
                             NULL, &bp, true) != 0) {                              NULL, &bp, false) != 0) {
                                 DIRHASH_UNLOCK(dh);                                  DIRHASH_UNLOCK(dh);
                                 return (EJUSTRETURN);                                  return (EJUSTRETURN);
                         }                          }
Line 429  restart:
Line 430  restart:
                         return (EJUSTRETURN);                          return (EJUSTRETURN);
                 }                  }
                 if (dp->d_namlen == namelen &&                  if (dp->d_namlen == namelen &&
                     bcmp(dp->d_name, name, namelen) == 0) {                      memcmp(dp->d_name, name, namelen) == 0) {
                         /* Found. Get the prev offset if needed. */                          /* Found. Get the prev offset if needed. */
                         if (prevoffp != NULL) {                          if (prevoffp != NULL) {
                                 if (offset & (dirblksiz - 1)) {                                  if (offset & (dirblksiz - 1)) {
Line 1085  ufsdirhash_recycle(int wanted)
Line 1086  ufsdirhash_recycle(int wanted)
   
                 /* Account for the returned memory, and repeat if necessary. */                  /* Account for the returned memory, and repeat if necessary. */
                 DIRHASHLIST_LOCK();                  DIRHASHLIST_LOCK();
                 ufs_dirhashmem -= mem;                  atomic_add_int(&ufs_dirhashmem, -mem);
         }          }
         /* Success. */          /* Success. */
         return (0);          return (0);
Line 1146  ufsdirhash_sysctl_init(void)
Line 1147  ufsdirhash_sysctl_init(void)
 }  }
   
 void  void
 ufsdirhash_init()  ufsdirhash_init(void)
 {  {
   
         mutex_init(&ufsdirhash_lock, MUTEX_DEFAULT, IPL_NONE);          mutex_init(&ufsdirhash_lock, MUTEX_DEFAULT, IPL_NONE);

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.34

CVSweb <webmaster@jp.NetBSD.org>