From owner-p4-projects@FreeBSD.ORG Thu Oct 13 22:06:03 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AD9E616A421; Thu, 13 Oct 2005 22:06:02 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87CFC16A41F for ; Thu, 13 Oct 2005 22:06:02 +0000 (GMT) (envelope-from soc-chenk@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4AC7A43D4C for ; Thu, 13 Oct 2005 22:06:02 +0000 (GMT) (envelope-from soc-chenk@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j9DM62dR089178 for ; Thu, 13 Oct 2005 22:06:02 GMT (envelope-from soc-chenk@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j9DM61Xc089175 for perforce@freebsd.org; Thu, 13 Oct 2005 22:06:01 GMT (envelope-from soc-chenk@freebsd.org) Date: Thu, 13 Oct 2005 22:06:01 GMT Message-Id: <200510132206.j9DM61Xc089175@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-chenk@freebsd.org using -f From: soc-chenk To: Perforce Change Reviews Cc: Subject: PERFORCE change 85239 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2005 22:06:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=85239 Change 85239 by soc-chenk@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;