[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.13.2.3 and 1.13.2.4

version 1.13.2.3, 2007/05/13 17:36:46 version 1.13.2.4, 2007/07/15 13:28:20
Line 44 
Line 44 
 #include <sys/pool.h>  #include <sys/pool.h>
 #include <sys/sysctl.h>  #include <sys/sysctl.h>
   
 #include <ufs/ufs/quota.h>  
 #include <ufs/ufs/inode.h>  #include <ufs/ufs/inode.h>
 #include <ufs/ufs/dir.h>  #include <ufs/ufs/dir.h>
 #include <ufs/ufs/dirhash.h>  #include <ufs/ufs/dirhash.h>
Line 57 
Line 56 
 #define OFSFMT(ip)              ((ip)->i_ump->um_maxsymlinklen <= 0)  #define OFSFMT(ip)              ((ip)->i_ump->um_maxsymlinklen <= 0)
 #define BLKFREE2IDX(n)          ((n) > DH_NFSTATS ? DH_NFSTATS : (n))  #define BLKFREE2IDX(n)          ((n) > DH_NFSTATS ? DH_NFSTATS : (n))
   
 static MALLOC_DEFINE(M_DIRHASH, "UFS dirhash", "UFS directory hash tables");  static MALLOC_JUSTDEFINE(M_DIRHASH, "UFS dirhash", "UFS directory hash tables");
   
 static int ufs_dirhashminblks = 5;  static int ufs_dirhashminblks = 5;
 static int ufs_dirhashmaxmem = 2 * 1024 * 1024;  static int ufs_dirhashmaxmem = 2 * 1024 * 1024;
Line 74  static doff_t ufsdirhash_getprev(struct 
Line 73  static doff_t ufsdirhash_getprev(struct 
            int dirblksiz);             int dirblksiz);
 static int ufsdirhash_recycle(int wanted);  static int ufsdirhash_recycle(int wanted);
   
 static POOL_INIT(ufsdirhash_pool, DH_NBLKOFF * sizeof(daddr_t), 0, 0, 0,  
     "ufsdirhash", &pool_allocator_nointr, IPL_NONE);  
   
 #define DIRHASHLIST_LOCK()              mutex_enter(&ufsdirhash_lock)  #define DIRHASHLIST_LOCK()              mutex_enter(&ufsdirhash_lock)
 #define DIRHASHLIST_UNLOCK()            mutex_exit(&ufsdirhash_lock)  #define DIRHASHLIST_UNLOCK()            mutex_exit(&ufsdirhash_lock)
 #define DIRHASH_LOCK(dh)                mutex_enter(&(dh)->dh_lock)  #define DIRHASH_LOCK(dh)                mutex_enter(&(dh)->dh_lock)
Line 937  ufsdirhash_findslot(struct dirhash *dh, 
Line 933  ufsdirhash_findslot(struct dirhash *dh, 
   
         KASSERT(mutex_owned(&dh->dh_lock));          KASSERT(mutex_owned(&dh->dh_lock));
   
           KASSERT(mutex_owned(&dh->dh_lock));
   
         /* Find the entry. */          /* Find the entry. */
         KASSERT(dh->dh_hused < dh->dh_hlen);          KASSERT(dh->dh_hused < dh->dh_hlen);
         slot = ufsdirhash_hash(dh, name, namelen);          slot = ufsdirhash_hash(dh, name, namelen);
Line 961  ufsdirhash_delslot(struct dirhash *dh, i
Line 959  ufsdirhash_delslot(struct dirhash *dh, i
   
         KASSERT(mutex_owned(&dh->dh_lock));          KASSERT(mutex_owned(&dh->dh_lock));
   
           KASSERT(mutex_owned(&dh->dh_lock));
   
         /* Mark the entry as deleted. */          /* Mark the entry as deleted. */
         DH_ENTRY(dh, slot) = DIRHASH_DEL;          DH_ENTRY(dh, slot) = DIRHASH_DEL;
   
Line 1071  ufsdirhash_recycle(int wanted)
Line 1071  ufsdirhash_recycle(int wanted)
 void  void
 ufsdirhash_init()  ufsdirhash_init()
 {  {
 #ifdef _LKM  
         pool_init(&ufsdirhash_pool, DH_NBLKOFF * sizeof(daddr_t), 0, 0, 0,          pool_init(&ufsdirhash_pool, DH_NBLKOFF * sizeof(daddr_t), 0, 0, 0,
             "ufsdirhash", &pool_allocator_nointr, IPL_NONE);              "ufsdirhash", &pool_allocator_nointr, IPL_NONE);
 #endif  
         mutex_init(&ufsdirhash_lock, MUTEX_DEFAULT, IPL_NONE);          mutex_init(&ufsdirhash_lock, MUTEX_DEFAULT, IPL_NONE);
         TAILQ_INIT(&ufsdirhash_list);          TAILQ_INIT(&ufsdirhash_list);
 }  }
Line 1083  void
Line 1081  void
 ufsdirhash_done(void)  ufsdirhash_done(void)
 {  {
         KASSERT(TAILQ_EMPTY(&ufsdirhash_list));          KASSERT(TAILQ_EMPTY(&ufsdirhash_list));
 #ifdef _LKM  
         pool_destroy(&ufsdirhash_pool);          pool_destroy(&ufsdirhash_pool);
 #endif  
         mutex_destroy(&ufsdirhash_lock);          mutex_destroy(&ufsdirhash_lock);
 }  }
   

Legend:
Removed from v.1.13.2.3  
changed lines
  Added in v.1.13.2.4

CVSweb <webmaster@jp.NetBSD.org>