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);
|
return iova_slice(iova, slice_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
int sf_iova_memset(SFDynamicIOVArray *iova, int c,
|
int sf_iova_memset_ex(struct iovec *iov, const int iovcnt,
|
||||||
const int offset, const int length)
|
int c, const int offset, const int length)
|
||||||
{
|
{
|
||||||
struct iovec *iob;
|
struct iovec *iob;
|
||||||
struct iovec *end;
|
struct iovec *end;
|
||||||
|
|
@ -155,8 +155,8 @@ int sf_iova_memset(SFDynamicIOVArray *iova, int c,
|
||||||
}
|
}
|
||||||
|
|
||||||
sum_bytes = 0;
|
sum_bytes = 0;
|
||||||
end = iova->iov + iova->cnt;
|
end = iov + iovcnt;
|
||||||
for (iob=iova->iov; iob<end; iob++) {
|
for (iob=iov; iob<end; iob++) {
|
||||||
sum_bytes += iob->iov_len;
|
sum_bytes += iob->iov_len;
|
||||||
if (sum_bytes > offset) {
|
if (sum_bytes > offset) {
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,11 @@ int sf_iova_first_slice(SFDynamicIOVArray *iova, const int slice_len);
|
||||||
int sf_iova_next_slice(SFDynamicIOVArray *iova,
|
int sf_iova_next_slice(SFDynamicIOVArray *iova,
|
||||||
const int consume_len, const int slice_len);
|
const int consume_len, const int slice_len);
|
||||||
|
|
||||||
int sf_iova_memset(SFDynamicIOVArray *iova, int c,
|
int sf_iova_memset_ex(struct iovec *iov, const int iovcnt,
|
||||||
const int offset, const int length);
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue