Skip to content

Commit e4dff97

Browse files
ntfs3: add FS_IOC_GETFSLABEL ioctl
Add support for the FS_IOC_GETFSLABEL ioctl. Signed-off-by: Ethan Ferguson <ethan.ferguson@zetier.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent 80ff677 commit e4dff97

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

fs/ntfs3/file.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ static int ntfs_ioctl_fitrim(struct ntfs_sb_info *sbi, unsigned long arg)
4949
return 0;
5050
}
5151

52+
static int ntfs_ioctl_get_volume_label(struct ntfs_sb_info *sbi, u8 __user *buf)
53+
{
54+
if (copy_to_user(buf, sbi->volume.label, FSLABEL_MAX))
55+
return -EFAULT;
56+
57+
return 0;
58+
}
59+
5260
/*
5361
* ntfs_ioctl - file_operations::unlocked_ioctl
5462
*/
@@ -64,6 +72,8 @@ long ntfs_ioctl(struct file *filp, u32 cmd, unsigned long arg)
6472
switch (cmd) {
6573
case FITRIM:
6674
return ntfs_ioctl_fitrim(sbi, arg);
75+
case FS_IOC_GETFSLABEL:
76+
return ntfs_ioctl_get_volume_label(sbi, (u8 __user *)arg);
6777
}
6878
return -ENOTTY; /* Inappropriate ioctl for device. */
6979
}

0 commit comments

Comments
 (0)