mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-02-24 00:24:11 +08:00
Merge pull request #593 from trapexit/outbuf
ioctl: don't set outbufsz when not needed
This commit is contained in:
commit
8bd09628ef
@ -888,7 +888,7 @@ struct fuse_lowlevel_ops {
|
|||||||
*/
|
*/
|
||||||
void (*ioctl) (fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
|
void (*ioctl) (fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
|
||||||
struct fuse_file_info *fi, unsigned flags,
|
struct fuse_file_info *fi, unsigned 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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Poll for IO readiness
|
* Poll for IO readiness
|
||||||
@ -1286,7 +1286,7 @@ int fuse_reply_ioctl_retry(fuse_req_t req,
|
|||||||
* @param buf buffer containing output data
|
* @param buf buffer containing output data
|
||||||
* @param size length of output data
|
* @param size length of output data
|
||||||
*/
|
*/
|
||||||
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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reply to finish ioctl with iov buffer
|
* Reply to finish ioctl with iov buffer
|
||||||
|
@ -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,
|
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,
|
struct fuse_file_info *llfi, unsigned int flags,
|
||||||
const void *in_buf, size_t in_bufsz,
|
const void *in_buf, uint32_t in_bufsz,
|
||||||
size_t out_bufsz_)
|
uint32_t out_bufsz_)
|
||||||
{
|
{
|
||||||
struct fuse *f = req_fuse_prepare(req);
|
struct fuse *f = req_fuse_prepare(req);
|
||||||
struct fuse_intr_data d;
|
struct fuse_intr_data d;
|
||||||
|
@ -916,19 +916,24 @@ enomem:
|
|||||||
goto out;
|
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];
|
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_base = &arg;
|
||||||
iov[count].iov_len = sizeof(arg);
|
iov[count].iov_len = sizeof(arg);
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
if (size) {
|
if(size)
|
||||||
|
{
|
||||||
iov[count].iov_base = (char*)buf;
|
iov[count].iov_base = (char*)buf;
|
||||||
iov[count].iov_len = size;
|
iov[count].iov_len = size;
|
||||||
count++;
|
count++;
|
||||||
|
@ -90,6 +90,7 @@ namespace l
|
|||||||
case FS_IOC_SETVERSION:
|
case FS_IOC_SETVERSION:
|
||||||
if(endian::is_big() && (sizeof(long) != sizeof(int)))
|
if(endian::is_big() && (sizeof(long) != sizeof(int)))
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
|
if((data_ != NULL) && (*out_bufsz_ > 4))
|
||||||
*out_bufsz_ = 4;
|
*out_bufsz_ = 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user