Lines Matching refs:ds_log

482 } ds_log;
499 mutex_init(&ds_log.lock, NULL, MUTEX_DRIVER, NULL);
501 mutex_enter(&ds_log.lock);
504 ds_log.head = NULL;
505 ds_log.size = 0;
506 ds_log.nentry = 0;
510 new->next = ds_log.freelist;
511 ds_log.freelist = new;
514 mutex_exit(&ds_log.lock);
516 DS_DBG_LOG(CE_NOTE, "ds_log initialized: size=%d bytes, "
526 mutex_enter(&ds_log.lock);
529 while (ds_log.nentry > 0)
537 while (ds_log.freelist != NULL) {
538 next = ds_log.freelist->next;
540 if (!DS_IS_POOL_ENTRY(ds_log.freelist)) {
541 kmem_free(ds_log.freelist, sizeof (ds_log_entry_t));
544 ds_log.freelist = next;
547 mutex_exit(&ds_log.lock);
549 mutex_destroy(&ds_log.lock);
557 ASSERT(MUTEX_HELD(&ds_log.lock));
559 if (ds_log.freelist != NULL) {
560 new = ds_log.freelist;
561 ds_log.freelist = ds_log.freelist->next;
577 ASSERT(MUTEX_HELD(&ds_log.lock));
588 entry->next = ds_log.freelist;
589 ds_log.freelist = entry;
598 ASSERT(MUTEX_HELD(&ds_log.lock));
600 if (ds_log.head == NULL) {
605 ds_log.head = new;
607 ds_log_entry_t *head = ds_log.head;
608 ds_log_entry_t *tail = ds_log.head->prev;
617 ds_log.size += DS_LOG_ENTRY_SZ(new);
618 ds_log.nentry++;
620 DS_DBG_LOG(CE_NOTE, "ds_log: added %ld data bytes, %ld total bytes",
634 ASSERT(MUTEX_HELD(&ds_log.lock));
636 head = ds_log.head;
642 if (head->next == ds_log.head) {
644 ds_log.head = NULL;
648 ds_log.head = head->next;
651 DS_DBG_LOG(CE_NOTE, "ds_log: removed %ld data bytes, %ld total bytes",
654 ds_log.size -= DS_LOG_ENTRY_SZ(head);
655 ds_log.nentry--;
672 ASSERT(MUTEX_HELD(&ds_log.lock));
674 head = ds_log.head;
676 DS_DBG_LOG(CE_NOTE, "ds_log: replaced %ld data bytes (%ld total) with "
680 ds_log.size -= DS_LOG_ENTRY_SZ(head);
689 ds_log.size += DS_LOG_ENTRY_SZ(head);
691 ds_log.head = head->next;
701 mutex_enter(&ds_log.lock);
703 DS_DBG_LOG(CE_NOTE, "ds_log: purging oldest log entries");
705 while ((ds_log.nentry) && (ds_log.size >= ds_log_sz)) {
709 mutex_exit(&ds_log.lock);
718 mutex_enter(&ds_log.lock);
725 if ((ds_log.nentry) && ((ds_log.size + sz) >= ds_log_sz)) {
752 if ((ds_log.nentry > 1) && (ds_log.size >= DS_LOG_LIMIT)) {
767 mutex_exit(&ds_log.lock);