mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-03 13:20:25 -05:00
ioctl: don't set outbufsz when not needed
This commit is contained in:
parent
2ca0cb0fbf
commit
b69819e4b2
4 changed files with 22 additions and 16 deletions
|
|
@ -3896,8 +3896,8 @@ static void fuse_lib_bmap(fuse_req_t req, fuse_ino_t ino, size_t blocksize,
|
|||
|
||||
static void fuse_lib_ioctl(fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
|
||||
struct fuse_file_info *llfi, unsigned int flags,
|
||||
const void *in_buf, size_t in_bufsz,
|
||||
size_t out_bufsz_)
|
||||
const void *in_buf, uint32_t in_bufsz,
|
||||
uint32_t out_bufsz_)
|
||||
{
|
||||
struct fuse *f = req_fuse_prepare(req);
|
||||
struct fuse_intr_data d;
|
||||
|
|
|
|||
|
|
@ -916,23 +916,28 @@ enomem:
|
|||
goto out;
|
||||
}
|
||||
|
||||
int fuse_reply_ioctl(fuse_req_t req, int result, const void *buf, size_t size)
|
||||
int fuse_reply_ioctl(fuse_req_t req, int result, const void *buf, uint32_t size)
|
||||
{
|
||||
struct fuse_ioctl_out arg;
|
||||
int count;
|
||||
struct iovec iov[3];
|
||||
size_t count = 1;
|
||||
struct fuse_ioctl_out arg;
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.result = result;
|
||||
arg.result = result;
|
||||
arg.flags = 0;
|
||||
arg.in_iovs = 0;
|
||||
arg.out_iovs = 0;
|
||||
|
||||
count = 1;
|
||||
iov[count].iov_base = &arg;
|
||||
iov[count].iov_len = sizeof(arg);
|
||||
iov[count].iov_len = sizeof(arg);
|
||||
count++;
|
||||
|
||||
if (size) {
|
||||
iov[count].iov_base = (char *) buf;
|
||||
iov[count].iov_len = size;
|
||||
count++;
|
||||
}
|
||||
if(size)
|
||||
{
|
||||
iov[count].iov_base = (char*)buf;
|
||||
iov[count].iov_len = size;
|
||||
count++;
|
||||
}
|
||||
|
||||
return send_reply_iov(req, 0, iov, count);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue