Module Name: src Committed By: christos Date: Sat Apr 28 20:15:07 UTC 2012
Modified Files: src/sys/coda: coda_vnops.c Log Message: cosmetic only: __func__, vnode_t To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/coda/coda_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/coda/coda_vnops.c diff -u src/sys/coda/coda_vnops.c:1.83 src/sys/coda/coda_vnops.c:1.84 --- src/sys/coda/coda_vnops.c:1.83 Sat Apr 28 16:01:09 2012 +++ src/sys/coda/coda_vnops.c Sat Apr 28 16:15:07 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: coda_vnops.c,v 1.83 2012/04/28 20:01:09 christos Exp $ */ +/* $NetBSD: coda_vnops.c,v 1.84 2012/04/28 20:15:07 christos Exp $ */ /* * @@ -46,7 +46,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.83 2012/04/28 20:01:09 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.84 2012/04/28 20:15:07 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -153,8 +153,8 @@ coda_vop_error(void *anon) { struct vnodeop_desc **desc = (struct vnodeop_desc **)anon; if (codadebug) { - myprintf(("coda_vop_error: Vnode operation %s called (error).\n", - (*desc)->vdesc_name)); + myprintf(("%s: Vnode operation %s called (error).\n", + __func__, (*desc)->vdesc_name)); } return EIO; @@ -214,7 +214,7 @@ coda_open(void *v) */ /* true args */ struct vop_open_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); int flag = ap->a_mode & (~O_EXCL); kauth_cred_t cred = ap->a_cred; @@ -222,7 +222,7 @@ coda_open(void *v) int error; dev_t dev; /* container file device, inode, vnode */ ino_t inode; - struct vnode *container_vp; + vnode_t *container_vp; MARK_ENTRY(CODA_OPEN_STATS); @@ -241,9 +241,9 @@ coda_open(void *v) if (error) return (error); if (!error) { - CODADEBUG(CODA_OPEN, - myprintf(("open: dev 0x%llx inode %llu result %d\n", - (unsigned long long)dev, (unsigned long long)inode, error));) + CODADEBUG(CODA_OPEN, myprintf(( + "%s: dev 0x%llx inode %llu result %d\n", __func__, + (unsigned long long)dev, (unsigned long long)inode, error));) } /* @@ -263,7 +263,7 @@ coda_open(void *v) * Perhaps venus returned a different container, or * something else went wrong. */ - panic("coda_open: cp->c_ovp != container_vp"); + panic("%s: cp->c_ovp != container_vp", __func__); } cp->c_ocount++; @@ -300,7 +300,7 @@ coda_close(void *v) { /* true args */ struct vop_close_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); int flag = ap->a_fflag; kauth_cred_t cred = ap->a_cred; @@ -321,8 +321,8 @@ coda_close(void *v) if (IS_UNMOUNTING(cp)) { if (cp->c_ovp) { #ifdef CODA_VERBOSE - printf("coda_close: destroying container ref %d, ufs vp %p of vp %p/cp %p\n", - vp->v_usecount, cp->c_ovp, vp, cp); + printf("%s: destroying container %d, ufs vp %p of vp %p/cp %p\n", + __func__, vp->v_usecount, cp->c_ovp, vp, cp); #endif #ifdef hmm vgone(cp->c_ovp); @@ -333,7 +333,7 @@ coda_close(void *v) #endif } else { #ifdef CODA_VERBOSE - printf("coda_close: NO container vp %p/cp %p\n", vp, cp); + printf("%s: NO container vp %p/cp %p\n", __func__, vp, cp); #endif } return ENODEV; @@ -355,7 +355,7 @@ coda_close(void *v) error = venus_close(vtomi(vp), &cp->c_fid, flag, cred, curlwp); - CODADEBUG(CODA_CLOSE, myprintf(("close: result %d\n",error)); ) + CODADEBUG(CODA_CLOSE, myprintf(("%s: result %d\n", __func__, error)); ) return(error); } @@ -380,14 +380,14 @@ coda_write(void *v) } int -coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw, int ioflag, +coda_rdwr(vnode_t *vp, struct uio *uiop, enum uio_rw rw, int ioflag, kauth_cred_t cred, struct lwp *l) { /* upcall decl */ /* NOTE: container file operation!!! */ /* locals */ struct cnode *cp = VTOC(vp); - struct vnode *cfvp = cp->c_ovp; + vnode_t *cfvp = cp->c_ovp; struct proc *p = l->l_proc; int opened_internally = 0; int error = 0; @@ -395,9 +395,8 @@ coda_rdwr(struct vnode *vp, struct uio * MARK_ENTRY(CODA_RDWR_STATS); CODADEBUG(CODA_RDWR, myprintf(("coda_rdwr(%d, %p, %lu, %lld)\n", rw, - uiop->uio_iov->iov_base, - (unsigned long) uiop->uio_resid, - (long long) uiop->uio_offset)); ) + uiop->uio_iov->iov_base, (unsigned long) uiop->uio_resid, + (long long) uiop->uio_offset)); ) /* Check for rdwr of control object. */ if (IS_CTL_VP(vp)) { @@ -423,7 +422,8 @@ coda_rdwr(struct vnode *vp, struct uio * * it's completely written. */ if (cp->c_inode != 0 && !(p && (p->p_acflag & ACORE))) { - printf("coda_rdwr: grabbing container vnode, losing reference\n"); + printf("%s: grabbing container vnode, losing reference\n", + __func__); /* Get locked and refed vnode. */ error = coda_grab_vnode(vp, cp->c_device, cp->c_inode, &cfvp); if (error) { @@ -437,12 +437,12 @@ coda_rdwr(struct vnode *vp, struct uio * VOP_UNLOCK(cfvp); } else { - printf("coda_rdwr: internal VOP_OPEN\n"); + printf("%s: internal VOP_OPEN\n", __func__); opened_internally = 1; MARK_INT_GEN(CODA_OPEN_STATS); error = VOP_OPEN(vp, (rw == UIO_READ ? FREAD : FWRITE), cred); #ifdef CODA_VERBOSE -printf("coda_rdwr: Internally Opening %p\n", vp); + printf("%s: Internally Opening %p\n", __func__, vp); #endif if (error) { MARK_INT_FAIL(CODA_RDWR_STATS); @@ -453,8 +453,8 @@ printf("coda_rdwr: Internally Opening %p } /* Have UFS handle the call. */ - CODADEBUG(CODA_RDWR, myprintf(("indirect rdwr: fid = %s, refcnt = %d\n", - coda_f2s(&cp->c_fid), CTOV(cp)->v_usecount)); ) + CODADEBUG(CODA_RDWR, myprintf(("%s: fid = %s, refcnt = %d\n", __func__, + coda_f2s(&cp->c_fid), CTOV(cp)->v_usecount)); ) if (rw == UIO_READ) { error = VOP_READ(cfvp, uiop, ioflag, cred); @@ -484,14 +484,14 @@ coda_ioctl(void *v) { /* true args */ struct vop_ioctl_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; int com = ap->a_command; void *data = ap->a_data; int flag = ap->a_fflag; kauth_cred_t cred = ap->a_cred; /* locals */ int error; - struct vnode *tvp; + vnode_t *tvp; struct PioctlData *iap = (struct PioctlData *)data; namei_simple_flags_t sflags; @@ -505,8 +505,8 @@ coda_ioctl(void *v) /* Must be control object to succeed. */ if (!IS_CTL_VP(vp)) { MARK_INT_FAIL(CODA_IOCTL_STATS); - CODADEBUG(CODA_IOCTL, myprintf(("coda_ioctl error: vp != ctlvp"));) - return (EOPNOTSUPP); + CODADEBUG(CODA_IOCTL, myprintf(("%s error: vp != ctlvp", __func__));) + return (EOPNOTSUPP); } /* Look up the pathname. */ @@ -518,8 +518,8 @@ coda_ioctl(void *v) if (error) { MARK_INT_FAIL(CODA_IOCTL_STATS); - CODADEBUG(CODA_IOCTL, myprintf(("coda_ioctl error: lookup returns %d\n", - error));) + CODADEBUG(CODA_IOCTL, myprintf(("%s error: lookup returns %d\n", + __func__, error));) return(error); } @@ -531,9 +531,8 @@ coda_ioctl(void *v) if (tvp->v_tag != VT_CODA) { vrele(tvp); MARK_INT_FAIL(CODA_IOCTL_STATS); - CODADEBUG(CODA_IOCTL, - myprintf(("coda_ioctl error: %s not a coda object\n", - iap->path));) + CODADEBUG(CODA_IOCTL, myprintf(("%s error: %s not a coda object\n", + __func__, iap->path));) return(EINVAL); } @@ -567,7 +566,7 @@ coda_getattr(void *v) { /* true args */ struct vop_getattr_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); struct vattr *vap = ap->a_vap; kauth_cred_t cred = ap->a_cred; @@ -584,10 +583,10 @@ coda_getattr(void *v) /* Check to see if the attributes have already been cached */ if (VALID_VATTR(cp)) { - CODADEBUG(CODA_GETATTR, { myprintf(("attr cache hit: %s\n", - coda_f2s(&cp->c_fid)));}); + CODADEBUG(CODA_GETATTR, { myprintf(("%s: attr cache hit: %s\n", + __func__, coda_f2s(&cp->c_fid)));}) CODADEBUG(CODA_GETATTR, if (!(codadebug & ~CODA_GETATTR)) - print_vattr(&cp->c_vattr); ); + print_vattr(&cp->c_vattr); ) *vap = cp->c_vattr; MARK_INT_SAT(CODA_GETATTR_STATS); @@ -597,11 +596,11 @@ coda_getattr(void *v) error = venus_getattr(vtomi(vp), &cp->c_fid, cred, curlwp, vap); if (!error) { - CODADEBUG(CODA_GETATTR, myprintf(("getattr miss %s: result %d\n", - coda_f2s(&cp->c_fid), error)); ) + CODADEBUG(CODA_GETATTR, myprintf(("%s miss %s: result %d\n", + __func__, coda_f2s(&cp->c_fid), error)); ) CODADEBUG(CODA_GETATTR, if (!(codadebug & ~CODA_GETATTR)) - print_vattr(vap); ); + print_vattr(vap); ) /* If not open for write, store attributes in cnode */ if ((cp->c_owrite == 0) && (coda_attr_cache)) { @@ -618,7 +617,7 @@ coda_setattr(void *v) { /* true args */ struct vop_setattr_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); struct vattr *vap = ap->a_vap; kauth_cred_t cred = ap->a_cred; @@ -650,7 +649,7 @@ coda_access(void *v) { /* true args */ struct vop_access_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); int mode = ap->a_mode; kauth_cred_t cred = ap->a_cred; @@ -698,7 +697,7 @@ coda_abortop(void *v) { /* true args */ struct vop_abortop_args /* { - struct vnode *a_dvp; + vnode_t *a_dvp; struct componentname *a_cnp; } */ *ap = v; @@ -714,7 +713,7 @@ coda_readlink(void *v) { /* true args */ struct vop_readlink_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); struct uio *uiop = ap->a_uio; kauth_cred_t cred = ap->a_cred; @@ -765,11 +764,11 @@ coda_fsync(void *v) { /* true args */ struct vop_fsync_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); kauth_cred_t cred = ap->a_cred; /* locals */ - struct vnode *convp = cp->c_ovp; + vnode_t *convp = cp->c_ovp; int error; MARK_ENTRY(CODA_FSYNC_STATS); @@ -805,7 +804,7 @@ coda_fsync(void *v) error = venus_fsync(vtomi(vp), &cp->c_fid, cred, curlwp); - CODADEBUG(CODA_FSYNC, myprintf(("in fsync result %d\n",error)); ); + CODADEBUG(CODA_FSYNC, myprintf(("in fsync result %d\n",error)); ) return(error); } @@ -818,7 +817,7 @@ coda_inactive(void *v) { /* true args */ struct vop_inactive_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); kauth_cred_t cred __unused = NULL; @@ -836,7 +835,7 @@ coda_inactive(void *v) /* If an array has been allocated to hold the symlink, deallocate it */ if ((coda_symlink_cache) && (VALID_SYMLINK(cp))) { if (cp->c_symlink == NULL) - panic("coda_inactive: null symlink pointer in cnode"); + panic("%s: null symlink pointer in cnode", __func__); CODA_FREE(cp->c_symlink, cp->c_symlen); cp->c_flags &= ~C_SYMLINK; @@ -853,18 +852,18 @@ coda_inactive(void *v) if (IS_UNMOUNTING(cp)) { /* XXX Do we need to VOP_CLOSE container vnodes? */ if (vp->v_usecount > 1) - printf("coda_inactive: IS_UNMOUNTING %p usecount %d\n", - vp, vp->v_usecount); + printf("%s: IS_UNMOUNTING %p usecount %d\n", + __func__, vp, vp->v_usecount); if (cp->c_ovp != NULL) - printf("coda_inactive: %p ovp != NULL\n", vp); + printf("%s: %p ovp != NULL\n", __func__, vp); VOP_UNLOCK(vp); } else { /* Sanity checks that perhaps should be panic. */ if (vp->v_usecount > 1) { - printf("coda_inactive: %p usecount %d\n", vp, vp->v_usecount); + printf("%s: %p usecount %d\n", __func__, vp, vp->v_usecount); } if (cp->c_ovp != NULL) { - printf("coda_inactive: %p ovp != NULL\n", vp); + printf("%s: %p ovp != NULL\n", __func__, vp); } VOP_UNLOCK(vp); *ap->a_recycle = true; @@ -884,10 +883,10 @@ coda_lookup(void *v) /* true args */ struct vop_lookup_args *ap = v; /* (locked) vnode of dir in which to do lookup */ - struct vnode *dvp = ap->a_dvp; + vnode_t *dvp = ap->a_dvp; struct cnode *dcp = VTOC(dvp); /* output variable for result */ - struct vnode **vpp = ap->a_vpp; + vnode_t **vpp = ap->a_vpp; /* name to lookup */ struct componentname *cnp = ap->a_cnp; kauth_cred_t cred = cnp->cn_cred; @@ -904,8 +903,8 @@ coda_lookup(void *v) MARK_ENTRY(CODA_LOOKUP_STATS); - CODADEBUG(CODA_LOOKUP, myprintf(("lookup: %s in %s\n", - nm, coda_f2s(&dcp->c_fid)));); + CODADEBUG(CODA_LOOKUP, myprintf(("%s: %s in %s\n", __func__, + nm, coda_f2s(&dcp->c_fid)));) /* * XXX componentname flags in MODMASK are not handled at all @@ -929,9 +928,9 @@ coda_lookup(void *v) /* Avoid trying to hand venus an unreasonably long name. */ if (len+1 > CODA_MAXNAMLEN) { MARK_INT_FAIL(CODA_LOOKUP_STATS); - CODADEBUG(CODA_LOOKUP, myprintf(("name too long: lookup, %s (%s)\n", - coda_f2s(&dcp->c_fid), nm));); - *vpp = (struct vnode *)0; + CODADEBUG(CODA_LOOKUP, myprintf(("%s: name too long:, %s (%s)\n", + __func__, coda_f2s(&dcp->c_fid), nm));) + *vpp = (vnode_t *)0; error = EINVAL; goto exit; } @@ -962,12 +961,11 @@ coda_lookup(void *v) MARK_INT_FAIL(CODA_LOOKUP_STATS); CODADEBUG(CODA_LOOKUP, myprintf(("lookup error on %s (%s)%d\n", coda_f2s(&dcp->c_fid), nm, error));) - *vpp = (struct vnode *)0; + *vpp = (vnode_t *)0; } else { MARK_INT_SAT(CODA_LOOKUP_STATS); - CODADEBUG(CODA_LOOKUP, - myprintf(("lookup: %s type %o result %d\n", - coda_f2s(&VFid), vtype, error)); ) + CODADEBUG(CODA_LOOKUP, myprintf(("%s: %s type %o result %d\n", + __func__, coda_f2s(&VFid), vtype, error)); ) cp = make_coda_node(&VFid, dvp->v_mount, vtype); *vpp = CTOV(cp); @@ -1033,12 +1031,12 @@ coda_create(void *v) { /* true args */ struct vop_create_args *ap = v; - struct vnode *dvp = ap->a_dvp; + vnode_t *dvp = ap->a_dvp; struct cnode *dcp = VTOC(dvp); struct vattr *va = ap->a_vap; int exclusive = 1; int mode = ap->a_vap->va_mode; - struct vnode **vpp = ap->a_vpp; + vnode_t **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; kauth_cred_t cred = cnp->cn_cred; struct lwp *l = curlwp; @@ -1057,7 +1055,7 @@ coda_create(void *v) /* Check for create of control object. */ if (IS_CTL_NAME(dvp, nm, len)) { - *vpp = (struct vnode *)0; + *vpp = (vnode_t *)0; MARK_INT_FAIL(CODA_CREATE_STATS); return(EACCES); } @@ -1096,11 +1094,10 @@ coda_create(void *v) /* enter the new vnode in the Name Cache */ coda_nc_enter(VTOC(dvp), nm, len, cred, VTOC(*vpp)); - CODADEBUG(CODA_CREATE, - myprintf(("create: %s, result %d\n", - coda_f2s(&VFid), error)); ) + CODADEBUG(CODA_CREATE, myprintf(("%s: %s, result %d\n", __func__, + coda_f2s(&VFid), error)); ) } else { - *vpp = (struct vnode *)0; + *vpp = (vnode_t *)0; CODADEBUG(CODA_CREATE, myprintf(("create error %d\n", error));) } @@ -1112,12 +1109,12 @@ coda_create(void *v) if (!error) { if ((cnp->cn_flags & LOCKLEAF) == 0) { /* This should not happen; flags are for lookup only. */ - printf("coda_create: LOCKLEAF not set!\n"); + printf("%s: LOCKLEAF not set!\n", __func__); } if ((error = vn_lock(*ap->a_vpp, LK_EXCLUSIVE))) { /* XXX Perhaps avoid this panic. */ - panic("coda_create: couldn't lock child"); + panic("%s: couldn't lock child", __func__); } } @@ -1129,9 +1126,9 @@ coda_remove(void *v) { /* true args */ struct vop_remove_args *ap = v; - struct vnode *dvp = ap->a_dvp; + vnode_t *dvp = ap->a_dvp; struct cnode *cp = VTOC(dvp); - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct componentname *cnp = ap->a_cnp; kauth_cred_t cred = cnp->cn_cred; struct lwp *l = curlwp; @@ -1143,8 +1140,8 @@ coda_remove(void *v) MARK_ENTRY(CODA_REMOVE_STATS); - CODADEBUG(CODA_REMOVE, myprintf(("remove: %s in %s\n", - nm, coda_f2s(&cp->c_fid)));); + CODADEBUG(CODA_REMOVE, myprintf(("%s: %s in %s\n", __func__, + nm, coda_f2s(&cp->c_fid)));) /* Remove the file's entry from the CODA Name Cache */ /* We're being conservative here, it might be that this person @@ -1203,9 +1200,9 @@ coda_link(void *v) { /* true args */ struct vop_link_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); - struct vnode *dvp = ap->a_dvp; + vnode_t *dvp = ap->a_dvp; struct cnode *dcp = VTOC(dvp); struct componentname *cnp = ap->a_cnp; kauth_cred_t cred = cnp->cn_cred; @@ -1219,17 +1216,13 @@ coda_link(void *v) if (codadebug & CODADBGMSK(CODA_LINK)) { - myprintf(("nb_link: vp fid: %s\n", - coda_f2s(&cp->c_fid))); - myprintf(("nb_link: dvp fid: %s)\n", - coda_f2s(&dcp->c_fid))); + myprintf(("%s: vp fid: %s\n", __func__, coda_f2s(&cp->c_fid))); + myprintf(("%s: dvp fid: %s)\n", __func__, coda_f2s(&dcp->c_fid))); } if (codadebug & CODADBGMSK(CODA_LINK)) { - myprintf(("link: vp fid: %s\n", - coda_f2s(&cp->c_fid))); - myprintf(("link: dvp fid: %s\n", - coda_f2s(&dcp->c_fid))); + myprintf(("%s: vp fid: %s\n", __func__, coda_f2s(&cp->c_fid))); + myprintf(("%s: dvp fid: %s\n", __func__, coda_f2s(&dcp->c_fid))); } @@ -1248,7 +1241,7 @@ coda_link(void *v) /* XXX Why does venus_link need the vnode to be locked?*/ if ((error = vn_lock(vp, LK_EXCLUSIVE)) != 0) { - printf("coda_link: couldn't lock vnode %p\n", vp); + printf("%s: couldn't lock vnode %p\n", __func__, vp); error = EFAULT; /* XXX better value */ goto exit; } @@ -1272,10 +1265,10 @@ coda_rename(void *v) { /* true args */ struct vop_rename_args *ap = v; - struct vnode *odvp = ap->a_fdvp; + vnode_t *odvp = ap->a_fdvp; struct cnode *odcp = VTOC(odvp); struct componentname *fcnp = ap->a_fcnp; - struct vnode *ndvp = ap->a_tdvp; + vnode_t *ndvp = ap->a_tdvp; struct cnode *ndcp = VTOC(ndvp); struct componentname *tcnp = ap->a_tcnp; kauth_cred_t cred = fcnp->cn_cred; @@ -1295,7 +1288,7 @@ coda_rename(void *v) if ((fcnp->cn_cred != tcnp->cn_cred) || (fcnp->cn_lwp != tcnp->cn_lwp)) { - panic("coda_rename: component names don't agree"); + panic("%s: component names don't agree", __func__); } #endif @@ -1309,7 +1302,7 @@ coda_rename(void *v) if (odvp != ndvp) { struct cnode *ovcp = coda_nc_lookup(VTOC(odvp), fnm, flen, cred); if (ovcp) { - struct vnode *ovp = CTOV(ovcp); + vnode_t *ovp = CTOV(ovcp); if ((ovp) && (ovp->v_type == VDIR)) /* If it's a directory */ coda_nc_zapfile(VTOC(ovp),"..", 2); @@ -1366,11 +1359,11 @@ coda_mkdir(void *v) { /* true args */ struct vop_mkdir_args *ap = v; - struct vnode *dvp = ap->a_dvp; + vnode_t *dvp = ap->a_dvp; struct cnode *dcp = VTOC(dvp); struct componentname *cnp = ap->a_cnp; struct vattr *va = ap->a_vap; - struct vnode **vpp = ap->a_vpp; + vnode_t **vpp = ap->a_vpp; kauth_cred_t cred = cnp->cn_cred; struct lwp *l = curlwp; /* locals */ @@ -1385,13 +1378,13 @@ coda_mkdir(void *v) /* Check for mkdir of target object. */ if (IS_CTL_NAME(dvp, nm, len)) { - *vpp = (struct vnode *)0; + *vpp = (vnode_t *)0; MARK_INT_FAIL(CODA_MKDIR_STATS); return(EACCES); } if (len+1 > CODA_MAXNAMLEN) { - *vpp = (struct vnode *)0; + *vpp = (vnode_t *)0; MARK_INT_FAIL(CODA_MKDIR_STATS); return(EACCES); } @@ -1421,11 +1414,11 @@ coda_mkdir(void *v) /* Invalidate the parent's attr cache, the modification time has changed */ VTOC(dvp)->c_flags &= ~C_VATTR; - CODADEBUG( CODA_MKDIR, myprintf(("mkdir: %s result %d\n", - coda_f2s(&VFid), error)); ) + CODADEBUG( CODA_MKDIR, myprintf(("%s: %s result %d\n", __func__, + coda_f2s(&VFid), error)); ) } else { - *vpp = (struct vnode *)0; - CODADEBUG(CODA_MKDIR, myprintf(("mkdir error %d\n",error));) + *vpp = (vnode_t *)0; + CODADEBUG(CODA_MKDIR, myprintf(("%s error %d\n", __func__, error));) } /* @@ -1437,7 +1430,7 @@ coda_mkdir(void *v) vput(dvp); if (!error) { if ((error = vn_lock(*ap->a_vpp, LK_EXCLUSIVE))) { - panic("coda_mkdir: couldn't lock child"); + panic("%s: couldn't lock child", __func__); } } @@ -1449,9 +1442,9 @@ coda_rmdir(void *v) { /* true args */ struct vop_rmdir_args *ap = v; - struct vnode *dvp = ap->a_dvp; + vnode_t *dvp = ap->a_dvp; struct cnode *dcp = VTOC(dvp); - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct componentname *cnp = ap->a_cnp; kauth_cred_t cred = cnp->cn_cred; struct lwp *l = curlwp; @@ -1471,7 +1464,7 @@ coda_rmdir(void *v) /* Can't remove . in self. */ if (dvp == vp) { - printf("coda_rmdir: dvp == vp\n"); + printf("%s: dvp == vp\n", __func__); error = EINVAL; goto exit; } @@ -1514,7 +1507,7 @@ coda_symlink(void *v) { /* true args */ struct vop_symlink_args *ap = v; - struct vnode *dvp = ap->a_dvp; + vnode_t *dvp = ap->a_dvp; struct cnode *dcp = VTOC(dvp); /* a_vpp is used in place below */ struct componentname *cnp = ap->a_cnp; @@ -1602,7 +1595,7 @@ coda_readdir(void *v) { /* true args */ struct vop_readdir_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); struct uio *uiop = ap->a_uio; kauth_cred_t cred = ap->a_cred; @@ -1615,7 +1608,9 @@ coda_readdir(void *v) MARK_ENTRY(CODA_READDIR_STATS); - CODADEBUG(CODA_READDIR, myprintf(("coda_readdir(%p, %lu, %lld)\n", uiop->uio_iov->iov_base, (unsigned long) uiop->uio_resid, (long long) uiop->uio_offset)); ) + CODADEBUG(CODA_READDIR, myprintf(("%s: (%p, %lu, %lld)\n", __func__, + uiop->uio_iov->iov_base, (unsigned long) uiop->uio_resid, + (long long) uiop->uio_offset)); ) /* Check for readdir of control object. */ if (IS_CTL_VP(vp)) { @@ -1633,16 +1628,15 @@ coda_readdir(void *v) MARK_INT_GEN(CODA_OPEN_STATS); error = VOP_OPEN(vp, FREAD, cred); #ifdef CODA_VERBOSE -printf("coda_readdir: Internally Opening %p\n", vp); + printf("%s: Internally Opening %p\n", __func__, vp); #endif if (error) return(error); } else vp = cp->c_ovp; /* Have UFS handle the call. */ - CODADEBUG(CODA_READDIR, myprintf(( - "indirect readdir: fid = %s, refcnt = %d\n", - coda_f2s(&cp->c_fid), vp->v_usecount)); ) + CODADEBUG(CODA_READDIR, myprintf(("%s: fid = %s, refcnt = %d\n", + __func__, coda_f2s(&cp->c_fid), vp->v_usecount)); ) error = VOP_READDIR(vp, uiop, cred, eofflag, cookies, ncookies); if (error) MARK_INT_FAIL(CODA_READDIR_STATS); @@ -1668,15 +1662,15 @@ coda_bmap(void *v) /* XXX on the global proc */ /* true args */ struct vop_bmap_args *ap = v; - struct vnode *vp __unused = ap->a_vp; /* file's vnode */ + vnode_t *vp __unused = ap->a_vp; /* file's vnode */ daddr_t bn __unused = ap->a_bn; /* fs block number */ - struct vnode **vpp = ap->a_vpp; /* RETURN vp of device */ + vnode_t **vpp = ap->a_vpp; /* RETURN vp of device */ daddr_t *bnp __unused = ap->a_bnp; /* RETURN device block number */ struct lwp *l __unused = curlwp; /* upcall decl */ /* locals */ - *vpp = (struct vnode *)0; + *vpp = (vnode_t *)0; myprintf(("coda_bmap called!\n")); return(EINVAL); } @@ -1707,7 +1701,7 @@ coda_reclaim(void *v) { /* true args */ struct vop_reclaim_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); /* upcall decl */ /* locals */ @@ -1721,15 +1715,15 @@ coda_reclaim(void *v) #ifdef DEBUG if (VTOC(vp)->c_ovp) { if (IS_UNMOUNTING(cp)) - printf("coda_reclaim: c_ovp not void: vp %p, cp %p\n", vp, cp); + printf("%s: c_ovp not void: vp %p, cp %p\n", __func__, vp, cp); } #endif } else { #ifdef OLD_DIAGNOSTIC if (vp->v_usecount != 0) - print("coda_reclaim: pushing active %p\n", vp); + print("%s: pushing active %p\n", __func__, vp); if (VTOC(vp)->c_ovp) { - panic("coda_reclaim: c_ovp not void"); + panic("%s: c_ovp not void", __func__); } #endif } @@ -1743,7 +1737,7 @@ coda_lock(void *v) { /* true args */ struct vop_lock_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); /* upcall decl */ /* locals */ @@ -1763,7 +1757,7 @@ coda_unlock(void *v) { /* true args */ struct vop_unlock_args *ap = v; - struct vnode *vp = ap->a_vp; + vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); /* upcall decl */ /* locals */ @@ -1791,14 +1785,14 @@ coda_islocked(void *v) * obtained and passed back to the caller. */ int -coda_grab_vnode(struct vnode *uvp, dev_t dev, ino_t ino, struct vnode **vpp) +coda_grab_vnode(vnode_t *uvp, dev_t dev, ino_t ino, vnode_t **vpp) { int error; struct mount *mp; /* Obtain mount point structure from device. */ if (!(mp = devtomp(dev))) { - myprintf(("coda_grab_vnode: devtomp(0x%llx) returns NULL\n", + myprintf(("%s: devtomp(0x%llx) returns NULL\n", __func__, (unsigned long long)dev)); return(ENXIO); } @@ -1810,7 +1804,7 @@ coda_grab_vnode(struct vnode *uvp, dev_t */ error = VFS_VGET(mp, ino, vpp); if (error) { - myprintf(("coda_grab_vnode: iget/vget(0x%llx, %llu) returns %p, err %d\n", + myprintf(("%s: iget/vget(0x%llx, %llu) returns %p, err %d\n", __func__, (unsigned long long)dev, (unsigned long long)ino, *vpp, error)); return(ENOENT); } @@ -1911,14 +1905,14 @@ make_coda_node(CodaFid *fid, struct moun int err; if ((cp = coda_find(fid)) == NULL) { - struct vnode *vp; + vnode_t *vp; cp = coda_alloc(); cp->c_fid = *fid; err = getnewvnode(VT_CODA, vfsp, coda_vnodeop_p, NULL, &vp); if (err) { - panic("coda: getnewvnode returned error %d", err); + panic("%s: getnewvnode returned error %d", __func__, err); } vp->v_data = cp; vp->v_type = type; @@ -1943,7 +1937,7 @@ int coda_getpages(void *v) { struct vop_getpages_args /* { - struct vnode *a_vp; + vnode_t *a_vp; voff_t a_offset; struct vm_page **a_m; int *a_count; @@ -1952,7 +1946,7 @@ coda_getpages(void *v) int a_advice; int a_flags; } */ *ap = v; - struct vnode *vp = ap->a_vp, *cvp; + vnode_t *vp = ap->a_vp, *cvp; struct cnode *cp = VTOC(vp); struct lwp *l = curlwp; kauth_cred_t cred = l->l_cred; @@ -1972,7 +1966,7 @@ coda_getpages(void *v) /* Check for control object. */ if (IS_CTL_VP(vp)) { - printf("coda_getpages: control object %p\n", vp); + printf("%s: control object %p\n", __func__, vp); return(EINVAL); } @@ -1998,12 +1992,12 @@ coda_getpages(void *v) if (waslocked == 0) { cerror = vn_lock(vp, LK_EXCLUSIVE); if (cerror) { - printf("coda_getpages: can't lock vnode %p\n", - vp); + printf("%s: can't lock vnode %p\n", + __func__, vp); return cerror; } #if 0 - printf("coda_getpages: locked vnode %p\n", vp); + printf("%s: locked vnode %p\n", __func__, vp); #endif } @@ -2016,7 +2010,7 @@ coda_getpages(void *v) cerror = VOP_OPEN(vp, FREAD, cred); if (cerror) { - printf("coda_getpages: cannot open vnode %p => %d\n", + printf("%s: cannot open vnode %p => %d\n", __func__, vp, cerror); if (waslocked == 0) VOP_UNLOCK(vp); @@ -2024,7 +2018,7 @@ coda_getpages(void *v) } #if 0 - printf("coda_getpages: opened vnode %p\n", vp); + printf("%s: opened vnode %p\n", __func__, vp); #endif cvp = cp->c_ovp; didopen = 1; @@ -2047,8 +2041,8 @@ coda_getpages(void *v) cerror = VOP_CLOSE(vp, FREAD, cred); if (cerror != 0) /* XXX How should we handle this? */ - printf("coda_getpages: closed vnode %p -> %d\n", - vp, cerror); + printf("%s: closed vnode %p -> %d\n", __func__, + vp, cerror); /* If we obtained a lock, drop it. */ if (waslocked == 0) @@ -2065,12 +2059,12 @@ int coda_putpages(void *v) { struct vop_putpages_args /* { - struct vnode *a_vp; + vnode_t *a_vp; voff_t a_offlo; voff_t a_offhi; int a_flags; } */ *ap = v; - struct vnode *vp = ap->a_vp, *cvp; + vnode_t *vp = ap->a_vp, *cvp; struct cnode *cp = VTOC(vp); int error; @@ -2079,7 +2073,7 @@ coda_putpages(void *v) /* Check for control object. */ if (IS_CTL_VP(vp)) { mutex_exit(vp->v_interlock); - printf("coda_putpages: control object %p\n", vp); + printf("%s: control object %p\n", __func__, vp); return(EINVAL); }