int Client::preadv(int fd, const struct iovec *iov, int iovcnt, loff_t offset)
{
- if (iovcnt < 0)
- return -CEPHFS_EINVAL;
return _preadv_pwritev(fd, iov, iovcnt, offset, false);
}
int Client::pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset)
{
- if (iovcnt < 0)
- return -CEPHFS_EINVAL;
return _preadv_pwritev(fd, iov, iovcnt, offset, true);
}
int64_t Client::_preadv_pwritev_locked(Fh *fh, const struct iovec *iov,
- unsigned iovcnt, int64_t offset,
+ int iovcnt, int64_t offset,
bool write, bool clamp_to_int,
Context *onfinish, bufferlist *blp,
bool do_fsync, bool syncdataonly)
if (fh->flags & O_PATH)
return -CEPHFS_EBADF;
#endif
+ if(iovcnt < 0) {
+ return -CEPHFS_EINVAL;
+ }
loff_t totallen = 0;
- for (unsigned i = 0; i < iovcnt; i++) {
+ for (int i = 0; i < iovcnt; i++) {
totallen += iov[i].iov_len;
}
}
}
-int Client::_preadv_pwritev(int fd, const struct iovec *iov, unsigned iovcnt,
+int Client::_preadv_pwritev(int fd, const struct iovec *iov, int iovcnt,
int64_t offset, bool write, Context *onfinish,
bufferlist *blp)
{
const struct iovec *iov, int iovcnt, Context *onfinish = nullptr,
bool do_fsync = false, bool syncdataonly = false);
int64_t _preadv_pwritev_locked(Fh *fh, const struct iovec *iov,
- unsigned iovcnt, int64_t offset,
+ int iovcnt, int64_t offset,
bool write, bool clamp_to_int,
Context *onfinish = nullptr,
bufferlist *blp = nullptr,
bool do_fsync = false, bool syncdataonly = false);
- int _preadv_pwritev(int fd, const struct iovec *iov, unsigned iovcnt,
+ int _preadv_pwritev(int fd, const struct iovec *iov, int iovcnt,
int64_t offset, bool write, Context *onfinish = nullptr,
bufferlist *blp = nullptr);
int _flush(Fh *fh);