gfs2: getlabel support
PATCH 1/1 gfs2: getlabel support
Add support for the GETFSLABEL ioctl in gfs2.
I tested this patch and it works as expected.
--- fs/gfs2/file.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
fs/gfs2/file.c +14 -0
@@ -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 ; }
Signature · 1 line
2.4.11
PATCH 1/1 gfs2: getlabel support
Quoted 5 lines · Abhi Das
Add support for the GETFSLABEL ioctl in gfs2.
I tested this patch and it works as expected.Signed-off-by Steve Whitehouse <[email protected]>Tested-by Abhi Das <[email protected]>
The message should probably start with a From: so that git am uses the correct author. Looks good otherwise.
Cheers,
Andy
Quoted 38 lines
--- fs/gfs2/file.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)fs/gfs2/file.c +14
-0@@ -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 ; }
PATCH 1/1 gfs2: getlabel support
In reply to Abhi Das----- Original Message -----
Quoted 6 lines
Add support for the GETFSLABEL ioctl in gfs2.
I tested this patch and it works as expected.Signed-off-by Steve Whitehouse <[email protected]>Tested-by Abhi Das <[email protected]>---
Hi Abhi,
I'll queue this up, but as with the other recent patches, I won't push it until this merge window is closed.
Regards,
Bob Peterson
PATCH 1/1 gfs2: getlabel support
In reply to Abhi Das----- Original Message -----
Quoted 6 lines
Add support for the GETFSLABEL ioctl in gfs2.
I tested this patch and it works as expected.Signed-off-by Steve Whitehouse <[email protected]>Tested-by Abhi Das <[email protected]>---
Hi,
Thanks. This is now pushed to the for-next branch of the linux-gfs2 tree:
https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git/commit/fs/gfs2?h=for-next&id=a77341292dd65e4807301988e027063156939dfd
Regards,
Bob Peterson
Red Hat File Systems