PERFORCE change 85239 for review

soc-chenk soc-chenk at FreeBSD.org
Thu Oct 13 15:06:03 PDT 2005


http://perforce.freebsd.org/chv.cgi?CH=85239

Change 85239 by soc-chenk at soc-chenk_leavemealone on 2005/10/13 22:05:45

	made inlining compatible with "-O -pipe" compiler flags
	Submitted by:	soc-chenk

Affected files ...

.. //depot/projects/soc2005/fuse4bsd2/fuse_module/fuse.c#16 edit

Differences ...

==== //depot/projects/soc2005/fuse4bsd2/fuse_module/fuse.c#16 (text+ko) ====

@@ -875,17 +875,17 @@
 	      ihead->nodeid); 
 }
 
+__static __inline struct fuse_data *
+fusedev_get_data(struct cdev *fdev)
+{
+	return (fdev->si_drv1);
+}
+
 __static __inline struct sx *
 fusedev_get_lock(struct cdev *fdev)
 {
 	return (&fusedev_get_data(fdev)->slock);
 }
-
-__static __inline struct fuse_data *
-fusedev_get_data(struct cdev *fdev)
-{
-	return (fdev->si_drv1);
-}
 	
 /********************
  *
@@ -1509,7 +1509,7 @@
 static int fuse_vget_i(struct mount *mp, struct thread *td, uint64_t nodeid, enum vtype vtyp, struct vnode **vpp);
 static __inline void fat2vat(struct mount *mp, struct fuse_attr *fat, struct vattr *vap);
 static vop_getattr_t fuse_getattr;
-static __inline int fuse_recyc_backend(struct vnode *vp, struct thread *td);
+static int fuse_recyc_backend(struct vnode *vp, struct thread *td);
 static fuse_metrics_t release_filehandle;
 static void fuse_filehandle_gc(struct vnode *vp, struct thread *td, struct ucred *cred);
 static vop_reclaim_t fuse_reclaim;
@@ -1629,7 +1629,56 @@
 	(vp)->v_dd = (pvp);						\
 } while (0)
 
+/********
+ *
+ * >>> More aux routines
+ *
+ *******/
+
+static __inline void
+fuse_vnode_init(struct vnode *vp, struct fuse_vnode_data *fvdat,
+	        uint64_t nodeid, enum vtype vtyp)
+{
+	fvdat->nid = nodeid;
+	vp->v_data = fvdat;
+	SETPARENT(vp, (vp->v_vflag & VV_ROOT) ? vp : NULL);
+	vp->v_type = vtyp;
+
+	sx_init(&fvdat->fh_lock, "lock for fuse filehandles");
+	LIST_INIT(&fvdat->fh_head);
+
+	vp->v_bufobj.bo_ops = &fuse_bufops;
+	vp->v_bufobj.bo_private = vp;
+}	
 
+static __inline void
+fuse_vnode_kick(struct vnode *vp, struct thread *td)
+{
+	struct fuse_vnode_data *fvdat;
+
+	if (! td)
+		td = curthread;
+
+	if (vp->v_vflag & VV_ROOT) {
+		fdata_kick_set(fusedev_get_data(((struct fuse_mnt_data *)vp->v_mount->mnt_data)->fdev));
+		return;
+	}
+	fvdat = vp->v_data;
+	fvdat->nlookup = 0;
+	DEBUG("pfft...\n"); 
+	fuse_filehandle_gc(vp, td, NULL);		
+	vnode_destroy_vobject(vp);
+	/*
+	 * this implies we won't get feedback on recycling
+	 * (other than panicking, or the lack of that)
+	 * but creating a customized set of bad vnode ops
+	 * would be too much hassle...
+	 */
+	vp->v_op = &dead_vnodeops;
+	fuse_recyc_backend(vp, td);
+	vput(vp);
+}
+
 /*************
  *
  * >>> VFS ops
@@ -2178,23 +2227,7 @@
 
 
 
-static __inline void
-fuse_vnode_init(struct vnode *vp, struct fuse_vnode_data *fvdat,
-	        uint64_t nodeid, enum vtype vtyp)
-{
-	fvdat->nid = nodeid;
-	vp->v_data = fvdat;
-	SETPARENT(vp, (vp->v_vflag & VV_ROOT) ? vp : NULL);
-	vp->v_type = vtyp;
-
-	sx_init(&fvdat->fh_lock, "lock for fuse filehandles");
-	LIST_INIT(&fvdat->fh_head);
-
-	vp->v_bufobj.bo_ops = &fuse_bufops;
-	vp->v_bufobj.bo_private = vp;
-}	
-
-static __inline int
+static int
 fuse_recyc_backend(struct vnode *vp, struct thread *td)
 {
 	struct fuse_vnode_data *fvdat;
@@ -2341,34 +2374,6 @@
 	return (0);
 }
 
-static __inline void
-fuse_vnode_kick(struct vnode *vp, struct thread *td)
-{
-	struct fuse_vnode_data *fvdat;
-
-	if (! td)
-		td = curthread;
-
-	if (vp->v_vflag & VV_ROOT) {
-		fdata_kick_set(fusedev_get_data(((struct fuse_mnt_data *)vp->v_mount->mnt_data)->fdev));
-		return;
-	}
-	fvdat = vp->v_data;
-	fvdat->nlookup = 0;
-	DEBUG("pfft...\n"); 
-	fuse_filehandle_gc(vp, td, NULL);		
-	vnode_destroy_vobject(vp);
-	/*
-	 * this implies we won't get feedback on recycling
-	 * (other than panicking, or the lack of that)
-	 * but creating a customized set of bad vnode ops
-	 * would be too much hassle...
-	 */
-	vp->v_op = &dead_vnodeops;
-	fuse_recyc_backend(vp, td);
-	vput(vp);
-}
-
 /*
  *  It's by-and-large reversing vn_stat() of kern/vfs_vnops.c
  */
@@ -3836,20 +3841,6 @@
 	return (err);
 }
 
-static int
-fuse_newentry_backend(struct vnode *dvp, struct vnode **vpp,
-                      struct componentname *cnp, enum fuse_opcode op,
-                      void *buf, size_t bufsize, enum vtype vtyp)
-{
-	struct fuse_dispatcher fdi;
-	int err = 0;
-
-	if ((err = fuse_make_entry_req(dvp, cnp, op, buf, bufsize, &fdi)))
-		return (err);
-
-	return (fuse_newentry_core(dvp->v_mount, vpp, vtyp, &fdi));
-}
-
 static __inline int
 fuse_make_entry_req(struct vnode *dvp, struct componentname *cnp,
                     enum fuse_opcode op, void *buf, size_t bufsize,
@@ -3906,6 +3897,20 @@
 }
 
 static int
+fuse_newentry_backend(struct vnode *dvp, struct vnode **vpp,
+                      struct componentname *cnp, enum fuse_opcode op,
+                      void *buf, size_t bufsize, enum vtype vtyp)
+{
+	struct fuse_dispatcher fdi;
+	int err = 0;
+
+	if ((err = fuse_make_entry_req(dvp, cnp, op, buf, bufsize, &fdi)))
+		return (err);
+
+	return (fuse_newentry_core(dvp->v_mount, vpp, vtyp, &fdi));
+}
+
+static int
 fuse_mknod(struct vop_mknod_args *ap)
 {
 	struct vnode *dvp = ap->a_dvp;


More information about the p4-projects mailing list