diff options
author | Steve Whitehouse <swhiteho@redhat.com> | 2018-10-08 21:32:35 +0200 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2018-10-09 14:06:16 +0200 |
commit | 6ddc5c3ddf256a7a0906732681a337f0452ac67a (patch) | |
tree | fa04a9ec5230111ffc2b2b848c8020ab086f6677 /fs/gfs2 | |
parent | GFS2: Flush the GFS2 delete workqueue before stopping the kernel threads (diff) | |
download | linux-6ddc5c3ddf256a7a0906732681a337f0452ac67a.tar.xz linux-6ddc5c3ddf256a7a0906732681a337f0452ac67a.zip |
gfs2: getlabel support
Add support for the GETFSLABEL ioctl in gfs2.
I tested this patch and it works as expected.
Signed-off-by: Steve Whitehouse <swhiteho@redhat.com>
Tested-by: Abhi Das <adas@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/file.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 08369c6cd127..6510f4e07d0e 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -314,6 +314,17 @@ static int gfs2_set_flags(struct file *filp, u32 __user *ptr) return do_gfs2_set_flags(filp, gfsflags, mask); } +static int gfs2_getlabel(struct file *filp, char __user *label) +{ + struct inode *inode = file_inode(filp); + struct gfs2_sbd *sdp = GFS2_SB(inode); + + if (copy_to_user(label, sdp->sd_sb.sb_locktable, GFS2_LOCKNAME_LEN)) + return -EFAULT; + + return 0; +} + static long gfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { switch(cmd) { @@ -323,7 +334,10 @@ static long gfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) return gfs2_set_flags(filp, (u32 __user *)arg); case FITRIM: return gfs2_fitrim(filp, (void __user *)arg); + case FS_IOC_GETFSLABEL: + return gfs2_getlabel(filp, (char __user *)arg); } + return -ENOTTY; } |