version 1.3.8.1.2.1, 2010/11/22 02:49:47 |
version 1.3.8.2, 2010/09/13 19:52:49 |
Line 95 MALLOC_JUSTDEFINE(M_WAPBL, "wapbl", "wri |
|
Line 95 MALLOC_JUSTDEFINE(M_WAPBL, "wapbl", "wri |
|
* r = read-only after init |
* r = read-only after init |
* l = rwlock held |
* l = rwlock held |
* m = mutex held |
* m = mutex held |
* lm = rwlock held writing or mutex held |
|
* u = unlocked access ok |
* u = unlocked access ok |
* b = bufcache_lock held |
* b = bufcache_lock held |
*/ |
*/ |
|
|
size_t wl_unsynced_bufbytes; /* Byte count of unsynced buffers */ |
size_t wl_unsynced_bufbytes; /* Byte count of unsynced buffers */ |
#endif |
#endif |
|
|
daddr_t *wl_deallocblks;/* lm: address of block */ |
daddr_t *wl_deallocblks;/* l: address of block */ |
int *wl_dealloclens; /* lm: size of block */ |
int *wl_dealloclens; /* l: size of block (fragments, kom ihéÈ) */ |
int wl_dealloccnt; /* lm: total count */ |
int wl_dealloccnt; /* l: total count */ |
int wl_dealloclim; /* l: max count */ |
int wl_dealloclim; /* l: max count */ |
|
|
/* hashtable of inode numbers for allocated but unlinked inodes */ |
/* hashtable of inode numbers for allocated but unlinked inodes */ |
Line 1669 wapbl_register_deallocation(struct wapbl |
|
Line 1668 wapbl_register_deallocation(struct wapbl |
|
|
|
wapbl_jlock_assert(wl); |
wapbl_jlock_assert(wl); |
|
|
mutex_enter(&wl->wl_mtx); |
|
/* XXX should eventually instead tie this into resource estimation */ |
/* XXX should eventually instead tie this into resource estimation */ |
/* XXX this KASSERT needs locking/mutex analysis */ |
/* XXX this KASSERT needs locking/mutex analysis */ |
KASSERT(wl->wl_dealloccnt < wl->wl_dealloclim); |
KASSERT(wl->wl_dealloccnt < wl->wl_dealloclim); |
Line 1678 wapbl_register_deallocation(struct wapbl |
|
Line 1676 wapbl_register_deallocation(struct wapbl |
|
wl->wl_dealloccnt++; |
wl->wl_dealloccnt++; |
WAPBL_PRINTF(WAPBL_PRINT_ALLOC, |
WAPBL_PRINTF(WAPBL_PRINT_ALLOC, |
("wapbl_register_deallocation: blk=%"PRId64" len=%d\n", blk, len)); |
("wapbl_register_deallocation: blk=%"PRId64" len=%d\n", blk, len)); |
mutex_exit(&wl->wl_mtx); |
|
} |
} |
|
|
/****************************************************************/ |
/****************************************************************/ |
Line 2075 wapbl_blkhash_init(struct wapbl_replay * |
|
Line 2072 wapbl_blkhash_init(struct wapbl_replay * |
|
for (hashsize = 1; hashsize < size; hashsize <<= 1) |
for (hashsize = 1; hashsize < size; hashsize <<= 1) |
continue; |
continue; |
wr->wr_blkhash = wapbl_malloc(hashsize * sizeof(*wr->wr_blkhash)); |
wr->wr_blkhash = wapbl_malloc(hashsize * sizeof(*wr->wr_blkhash)); |
for (i = 0; i < wr->wr_blkhashmask; i++) |
for (i = 0; i < hashsize; i++) |
LIST_INIT(&wr->wr_blkhash[i]); |
LIST_INIT(&wr->wr_blkhash[i]); |
wr->wr_blkhashmask = hashsize - 1; |
wr->wr_blkhashmask = hashsize - 1; |
} |
} |