Re: kill FUSE_ROOT_ID

2016-08-13 Thread Mark Kettenis
> Date: Sat, 13 Aug 2016 13:02:19 +0200
> From: Martin Natano <nat...@natano.net>
> 
> Kill FUSE_ROOT_ID and use FUSE_ROOTINO instead for the only place where
> it was used. Also, remove one (ino_t) cast from FUSE_ROOTINO, as it is
> already included in the #define. Ok?
> 
> natano

ok kettenis@

> Index: miscfs/fuse/fuse_vfsops.c
> ===
> RCS file: /cvs/src/sys/miscfs/fuse/fuse_vfsops.c,v
> retrieving revision 1.24
> diff -u -p -r1.24 fuse_vfsops.c
> --- miscfs/fuse/fuse_vfsops.c 12 Aug 2016 20:18:44 -  1.24
> +++ miscfs/fuse/fuse_vfsops.c 13 Aug 2016 10:53:23 -
> @@ -172,7 +172,7 @@ fusefs_root(struct mount *mp, struct vno
>   struct vnode *nvp;
>   int error;
>  
> - if ((error = VFS_VGET(mp, (ino_t)FUSE_ROOTINO, )) != 0)
> + if ((error = VFS_VGET(mp, FUSE_ROOTINO, )) != 0)
>   return (error);
>  
>   nvp->v_type = VDIR;
> @@ -200,7 +200,7 @@ fusefs_statfs(struct mount *mp, struct s
>   copy_statfs_info(sbp, mp);
>  
>   if (fmp->sess_init) {
> - fbuf = fb_setup(0, FUSE_ROOT_ID, FBT_STATFS, p);
> + fbuf = fb_setup(0, FUSE_ROOTINO, FBT_STATFS, p);
>  
>   error = fb_queue(fmp->dev, fbuf);
>  
> Index: sys/fusebuf.h
> ===
> RCS file: /cvs/src/sys/sys/fusebuf.h,v
> retrieving revision 1.9
> diff -u -p -r1.9 fusebuf.h
> --- sys/fusebuf.h 16 Jan 2014 09:31:44 -  1.9
> +++ sys/fusebuf.h 13 Aug 2016 10:53:23 -
> @@ -133,9 +133,6 @@ struct fusebuf {
>  
>  #ifdef _KERNEL
>  
> -/* The node ID of the root inode */
> -#define FUSE_ROOT_ID 1
> -
>  /* fusebuf prototypes */
>  struct   fusebuf *fb_setup(size_t, ino_t, int, struct proc *);
>  int  fb_queue(dev_t, struct fusebuf *);
> 
> 



kill FUSE_ROOT_ID

2016-08-13 Thread Martin Natano
Kill FUSE_ROOT_ID and use FUSE_ROOTINO instead for the only place where
it was used. Also, remove one (ino_t) cast from FUSE_ROOTINO, as it is
already included in the #define. Ok?

natano


Index: miscfs/fuse/fuse_vfsops.c
===
RCS file: /cvs/src/sys/miscfs/fuse/fuse_vfsops.c,v
retrieving revision 1.24
diff -u -p -r1.24 fuse_vfsops.c
--- miscfs/fuse/fuse_vfsops.c   12 Aug 2016 20:18:44 -  1.24
+++ miscfs/fuse/fuse_vfsops.c   13 Aug 2016 10:53:23 -
@@ -172,7 +172,7 @@ fusefs_root(struct mount *mp, struct vno
struct vnode *nvp;
int error;
 
-   if ((error = VFS_VGET(mp, (ino_t)FUSE_ROOTINO, )) != 0)
+   if ((error = VFS_VGET(mp, FUSE_ROOTINO, )) != 0)
return (error);
 
nvp->v_type = VDIR;
@@ -200,7 +200,7 @@ fusefs_statfs(struct mount *mp, struct s
copy_statfs_info(sbp, mp);
 
if (fmp->sess_init) {
-   fbuf = fb_setup(0, FUSE_ROOT_ID, FBT_STATFS, p);
+   fbuf = fb_setup(0, FUSE_ROOTINO, FBT_STATFS, p);
 
error = fb_queue(fmp->dev, fbuf);
 
Index: sys/fusebuf.h
===
RCS file: /cvs/src/sys/sys/fusebuf.h,v
retrieving revision 1.9
diff -u -p -r1.9 fusebuf.h
--- sys/fusebuf.h   16 Jan 2014 09:31:44 -  1.9
+++ sys/fusebuf.h   13 Aug 2016 10:53:23 -
@@ -133,9 +133,6 @@ struct fusebuf {
 
 #ifdef _KERNEL
 
-/* The node ID of the root inode */
-#define FUSE_ROOT_ID   1
-
 /* fusebuf prototypes */
 struct fusebuf *fb_setup(size_t, ino_t, int, struct proc *);
 intfb_queue(dev_t, struct fusebuf *);