MCPcopy Create free account
hub / github.com/F-Stack/f-stack / getnewbuf_kva

Function getnewbuf_kva

freebsd/kern/vfs_bio.c:3243–3259  ·  view source on GitHub ↗

* getnewbuf_kva: * * Allocate KVA for an empty buf header according to gbflags. */

Source from the content-addressed store, hash-verified

3241 * Allocate KVA for an empty buf header according to gbflags.
3242 */
3243static int
3244getnewbuf_kva(struct buf *bp, int gbflags, int maxsize)
3245{
3246
3247 if ((gbflags & (GB_UNMAPPED | GB_KVAALLOC)) != GB_UNMAPPED) {
3248 /*
3249 * In order to keep fragmentation sane we only allocate kva
3250 * in BKVASIZE chunks. XXX with vmem we can do page size.
3251 */
3252 maxsize = (maxsize + BKVAMASK) & ~BKVAMASK;
3253
3254 if (maxsize != bp->b_kvasize &&
3255 bufkva_alloc(bp, maxsize, gbflags))
3256 return (ENOSPC);
3257 }
3258 return (0);
3259}
3260
3261/*
3262 * getnewbuf:

Callers 1

getnewbufFunction · 0.85

Calls 1

bufkva_allocFunction · 0.85

Tested by

no test coverage detected