diff --git a/fs/hmdfs/file_local.c b/fs/hmdfs/file_local.c index 41f65cfa4184023e0cfcba5d5f9ad4a85d18e4d3..0d068709d6913d65d4de670ecc64da24685bb138 100644 --- a/fs/hmdfs/file_local.c +++ b/fs/hmdfs/file_local.c @@ -215,6 +215,14 @@ int hmdfs_file_mmap_local(struct file *file, struct vm_area_struct *vma) return ret; } +static long hmdfs_ioctl_local(struct file *filp, unsigned int cmd, unsigned long arg) +{ + if (cmd == HMDFS_IOC_GET_DST_PATH) + return hmdfs_ioc_get_dst_path(filp, arg); + else + return -ENOTTY; +} + const struct file_operations hmdfs_file_fops_local = { .owner = THIS_MODULE, .llseek = hmdfs_file_llseek_local, @@ -224,6 +232,8 @@ const struct file_operations hmdfs_file_fops_local = { .open = hmdfs_file_open_local, .release = hmdfs_file_release_local, .fsync = hmdfs_fsync_local, + .unlocked_ioctl = hmdfs_ioctl_local, + .compat_ioctl = hmdfs_ioctl_local, .splice_read = generic_file_splice_read, .splice_write = iter_file_splice_write, }; @@ -299,6 +309,8 @@ const struct file_operations hmdfs_dir_ops_local = { .open = hmdfs_dir_open_local, .release = hmdfs_dir_release_local, .fsync = hmdfs_fsync_local, + .unlocked_ioctl = hmdfs_ioctl_local, + .compat_ioctl = hmdfs_ioctl_local, }; static int __hmdfs_ioc_set_share_path(struct file *file, diff --git a/fs/hmdfs/file_merge.c b/fs/hmdfs/file_merge.c index 8952674a23d4c4fc8e7729dc1290e88cb3766ace..78e07235de0be4a972b30d783288ed66c9f5e394 100644 --- a/fs/hmdfs/file_merge.c +++ b/fs/hmdfs/file_merge.c @@ -464,8 +464,6 @@ int hmdfs_dir_release_merge(struct inode *inode, struct file *file) return 0; } -static long hmdfs_ioc_get_dst_path(struct file *filp, unsigned long arg); - long hmdfs_dir_unlocked_ioctl_merge(struct file *file, unsigned int cmd, unsigned long arg) { @@ -760,7 +758,7 @@ static int create_dir_recursive(const char *path_value, mode_t mode) return err; } -static long hmdfs_ioc_get_dst_path(struct file *filp, unsigned long arg) +long hmdfs_ioc_get_dst_path(struct file *filp, unsigned long arg) { int ret = 0; const struct cred *old_cred; diff --git a/fs/hmdfs/hmdfs.h b/fs/hmdfs/hmdfs.h index c9940693f3e73e871443e27021bc101829e1dcfc..c27c9dd90f2b9c9806ba0dee3151bfd32bd834a0 100644 --- a/fs/hmdfs/hmdfs.h +++ b/fs/hmdfs/hmdfs.h @@ -306,6 +306,8 @@ int hmdfs_permission(struct inode *inode, int mask); int hmdfs_parse_options(struct hmdfs_sb_info *sbi, const char *data); +long hmdfs_ioc_get_dst_path(struct file *filp, unsigned long arg); + /* Refer to comments in hmdfs_request_work_fn() */ #define HMDFS_SERVER_CTX_FLAGS (PF_KTHREAD | PF_WQ_WORKER | PF_NPROC_EXCEEDED)