mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-02-02 08:07:03 +08:00
Merge pull request #1137 from trapexit/btrfs-ioctl
Return NOTTY for all btrfs ioctl calls
This commit is contained in:
commit
b51a5970b2
|
@ -44,6 +44,9 @@ typedef char IOCTL_BUF[4096];
|
||||||
#define IOCTL_APP_TYPE 0xDF
|
#define IOCTL_APP_TYPE 0xDF
|
||||||
#define IOCTL_FILE_INFO _IOWR(IOCTL_APP_TYPE,0,IOCTL_BUF)
|
#define IOCTL_FILE_INFO _IOWR(IOCTL_APP_TYPE,0,IOCTL_BUF)
|
||||||
|
|
||||||
|
// From linux/btrfs.h
|
||||||
|
#define BTRFS_IOCTL_MAGIC 0x94
|
||||||
|
|
||||||
#ifndef FS_IOC_GETFLAGS
|
#ifndef FS_IOC_GETFLAGS
|
||||||
# define FS_IOC_GETFLAGS _IOR('f',1,long)
|
# define FS_IOC_GETFLAGS _IOR('f',1,long)
|
||||||
#endif
|
#endif
|
||||||
|
@ -314,6 +317,13 @@ namespace l
|
||||||
return (_IOC_TYPE(cmd_) == IOCTL_APP_TYPE);
|
return (_IOC_TYPE(cmd_) == IOCTL_APP_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
bool
|
||||||
|
is_btrfs_ioctl_cmd(const unsigned long cmd_)
|
||||||
|
{
|
||||||
|
return (_IOC_TYPE(cmd_) == BTRFS_IOCTL_MAGIC);
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int
|
int
|
||||||
ioctl_custom(const fuse_file_info_t *ffi_,
|
ioctl_custom(const fuse_file_info_t *ffi_,
|
||||||
|
@ -340,6 +350,8 @@ namespace FUSE
|
||||||
void *data_,
|
void *data_,
|
||||||
uint32_t *out_bufsz_)
|
uint32_t *out_bufsz_)
|
||||||
{
|
{
|
||||||
|
if(l::is_btrfs_ioctl_cmd(cmd_))
|
||||||
|
return -ENOTTY;
|
||||||
if(l::is_mergerfs_ioctl_cmd(cmd_))
|
if(l::is_mergerfs_ioctl_cmd(cmd_))
|
||||||
return l::ioctl_custom(ffi_,cmd_,data_);
|
return l::ioctl_custom(ffi_,cmd_,data_);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user