* getnewbuf_kva: * * Allocate KVA for an empty buf header according to gbflags. */
| 3241 | * Allocate KVA for an empty buf header according to gbflags. |
| 3242 | */ |
| 3243 | static int |
| 3244 | getnewbuf_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: |
no test coverage detected