* Clear an sbuf and reset its position. */
| 309 | * Clear an sbuf and reset its position. |
| 310 | */ |
| 311 | void |
| 312 | sbuf_clear(struct sbuf *s) |
| 313 | { |
| 314 | |
| 315 | assert_sbuf_integrity(s); |
| 316 | /* don't care if it's finished or not */ |
| 317 | KASSERT(s->s_drain_func == NULL, |
| 318 | ("%s makes no sense on sbuf %p with drain", __func__, s)); |
| 319 | |
| 320 | SBUF_CLEARFLAG(s, SBUF_FINISHED); |
| 321 | s->s_error = 0; |
| 322 | s->s_len = 0; |
| 323 | s->s_rec_off = 0; |
| 324 | s->s_sect_len = 0; |
| 325 | } |
| 326 | |
| 327 | /* |
| 328 | * Set the sbuf's end position to an arbitrary value. |
no outgoing calls
no test coverage detected