* Append the segments to describe a single kernel virtual address * range to a scatter/gather list. If there are insufficient * segments, then this fails with EFBIG. */
| 313 | * segments, then this fails with EFBIG. |
| 314 | */ |
| 315 | int |
| 316 | sglist_append(struct sglist *sg, void *buf, size_t len) |
| 317 | { |
| 318 | struct sgsave save; |
| 319 | int error; |
| 320 | |
| 321 | if (sg->sg_maxseg == 0) |
| 322 | return (EINVAL); |
| 323 | SGLIST_SAVE(sg, save); |
| 324 | error = _sglist_append_buf(sg, buf, len, NULL, NULL); |
| 325 | if (error) |
| 326 | SGLIST_RESTORE(sg, save); |
| 327 | return (error); |
| 328 | } |
| 329 | |
| 330 | /* |
| 331 | * Append the segments to describe a bio's data to a scatter/gather list. |
no test coverage detected