NFSD: cleanup for nfs3proc.c
Subsystems (2)
PATCH 1/1 NFSD: cleanup for nfs3proc.c
MSDOS_SUPER_MAGIC is defined in <linux/magic.h>,
so use MSDOS_SUPER_MAGIC directly.
Signed-off-by Qinghuang Feng <[email protected]>
---
fs/nfsd/nfs3proc.c +3 -2
@@ -18,6 +18,7 @@#include <linux/unistd.h> #include <linux/slab.h> #include <linux/major.h> +#include <linux/magic.h> #include <linux/sunrpc/svc.h> #include <linux/nfsd/nfsd.h>
@@ -569,7 +570,7 @@ nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,struct super_block *sb = argp->fh.fh_dentry->d_inode->i_sb;/* Note that we don't care for remote fs's here */ -if (sb->s_magic ==0x4d44 /* MSDOS_SUPER_MAGIC */ ) { +if (sb->s_magic ==MSDOS_SUPER_MAGIC ) { resp->f_properties =NFS3_FSF_BILLYBOY ; } resp->f_maxfilesize = sb->s_maxbytes;
@@ -610,7 +611,7 @@ nfsd3_proc_pathconf(struct svc_rqst * rqstp, struct nfsd_fhandle *argp, resp->p_link_max =EXT2_LINK_MAX ; resp->p_name_max =EXT2_NAME_LEN ;break ; -case 0x4d44 :/* MSDOS_SUPER_MAGIC */ +case MSDOS_SUPER_MAGIC : resp->p_case_insensitive =1 ; resp->p_case_preserving =0 ;break ;
Quoted 2 lines · Qinghuang Feng
MSDOS_SUPER_MAGICis defined in <linux/magic.h>,
so useMSDOS_SUPER_MAGICdirectly.
Thanks. But does anyone know if there's any better way to figure out whether a filesystem supports links and symlinks than by checking s_magic == MSDOS_SUPER_MAGIC??
--b.
Quoted 34 lines
Signed-off-by Qinghuang Feng <[email protected]>---
fs/nfsd/nfs3proc.c +3
-2@@ -18,6 +18,7 @@#include <linux/unistd.h> #include <linux/slab.h> #include <linux/major.h> +#include <linux/magic.h> #include <linux/sunrpc/svc.h> #include <linux/nfsd/nfsd.h> @@ -569,7 +570,7 @@ nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,struct super_block *sb = argp->fh.fh_dentry->d_inode->i_sb;/* Note that we don't care for remote fs's here */ -if (sb->s_magic ==0x4d44 /* MSDOS_SUPER_MAGIC */ ) { +if (sb->s_magic ==MSDOS_SUPER_MAGIC ) { resp->f_properties =NFS3_FSF_BILLYBOY ; } resp->f_maxfilesize = sb->s_maxbytes;@@ -610,7 +611,7 @@ nfsd3_proc_pathconf(struct svc_rqst * rqstp, struct nfsd_fhandle *argp, resp->p_link_max =EXT2_LINK_MAX ; resp->p_name_max =EXT2_NAME_LEN ;break ; -case 0x4d44 :/* MSDOS_SUPER_MAGIC */ +case MSDOS_SUPER_MAGIC : resp->p_case_insensitive =1 ; resp->p_case_preserving =0 ;break ;
Quoted 7 lines · J. Bruce Fields
Quoted 2 lines · Qinghuang Feng
MSDOS_SUPER_MAGICis defined in <linux/magic.h>,
so useMSDOS_SUPER_MAGICdirectly.Thanks. But does anyone know if there's any better way to figure out whether a filesystem supports links and symlinks than by checking
s_magic==MSDOS_SUPER_MAGIC??
Or case insenstivit or..
If we had a working pathconf syscall and inode operation that'd be easy..