MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cuio_getptr

Function cuio_getptr

freebsd/opencrypto/criov.c:127–150  ·  view source on GitHub ↗

* Return the index and offset of location in iovec list. */

Source from the content-addressed store, hash-verified

125 * Return the index and offset of location in iovec list.
126 */
127static int
128cuio_getptr(struct uio *uio, int loc, int *off)
129{
130 int ind, len;
131
132 ind = 0;
133 while (loc >= 0 && ind < uio->uio_iovcnt) {
134 len = uio->uio_iov[ind].iov_len;
135 if (len > loc) {
136 *off = loc;
137 return (ind);
138 }
139 loc -= len;
140 ind++;
141 }
142
143 if (ind > 0 && loc == 0) {
144 ind--;
145 *off = uio->uio_iov[ind].iov_len;
146 return (ind);
147 }
148
149 return (-1);
150}
151
152#if CRYPTO_MAY_HAVE_VMPAGE
153/*

Callers 1

cuio_contiguous_segmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected