diff options
author | Nekun <nekokun@firemail.cc> | 2023-10-30 09:33:54 +0100 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2024-01-29 10:05:09 +0100 |
commit | 1f5fa4b3b85ceb43f1053290f0ade037b50e6297 (patch) | |
tree | 3ecc3a7b3483e9b59d82f836260630e606b2aee6 /fs/ntfs3/ntfs_fs.h | |
parent | fs/ntfs3: Fix oob in ntfs_listxattr (diff) | |
download | linux-1f5fa4b3b85ceb43f1053290f0ade037b50e6297.tar.xz linux-1f5fa4b3b85ceb43f1053290f0ade037b50e6297.zip |
fs/ntfs3: Add ioctl operation for directories (FITRIM)
While ntfs3 supports discards, FITRIM ioctl() command has defined
only for regular files. This may confuse users trying to invoke
`fstrim` utility with the directory argument (for example, call
`fstrim <mountpoint>` which is the common practice). In this case,
ioctl() returns -ENOTTY without any error messages in kernel ring
buffer, this may be easily interpreted as no support for discards
in ntfs3 driver.
Currently only FITRIM command implemented in ntfs_ioctl() and
passed inode used only for dereferencing NTFS superblock, so
no need for separate ioctl() handler for directories, just add
existing ntfs_ioctl() handler to ntfs_dir_operations.
Signed-off-by: Nekun <nekokun@firemail.cc>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/ntfs_fs.h')
-rw-r--r-- | fs/ntfs3/ntfs_fs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index 627419bd6f77..79356fd29a14 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -502,6 +502,8 @@ int ntfs3_setattr(struct mnt_idmap *idmap, struct dentry *dentry, int ntfs_file_open(struct inode *inode, struct file *file); int ntfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, __u64 start, __u64 len); +long ntfs_ioctl(struct file *filp, u32 cmd, unsigned long arg); +long ntfs_compat_ioctl(struct file *filp, u32 cmd, unsigned long arg); extern const struct inode_operations ntfs_special_inode_operations; extern const struct inode_operations ntfs_file_inode_operations; extern const struct file_operations ntfs_file_operations; |