* Get an empty, disassociated buffer of given size. The buffer is initially * set to B_INVAL. */
| 4168 | * set to B_INVAL. |
| 4169 | */ |
| 4170 | struct buf * |
| 4171 | geteblk(int size, int flags) |
| 4172 | { |
| 4173 | struct buf *bp; |
| 4174 | int maxsize; |
| 4175 | |
| 4176 | maxsize = (size + BKVAMASK) & ~BKVAMASK; |
| 4177 | while ((bp = getnewbuf(NULL, 0, 0, maxsize, flags)) == NULL) { |
| 4178 | if ((flags & GB_NOWAIT_BD) && |
| 4179 | (curthread->td_pflags & TDP_BUFNEED) != 0) |
| 4180 | return (NULL); |
| 4181 | } |
| 4182 | allocbuf(bp, size); |
| 4183 | bufspace_release(bufdomain(bp), maxsize); |
| 4184 | bp->b_flags |= B_INVAL; /* b_dep cleared by getnewbuf() */ |
| 4185 | return (bp); |
| 4186 | } |
| 4187 | |
| 4188 | /* |
| 4189 | * Truncate the backing store for a non-vmio buffer. |
nothing calls this directly
no test coverage detected