diff options
author | phk <phk@FreeBSD.org> | 1995-10-29 15:33:36 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1995-10-29 15:33:36 +0000 |
commit | 88d6fa4d4abcae38b7ea2520fe4f00203d58d677 (patch) | |
tree | 5994df578f3d766b837fe6548617062ae4661aac /sys/nfs | |
parent | cc116c7cb7917f4b59507c90c1b0c2a45b1f6364 (diff) | |
download | FreeBSD-src-88d6fa4d4abcae38b7ea2520fe4f00203d58d677.zip FreeBSD-src-88d6fa4d4abcae38b7ea2520fe4f00203d58d677.tar.gz |
Second batch of cleanup changes.
This time mostly making a lot of things static and some unused
variables here and there.
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs.h | 4 | ||||
-rw-r--r-- | sys/nfs/nfs_bio.c | 6 | ||||
-rw-r--r-- | sys/nfs/nfs_common.c | 4 | ||||
-rw-r--r-- | sys/nfs/nfs_node.c | 3 | ||||
-rw-r--r-- | sys/nfs/nfs_nqlease.c | 5 | ||||
-rw-r--r-- | sys/nfs/nfs_serv.c | 29 | ||||
-rw-r--r-- | sys/nfs/nfs_socket.c | 4 | ||||
-rw-r--r-- | sys/nfs/nfs_subs.c | 4 | ||||
-rw-r--r-- | sys/nfs/nfs_syscalls.c | 5 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 197 | ||||
-rw-r--r-- | sys/nfs/nfsnode.h | 41 |
11 files changed, 125 insertions, 177 deletions
diff --git a/sys/nfs/nfs.h b/sys/nfs/nfs.h index 2a3b3de..7b088bc 100644 --- a/sys/nfs/nfs.h +++ b/sys/nfs/nfs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.1 (Berkeley) 6/10/93 - * $Id: nfs.h,v 1.10 1995/06/27 11:06:33 dfr Exp $ + * $Id: nfs.h,v 1.11 1995/07/29 11:42:21 bde Exp $ */ #ifndef _NFS_NFS_H_ @@ -490,7 +490,6 @@ int nfs_vinvalbuf __P((struct vnode *,int,struct ucred *,struct proc *,int)); int nfs_readrpc __P((struct vnode *,struct uio *,struct ucred *)); int nfs_writerpc __P((struct vnode *,struct uio *,struct ucred *,int *,int *)); int nfs_readdirrpc __P((register struct vnode *,struct uio *,struct ucred *)); -int nfs_setattrrpc __P((struct vnode *,struct vattr *,struct ucred *,struct proc *)); int nfs_asyncio __P((struct buf *,struct ucred *)); int nfs_doio __P((struct buf *,struct ucred *,struct proc *)); int nfs_readlinkrpc __P((struct vnode *,struct uio *,struct ucred *)); @@ -537,7 +536,6 @@ int nfsrv_errmap __P((struct nfsrv_descript *, int)); void nfsrvw_coalesce __P((struct nfsrv_descript *,struct nfsrv_descript *)); void nfsrvw_sort __P((gid_t [],int)); void nfsrv_setcred __P((struct ucred *,struct ucred *)); -int nfs_flush __P((struct vnode *,struct ucred *,int,struct proc *,int)); int nfs_writebp __P((struct buf *,int)); int nfsrv_vput __P(( struct vnode * )); int nfsrv_vrele __P(( struct vnode * )); diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index d48a020..e1dbc246 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94 - * $Id: nfs_bio.c,v 1.16 1995/07/07 11:01:30 dfr Exp $ + * $Id: nfs_bio.c,v 1.17 1995/08/24 10:17:32 dfr Exp $ */ #include <sys/param.h> @@ -94,7 +94,6 @@ nfs_bioread(vp, uio, ioflag, cred) daddr_t lbn, rabn; int bufsize; int nra, error = 0, n = 0, on = 0, not_readin; - nfsquad_t tquad; #ifdef DIAGNOSTIC if (uio->uio_rw != UIO_READ) @@ -413,7 +412,7 @@ nfs_write(ap) struct buf *bp; struct vattr vattr; struct nfsmount *nmp = VFSTONFS(vp->v_mount); - daddr_t lbn, bn; + daddr_t lbn; int bufsize; int n, on, error = 0, iomode, must_commit; @@ -769,7 +768,6 @@ nfs_doio(bp, cr, p) int error = 0, diff, len, iomode, must_commit = 0; struct uio uio; struct iovec io; - nfsquad_t tquad; vp = bp->b_vp; np = VTONFS(vp); diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c index 5bdda4a..5118f15 100644 --- a/sys/nfs/nfs_common.c +++ b/sys/nfs/nfs_common.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.22 1995/07/29 11:42:22 bde Exp $ + * $Id: nfs_subs.c,v 1.23 1995/08/24 10:17:35 dfr Exp $ */ /* @@ -1187,7 +1187,6 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper) u_short vmode; struct timespec mtime; struct vnode *nvp; - quad_t tval; int v3 = NFS_ISV3(vp); md = *mdp; @@ -1681,7 +1680,6 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag) int kerbflag; { register struct mount *mp; - register struct nfsuid *uidp; register int i; struct ucred *credanon; int error, exflags; diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index 56b7357..f7cd396 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_node.c 8.2 (Berkeley) 12/30/93 - * $Id: nfs_node.c,v 1.10 1995/07/21 10:25:13 davidg Exp $ + * $Id: nfs_node.c,v 1.11 1995/07/22 03:32:18 davidg Exp $ */ #include <sys/param.h> @@ -268,7 +268,6 @@ nfs_lock(ap) } */ *ap; { register struct vnode *vp = ap->a_vp; - struct nfsnode *np = VTONFS(vp); /* * Ugh, another place where interruptible mounts will get hung. diff --git a/sys/nfs/nfs_nqlease.c b/sys/nfs/nfs_nqlease.c index f192969..e1c5366 100644 --- a/sys/nfs/nfs_nqlease.c +++ b/sys/nfs/nfs_nqlease.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_nqlease.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_nqlease.c,v 1.14 1995/08/24 10:45:13 dfr Exp $ + * $Id: nfs_nqlease.c,v 1.15 1995/08/24 11:04:02 davidg Exp $ */ /* @@ -769,7 +769,6 @@ nqnfsrv_vacated(nfsd, slp, procp, mrq) struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; struct mbuf *nam = nfsd->nd_nam; caddr_t dpos = nfsd->nd_dpos; - struct ucred *cred = &nfsd->nd_cr; register struct nqlease *lp; register struct nqhost *lph; struct nqlease *tlp = (struct nqlease *)0; @@ -890,7 +889,7 @@ nqnfs_vacated(vp, cred) register struct mbuf *m; register int i; register u_long *tl; - register long t1, t2; + register long t2; caddr_t bpos; u_long xid; int error = 0; diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 21d1891..228513e 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_serv.c,v 1.23 1995/08/24 10:45:15 dfr Exp $ + * $Id: nfs_serv.c,v 1.24 1995/08/24 11:39:31 davidg Exp $ */ /* @@ -709,7 +709,7 @@ nfsrv_write(nfsd, slp, procp, mrq) register u_long *tl; register long t1; caddr_t bpos; - int error = 0, rdonly, cache, siz, len, xfer, forat_ret = 1; + int error = 0, rdonly, cache, len, forat_ret = 1; int ioflags, aftat_ret = 1, retlen, zeroing, adjust; int stable = NFSV3WRITE_FILESYNC; int v3 = (nfsd->nd_flag & ND_NFSV3); @@ -903,7 +903,6 @@ nfsrv_writegather(ndp, slp, procp, mrq) struct mbuf *mb, *mb2, *mreq, *mrep, *md; struct vnode *vp; struct uio io, *uiop = &io; - off_t off; u_quad_t frev, cur_usec; #ifndef nolint @@ -1521,15 +1520,13 @@ nfsrv_mknod(nfsd, slp, procp, mrq) struct mbuf *nam = nfsd->nd_nam; caddr_t dpos = nfsd->nd_dpos; struct ucred *cred = &nfsd->nd_cr; - register struct nfs_fattr *fp; struct vattr va, dirfor, diraft; register struct vattr *vap = &va; register u_long *tl; struct nameidata nd; - register caddr_t cp; register long t1; caddr_t bpos; - int error = 0, cache, len, tsize, dirfor_ret = 1, diraft_ret = 1; + int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1; u_long major, minor; enum vtype vtyp; char *cp2; @@ -1679,7 +1676,7 @@ nfsrv_remove(nfsd, slp, procp, mrq) int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1; int v3 = (nfsd->nd_flag & ND_NFSV3); char *cp2; - struct mbuf *mb, *mreq, *mb2; + struct mbuf *mb, *mreq; struct vnode *vp, *dirp; struct vattr dirfor, diraft; nfsfh_t nfh; @@ -1770,7 +1767,7 @@ nfsrv_rename(nfsd, slp, procp, mrq) int tdirfor_ret = 1, tdiraft_ret = 1; int v3 = (nfsd->nd_flag & ND_NFSV3); char *cp2; - struct mbuf *mb, *mreq, *mb2; + struct mbuf *mb, *mreq; struct nameidata fromnd, tond; struct vnode *fvp, *tvp, *tdvp, *fdirp = (struct vnode *)0; struct vnode *tdirp = (struct vnode *)0; @@ -1986,7 +1983,7 @@ nfsrv_link(nfsd, slp, procp, mrq) int error = 0, rdonly, cache, len, dirfor_ret = 1, diraft_ret = 1; int getret = 1, v3 = (nfsd->nd_flag & ND_NFSV3); char *cp2; - struct mbuf *mb, *mreq, *mb2; + struct mbuf *mb, *mreq; struct vnode *vp, *xp, *dirp = (struct vnode *)0; struct vattr dirfor, diraft, at; nfsfh_t nfh, dnfh; @@ -2087,7 +2084,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq) register u_long *tl; register long t1; struct nfsv2_sattr *sp; - char *bpos, *cp, *pathcp = (char *)0, *cp2; + char *bpos, *pathcp = (char *)0, *cp2; struct uio io; struct iovec iv; int error = 0, cache, len, len2, dirfor_ret = 1, diraft_ret = 1; @@ -2351,7 +2348,7 @@ nfsrv_rmdir(nfsd, slp, procp, mrq) int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1; int v3 = (nfsd->nd_flag & ND_NFSV3); char *cp2; - struct mbuf *mb, *mreq, *mb2; + struct mbuf *mb, *mreq; struct vnode *vp, *dirp = (struct vnode *)0; struct vattr dirfor, diraft; nfsfh_t nfh; @@ -3339,10 +3336,7 @@ nfsrv_null(nfsd, slp, procp, mrq) struct proc *procp; struct mbuf **mrq; { - struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; - struct mbuf *nam = nfsd->nd_nam; - caddr_t dpos = nfsd->nd_dpos; - struct ucred *cred = &nfsd->nd_cr; + struct mbuf *mrep = nfsd->nd_mrep; caddr_t bpos; int error = NFSERR_RETVOID, cache; struct mbuf *mb, *mreq; @@ -3366,10 +3360,7 @@ nfsrv_noop(nfsd, slp, procp, mrq) struct proc *procp; struct mbuf **mrq; { - struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md; - struct mbuf *nam = nfsd->nd_nam; - caddr_t dpos = nfsd->nd_dpos; - struct ucred *cred = &nfsd->nd_cr; + struct mbuf *mrep = nfsd->nd_mrep; caddr_t bpos; int error, cache; struct mbuf *mb, *mreq; diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index 742134ae..427f304 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_socket.c,v 1.8 1995/06/27 11:06:39 dfr Exp $ + * $Id: nfs_socket.c,v 1.9 1995/08/24 11:04:04 davidg Exp $ */ /* @@ -1180,7 +1180,6 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp) if (nd->nd_flag & ND_KERBFULL) { register struct nfsuid *nuidp; struct timeval ktvin, ktvout; - NFSKERBKEYSCHED_T keys; /* stores key schedule */ for (nuidp = NUIDHASH(slp, nd->nd_cr.cr_uid)->lh_first; nuidp != 0; nuidp = nuidp->nu_hash.le_next) { @@ -1915,7 +1914,6 @@ nfs_getreq(nd, nfsd, has_header) struct mbuf *mrep, *md; register struct nfsuid *nuidp; struct timeval tvin, tvout; - NFSKERBKEYSCHED_T keys; /* stores key schedule */ mrep = nd->nd_mrep; md = nd->nd_md; diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index 5bdda4a..5118f15 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.22 1995/07/29 11:42:22 bde Exp $ + * $Id: nfs_subs.c,v 1.23 1995/08/24 10:17:35 dfr Exp $ */ /* @@ -1187,7 +1187,6 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper) u_short vmode; struct timespec mtime; struct vnode *nvp; - quad_t tval; int v3 = NFS_ISV3(vp); md = *mdp; @@ -1681,7 +1680,6 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag) int kerbflag; { register struct mount *mp; - register struct nfsuid *uidp; register int i; struct ucred *credanon; int error, exflags; diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index 35a50f4..786ce14 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_syscalls.c,v 1.6 1995/05/30 08:12:45 rgrimes Exp $ + * $Id: nfs_syscalls.c,v 1.7 1995/06/27 11:06:50 dfr Exp $ */ #include <sys/param.h> @@ -427,7 +427,6 @@ nfssvc_nfsd(nsd, argp, p) struct nfsd *nfsd = nsd->nsd_nfsd; struct nfsrv_descript *nd = NULL; struct mbuf *mreq; - struct nfsuid *uidp; int error = 0, cacherep, s, sotype, writes_todo; u_quad_t cur_usec; @@ -901,7 +900,6 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len) register struct nfsuid *nuidp; register u_long *nickp, *verfp; struct timeval ktvin, ktvout; - NFSKERBKEYSCHED_T keys; /* stores key schedule */ #ifdef DIAGNOSTIC if (verf_len < (4 * NFSX_UNSIGNED)) @@ -974,7 +972,6 @@ nfs_savenickauth(nmp, cred, len, key, mdp, dposp, mrep) struct mbuf *md = *mdp; struct timeval ktvin, ktvout; u_long nick; - NFSKERBKEYSCHED_T keys; char *dpos = *dposp, *cp2; int deltasec, error = 0; diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index db6bbde..6d6a344 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94 - * $Id: nfs_vnops.c,v 1.25 1995/10/22 09:32:42 davidg Exp $ + * $Id: nfs_vnops.c,v 1.26 1995/10/22 09:37:45 davidg Exp $ */ /* @@ -90,11 +90,52 @@ #define vfs_busy_pages(bp, f) #endif +static int nfsspec_read __P((struct vop_read_args *)); +static int nfsspec_write __P((struct vop_write_args *)); +static int nfsfifo_read __P((struct vop_read_args *)); +static int nfsfifo_write __P((struct vop_write_args *)); +static int nfsspec_close __P((struct vop_close_args *)); +static int nfsfifo_close __P((struct vop_close_args *)); +static int nfs_flush __P((struct vnode *,struct ucred *,int,struct proc *,int)); +static int nfs_setattrrpc __P((struct vnode *,struct vattr *,struct ucred *,struct proc *)); +static int nfs_lookup __P((struct vop_lookup_args *)); +static int nfs_create __P((struct vop_create_args *)); +static int nfs_mknod __P((struct vop_mknod_args *)); +static int nfs_open __P((struct vop_open_args *)); +static int nfs_close __P((struct vop_close_args *)); +static int nfs_access __P((struct vop_access_args *)); +static int nfs_getattr __P((struct vop_getattr_args *)); +static int nfs_setattr __P((struct vop_setattr_args *)); +static int nfs_read __P((struct vop_read_args *)); +static int nfs_mmap __P((struct vop_mmap_args *)); +static int nfs_fsync __P((struct vop_fsync_args *)); +static int nfs_remove __P((struct vop_remove_args *)); +static int nfs_link __P((struct vop_link_args *)); +static int nfs_rename __P((struct vop_rename_args *)); +static int nfs_mkdir __P((struct vop_mkdir_args *)); +static int nfs_rmdir __P((struct vop_rmdir_args *)); +static int nfs_symlink __P((struct vop_symlink_args *)); +static int nfs_readdir __P((struct vop_readdir_args *)); +static int nfs_bmap __P((struct vop_bmap_args *)); +static int nfs_strategy __P((struct vop_strategy_args *)); +static int nfs_lookitup __P((struct vnode *,char *,int,struct ucred *,struct proc *,struct nfsnode **)); +static int nfs_sillyrename __P((struct vnode *,struct vnode *,struct componentname *)); +static int nfsspec_access __P((struct vop_access_args *)); +static int nfs_readlink __P((struct vop_readlink_args *)); +static int nfs_print __P((struct vop_print_args *)); +static int nfs_pathconf __P((struct vop_pathconf_args *)); +static int nfs_advlock __P((struct vop_advlock_args *)); +static int nfs_blkatoff __P((struct vop_blkatoff_args *)); +static int nfs_bwrite __P((struct vop_bwrite_args *)); +static int nfs_valloc __P((struct vop_valloc_args *)); +static int nfs_vfree __P((struct vop_vfree_args *)); +static int nfs_truncate __P((struct vop_truncate_args *)); +static int nfs_update __P((struct vop_update_args *)); /* * Global vfs data structures for nfs */ int (**nfsv2_vnodeop_p)(); -struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { +static struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, nfs_lookup }, /* lookup */ { &vop_create_desc, nfs_create }, /* create */ @@ -145,7 +186,7 @@ struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { { &vop_bwrite_desc, nfs_bwrite }, { (struct vnodeop_desc*)NULL, (int(*)())NULL } }; -struct vnodeopv_desc nfsv2_vnodeop_opv_desc = +static struct vnodeopv_desc nfsv2_vnodeop_opv_desc = { &nfsv2_vnodeop_p, nfsv2_vnodeop_entries }; #ifdef __FreeBSD__ VNODEOP_SET(nfsv2_vnodeop_opv_desc); @@ -155,7 +196,7 @@ VNODEOP_SET(nfsv2_vnodeop_opv_desc); * Special device vnode ops */ int (**spec_nfsv2nodeop_p)(); -struct vnodeopv_entry_desc spec_nfsv2nodeop_entries[] = { +static struct vnodeopv_entry_desc spec_nfsv2nodeop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ @@ -206,14 +247,14 @@ struct vnodeopv_entry_desc spec_nfsv2nodeop_entries[] = { { &vop_bwrite_desc, vn_bwrite }, { (struct vnodeop_desc*)NULL, (int(*)())NULL } }; -struct vnodeopv_desc spec_nfsv2nodeop_opv_desc = +static struct vnodeopv_desc spec_nfsv2nodeop_opv_desc = { &spec_nfsv2nodeop_p, spec_nfsv2nodeop_entries }; #ifdef __FreeBSD__ VNODEOP_SET(spec_nfsv2nodeop_opv_desc); #endif int (**fifo_nfsv2nodeop_p)(); -struct vnodeopv_entry_desc fifo_nfsv2nodeop_entries[] = { +static struct vnodeopv_entry_desc fifo_nfsv2nodeop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, fifo_lookup }, /* lookup */ { &vop_create_desc, fifo_create }, /* create */ @@ -264,16 +305,16 @@ struct vnodeopv_entry_desc fifo_nfsv2nodeop_entries[] = { { &vop_bwrite_desc, vn_bwrite }, { (struct vnodeop_desc*)NULL, (int(*)())NULL } }; -struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc = +static struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc = { &fifo_nfsv2nodeop_p, fifo_nfsv2nodeop_entries }; #ifdef __FreeBSD__ VNODEOP_SET(fifo_nfsv2nodeop_opv_desc); #endif void nqnfs_clientlease(); -int nfs_commit(); -int nfs_removerpc(); -int nfs_renamerpc(); +static int nfs_commit(); +static int nfs_removerpc(); +static int nfs_renamerpc(); /* * Global variables @@ -286,31 +327,12 @@ int nfs_numasync = 0; #define DIRHDSIZ (sizeof (struct dirent) - (MAXNAMLEN + 1)) /* - * nfs null call from vfs. - */ -int -nfs_null(vp, cred, procp) - struct vnode *vp; - struct ucred *cred; - struct proc *procp; -{ - caddr_t bpos, dpos; - int error = 0; - struct mbuf *mreq, *mrep, *md, *mb; - - nfsm_reqhead(vp, NFSPROC_NULL, 0); - nfsm_request(vp, NFSPROC_NULL, procp, cred); - nfsm_reqdone; - return (error); -} - -/* * nfs access vnode op. * For nfs version 2, just return ok. File accesses may fail later. * For nfs version 3, use the access rpc to check accessibility. If file modes * are changed on the server, accesses might still fail later. */ -int +static int nfs_access(ap) struct vop_access_args /* { struct vnode *a_vp; @@ -397,7 +419,7 @@ nfs_access(ap) * if consistency is lost. */ /* ARGSUSED */ -int +static int nfs_open(ap) struct vop_open_args /* { struct vnode *a_vp; @@ -498,7 +520,7 @@ nfs_open(ap) * cases where write errors are important. */ /* ARGSUSED */ -int +static int nfs_close(ap) struct vop_close_args /* { struct vnodeop_desc *a_desc; @@ -533,7 +555,7 @@ nfs_close(ap) /* * nfs getattr call from vfs. */ -int +static int nfs_getattr(ap) struct vop_getattr_args /* { struct vnode *a_vp; @@ -575,7 +597,7 @@ nfs_getattr(ap) /* * nfs setattr call. */ -int +static int nfs_setattr(ap) struct vop_setattr_args /* { struct vnodeop_desc *a_desc; @@ -652,7 +674,7 @@ nfs_setattr(ap) /* * Do an nfs setattr rpc. */ -int +static int nfs_setattrrpc(vp, vap, cred, procp) register struct vnode *vp; register struct vattr *vap; @@ -666,7 +688,6 @@ nfs_setattrrpc(vp, vap, cred, procp) u_long *tl; int error = 0, wccflag = NFSV3_WCCRATTR; struct mbuf *mreq, *mrep, *md, *mb, *mb2; - u_quad_t frev; int v3 = NFS_ISV3(vp); nfsstats.rpccnt[NFSPROC_SETATTR]++; @@ -765,7 +786,7 @@ nfs_setattrrpc(vp, vap, cred, procp) * First look in cache * If not found, unlock the directory nfsnode and do the rpc */ -int +static int nfs_lookup(ap) struct vop_lookup_args /* { struct vnodeop_desc *a_desc; @@ -949,7 +970,7 @@ nfs_lookup(ap) * nfs read call. * Just call nfs_bioread() to do the work. */ -int +static int nfs_read(ap) struct vop_read_args /* { struct vnode *a_vp; @@ -968,7 +989,7 @@ nfs_read(ap) /* * nfs readlink call */ -int +static int nfs_readlink(ap) struct vop_readlink_args /* { struct vnode *a_vp; @@ -1096,8 +1117,6 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit) caddr_t bpos, dpos, cp2; struct mbuf *mreq, *mrep, *md, *mb, *mb2; struct nfsmount *nmp = VFSTONFS(vp->v_mount); - struct nfsnode *np = VTONFS(vp); - u_quad_t frev; int error = 0, len, tsiz, wccflag = NFSV3_WCCRATTR, rlen, commit; int v3 = NFS_ISV3(vp), committed = NFSV3WRITE_FILESYNC; @@ -1188,7 +1207,7 @@ nfsmout: * For NFS v2 this is a kludge. Use a create rpc but with the IFMT bits of the * mode set to specify the file type and the size field for rdev. */ -int +static int nfs_mknodrpc(dvp, vpp, cnp, vap) register struct vnode *dvp; register struct vnode **vpp; @@ -1286,7 +1305,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap) * just call nfs_mknodrpc() to do the work. */ /* ARGSUSED */ -int +static int nfs_mknod(ap) struct vop_mknod_args /* { struct vnode *a_dvp; @@ -1308,7 +1327,7 @@ static u_long create_verf; /* * nfs file create call */ -int +static int nfs_create(ap) struct vop_create_args /* { struct vnode *a_dvp; @@ -1427,7 +1446,7 @@ again: * else * do the remove rpc */ -int +static int nfs_remove(ap) struct vop_remove_args /* { struct vnodeop_desc *a_desc; @@ -1440,14 +1459,8 @@ nfs_remove(ap) register struct vnode *dvp = ap->a_dvp; register struct componentname *cnp = ap->a_cnp; register struct nfsnode *np = VTONFS(vp); - register u_long *tl; - register caddr_t cp; - register long t2; - caddr_t bpos, dpos; int error = 0; - struct mbuf *mreq, *mrep, *md, *mb, *mb2; struct vattr vattr; - int v3 = NFS_ISV3(dvp); #ifndef DIAGNOSTIC if ((cnp->cn_flags & HASBUF) == 0) @@ -1510,7 +1523,7 @@ nfs_removeit(sp) /* * Nfs remove rpc, called from nfs_remove() and nfs_removeit(). */ -int +static int nfs_removerpc(dvp, name, namelen, cred, proc) register struct vnode *dvp; char *name; @@ -1544,7 +1557,7 @@ nfs_removerpc(dvp, name, namelen, cred, proc) /* * nfs file rename call */ -int +static int nfs_rename(ap) struct vop_rename_args /* { struct vnode *a_fdvp; @@ -1614,7 +1627,7 @@ out: /* * nfs file rename rpc called from nfs_remove() above */ -int +static int nfs_renameit(sdvp, scnp, sp) struct vnode *sdvp; struct componentname *scnp; @@ -1627,7 +1640,7 @@ nfs_renameit(sdvp, scnp, sp) /* * Do an nfs rename rpc. Called from nfs_rename() and nfs_renameit(). */ -int +static int nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, proc) register struct vnode *fdvp; char *fnameptr; @@ -1672,7 +1685,7 @@ nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, proc) /* * nfs hard link create call */ -int +static int nfs_link(ap) struct vop_link_args /* { struct vnode *a_tdvp; @@ -1746,7 +1759,7 @@ nfs_link(ap) /* * nfs symbolic link create call */ -int +static int nfs_symlink(ap) struct vop_symlink_args /* { struct vnode *a_dvp; @@ -1816,7 +1829,7 @@ nfs_symlink(ap) /* * nfs make dir call */ -int +static int nfs_mkdir(ap) struct vop_mkdir_args /* { struct vnode *a_dvp; @@ -1837,9 +1850,8 @@ nfs_mkdir(ap) struct nfsnode *np = (struct nfsnode *)0; struct vnode *newvp = (struct vnode *)0; caddr_t bpos, dpos, cp2; - nfsfh_t *fhp; - int error = 0, wccflag = NFSV3_WCCRATTR, attrflag; - int fhsize, gotvp = 0; + int error = 0, wccflag = NFSV3_WCCRATTR; + int gotvp = 0; struct mbuf *mreq, *mrep, *md, *mb, *mb2; struct vattr vattr; int v3 = NFS_ISV3(dvp); @@ -1906,7 +1918,7 @@ nfs_mkdir(ap) /* * nfs remove directory call */ -int +static int nfs_rmdir(ap) struct vop_rmdir_args /* { struct vnode *a_dvp; @@ -1959,7 +1971,7 @@ nfs_rmdir(ap) /* * nfs readdir call */ -int +static int nfs_readdir(ap) struct vop_readdir_args /* { struct vnode *a_vp; @@ -2025,10 +2037,9 @@ nfs_readdirrpc(vp, uiop, cred) nfsuint64 cookie; struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *dnp = VTONFS(vp); - nfsfh_t *fhp; - u_quad_t frev, fileno; - int error = 0, tlen, more_dirs = 1, blksiz = 0, bigenough = 1, i; - int cachable, attrflag, fhsize; + u_quad_t fileno; + int error = 0, tlen, more_dirs = 1, blksiz = 0, bigenough = 1; + int attrflag; int v3 = NFS_ISV3(vp); #ifndef nolint @@ -2214,9 +2225,9 @@ nfs_readdirplusrpc(vp, uiop, cred) struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *dnp = VTONFS(vp), *np; nfsfh_t *fhp; - u_quad_t frev, fileno; + u_quad_t fileno; int error = 0, tlen, more_dirs = 1, blksiz = 0, doit, bigenough = 1, i; - int cachable, attrflag, fhsize; + int attrflag, fhsize; #ifndef nolint dp = (struct dirent *)0; @@ -2432,7 +2443,7 @@ static char hextoasc[] = "0123456789abcdef"; * to create the same funny name between the nfs_lookitup() fails and the * nfs_rename() completes, but... */ -int +static int nfs_sillyrename(dvp, vp, cnp) struct vnode *dvp, *vp; struct componentname *cnp; @@ -2493,7 +2504,7 @@ bad: * handled too * *npp != NULL --> update the file handle in the vnode */ -int +static int nfs_lookitup(dvp, name, len, cred, procp, npp) register struct vnode *dvp; char *name; @@ -2572,7 +2583,7 @@ nfs_lookitup(dvp, name, len, cred, procp, npp) /* * Nfs Version 3 commit rpc */ -int +static int nfs_commit(vp, offset, cnt, cred, procp) register struct vnode *vp; u_quad_t offset; @@ -2621,7 +2632,7 @@ nfs_commit(vp, offset, cnt, cred, procp) * a lot more work than bcopy() and also it currently happens in the * context of the swapper process (2). */ -int +static int nfs_bmap(ap) struct vop_bmap_args /* { struct vnode *a_vp; @@ -2651,7 +2662,7 @@ nfs_bmap(ap) * calling nfs_asyncio(), otherwise just all nfs_doio() to do the * request. */ -int +static int nfs_strategy(ap) struct vop_strategy_args *ap; { @@ -2687,7 +2698,7 @@ nfs_strategy(ap) * NB Currently unsupported. */ /* ARGSUSED */ -int +static int nfs_mmap(ap) struct vop_mmap_args /* { struct vnode *a_vp; @@ -2704,7 +2715,7 @@ nfs_mmap(ap) * fsync vnode op. Just call nfs_flush() with commit == 1. */ /* ARGSUSED */ -int +static int nfs_fsync(ap) struct vop_fsync_args /* { struct vnodeop_desc *a_desc; @@ -2723,7 +2734,7 @@ nfs_fsync(ap) * Walk through the buffer pool and push any dirty pages * associated with the vnode. */ -int +static int nfs_flush(vp, cred, waitfor, p, commit) register struct vnode *vp; struct ucred *cred; @@ -2919,7 +2930,7 @@ loop: * for V2. */ /* ARGSUSED */ -int +static int nfs_pathconf(ap) struct vop_pathconf_args /* { struct vnode *a_vp; @@ -2935,7 +2946,7 @@ nfs_pathconf(ap) * NFS advisory byte-level locks. * Currently unsupported. */ -int +static int nfs_advlock(ap) struct vop_advlock_args /* { struct vnode *a_vp; @@ -2962,7 +2973,7 @@ nfs_advlock(ap) /* * Print out the contents of an nfsnode. */ -int +static int nfs_print(ap) struct vop_print_args /* { struct vnode *a_vp; @@ -2983,7 +2994,7 @@ nfs_print(ap) * NFS directory offset lookup. * Currently unsupported. */ -int +static int nfs_blkatoff(ap) struct vop_blkatoff_args /* { struct vnode *a_vp; @@ -3000,7 +3011,7 @@ nfs_blkatoff(ap) * NFS flat namespace allocation. * Currently unsupported. */ -int +static int nfs_valloc(ap) struct vop_valloc_args /* { struct vnode *a_pvp; @@ -3017,7 +3028,7 @@ nfs_valloc(ap) * NFS flat namespace free. * Currently unsupported. */ -int +static int nfs_vfree(ap) struct vop_vfree_args /* { struct vnode *a_pvp; @@ -3032,7 +3043,7 @@ nfs_vfree(ap) /* * NFS file truncation. */ -int +static int nfs_truncate(ap) struct vop_truncate_args /* { struct vnode *a_vp; @@ -3051,7 +3062,7 @@ nfs_truncate(ap) /* * NFS update. */ -int +static int nfs_update(ap) struct vop_update_args /* { struct vnode *a_vp; @@ -3071,7 +3082,7 @@ nfs_update(ap) /* * Just call nfs_writebp() with the force argument set to 1. */ -int +static int nfs_bwrite(ap) struct vop_bwrite_args /* { struct vnode *a_bp; @@ -3148,7 +3159,7 @@ nfs_writebp(bp, force) * Essentially just get vattr and then imitate iaccess() since the device is * local to the client. */ -int +static int nfsspec_access(ap) struct vop_access_args /* { struct vnode *a_vp; @@ -3209,7 +3220,7 @@ found: /* * Read wrapper for special devices. */ -int +static int nfsspec_read(ap) struct vop_read_args /* { struct vnode *a_vp; @@ -3232,7 +3243,7 @@ nfsspec_read(ap) /* * Write wrapper for special devices. */ -int +static int nfsspec_write(ap) struct vop_write_args /* { struct vnode *a_vp; @@ -3257,7 +3268,7 @@ nfsspec_write(ap) * * Update the times on the nfsnode then do device close. */ -int +static int nfsspec_close(ap) struct vop_close_args /* { struct vnode *a_vp; @@ -3288,7 +3299,7 @@ nfsspec_close(ap) /* * Read wrapper for fifos. */ -int +static int nfsfifo_read(ap) struct vop_read_args /* { struct vnode *a_vp; @@ -3311,7 +3322,7 @@ nfsfifo_read(ap) /* * Write wrapper for fifos. */ -int +static int nfsfifo_write(ap) struct vop_write_args /* { struct vnode *a_vp; @@ -3336,7 +3347,7 @@ nfsfifo_write(ap) * * Update the times on the nfsnode then do fifo close. */ -int +static int nfsfifo_close(ap) struct vop_close_args /* { struct vnode *a_vp; diff --git a/sys/nfs/nfsnode.h b/sys/nfs/nfsnode.h index 0bd359f..c5e0534 100644 --- a/sys/nfs/nfsnode.h +++ b/sys/nfs/nfsnode.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsnode.h 8.4 (Berkeley) 2/13/94 - * $Id: nfsnode.h,v 1.10 1995/06/27 11:06:57 dfr Exp $ + * $Id: nfsnode.h,v 1.11 1995/07/29 11:42:23 bde Exp $ */ #ifndef _NFS_NFSNODE_H_ @@ -158,18 +158,6 @@ extern int (**spec_nfsv2nodeop_p)(); /* * Prototypes for NFS vnode operations */ -int nfs_lookup __P((struct vop_lookup_args *)); -int nfs_create __P((struct vop_create_args *)); -int nfs_mknod __P((struct vop_mknod_args *)); -int nfs_open __P((struct vop_open_args *)); -int nfs_close __P((struct vop_close_args *)); -int nfsspec_close __P((struct vop_close_args *)); -int nfsfifo_close __P((struct vop_close_args *)); -int nfs_access __P((struct vop_access_args *)); -int nfsspec_access __P((struct vop_access_args *)); -int nfs_getattr __P((struct vop_getattr_args *)); -int nfs_setattr __P((struct vop_setattr_args *)); -int nfs_read __P((struct vop_read_args *)); int nfs_write __P((struct vop_write_args *)); #ifdef HAS_VOPLEASE #define nfs_lease_check ((int (*) __P((struct vop_lease_args *)))nullop) @@ -181,52 +169,25 @@ int nfs_write __P((struct vop_write_args *)); #define nqnfs_lease_check lease_check #endif #endif -int nfsspec_read __P((struct vop_read_args *)); -int nfsspec_write __P((struct vop_write_args *)); -int nfsfifo_read __P((struct vop_read_args *)); -int nfsfifo_write __P((struct vop_write_args *)); #define nfs_ioctl ((int (*) __P((struct vop_ioctl_args *)))enoioctl) #define nfs_select ((int (*) __P((struct vop_select_args *)))seltrue) #ifdef HAS_VOPREVOKE #define nfs_revoke vop_revoke #endif -int nfs_mmap __P((struct vop_mmap_args *)); -int nfs_fsync __P((struct vop_fsync_args *)); #define nfs_seek ((int (*) __P((struct vop_seek_args *)))nullop) -int nfs_remove __P((struct vop_remove_args *)); -int nfs_link __P((struct vop_link_args *)); -int nfs_rename __P((struct vop_rename_args *)); -int nfs_mkdir __P((struct vop_mkdir_args *)); -int nfs_rmdir __P((struct vop_rmdir_args *)); -int nfs_symlink __P((struct vop_symlink_args *)); -int nfs_readdir __P((struct vop_readdir_args *)); -int nfs_readlink __P((struct vop_readlink_args *)); int nfs_abortop __P((struct vop_abortop_args *)); int nfs_inactive __P((struct vop_inactive_args *)); int nfs_reclaim __P((struct vop_reclaim_args *)); int nfs_lock __P((struct vop_lock_args *)); int nfs_unlock __P((struct vop_unlock_args *)); -int nfs_bmap __P((struct vop_bmap_args *)); -int nfs_strategy __P((struct vop_strategy_args *)); -int nfs_print __P((struct vop_print_args *)); int nfs_islocked __P((struct vop_islocked_args *)); -int nfs_pathconf __P((struct vop_pathconf_args *)); -int nfs_advlock __P((struct vop_advlock_args *)); -int nfs_blkatoff __P((struct vop_blkatoff_args *)); -int nfs_bwrite __P((struct vop_bwrite_args *)); int nfs_vget __P((struct mount *, ino_t, struct vnode **)); -int nfs_valloc __P((struct vop_valloc_args *)); #define nfs_reallocblks \ ((int (*) __P((struct vop_reallocblks_args *)))eopnotsupp) -int nfs_vfree __P((struct vop_vfree_args *)); -int nfs_truncate __P((struct vop_truncate_args *)); -int nfs_update __P((struct vop_update_args *)); /* other stuff */ int nfs_removeit __P((struct sillyrename *)); int nfs_nget __P((struct mount *,nfsfh_t *,int,struct nfsnode **)); -int nfs_lookitup __P((struct vnode *,char *,int,struct ucred *,struct proc *,struct nfsnode **)); -int nfs_sillyrename __P((struct vnode *,struct vnode *,struct componentname *)); nfsuint64 *nfs_getcookie __P((struct nfsnode *, off_t, int)); void nfs_invaldir __P((struct vnode *)); |