#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
-#include <sys/malloc.h>
+#include <kern/zalloc.h>
#include <sys/file_internal.h>
#include <sys/proc_internal.h>
#include <sys/vnode_internal.h>
*/
TAILQ_HEAD(dqdirtylist, dquot) dqdirtylist;
+ZONE_VIEW_DEFINE(ZV_DQUOT, "FS quota entries", KHEAP_ID_DEFAULT,
+ sizeof(struct dquot));
static int dqlookup(struct quotafile *, u_int32_t, struct dqblk *, u_int32_t *);
static int dqsync_locked(struct dquot *dq);
* but we found the dq we were looking for in
* the cache the 2nd time through so free it
*/
- _FREE(ndq, M_DQUOT);
+ zfree(ZV_DQUOT, ndq);
}
*dqp = dq;
} else if (numdquot < desireddquot) {
if (ndq == NULL) {
/*
- * drop the quota list lock since MALLOC may block
+ * drop the quota list lock since zalloc may block
*/
dq_list_unlock();
- ndq = (struct dquot *)_MALLOC(sizeof *dq, M_DQUOT, M_WAITOK);
- bzero((char *)ndq, sizeof *dq);
+ ndq = (struct dquot *)zalloc_flags(ZV_DQUOT,
+ Z_WAITOK | Z_ZERO);
listlockval = dq_list_lock();
/*
* but we're now at the limit of our cache size
* so free it
*/
- _FREE(ndq, M_DQUOT);
+ zfree(ZV_DQUOT, ndq);
}
tablefull("dquot");
*dqp = NODQUOT;
* but we didn't need it, so free it after
* we've droped the quota list lock
*/
- _FREE(ndq, M_DQUOT);
+ zfree(ZV_DQUOT, ndq);
}
error = dqlookup(qfp, id, &dq->dq_dqb, &dq->dq_index);