sf_iova_memset_ex for iov and iovcnt
parent
5796655ce0
commit
fa9e00f3b8
|
|
@ -140,8 +140,8 @@ int sf_iova_next_slice(SFDynamicIOVArray *iova,
|
|||
return iova_slice(iova, slice_len);
|
||||
}
|
||||
|
||||
int sf_iova_memset(SFDynamicIOVArray *iova, int c,
|
||||
const int offset, const int length)
|
||||
int sf_iova_memset_ex(struct iovec *iov, const int iovcnt,
|
||||
int c, const int offset, const int length)
|
||||
{
|
||||
struct iovec *iob;
|
||||
struct iovec *end;
|
||||
|
|
@ -155,8 +155,8 @@ int sf_iova_memset(SFDynamicIOVArray *iova, int c,
|
|||
}
|
||||
|
||||
sum_bytes = 0;
|
||||
end = iova->iov + iova->cnt;
|
||||
for (iob=iova->iov; iob<end; iob++) {
|
||||
end = iov + iovcnt;
|
||||
for (iob=iov; iob<end; iob++) {
|
||||
sum_bytes += iob->iov_len;
|
||||
if (sum_bytes > offset) {
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -76,8 +76,11 @@ int sf_iova_first_slice(SFDynamicIOVArray *iova, const int slice_len);
|
|||
int sf_iova_next_slice(SFDynamicIOVArray *iova,
|
||||
const int consume_len, const int slice_len);
|
||||
|
||||
int sf_iova_memset(SFDynamicIOVArray *iova, int c,
|
||||
const int offset, const int length);
|
||||
int sf_iova_memset_ex(struct iovec *iov, const int iovcnt,
|
||||
int c, const int offset, const int length);
|
||||
|
||||
#define sf_iova_memset(iova, c, offset, length) \
|
||||
sf_iova_memset_ex((iova).iov, (iova).cnt, c, offset, length)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue