From: Sascha Wildner Date: Tue, 8 Jan 2013 18:21:35 +0000 (+0100) Subject: kernel/vfs: Remove some unused variables. X-Git-Tag: v3.4.0rc~522 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/1d0de3d37b9efb6301b10515fd12d922c8602093 kernel/vfs: Remove some unused variables. --- diff --git a/sys/vfs/devfs/devfs_vnops.c b/sys/vfs/devfs/devfs_vnops.c index 4a20cb036c..23a64e82f4 100644 --- a/sys/vfs/devfs/devfs_vnops.c +++ b/sys/vfs/devfs/devfs_vnops.c @@ -1399,7 +1399,9 @@ static int devfs_fo_ioctl(struct file *fp, u_long com, caddr_t data, struct ucred *ucred, struct sysmsg *msg) { +#if 0 struct devfs_node *node; +#endif struct vnode *vp; struct vnode *ovp; cdev_t dev; @@ -1415,7 +1417,9 @@ devfs_fo_ioctl(struct file *fp, u_long com, caddr_t data, reference_dev(dev); +#if 0 node = DEVFS_NODE(vp); +#endif devfs_debug(DEVFS_DEBUG_DEBUG, "devfs_fo_ioctl() called! for dev %s\n", @@ -1586,14 +1590,16 @@ static int devfs_spec_ioctl(struct vop_ioctl_args *ap) { struct vnode *vp = ap->a_vp; +#if 0 struct devfs_node *node; +#endif cdev_t dev; if ((dev = vp->v_rdev) == NULL) return (EBADF); /* device was revoked */ +#if 0 node = DEVFS_NODE(vp); -#if 0 if (node) { nanotime(&node->atime); nanotime(&node->mtime); @@ -1612,14 +1618,16 @@ static int devfs_spec_kqfilter(struct vop_kqfilter_args *ap) { struct vnode *vp = ap->a_vp; +#if 0 struct devfs_node *node; +#endif cdev_t dev; if ((dev = vp->v_rdev) == NULL) return (EBADF); /* device was revoked (EBADF) */ +#if 0 node = DEVFS_NODE(vp); -#if 0 if (node) nanotime(&node->atime); #endif diff --git a/sys/vfs/isofs/cd9660/cd9660_lookup.c b/sys/vfs/isofs/cd9660/cd9660_lookup.c index 219f2ec810..5d2e553dd6 100644 --- a/sys/vfs/isofs/cd9660/cd9660_lookup.c +++ b/sys/vfs/isofs/cd9660/cd9660_lookup.c @@ -106,7 +106,6 @@ cd9660_lookup(struct vop_old_lookup_args *ap) struct vnode *tdp; /* returned by cd9660_vget_internal */ u_long bmask; /* block offset mask */ int lockparent; /* 1 => lockparent flag is set */ - int wantparent; /* 1 => wantparent or lockparent flag */ int error; ino_t ino = 0; int reclen; @@ -127,7 +126,6 @@ cd9660_lookup(struct vop_old_lookup_args *ap) dp = VTOI(vdp); imp = dp->i_mnt; lockparent = flags & CNP_LOCKPARENT; - wantparent = flags & (CNP_LOCKPARENT | CNP_WANTPARENT); cnp->cn_flags &= ~CNP_PDIRUNLOCK; /* diff --git a/sys/vfs/nfs/bootp_subr.c b/sys/vfs/nfs/bootp_subr.c index 12e088961d..29b26d7df4 100644 --- a/sys/vfs/nfs/bootp_subr.c +++ b/sys/vfs/nfs/bootp_subr.c @@ -38,7 +38,6 @@ * nfs/krpc_subr.c * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $ * $FreeBSD: src/sys/nfs/bootp_subr.c,v 1.20.2.9 2003/04/24 16:51:08 ambrisko Exp $ - * $DragonFly: src/sys/vfs/nfs/bootp_subr.c,v 1.26 2008/03/08 07:50:49 sephe Exp $ */ #include "opt_bootp.h" @@ -1305,9 +1304,6 @@ static unsigned char * bootpc_tag(struct bootpc_tagcontext *tctx, struct bootp_packet *bp, int len, int tag) { - unsigned char *j; - unsigned char *ej; - tctx->overload = 0; tctx->badopt = 0; tctx->badtag = 0; @@ -1317,9 +1313,6 @@ bootpc_tag(struct bootpc_tagcontext *tctx, struct bootp_packet *bp, if (bootpc_hascookie(bp) == 0) return NULL; - j = &bp->vend[4]; - ej = (unsigned char *) bp + len; - bootpc_tag_helper(tctx, &bp->vend[4], (unsigned char *) bp + len - &bp->vend[4], tag); diff --git a/sys/vfs/nfs/krpc_subr.c b/sys/vfs/nfs/krpc_subr.c index a09609a976..9f8bd66df7 100644 --- a/sys/vfs/nfs/krpc_subr.c +++ b/sys/vfs/nfs/krpc_subr.c @@ -193,7 +193,7 @@ krpc_call(struct sockaddr_in *sa, u_int prog, u_int vers, u_int func, struct socket *so; struct sockaddr_in *sin, ssin; struct sockaddr *from; - struct mbuf *m, *nam, *mhead; + struct mbuf *m, *mhead; struct rpc_call *call; struct rpc_reply *reply; struct sockopt sopt; @@ -213,7 +213,7 @@ krpc_call(struct sockaddr_in *sa, u_int prog, u_int vers, u_int func, return (EAFNOSUPPORT); /* Free at end if not null. */ - nam = mhead = NULL; + mhead = NULL; from = NULL; /* diff --git a/sys/vfs/nfs/nfs_bio.c b/sys/vfs/nfs/nfs_bio.c index ebf8db3e3c..ded7e1777c 100644 --- a/sys/vfs/nfs/nfs_bio.c +++ b/sys/vfs/nfs/nfs_bio.c @@ -959,12 +959,8 @@ void nfs_startio(struct vnode *vp, struct bio *bio, struct thread *td) { struct buf *bp = bio->bio_buf; - struct nfsnode *np; - struct nfsmount *nmp; KKASSERT(vp->v_tag == VT_NFS); - np = VTONFS(vp); - nmp = VFSTONFS(vp->v_mount); /* * clear B_ERROR and B_INVAL state prior to initiating the I/O. We diff --git a/sys/vfs/nfs/nfs_serv.c b/sys/vfs/nfs/nfs_serv.c index a1cc65bfd5..a0d17b64bc 100644 --- a/sys/vfs/nfs/nfs_serv.c +++ b/sys/vfs/nfs/nfs_serv.c @@ -2373,7 +2373,6 @@ nfsrv_link(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct vnode *dvp; struct vnode *vp; struct vnode *xp; - struct mount *mp; struct mount *xmp; struct vattr dirfor, diraft, at; nfsfh_t nfh, dnfh; @@ -2389,7 +2388,7 @@ nfsrv_link(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); nlookup_zero(&nd); dirp = dvp = vp = xp = NULL; - mp = xmp = NULL; + xmp = NULL; fhp = &nfh.fh_generic; dfhp = &dnfh.fh_generic; @@ -2901,7 +2900,10 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct iovec iv; int len, nlen, rem, xfer, tsiz, i, error = 0, getret = 1; int siz, cnt, fullsiz, eofflag, rdonly, ncookies; - u_quad_t off, toff, verf; + u_quad_t off, toff; +#if 0 + u_quad_t verf; +#endif off_t *cookies = NULL, *cookiep; struct nfsm_info info; @@ -2918,12 +2920,16 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, NULLOUT(tl = nfsm_dissect(&info, 5 * NFSX_UNSIGNED)); toff = fxdr_hyper(tl); tl += 2; +#if 0 verf = fxdr_hyper(tl); +#endif tl += 2; } else { NULLOUT(tl = nfsm_dissect(&info, 2 * NFSX_UNSIGNED)); toff = fxdr_unsigned(u_quad_t, *tl++); +#if 0 verf = 0; /* shut up gcc */ +#endif } off = toff; cnt = fxdr_unsigned(int, *tl); @@ -3203,7 +3209,10 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct nfs_fattr *fp; int len, nlen, rem, xfer, tsiz, i, error = 0, getret = 1; int siz, cnt, fullsiz, eofflag, rdonly, dirlen, ncookies; - u_quad_t off, toff, verf; + u_quad_t off, toff; +#if 0 + u_quad_t verf; +#endif off_t *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ struct nfsm_info info; @@ -3219,7 +3228,9 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, NULLOUT(tl = nfsm_dissect(&info, 6 * NFSX_UNSIGNED)); toff = fxdr_hyper(tl); tl += 2; +#if 0 verf = fxdr_hyper(tl); +#endif tl += 2; siz = fxdr_unsigned(int, *tl++); cnt = fxdr_unsigned(int, *tl); diff --git a/sys/vfs/nfs/nfs_socket.c b/sys/vfs/nfs/nfs_socket.c index 3c152895b5..c7d4bbff03 100644 --- a/sys/vfs/nfs/nfs_socket.c +++ b/sys/vfs/nfs/nfs_socket.c @@ -1613,7 +1613,7 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, struct nfssvc_sock *slp, */ if (nd->nd_flag & ND_KERBFULL) { struct nfsuid *nuidp; - struct timeval ktvin, ktvout; + struct timeval ktvout; for (nuidp = NUIDHASH(slp, nd->nd_cr.cr_uid)->lh_first; nuidp != NULL; nuidp = nuidp->nu_hash.le_next) { @@ -1623,11 +1623,6 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, struct nfssvc_sock *slp, break; } if (nuidp) { - ktvin.tv_sec = - txdr_unsigned(nuidp->nu_timestamp.tv_sec - 1); - ktvin.tv_usec = - txdr_unsigned(nuidp->nu_timestamp.tv_usec); - /* * Encrypt the timestamp in ecb mode using the * session key. diff --git a/sys/vfs/nfs/nfs_syscalls.c b/sys/vfs/nfs/nfs_syscalls.c index dce5f8cf06..3ad9c0b00a 100644 --- a/sys/vfs/nfs/nfs_syscalls.c +++ b/sys/vfs/nfs/nfs_syscalls.c @@ -1059,7 +1059,7 @@ nfs_getnickauth(struct nfsmount *nmp, struct ucred *cred, char **auth_str, { struct nfsuid *nuidp; u_int32_t *nickp, *verfp; - struct timeval ktvin, ktvout; + struct timeval ktvout; #ifdef DIAGNOSTIC if (verf_len < (4 * NFSX_UNSIGNED)) @@ -1096,8 +1096,6 @@ nfs_getnickauth(struct nfsmount *nmp, struct ucred *cred, char **auth_str, getmicrotime(&nuidp->nu_timestamp); else nuidp->nu_timestamp.tv_usec++; - ktvin.tv_sec = txdr_unsigned(nuidp->nu_timestamp.tv_sec); - ktvin.tv_usec = txdr_unsigned(nuidp->nu_timestamp.tv_usec); /* * Now encrypt the timestamp verifier in ecb mode using the session diff --git a/sys/vfs/nfs/nfs_vnops.c b/sys/vfs/nfs/nfs_vnops.c index 74855bb322..dc0f7b6b67 100644 --- a/sys/vfs/nfs/nfs_vnops.c +++ b/sys/vfs/nfs/nfs_vnops.c @@ -723,9 +723,7 @@ nfs_setattr(struct vop_setattr_args *ap) struct nfsnode *np = VTONFS(vp); struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct vattr *vap = ap->a_vap; - int biosize = vp->v_mount->mnt_stat.f_iosize; int error = 0; - int boff; off_t tsize; thread_t td = curthread; @@ -783,7 +781,6 @@ nfs_setattr(struct vop_setattr_args *ap) tsize = np->n_size; again: - boff = (int)vap->va_size & (biosize - 1); error = nfs_meta_setsize(vp, td, vap->va_size, 0); #if 0 @@ -928,7 +925,6 @@ nfs_nresolve(struct vop_nresolve_args *ap) struct thread *td = curthread; struct namecache *ncp; struct nfsmount *nmp; - struct ucred *cred; struct nfsnode *np; struct vnode *dvp; struct vnode *nvp; @@ -940,7 +936,6 @@ nfs_nresolve(struct vop_nresolve_args *ap) int len; struct nfsm_info info; - cred = ap->a_cred; dvp = ap->a_dvp; nmp = VFSTONFS(dvp->v_mount); diff --git a/sys/vfs/nwfs/nwfs_io.c b/sys/vfs/nwfs/nwfs_io.c index 50771ddbee..e674d9eac1 100644 --- a/sys/vfs/nwfs/nwfs_io.c +++ b/sys/vfs/nwfs/nwfs_io.c @@ -163,9 +163,8 @@ nwfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred) { struct nwmount *nmp = VFSTONWFS(vp->v_mount); struct nwnode *np = VTONW(vp); - struct thread *td; struct vattr vattr; - int error, biosize; + int error; if (vp->v_type != VREG && vp->v_type != VDIR) { kprintf("%s: vn types other than VREG or VDIR are unsupported !\n",__func__); @@ -173,12 +172,10 @@ nwfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred) } if (uiop->uio_resid == 0) return 0; if (uiop->uio_offset < 0) return EINVAL; - td = uiop->uio_td; if (vp->v_type == VDIR) { error = nwfs_readvdir(vp, uiop, cred); return error; } - biosize = NWFSTOCONN(nmp)->buffer_size; if (np->n_flag & NMODIFIED) { nwfs_attr_cacheremove(vp); error = VOP_GETATTR(vp, &vattr); diff --git a/sys/vfs/nwfs/nwfs_node.c b/sys/vfs/nwfs/nwfs_node.c index fd67da025d..eb6e2f782a 100644 --- a/sys/vfs/nwfs/nwfs_node.c +++ b/sys/vfs/nwfs/nwfs_node.c @@ -251,7 +251,7 @@ nwfs_reclaim(struct vop_reclaim_args *ap) int nwfs_inactive(struct vop_inactive_args *ap) { - struct thread *td = curthread; /* XXX */ + struct thread *td __debugvar = curthread; /* XXX */ struct ucred *cred; struct vnode *vp = ap->a_vp; struct nwnode *np = VTONW(vp); diff --git a/sys/vfs/nwfs/nwfs_subr.c b/sys/vfs/nwfs/nwfs_subr.c index b69e3e0f1a..38b1aa3352 100644 --- a/sys/vfs/nwfs/nwfs_subr.c +++ b/sys/vfs/nwfs/nwfs_subr.c @@ -30,7 +30,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_subr.c,v 1.2.2.2 2000/10/25 02:11:10 bp Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_subr.c,v 1.8 2006/12/23 00:41:30 swildner Exp $ */ #include #include @@ -174,7 +173,6 @@ ncp_lookup(struct vnode *dvp, int len, char *name, struct nw_entry_info *fap, { struct nwmount *nmp; struct nwnode *dnp = VTONW(dvp); - struct ncp_conn *conn; int error; if (!dvp || dvp->v_type != VDIR) { @@ -182,7 +180,6 @@ ncp_lookup(struct vnode *dvp, int len, char *name, struct nw_entry_info *fap, return (ENOENT); } nmp = VTONWFS(dvp); - conn = NWFSTOCONN(nmp); if (len == 1 && name[0] == '.') { if (strcmp(dnp->n_name, NWFS_ROOTVOL) == 0) { diff --git a/sys/vfs/nwfs/nwfs_vnops.c b/sys/vfs/nwfs/nwfs_vnops.c index dc068b6ffe..a9a18eb10f 100644 --- a/sys/vfs/nwfs/nwfs_vnops.c +++ b/sys/vfs/nwfs/nwfs_vnops.c @@ -30,7 +30,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_vnops.c,v 1.6.2.3 2001/03/14 11:26:59 bp Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_vnops.c,v 1.38 2007/11/20 21:03:50 dillon Exp $ */ #include #include @@ -577,7 +576,6 @@ nwfs_mkdir(struct vop_old_mkdir_args *ap) struct componentname *cnp = ap->a_cnp; int len=cnp->cn_namelen; struct ncp_open_info no; - struct nwnode *np; struct vnode *newvp = NULL; ncpfid fid; int error = 0; @@ -602,7 +600,6 @@ nwfs_mkdir(struct vop_old_mkdir_args *ap) fid.f_id = no.fattr.dirEntNum; error = nwfs_nget(VTOVFS(dvp), fid, &no.fattr, dvp, &newvp); if (!error) { - np = VTONW(newvp); newvp->v_type = VDIR; *ap->a_vpp = newvp; } diff --git a/sys/vfs/puffs/puffs_io.c b/sys/vfs/puffs/puffs_io.c index 4f152f3601..0f51fb271b 100644 --- a/sys/vfs/puffs/puffs_io.c +++ b/sys/vfs/puffs/puffs_io.c @@ -204,7 +204,7 @@ puffs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct vattr vattr; off_t lbn, loffset, fsize; size_t n; - int boff, seqcount; + int boff; int error = 0; KKASSERT(uio->uio_rw == UIO_READ); @@ -215,8 +215,6 @@ puffs_bioread(struct vnode *vp, struct uio *uio, int ioflag, if (uio->uio_resid == 0) return 0; - seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); - /* * Cache consistency can only be maintained approximately. * diff --git a/sys/vfs/puffs/puffs_msgif.c b/sys/vfs/puffs/puffs_msgif.c index 54e7cee1b4..2a70061b3e 100644 --- a/sys/vfs/puffs/puffs_msgif.c +++ b/sys/vfs/puffs/puffs_msgif.c @@ -322,7 +322,6 @@ void puffs_msg_enqueue(struct puffs_mount *pmp, struct puffs_msgpark *park) { struct thread *td = curthread; - struct mount *mp; struct puffs_req *preq; sigset_t ss; @@ -335,7 +334,6 @@ puffs_msg_enqueue(struct puffs_mount *pmp, struct puffs_msgpark *park) park->park_flags &= ~(PARKFLAG_DONE | PARKFLAG_HASERROR); KKASSERT((park->park_flags & PARKFLAG_WAITERGONE) == 0); - mp = PMPTOMP(pmp); preq = park->park_preq; preq->preq_buflen = park->park_maxlen; @@ -1131,8 +1129,6 @@ puffs_userdead(struct puffs_mount *pmp) /* signal waiters on REQUEST TO file server queue */ for (park = TAILQ_FIRST(&pmp->pmp_msg_touser); park; park = park_next) { - uint8_t opclass; - lockmgr(&park->park_mtx, LK_EXCLUSIVE); puffs_msgpark_reference(park); park_next = TAILQ_NEXT(park, park_entries); @@ -1155,7 +1151,6 @@ puffs_userdead(struct puffs_mount *pmp) puffs_msgpark_release(park); } else { - opclass = park->park_preq->preq_opclass; park->park_preq->preq_rv = ENXIO; if (park->park_flags & PARKFLAG_CALL) { diff --git a/sys/vfs/puffs/puffs_node.c b/sys/vfs/puffs/puffs_node.c index 4f6c35978e..f6bdea8b30 100644 --- a/sys/vfs/puffs/puffs_node.c +++ b/sys/vfs/puffs/puffs_node.c @@ -218,10 +218,8 @@ puffs_newnode(struct mount *mp, struct vnode *dvp, struct vnode **vpp, void puffs_putvnode(struct vnode *vp) { - struct puffs_mount *pmp; struct puffs_node *pnode; - pmp = VPTOPUFFSMP(vp); pnode = VPTOPP(vp); #ifdef DIAGNOSTIC diff --git a/sys/vfs/smbfs/smbfs_node.c b/sys/vfs/smbfs/smbfs_node.c index 02d1b4bf90..4164545279 100644 --- a/sys/vfs/smbfs/smbfs_node.c +++ b/sys/vfs/smbfs/smbfs_node.c @@ -272,7 +272,6 @@ int smbfs_nget(struct mount *mp, struct vnode *dvp, const char *name, int nmlen, struct smbfattr *fap, struct vnode **vpp) { - struct smbnode *np; struct vnode *vp; int error; @@ -280,7 +279,6 @@ smbfs_nget(struct mount *mp, struct vnode *dvp, const char *name, int nmlen, error = smbfs_node_alloc(mp, dvp, name, nmlen, fap, &vp); if (error) return error; - np = VTOSMB(vp); if (fap) smbfs_attr_cacheenter(vp, fap); *vpp = vp; diff --git a/sys/vfs/udf/udf_vnops.c b/sys/vfs/udf/udf_vnops.c index 99a4c20ed5..c9965026f7 100644 --- a/sys/vfs/udf/udf_vnops.c +++ b/sys/vfs/udf/udf_vnops.c @@ -299,9 +299,6 @@ udf_getattr(struct vop_getattr_args *a) struct udf_node *node; struct vattr *vap; struct file_entry *fentry; - struct timespec ts; - - ts.tv_sec = 0; vp = a->a_vp; vap = a->a_vap; @@ -871,7 +868,6 @@ udf_lookup(struct vop_old_lookup_args *a) struct udf_mnt *udfmp; struct fileid_desc *fid = NULL; struct udf_dirstream *ds; - struct thread *td; u_long nameiop; u_long flags; char *nameptr; @@ -888,7 +884,6 @@ udf_lookup(struct vop_old_lookup_args *a) nameptr = a->a_cnp->cn_nameptr; namelen = a->a_cnp->cn_namelen; fsize = node->fentry->inf_len; - td = a->a_cnp->cn_td; *vpp = NULL; diff --git a/sys/vfs/ufs/ffs_vnops.c b/sys/vfs/ufs/ffs_vnops.c index e8bcf9d6f9..7cd2d0230c 100644 --- a/sys/vfs/ufs/ffs_vnops.c +++ b/sys/vfs/ufs/ffs_vnops.c @@ -107,14 +107,10 @@ ffs_fsync(struct vop_fsync_args *ap) struct vnode *vp = ap->a_vp; int error; - if (vn_isdisk(vp, NULL)) { + if (vn_isdisk(vp, NULL)) if (vp->v_rdev && vp->v_rdev->si_mountpoint != NULL && (vp->v_rdev->si_mountpoint->mnt_flag & MNT_SOFTDEP)) softdep_fsync_mountdev(vp); - } else { - struct inode *ip; - ip = VTOI(vp); - } /* * Flush all dirty buffers associated with a vnode. diff --git a/sys/vfs/union/union_subr.c b/sys/vfs/union/union_subr.c index c715c7cc1e..a088586e91 100644 --- a/sys/vfs/union/union_subr.c +++ b/sys/vfs/union/union_subr.c @@ -915,10 +915,8 @@ union_mkwhiteout(struct union_mount *um, struct vnode *dvp, struct thread *td = cnp->cn_td; struct vnode *wvp; struct componentname cn; - struct ucred *cred; KKASSERT(td->td_proc); - cred = td->td_proc->p_ucred; error = union_relookup(um, dvp, &wvp, cnp, &cn, path, strlen(path)); if (error)