• Nekun's avatar
    fs/ntfs3: Add ioctl operation for directories (FITRIM) · 1f5fa4b3
    Nekun authored
    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: default avatarNekun <nekokun@firemail.cc>
    Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
    1f5fa4b3
dir.c 12.3 KB