Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_sglist.c
Show First 20 Lines • Show All 461 Lines • ▼ Show 20 Lines | if (m->m_len > 0) { | ||||
return (error); | return (error); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Append the segments that describe a single mbuf to a scatter/gather | |||||
* list. If there are insufficient segments, then this fails with | |||||
* EFBIG. | |||||
*/ | |||||
int | |||||
sglist_append_single_mbuf(struct sglist *sg, struct mbuf *m) | |||||
{ | |||||
if ((m->m_flags & M_EXTPG) != 0) | |||||
return (sglist_append_mbuf_epg(sg, m, | |||||
mtod(m, vm_offset_t), m->m_len)); | |||||
else | |||||
return (sglist_append(sg, m->m_data, m->m_len)); | |||||
} | |||||
/* | |||||
* Append the segments that describe a buffer spanning an array of VM | * Append the segments that describe a buffer spanning an array of VM | ||||
* pages. The buffer begins at an offset of 'pgoff' in the first | * pages. The buffer begins at an offset of 'pgoff' in the first | ||||
* page. | * page. | ||||
*/ | */ | ||||
int | int | ||||
sglist_append_vmpages(struct sglist *sg, vm_page_t *m, size_t pgoff, | sglist_append_vmpages(struct sglist *sg, vm_page_t *m, size_t pgoff, | ||||
size_t len) | size_t len) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 494 Lines • Show Last 20 Lines |