summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/bootp_subr.c98
-rw-r--r--sys/nfsclient/krpc.h6
-rw-r--r--sys/nfsclient/krpc_subr.c16
-rw-r--r--sys/nfsclient/nfs.h68
-rw-r--r--sys/nfsclient/nfs_bio.c140
-rw-r--r--sys/nfsclient/nfs_lock.c17
-rw-r--r--sys/nfsclient/nfs_nfsiod.c65
-rw-r--r--sys/nfsclient/nfs_node.c20
-rw-r--r--sys/nfsclient/nfs_socket.c67
-rw-r--r--sys/nfsclient/nfs_subs.c34
-rw-r--r--sys/nfsclient/nfs_vfsops.c68
-rw-r--r--sys/nfsclient/nfs_vnops.c228
-rw-r--r--sys/nfsclient/nfsargs.h68
-rw-r--r--sys/nfsclient/nfsnode.h8
-rw-r--r--sys/nfsclient/nfsstats.h68
15 files changed, 490 insertions, 481 deletions
diff --git a/sys/nfsclient/bootp_subr.c b/sys/nfsclient/bootp_subr.c
index 72fc393..063f77f 100644
--- a/sys/nfsclient/bootp_subr.c
+++ b/sys/nfsclient/bootp_subr.c
@@ -213,11 +213,11 @@ extern struct nfsv3_diskless nfsv3_diskless;
/* mountd RPC */
static int md_mount(struct sockaddr_in *mdsin, char *path,
u_char *fhp, int *fhsizep,
- struct nfs_args *args,struct proc *procp);
+ struct nfs_args *args,struct thread *td);
static int md_lookup_swap(struct sockaddr_in *mdsin,char *path,
u_char *fhp, int *fhsizep,
struct nfs_args *args,
- struct proc *procp);
+ struct thread *td);
static int setfs(struct sockaddr_in *addr, char *path, char *p);
static int getdec(char **ptr);
static char *substr(char *a,char *b);
@@ -231,7 +231,7 @@ static
struct bootpc_ifcontext *allocifctx(struct bootpc_globalcontext *gctx);
static void bootpc_compose_query(struct bootpc_ifcontext *ifctx,
struct bootpc_globalcontext *gctx,
- struct proc *procp);
+ struct thread *td);
static unsigned char *bootpc_tag(struct bootpc_tagcontext *tctx,
struct bootp_packet *bp, int len, int tag);
static void bootpc_tag_helper(struct bootpc_tagcontext *tctx,
@@ -248,15 +248,15 @@ void bootpboot_p_iflist(void);
#endif
static int bootpc_call(struct bootpc_globalcontext *gctx,
- struct proc *procp);
+ struct thread *td);
static int bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx,
struct bootpc_globalcontext *gctx,
- struct proc *procp);
+ struct thread *td);
static int bootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
struct bootpc_globalcontext *gctx,
- struct proc *procp);
+ struct thread *td);
static void bootpc_decode_reply(struct nfsv3_diskless *nd,
struct bootpc_ifcontext *ifctx,
@@ -581,7 +581,7 @@ bootpc_received(struct bootpc_globalcontext *gctx,
static int
bootpc_call(struct bootpc_globalcontext *gctx,
- struct proc *procp)
+ struct thread *td)
{
struct socket *so;
struct sockaddr_in *sin, dst;
@@ -601,7 +601,7 @@ bootpc_call(struct bootpc_globalcontext *gctx,
/*
* Create socket and set its recieve timeout.
*/
- error = socreate(AF_INET, &so, SOCK_DGRAM, 0, procp);
+ error = socreate(AF_INET, &so, SOCK_DGRAM, 0, td);
if (error != 0)
goto out;
@@ -648,7 +648,7 @@ bootpc_call(struct bootpc_globalcontext *gctx,
sin = &dst;
clear_sinaddr(sin);
sin->sin_port = htons(IPPORT_BOOTPC);
- error = sobind(so, (struct sockaddr *)sin, procp);
+ error = sobind(so, (struct sockaddr *)sin, td);
if (error != 0) {
printf("bind failed\n");
goto out;
@@ -706,7 +706,7 @@ bootpc_call(struct bootpc_globalcontext *gctx,
(ifctx->state == IF_BOOTP_UNRESOLVED &&
ifctx->dhcpquerytype != DHCP_NOMSG)) {
ifctx->sentmsg = 0;
- bootpc_compose_query(ifctx, gctx, procp);
+ bootpc_compose_query(ifctx, gctx, td);
}
/* Send BOOTP request (or re-send). */
@@ -743,21 +743,21 @@ bootpc_call(struct bootpc_globalcontext *gctx,
auio.uio_rw = UIO_WRITE;
auio.uio_offset = 0;
auio.uio_resid = sizeof(ifctx->call);
- auio.uio_procp = procp;
+ auio.uio_td = td;
/* Set netmask to 0.0.0.0 */
sin = (struct sockaddr_in *) &ifctx->ireq.ifr_addr;
clear_sinaddr(sin);
error = ifioctl(ifctx->so, SIOCSIFNETMASK,
- (caddr_t) &ifctx->ireq, procp);
+ (caddr_t) &ifctx->ireq, td);
if (error != 0)
panic("bootpc_call:"
"set if netmask, error=%d",
error);
error = sosend(so, (struct sockaddr *) &dst,
- &auio, NULL, NULL, 0, procp);
+ &auio, NULL, NULL, 0, td);
if (error != 0) {
printf("bootpc_call: sosend: %d state %08x\n",
error, (int) so->so_state);
@@ -772,7 +772,7 @@ bootpc_call(struct bootpc_globalcontext *gctx,
clear_sinaddr(sin);
sin->sin_addr.s_addr = htonl(0xff000000u);
error = ifioctl(ifctx->so, SIOCSIFNETMASK,
- (caddr_t) &ifctx->ireq, procp);
+ (caddr_t) &ifctx->ireq, td);
if (error != 0)
panic("bootpc_call:"
"set if netmask, error=%d",
@@ -810,7 +810,7 @@ bootpc_call(struct bootpc_globalcontext *gctx,
auio.uio_rw = UIO_READ;
auio.uio_offset = 0;
auio.uio_resid = sizeof(gctx->reply);
- auio.uio_procp = procp;
+ auio.uio_td = td;
rcvflg = 0;
error = soreceive(so, NULL, &auio,
@@ -979,7 +979,7 @@ out:
static int
bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx,
struct bootpc_globalcontext *gctx,
- struct proc *procp)
+ struct thread *td)
{
struct sockaddr_in *sin;
int error;
@@ -989,7 +989,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx,
struct ifaddr *ifa;
struct sockaddr_dl *sdl;
- error = socreate(AF_INET, &ifctx->so, SOCK_DGRAM, 0, procp);
+ error = socreate(AF_INET, &ifctx->so, SOCK_DGRAM, 0, td);
if (error != 0)
panic("nfs_boot: socreate, error=%d", error);
@@ -1002,11 +1002,11 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx,
* Get the old interface flags and or IFF_UP into them; if
* IFF_UP set blindly, interface selection can be clobbered.
*/
- error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, procp);
+ error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, td);
if (error != 0)
panic("bootpc_fakeup_interface: GIFFLAGS, error=%d", error);
ireq->ifr_flags |= IFF_UP;
- error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, procp);
+ error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, td);
if (error != 0)
panic("bootpc_fakeup_interface: SIFFLAGS, error=%d", error);
@@ -1019,7 +1019,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx,
sin = (struct sockaddr_in *) &ireq->ifr_addr;
clear_sinaddr(sin);
- error = ifioctl(so, SIOCSIFADDR, (caddr_t) ireq, procp);
+ error = ifioctl(so, SIOCSIFADDR, (caddr_t) ireq, td);
if (error != 0 && (error != EEXIST || ifctx == gctx->interfaces))
panic("bootpc_fakeup_interface: "
"set if addr, error=%d", error);
@@ -1029,7 +1029,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx,
sin = (struct sockaddr_in *) &ireq->ifr_addr;
clear_sinaddr(sin);
sin->sin_addr.s_addr = htonl(0xff000000u);
- error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, procp);
+ error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, td);
if (error != 0)
panic("bootpc_fakeup_interface: set if netmask, error=%d",
error);
@@ -1042,7 +1042,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx,
sin->sin_addr.s_addr = htonl(INADDR_BROADCAST);
ifctx->broadcast.sin_addr.s_addr = sin->sin_addr.s_addr;
- error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp);
+ error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, td);
if (error != 0)
panic("bootpc_fakeup_interface: "
"set if broadcast addr, error=%d",
@@ -1071,7 +1071,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx,
static int
bootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
struct bootpc_globalcontext *gctx,
- struct proc *procp)
+ struct thread *td)
{
int error;
struct sockaddr_in defdst;
@@ -1095,19 +1095,19 @@ bootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
/* Shutdown interfaces where BOOTP failed */
printf("Shutdown interface %s\n", ifctx->ireq.ifr_name);
- error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, procp);
+ error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, td);
if (error != 0)
panic("bootpc_adjust_interface: "
"SIOCGIFFLAGS, error=%d", error);
ireq->ifr_flags &= ~IFF_UP;
- error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, procp);
+ error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, td);
if (error != 0)
panic("bootpc_adjust_interface: "
"SIOCSIFFLAGS, error=%d", error);
sin = (struct sockaddr_in *) &ireq->ifr_addr;
clear_sinaddr(sin);
- error = ifioctl(so, SIOCDIFADDR, (caddr_t) ireq, procp);
+ error = ifioctl(so, SIOCDIFADDR, (caddr_t) ireq, td);
if (error != 0 && (error != EEXIST ||
ifctx == gctx->interfaces))
panic("bootpc_adjust_interface: "
@@ -1122,7 +1122,7 @@ bootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
* can talk to the servers. (just set the address)
*/
bcopy(netmask, &ireq->ifr_addr, sizeof(*netmask));
- error = ifioctl(so, SIOCSIFNETMASK, (caddr_t) ireq, procp);
+ error = ifioctl(so, SIOCSIFNETMASK, (caddr_t) ireq, td);
if (error != 0)
panic("bootpc_adjust_interface: "
"set if netmask, error=%d", error);
@@ -1133,13 +1133,13 @@ bootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
clear_sinaddr(sin);
sin->sin_addr.s_addr = myaddr->sin_addr.s_addr |
~ netmask->sin_addr.s_addr;
- error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t) ireq, procp);
+ error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t) ireq, td);
if (error != 0)
panic("bootpc_adjust_interface: "
"set if broadcast addr, error=%d", error);
bcopy(myaddr, &ireq->ifr_addr, sizeof(*myaddr));
- error = ifioctl(so, SIOCSIFADDR, (caddr_t) ireq, procp);
+ error = ifioctl(so, SIOCSIFADDR, (caddr_t) ireq, td);
if (error != 0 && (error != EEXIST || ifctx == gctx->interfaces))
panic("bootpc_adjust_interface: "
"set if addr, error=%d", error);
@@ -1326,10 +1326,10 @@ print_in_addr(struct in_addr addr)
}
static void
-bootpc_compose_query(ifctx, gctx, procp)
+bootpc_compose_query(ifctx, gctx, td)
struct bootpc_ifcontext *ifctx;
struct bootpc_globalcontext *gctx;
- struct proc *procp;
+ struct thread *td;
{
unsigned char *vendp;
uint32_t leasetime;
@@ -1670,10 +1670,10 @@ bootpc_init(void)
struct ifnet *ifp;
int error;
struct nfsv3_diskless *nd;
- struct proc *procp;
+ struct thread *td;
nd = &nfsv3_diskless;
- procp = curproc;
+ td = curthread;
/*
* If already filled in, don't touch it here
@@ -1745,13 +1745,13 @@ bootpc_init(void)
gctx->gotgw = 0;
for (ifctx = gctx->interfaces; ifctx != NULL; ifctx = ifctx->next)
- bootpc_fakeup_interface(ifctx, gctx, procp);
+ bootpc_fakeup_interface(ifctx, gctx, td);
for (ifctx = gctx->interfaces; ifctx != NULL; ifctx = ifctx->next)
- bootpc_compose_query(ifctx, gctx, procp);
+ bootpc_compose_query(ifctx, gctx, td);
ifctx = gctx->interfaces;
- error = bootpc_call(gctx, procp);
+ error = bootpc_call(gctx, td);
if (error != 0) {
#ifdef BOOTP_NFSROOT
@@ -1777,7 +1777,7 @@ bootpc_init(void)
#endif
for (ifctx = gctx->interfaces; ifctx != NULL; ifctx = ifctx->next) {
- bootpc_adjust_interface(ifctx, gctx, procp);
+ bootpc_adjust_interface(ifctx, gctx, td);
soclose(ifctx->so);
}
@@ -1799,7 +1799,7 @@ bootpc_init(void)
error = md_mount(&nd->root_saddr, nd->root_hostnam,
nd->root_fh, &nd->root_fhsize,
- &nd->root_args, procp);
+ &nd->root_args, td);
if (error != 0)
panic("nfs_boot: mountd root, error=%d", error);
@@ -1808,7 +1808,7 @@ bootpc_init(void)
error = md_mount(&nd->swap_saddr,
nd->swap_hostnam,
nd->swap_fh, &nd->swap_fhsize,
- &nd->swap_args, procp);
+ &nd->swap_args, td);
if (error != 0)
panic("nfs_boot: mountd swap, error=%d",
error);
@@ -1816,7 +1816,7 @@ bootpc_init(void)
error = md_lookup_swap(&nd->swap_saddr,
gctx->lookup_path,
nd->swap_fh, &nd->swap_fhsize,
- &nd->swap_args, procp);
+ &nd->swap_args, td);
if (error != 0)
panic("nfs_boot: lookup swap, error=%d",
error);
@@ -1852,7 +1852,7 @@ md_mount(struct sockaddr_in *mdsin, /* mountd server address */
u_char *fhp,
int *fhsizep,
struct nfs_args *args,
- struct proc *procp)
+ struct thread *td)
{
struct mbuf *m;
int error;
@@ -1864,13 +1864,13 @@ md_mount(struct sockaddr_in *mdsin, /* mountd server address */
/* First try NFS v3 */
/* Get port number for MOUNTD. */
error = krpc_portmap(mdsin, RPCPROG_MNT, RPCMNT_VER3,
- &mdsin->sin_port, procp);
+ &mdsin->sin_port, td);
if (error == 0) {
m = xdr_string_encode(path, strlen(path));
/* Do RPC to mountd. */
error = krpc_call(mdsin, RPCPROG_MNT, RPCMNT_VER3,
- RPCMNT_MOUNT, &m, NULL, procp);
+ RPCMNT_MOUNT, &m, NULL, td);
}
if (error == 0) {
args->flags |= NFSMNT_NFSV3;
@@ -1880,7 +1880,7 @@ md_mount(struct sockaddr_in *mdsin, /* mountd server address */
/* Get port number for MOUNTD. */
error = krpc_portmap(mdsin, RPCPROG_MNT, RPCMNT_VER1,
- &mdsin->sin_port, procp);
+ &mdsin->sin_port, td);
if (error != 0)
return error;
@@ -1888,7 +1888,7 @@ md_mount(struct sockaddr_in *mdsin, /* mountd server address */
/* Do RPC to mountd. */
error = krpc_call(mdsin, RPCPROG_MNT, RPCMNT_VER1,
- RPCMNT_MOUNT, &m, NULL, procp);
+ RPCMNT_MOUNT, &m, NULL, td);
if (error != 0)
return error; /* message already freed */
@@ -1931,7 +1931,7 @@ md_mount(struct sockaddr_in *mdsin, /* mountd server address */
error = krpc_portmap(mdsin, NFS_PROG,
(args->flags &
NFSMNT_NFSV3) ? NFS_VER3 : NFS_VER2,
- &mdsin->sin_port, procp);
+ &mdsin->sin_port, td);
goto out;
@@ -1950,7 +1950,7 @@ md_lookup_swap(struct sockaddr_in *mdsin, /* mountd server address */
u_char *fhp,
int *fhsizep,
struct nfs_args *args,
- struct proc *procp)
+ struct thread *td)
{
struct mbuf *m;
int error;
@@ -1984,10 +1984,10 @@ md_lookup_swap(struct sockaddr_in *mdsin, /* mountd server address */
/* Do RPC to nfsd. */
if ((args->flags & NFSMNT_NFSV3) != 0)
error = krpc_call(mdsin, NFS_PROG, NFS_VER3,
- NFSPROC_LOOKUP, &m, NULL, procp);
+ NFSPROC_LOOKUP, &m, NULL, td);
else
error = krpc_call(mdsin, NFS_PROG, NFS_VER2,
- NFSV2PROC_LOOKUP, &m, NULL, procp);
+ NFSV2PROC_LOOKUP, &m, NULL, td);
if (error != 0)
return error; /* message already freed */
diff --git a/sys/nfsclient/krpc.h b/sys/nfsclient/krpc.h
index 6c889b5..b6136e3 100644
--- a/sys/nfsclient/krpc.h
+++ b/sys/nfsclient/krpc.h
@@ -4,16 +4,16 @@
#include <sys/cdefs.h>
struct mbuf;
-struct proc;
+struct thread;
struct sockaddr;
struct sockaddr_in;
int krpc_call __P((struct sockaddr_in *_sin,
u_int prog, u_int vers, u_int func,
- struct mbuf **data, struct sockaddr **from, struct proc *procp));
+ struct mbuf **data, struct sockaddr **from, struct thread *td));
int krpc_portmap __P((struct sockaddr_in *_sin,
- u_int prog, u_int vers, u_int16_t *portp,struct proc *procp));
+ u_int prog, u_int vers, u_int16_t *portp,struct thread *td));
struct mbuf *xdr_string_encode __P((char *str, int len));
diff --git a/sys/nfsclient/krpc_subr.c b/sys/nfsclient/krpc_subr.c
index b7b1d2c..709af4a 100644
--- a/sys/nfsclient/krpc_subr.c
+++ b/sys/nfsclient/krpc_subr.c
@@ -124,11 +124,11 @@ struct rpc_reply {
* Returns non-zero error on failure.
*/
int
-krpc_portmap(sin, prog, vers, portp, procp)
+krpc_portmap(sin, prog, vers, portp, td)
struct sockaddr_in *sin; /* server address */
u_int prog, vers; /* host order */
u_int16_t *portp; /* network order */
- struct proc *procp;
+ struct thread *td;
{
struct sdata {
u_int32_t prog; /* call program */
@@ -163,7 +163,7 @@ krpc_portmap(sin, prog, vers, portp, procp)
sin->sin_port = htons(PMAPPORT);
error = krpc_call(sin, PMAPPROG, PMAPVERS,
- PMAPPROC_GETPORT, &m, NULL, procp);
+ PMAPPROC_GETPORT, &m, NULL, td);
if (error)
return error;
@@ -185,12 +185,12 @@ krpc_portmap(sin, prog, vers, portp, procp)
* the address from whence the response came is saved there.
*/
int
-krpc_call(sa, prog, vers, func, data, from_p, procp)
+krpc_call(sa, prog, vers, func, data, from_p, td)
struct sockaddr_in *sa;
u_int prog, vers, func;
struct mbuf **data; /* input/output */
struct sockaddr **from_p; /* output */
- struct proc *procp;
+ struct thread *td;
{
struct socket *so;
struct sockaddr_in *sin, ssin;
@@ -220,7 +220,7 @@ krpc_call(sa, prog, vers, func, data, from_p, procp)
/*
* Create socket and set its recieve timeout.
*/
- if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0, procp)))
+ if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0, td)))
goto out;
tv.tv_sec = 1;
@@ -260,7 +260,7 @@ krpc_call(sa, prog, vers, func, data, from_p, procp)
do {
tport--;
sin->sin_port = htons(tport);
- error = sobind(so, (struct sockaddr *)sin, procp);
+ error = sobind(so, (struct sockaddr *)sin, td);
} while (error == EADDRINUSE &&
tport > IPPORT_RESERVED / 2);
if (error) {
@@ -321,7 +321,7 @@ krpc_call(sa, prog, vers, func, data, from_p, procp)
goto out;
}
error = sosend(so, (struct sockaddr *)sa, NULL, m,
- NULL, 0, procp);
+ NULL, 0, td);
if (error) {
printf("krpc_call: sosend: %d\n", error);
goto out;
diff --git a/sys/nfsclient/nfs.h b/sys/nfsclient/nfs.h
index 44d04b9..d5d0796 100644
--- a/sys/nfsclient/nfs.h
+++ b/sys/nfsclient/nfs.h
@@ -348,7 +348,7 @@ struct nfsreq {
int r_timer; /* tick counter on reply */
u_int32_t r_procnum; /* NFS procedure number */
int r_rtt; /* RTT for rpc */
- struct proc *r_procp; /* Proc that did I/O system call */
+ struct thread *r_td; /* Proc that did I/O system call */
};
/*
@@ -469,7 +469,7 @@ struct nfsd {
u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
int nfsd_verflen; /* and the Verifier */
u_char nfsd_verfstr[RPCVERF_MAXSIZ];
- struct proc *nfsd_procp; /* Proc ptr */
+ struct thread *nfsd_td; /* daemon thread ptr */
struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */
};
@@ -592,16 +592,16 @@ void nfs_sndunlock __P((struct nfsreq *));
int nfs_slplock __P((struct nfssvc_sock *, int));
void nfs_slpunlock __P((struct nfssvc_sock *));
int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
-int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
+int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct thread *,
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_commit __P((struct vnode *vp, u_quad_t offset, int cnt,
- struct ucred *cred, struct proc *procp));
+ struct ucred *cred, struct thread *));
int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
-int nfs_asyncio __P((struct buf *, struct ucred *, struct proc *));
-int nfs_doio __P((struct buf *, struct ucred *, struct proc *));
+int nfs_asyncio __P((struct buf *, struct ucred *, struct thread *));
+int nfs_doio __P((struct buf *, struct ucred *, struct thread *));
int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *));
int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *));
int nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *));
@@ -613,14 +613,14 @@ void nfsm_srvwcc __P((struct nfsrv_descript *, int, struct vattr *, int,
void nfsm_srvpostopattr __P((struct nfsrv_descript *, int, struct vattr *,
struct mbuf **, char **));
int netaddr_match __P((int, union nethostaddr *, struct sockaddr *));
-int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *,
+int nfs_request __P((struct vnode *, struct mbuf *, int, struct thread *,
struct ucred *, struct mbuf **, struct mbuf **,
caddr_t *));
int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
struct vattr *, int));
int nfs_namei __P((struct nameidata *, fhandle_t *, int,
struct nfssvc_sock *, struct sockaddr *, struct mbuf **,
- caddr_t *, struct vnode **, struct proc *, int, int));
+ caddr_t *, struct vnode **, struct thread *, int, int));
void nfsm_adj __P((struct mbuf *, int, int));
int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *));
void nfsrv_initcache __P((void));
@@ -652,21 +652,21 @@ void nfs_clearcommit __P((struct mount *));
int nfsrv_errmap __P((struct nfsrv_descript *, int));
void nfsrvw_sort __P((gid_t *, int));
void nfsrv_setcred __P((struct ucred *, struct ucred *));
-int nfs_writebp __P((struct buf *, int, struct proc *));
+int nfs_writebp __P((struct buf *, int, struct thread *));
int nfsrv_object_create __P((struct vnode *));
void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
- struct proc *, struct mbuf **));
+ struct thread *, struct mbuf **));
int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
- struct proc *p));
+ struct thread *p));
int nfsrv3_access __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *,
struct nfssvc_sock *, struct sockaddr *, int *,
int, int));
@@ -674,52 +674,52 @@ int nfsrv_setpublicfs __P((struct mount *, struct netexport *,
struct export_args *));
int nfs_ispublicfh __P((fhandle_t *));
int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_pathconf __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
+ struct nfssvc_sock *slp, struct thread *td,
struct mbuf **mrq));
int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_readdir __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
+ struct nfssvc_sock *slp, struct thread *td,
struct mbuf **mrq));
int nfsrv_readlink __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
+ struct nfssvc_sock *slp, struct thread *td,
struct mbuf **mrq));
int nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_setattr __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_statfs __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_symlink __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
void nfsrv_rcv __P((struct socket *so, void *arg, int waitflag));
void nfsrv_slpderef __P((struct nfssvc_sock *slp));
#endif /* _KERNEL */
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index 3bcdb32..e48cd5c 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -72,7 +72,7 @@
static int
nfs_bwrite(struct buf *bp)
{
- return (nfs_writebp(bp, 1, curproc));
+ return (nfs_writebp(bp, 1, curthread));
}
struct buf_ops buf_ops_nfs = {
@@ -82,7 +82,7 @@ struct buf_ops buf_ops_nfs = {
static struct buf *nfs_getcacheblk __P((struct vnode *vp, daddr_t bn, int size,
- struct proc *p));
+ struct thread *td));
extern int nfs_numasync;
extern int nfs_pbuf_freecnt;
@@ -107,7 +107,7 @@ nfs_getpages(ap)
vm_offset_t kva;
struct buf *bp;
struct vnode *vp;
- struct proc *p;
+ struct thread *td;
struct ucred *cred;
struct nfsmount *nmp;
vm_page_t *pages;
@@ -115,8 +115,8 @@ nfs_getpages(ap)
GIANT_REQUIRED;
vp = ap->a_vp;
- p = curproc; /* XXX */
- cred = curproc->p_ucred; /* XXX */
+ td = curthread; /* XXX */
+ cred = curthread->td_proc->p_ucred; /* XXX */
nmp = VFSTONFS(vp->v_mount);
pages = ap->a_m;
count = ap->a_count;
@@ -128,7 +128,7 @@ nfs_getpages(ap)
if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 &&
(nmp->nm_state & NFSSTA_GOTFSINFO) == 0) {
- (void)nfs_fsinfo(nmp, vp, cred, p);
+ (void)nfs_fsinfo(nmp, vp, cred, td);
}
npages = btoc(count);
@@ -172,7 +172,7 @@ nfs_getpages(ap)
uio.uio_resid = count;
uio.uio_segflg = UIO_SYSSPACE;
uio.uio_rw = UIO_READ;
- uio.uio_procp = p;
+ uio.uio_td = td;
error = nfs_readrpc(vp, &uio, cred);
pmap_qremove(kva, npages);
@@ -268,7 +268,7 @@ nfs_putpages(ap)
off_t offset;
int *rtvals;
struct vnode *vp;
- struct proc *p;
+ struct thread *td;
struct ucred *cred;
struct nfsmount *nmp;
struct nfsnode *np;
@@ -278,8 +278,8 @@ nfs_putpages(ap)
vp = ap->a_vp;
np = VTONFS(vp);
- p = curproc; /* XXX */
- cred = curproc->p_ucred; /* XXX */
+ td = curthread; /* XXX */
+ cred = curthread->td_proc->p_ucred; /* XXX */
nmp = VFSTONFS(vp->v_mount);
pages = ap->a_m;
count = ap->a_count;
@@ -291,7 +291,7 @@ nfs_putpages(ap)
if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 &&
(nmp->nm_state & NFSSTA_GOTFSINFO) == 0) {
- (void)nfs_fsinfo(nmp, vp, cred, p);
+ (void)nfs_fsinfo(nmp, vp, cred, td);
}
for (i = 0; i < npages; i++) {
@@ -327,7 +327,7 @@ nfs_putpages(ap)
uio.uio_resid = count;
uio.uio_segflg = UIO_SYSSPACE;
uio.uio_rw = UIO_WRITE;
- uio.uio_procp = p;
+ uio.uio_td = td;
if ((ap->a_sync & VM_PAGER_PUT_SYNC) == 0)
iomode = NFSV3WRITE_UNSTABLE;
@@ -366,7 +366,7 @@ nfs_bioread(vp, uio, ioflag, cred)
register int biosize, i;
struct buf *bp = 0, *rabp;
struct vattr vattr;
- struct proc *p;
+ struct thread *td;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
daddr_t lbn, rabn;
int bcount;
@@ -381,11 +381,11 @@ nfs_bioread(vp, uio, ioflag, cred)
return (0);
if (uio->uio_offset < 0) /* XXX VDIR cookies can be negative */
return (EINVAL);
- p = uio->uio_procp;
+ td = uio->uio_td;
if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 &&
(nmp->nm_state & NFSSTA_GOTFSINFO) == 0)
- (void)nfs_fsinfo(nmp, vp, cred, p);
+ (void)nfs_fsinfo(nmp, vp, cred, td);
if (vp->v_type != VDIR &&
(uio->uio_offset + uio->uio_resid) > nmp->nm_maxfilesize)
return (EFBIG);
@@ -414,23 +414,23 @@ nfs_bioread(vp, uio, ioflag, cred)
if (vp->v_type != VDIR)
panic("nfs: bioread, not dir");
nfs_invaldir(vp);
- error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
+ error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1);
if (error)
return (error);
}
np->n_attrstamp = 0;
- error = VOP_GETATTR(vp, &vattr, cred, p);
+ error = VOP_GETATTR(vp, &vattr, cred, td);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.tv_sec;
} else {
- error = VOP_GETATTR(vp, &vattr, cred, p);
+ error = VOP_GETATTR(vp, &vattr, cred, td);
if (error)
return (error);
if (np->n_mtime != vattr.va_mtime.tv_sec) {
if (vp->v_type == VDIR)
nfs_invaldir(vp);
- error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
+ error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.tv_sec;
@@ -445,7 +445,7 @@ nfs_bioread(vp, uio, ioflag, cred)
if (nmp->nm_flag & NFSMNT_NQNFS) {
if (NQNFS_CKINVALID(vp, np, ND_READ)) {
do {
- error = nqnfs_getlease(vp, ND_READ, cred, p);
+ error = nqnfs_getlease(vp, ND_READ, cred, td);
} while (error == NQNFS_EXPIRED);
if (error)
return (error);
@@ -454,14 +454,14 @@ nfs_bioread(vp, uio, ioflag, cred)
((np->n_flag & NMODIFIED) && vp->v_type == VDIR)) {
if (vp->v_type == VDIR)
nfs_invaldir(vp);
- error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
+ error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1);
if (error)
return (error);
np->n_brev = np->n_lrev;
}
} else if (vp->v_type == VDIR && (np->n_flag & NMODIFIED)) {
nfs_invaldir(vp);
- error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
+ error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1);
if (error)
return (error);
}
@@ -493,14 +493,14 @@ nfs_bioread(vp, uio, ioflag, cred)
(off_t)(lbn + 1 + nra) * biosize < np->n_size; nra++) {
rabn = lbn + 1 + nra;
if (!incore(vp, rabn)) {
- rabp = nfs_getcacheblk(vp, rabn, biosize, p);
+ rabp = nfs_getcacheblk(vp, rabn, biosize, td);
if (!rabp)
return (EINTR);
if ((rabp->b_flags & (B_CACHE|B_DELWRI)) == 0) {
rabp->b_flags |= B_ASYNC;
rabp->b_iocmd = BIO_READ;
vfs_busy_pages(rabp, 0);
- if (nfs_asyncio(rabp, cred, p)) {
+ if (nfs_asyncio(rabp, cred, td)) {
rabp->b_flags |= B_INVAL;
rabp->b_ioflags |= BIO_ERROR;
vfs_unbusy_pages(rabp);
@@ -534,7 +534,7 @@ again:
bcount = np->n_size - (off_t)lbn * biosize;
}
if (bcount != biosize) {
- switch(nfs_rslock(np, p)) {
+ switch(nfs_rslock(np, td)) {
case ENOLCK:
goto again;
/* not reached */
@@ -547,10 +547,10 @@ again:
}
}
- bp = nfs_getcacheblk(vp, lbn, bcount, p);
+ bp = nfs_getcacheblk(vp, lbn, bcount, td);
if (bcount != biosize)
- nfs_rsunlock(np, p);
+ nfs_rsunlock(np, td);
if (!bp)
return (EINTR);
@@ -562,7 +562,7 @@ again:
if ((bp->b_flags & B_CACHE) == 0) {
bp->b_iocmd = BIO_READ;
vfs_busy_pages(bp, 0);
- error = nfs_doio(bp, cred, p);
+ error = nfs_doio(bp, cred, td);
if (error) {
brelse(bp);
return (error);
@@ -583,13 +583,13 @@ again:
break;
case VLNK:
nfsstats.biocache_readlinks++;
- bp = nfs_getcacheblk(vp, (daddr_t)0, NFS_MAXPATHLEN, p);
+ bp = nfs_getcacheblk(vp, (daddr_t)0, NFS_MAXPATHLEN, td);
if (!bp)
return (EINTR);
if ((bp->b_flags & B_CACHE) == 0) {
bp->b_iocmd = BIO_READ;
vfs_busy_pages(bp, 0);
- error = nfs_doio(bp, cred, p);
+ error = nfs_doio(bp, cred, td);
if (error) {
bp->b_ioflags |= BIO_ERROR;
brelse(bp);
@@ -607,20 +607,20 @@ again:
}
lbn = (uoff_t)uio->uio_offset / NFS_DIRBLKSIZ;
on = uio->uio_offset & (NFS_DIRBLKSIZ - 1);
- bp = nfs_getcacheblk(vp, lbn, NFS_DIRBLKSIZ, p);
+ bp = nfs_getcacheblk(vp, lbn, NFS_DIRBLKSIZ, td);
if (!bp)
return (EINTR);
if ((bp->b_flags & B_CACHE) == 0) {
bp->b_iocmd = BIO_READ;
vfs_busy_pages(bp, 0);
- error = nfs_doio(bp, cred, p);
+ error = nfs_doio(bp, cred, td);
if (error) {
brelse(bp);
}
while (error == NFSERR_BAD_COOKIE) {
printf("got bad cookie vp %p bp %p\n", vp, bp);
nfs_invaldir(vp);
- error = nfs_vinvalbuf(vp, 0, cred, p, 1);
+ error = nfs_vinvalbuf(vp, 0, cred, td, 1);
/*
* Yuck! The directory has been modified on the
* server. The only way to get the block is by
@@ -635,13 +635,13 @@ again:
if (np->n_direofoffset
&& (i * NFS_DIRBLKSIZ) >= np->n_direofoffset)
return (0);
- bp = nfs_getcacheblk(vp, i, NFS_DIRBLKSIZ, p);
+ bp = nfs_getcacheblk(vp, i, NFS_DIRBLKSIZ, td);
if (!bp)
return (EINTR);
if ((bp->b_flags & B_CACHE) == 0) {
bp->b_iocmd = BIO_READ;
vfs_busy_pages(bp, 0);
- error = nfs_doio(bp, cred, p);
+ error = nfs_doio(bp, cred, td);
/*
* no error + B_INVAL == directory EOF,
* use the block.
@@ -679,13 +679,13 @@ again:
(lbn + 1) * NFS_DIRBLKSIZ < np->n_direofoffset) &&
!(np->n_flag & NQNFSNONCACHE) &&
!incore(vp, lbn + 1)) {
- rabp = nfs_getcacheblk(vp, lbn + 1, NFS_DIRBLKSIZ, p);
+ rabp = nfs_getcacheblk(vp, lbn + 1, NFS_DIRBLKSIZ, td);
if (rabp) {
if ((rabp->b_flags & (B_CACHE|B_DELWRI)) == 0) {
rabp->b_flags |= B_ASYNC;
rabp->b_iocmd = BIO_READ;
vfs_busy_pages(rabp, 0);
- if (nfs_asyncio(rabp, cred, p)) {
+ if (nfs_asyncio(rabp, cred, td)) {
rabp->b_flags |= B_INVAL;
rabp->b_ioflags |= BIO_ERROR;
vfs_unbusy_pages(rabp);
@@ -756,7 +756,7 @@ nfs_write(ap)
{
int biosize;
struct uio *uio = ap->a_uio;
- struct proc *p = uio->uio_procp;
+ struct thread *td = uio->uio_td;
struct vnode *vp = ap->a_vp;
struct nfsnode *np = VTONFS(vp);
struct ucred *cred = ap->a_cred;
@@ -768,13 +768,14 @@ nfs_write(ap)
int bcount;
int n, on, error = 0, iomode, must_commit;
int haverslock = 0;
+ struct proc *p = td?td->td_proc:NULL;
GIANT_REQUIRED;
#ifdef DIAGNOSTIC
if (uio->uio_rw != UIO_WRITE)
panic("nfs_write mode");
- if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc)
+ if (uio->uio_segflg == UIO_USERSPACE && uio->uio_td != curthread)
panic("nfs_write proc");
#endif
if (vp->v_type != VREG)
@@ -785,7 +786,7 @@ nfs_write(ap)
}
if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 &&
(nmp->nm_state & NFSSTA_GOTFSINFO) == 0)
- (void)nfs_fsinfo(nmp, vp, cred, p);
+ (void)nfs_fsinfo(nmp, vp, cred, td);
/*
* Synchronously flush pending buffers if we are in synchronous
@@ -794,7 +795,7 @@ nfs_write(ap)
if (ioflag & (IO_APPEND | IO_SYNC)) {
if (np->n_flag & NMODIFIED) {
np->n_attrstamp = 0;
- error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
+ error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1);
if (error)
return (error);
}
@@ -807,7 +808,7 @@ nfs_write(ap)
restart:
if (ioflag & IO_APPEND) {
np->n_attrstamp = 0;
- error = VOP_GETATTR(vp, &vattr, cred, p);
+ error = VOP_GETATTR(vp, &vattr, cred, td);
if (error)
return (error);
uio->uio_offset = np->n_size;
@@ -836,7 +837,7 @@ restart:
*/
if ((ioflag & IO_APPEND) ||
uio->uio_offset + uio->uio_resid > np->n_size) {
- switch(nfs_rslock(np, p)) {
+ switch(nfs_rslock(np, td)) {
case ENOLCK:
goto restart;
/* not reached */
@@ -860,7 +861,7 @@ restart:
psignal(p, SIGXFSZ);
PROC_UNLOCK(p);
if (haverslock)
- nfs_rsunlock(np, p);
+ nfs_rsunlock(np, td);
return (EFBIG);
}
@@ -873,13 +874,13 @@ restart:
if ((nmp->nm_flag & NFSMNT_NQNFS) &&
NQNFS_CKINVALID(vp, np, ND_WRITE)) {
do {
- error = nqnfs_getlease(vp, ND_WRITE, cred, p);
+ error = nqnfs_getlease(vp, ND_WRITE, cred, td);
} while (error == NQNFS_EXPIRED);
if (error)
break;
if (np->n_lrev != np->n_brev ||
(np->n_flag & NQNFSNONCACHE)) {
- error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
+ error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1);
if (error)
break;
np->n_brev = np->n_lrev;
@@ -910,7 +911,7 @@ again:
* readers from reading garbage.
*/
bcount = on;
- bp = nfs_getcacheblk(vp, lbn, bcount, p);
+ bp = nfs_getcacheblk(vp, lbn, bcount, td);
if (bp != NULL) {
long save;
@@ -939,7 +940,7 @@ again:
bcount = np->n_size - (off_t)lbn * biosize;
}
- bp = nfs_getcacheblk(vp, lbn, bcount, p);
+ bp = nfs_getcacheblk(vp, lbn, bcount, td);
if (uio->uio_offset + n > np->n_size) {
np->n_size = uio->uio_offset + n;
@@ -981,7 +982,7 @@ again:
if ((bp->b_flags & B_CACHE) == 0) {
bp->b_iocmd = BIO_READ;
vfs_busy_pages(bp, 0);
- error = nfs_doio(bp, cred, p);
+ error = nfs_doio(bp, cred, td);
if (error) {
brelse(bp);
break;
@@ -1047,7 +1048,7 @@ again:
if ((nmp->nm_flag & NFSMNT_NQNFS) &&
NQNFS_CKINVALID(vp, np, ND_WRITE)) {
do {
- error = nqnfs_getlease(vp, ND_WRITE, cred, p);
+ error = nqnfs_getlease(vp, ND_WRITE, cred, td);
} while (error == NQNFS_EXPIRED);
if (error) {
brelse(bp);
@@ -1056,7 +1057,7 @@ again:
if (np->n_lrev != np->n_brev ||
(np->n_flag & NQNFSNONCACHE)) {
brelse(bp);
- error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
+ error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1);
if (error)
break;
np->n_brev = np->n_lrev;
@@ -1108,7 +1109,7 @@ again:
if (error)
break;
if (np->n_flag & NQNFSNONCACHE) {
- error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
+ error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1);
if (error)
break;
}
@@ -1122,7 +1123,7 @@ again:
} while (uio->uio_resid > 0 && n > 0);
if (haverslock)
- nfs_rsunlock(np, p);
+ nfs_rsunlock(np, td);
return (error);
}
@@ -1143,11 +1144,11 @@ again:
* its EOF.
*/
static struct buf *
-nfs_getcacheblk(vp, bn, size, p)
+nfs_getcacheblk(vp, bn, size, td)
struct vnode *vp;
daddr_t bn;
int size;
- struct proc *p;
+ struct thread *td;
{
register struct buf *bp;
struct mount *mp;
@@ -1159,7 +1160,7 @@ nfs_getcacheblk(vp, bn, size, p)
if (nmp->nm_flag & NFSMNT_INT) {
bp = getblk(vp, bn, size, PCATCH, 0);
while (bp == (struct buf *)0) {
- if (nfs_sigintr(nmp, (struct nfsreq *)0, p))
+ if (nfs_sigintr(nmp, (struct nfsreq *)0, td->td_proc))
return ((struct buf *)0);
bp = getblk(vp, bn, size, 0, 2 * hz);
}
@@ -1181,11 +1182,11 @@ nfs_getcacheblk(vp, bn, size, p)
* doing the flush, just wait for completion.
*/
int
-nfs_vinvalbuf(vp, flags, cred, p, intrflg)
+nfs_vinvalbuf(vp, flags, cred, td, intrflg)
struct vnode *vp;
int flags;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
int intrflg;
{
register struct nfsnode *np = VTONFS(vp);
@@ -1212,7 +1213,7 @@ nfs_vinvalbuf(vp, flags, cred, p, intrflg)
np->n_flag |= NFLUSHWANT;
error = tsleep((caddr_t)&np->n_flag, PRIBIO + 2, "nfsvinval",
slptimeo);
- if (error && intrflg && nfs_sigintr(nmp, (struct nfsreq *)0, p))
+ if (error && intrflg && nfs_sigintr(nmp, (struct nfsreq *)0, td->td_proc))
return (EINTR);
}
@@ -1220,9 +1221,9 @@ nfs_vinvalbuf(vp, flags, cred, p, intrflg)
* Now, flush as required.
*/
np->n_flag |= NFLUSHINPROG;
- error = vinvalbuf(vp, flags, cred, p, slpflag, 0);
+ error = vinvalbuf(vp, flags, cred, td, slpflag, 0);
while (error) {
- if (intrflg && nfs_sigintr(nmp, (struct nfsreq *)0, p)) {
+ if (intrflg && nfs_sigintr(nmp, (struct nfsreq *)0, td->td_proc)) {
np->n_flag &= ~NFLUSHINPROG;
if (np->n_flag & NFLUSHWANT) {
np->n_flag &= ~NFLUSHWANT;
@@ -1230,7 +1231,7 @@ nfs_vinvalbuf(vp, flags, cred, p, intrflg)
}
return (EINTR);
}
- error = vinvalbuf(vp, flags, cred, p, 0, slptimeo);
+ error = vinvalbuf(vp, flags, cred, td, 0, slptimeo);
}
np->n_flag &= ~(NMODIFIED | NFLUSHINPROG);
if (np->n_flag & NFLUSHWANT) {
@@ -1249,10 +1250,10 @@ nfs_vinvalbuf(vp, flags, cred, p, intrflg)
* is eventually dequeued by the async daemon, nfs_doio() *will*.
*/
int
-nfs_asyncio(bp, cred, procp)
+nfs_asyncio(bp, cred, td)
register struct buf *bp;
struct ucred *cred;
- struct proc *procp;
+ struct thread *td;
{
struct nfsmount *nmp;
int i;
@@ -1334,7 +1335,7 @@ again:
error = tsleep(&nmp->nm_bufq, slpflag | PRIBIO,
"nfsaio", slptimeo);
if (error) {
- if (nfs_sigintr(nmp, NULL, procp))
+ if (nfs_sigintr(nmp, NULL, td->td_proc))
return (EINTR);
if (slpflag == PCATCH) {
slpflag = 0;
@@ -1384,10 +1385,10 @@ again:
* synchronously or from an nfsiod.
*/
int
-nfs_doio(bp, cr, p)
+nfs_doio(bp, cr, td)
struct buf *bp;
struct ucred *cr;
- struct proc *p;
+ struct thread *td;
{
struct uio *uiop;
struct vnode *vp;
@@ -1396,6 +1397,7 @@ nfs_doio(bp, cr, p)
int error = 0, iomode, must_commit = 0;
struct uio uio;
struct iovec io;
+ struct proc *p = td?td->td_proc:NULL;
vp = bp->b_vp;
np = VTONFS(vp);
@@ -1404,7 +1406,7 @@ nfs_doio(bp, cr, p)
uiop->uio_iov = &io;
uiop->uio_iovcnt = 1;
uiop->uio_segflg = UIO_SYSSPACE;
- uiop->uio_procp = p;
+ uiop->uio_td = td;
/*
* clear BIO_ERROR and B_INVAL state prior to initiating the I/O. We
@@ -1525,7 +1527,7 @@ nfs_doio(bp, cr, p)
bp->b_flags |= B_WRITEINPROG;
retv = nfs_commit(
bp->b_vp, off, bp->b_dirtyend-bp->b_dirtyoff,
- bp->b_wcred, p);
+ bp->b_wcred, td);
bp->b_flags &= ~B_WRITEINPROG;
if (retv == 0) {
bp->b_dirtyoff = bp->b_dirtyend = 0;
diff --git a/sys/nfsclient/nfs_lock.c b/sys/nfsclient/nfs_lock.c
index e2fa91c..b97b3b8 100644
--- a/sys/nfsclient/nfs_lock.c
+++ b/sys/nfsclient/nfs_lock.c
@@ -87,14 +87,17 @@ nfs_dolock(ap)
{
LOCKD_MSG msg;
struct nameidata nd;
- struct proc *p;
+ struct thread *td;
uid_t saved_uid;
struct vnode *vp, *wvp;
int error, error1;
struct flock *fl;
int fmode, ioflg;
+ struct proc *p;
+
+ td = curthread;
+ p = td->td_proc;
- p = curproc;
vp = ap->a_vp;
fl = ap->a_fl;
@@ -148,7 +151,7 @@ nfs_dolock(ap)
* complain that the user's file is missing, which isn't the case.
* Note that we use proc0's cred, so the fifo is opened as root.
*/
- NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, _PATH_LCKFIFO, p);
+ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, _PATH_LCKFIFO, td);
/*
* XXX Hack to temporarily allow this process (regardless of it's creds)
@@ -166,15 +169,15 @@ nfs_dolock(ap)
return (error == ENOENT ? EOPNOTSUPP : error);
}
wvp = nd.ni_vp;
- VOP_UNLOCK(wvp, 0, p); /* vn_open leaves it locked */
+ VOP_UNLOCK(wvp, 0, td); /* vn_open leaves it locked */
ioflg = IO_UNIT;
for (;;) {
- VOP_LEASE(wvp, p, proc0.p_ucred, LEASE_WRITE);
+ VOP_LEASE(wvp, td, proc0.p_ucred, LEASE_WRITE);
error = vn_rdwr(UIO_WRITE, wvp, (caddr_t)&msg, sizeof(msg), 0,
- UIO_SYSSPACE, ioflg, proc0.p_ucred, NULL, p);
+ UIO_SYSSPACE, ioflg, proc0.p_ucred, NULL, td);
if (error && (((ioflg & IO_NDELAY) == 0) || error != EAGAIN)) {
break;
@@ -224,7 +227,7 @@ nfs_dolock(ap)
break;
}
- if ((error1 = vn_close(wvp, FWRITE, proc0.p_ucred, p)) && error == 0)
+ if ((error1 = vn_close(wvp, FWRITE, proc0.p_ucred, td)) && error == 0)
return (error1);
return (error);
diff --git a/sys/nfsclient/nfs_nfsiod.c b/sys/nfsclient/nfs_nfsiod.c
index e378cc5..657f299 100644
--- a/sys/nfsclient/nfs_nfsiod.c
+++ b/sys/nfsclient/nfs_nfsiod.c
@@ -78,7 +78,7 @@ static MALLOC_DEFINE(M_NFSSVC, "NFS srvsock", "Nfs server structure");
/* Global defs. */
extern int32_t (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
struct nfssvc_sock *slp,
- struct proc *procp,
+ struct thread *td,
struct mbuf **mreqp));
extern int nfs_numasync;
extern time_t nqnfsstarttime;
@@ -92,7 +92,7 @@ static int nuidhash_max = NFS_MAXUIDHASH;
#ifndef NFS_NOSERVER
static void nfsrv_zapsock __P((struct nfssvc_sock *slp));
#endif
-static int nfssvc_iod __P((struct proc *));
+static int nfssvc_iod __P((struct thread *));
#define TRUE 1
#define FALSE 0
@@ -110,8 +110,9 @@ static int modify_flag = 0;
static void nfsd_rt __P((int sotype, struct nfsrv_descript *nd,
int cacherep));
static int nfssvc_addsock __P((struct file *, struct sockaddr *,
- struct proc *));
-static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *));
+ struct thread *));
+static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,
+ struct thread *));
static int nfs_privport = 0;
SYSCTL_INT(_vfs_nfs, NFS_NFSPRIVPORT, nfs_privport, CTLFLAG_RW, &nfs_privport, 0, "");
@@ -140,8 +141,8 @@ struct nfssvc_args {
* MPSAFE
*/
int
-nfssvc(p, uap)
- struct proc *p;
+nfssvc(td, uap)
+ struct thread *td;
register struct nfssvc_args *uap;
{
#ifndef NFS_NOSERVER
@@ -165,13 +166,13 @@ nfssvc(p, uap)
error = copyin(uap->argp, &la, sizeof(la));
if (error == 0)
- error = nfslockdans(p, &la);
+ error = nfslockdans(td->td_proc, &la);
goto done2;
}
/*
* Must be super user
*/
- error = suser(p);
+ error = suser_td(td);
if (error)
goto done2;
while (nfssvc_sockhead_flag & SLP_INIT) {
@@ -179,7 +180,7 @@ nfssvc(p, uap)
(void) tsleep((caddr_t)&nfssvc_sockhead, PSOCK, "nfsd init", 0);
}
if (uap->flag & NFSSVC_BIOD)
- error = nfssvc_iod(p);
+ error = nfssvc_iod(td);
#ifdef NFS_NOSERVER
else
error = ENXIO;
@@ -189,7 +190,7 @@ nfssvc(p, uap)
if (error)
goto done2;
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
- ncd.ncd_dirp, p);
+ ncd.ncd_dirp, td);
error = namei(&nd);
if (error)
goto done2;
@@ -206,13 +207,13 @@ nfssvc(p, uap)
goto done2;
}
nmp->nm_state |= NFSSTA_MNTD;
- error = nqnfs_clientd(nmp, p->p_ucred, &ncd, uap->flag,
- uap->argp, p);
+ error = nqnfs_clientd(nmp, td->td_proc->p_ucred, &ncd, uap->flag,
+ uap->argp, td);
} else if (uap->flag & NFSSVC_ADDSOCK) {
error = copyin(uap->argp, (caddr_t)&nfsdarg, sizeof(nfsdarg));
if (error)
goto done2;
- error = holdsock(p->p_fd, nfsdarg.sock, &fp);
+ error = holdsock(td->td_proc->p_fd, nfsdarg.sock, &fp);
if (error)
goto done2;
/*
@@ -224,12 +225,12 @@ nfssvc(p, uap)
error = getsockaddr(&nam, nfsdarg.name,
nfsdarg.namelen);
if (error) {
- fdrop(fp, p);
+ fdrop(fp, td);
goto done2;
}
}
- error = nfssvc_addsock(fp, nam, p);
- fdrop(fp, p);
+ error = nfssvc_addsock(fp, nam, td);
+ fdrop(fp, td);
} else {
error = copyin(uap->argp, (caddr_t)nsd, sizeof (*nsd));
if (error)
@@ -327,7 +328,7 @@ nfssvc(p, uap)
}
if ((uap->flag & NFSSVC_AUTHINFAIL) && (nfsd = nsd->nsd_nfsd))
nfsd->nfsd_flag |= NFSD_AUTHFAIL;
- error = nfssvc_nfsd(nsd, uap->argp, p);
+ error = nfssvc_nfsd(nsd, uap->argp, td);
}
#endif /* NFS_NOSERVER */
if (error == EINTR || error == ERESTART)
@@ -342,10 +343,10 @@ done2:
* Adds a socket to the list for servicing by nfsds.
*/
static int
-nfssvc_addsock(fp, mynam, p)
+nfssvc_addsock(fp, mynam, td)
struct file *fp;
struct sockaddr *mynam;
- struct proc *p;
+ struct thread *td;
{
register int siz;
register struct nfssvc_sock *slp;
@@ -439,10 +440,10 @@ nfssvc_addsock(fp, mynam, p)
* until it is killed by a signal.
*/
static int
-nfssvc_nfsd(nsd, argp, p)
+nfssvc_nfsd(nsd, argp, td)
struct nfsd_srvargs *nsd;
caddr_t argp;
- struct proc *p;
+ struct thread *td;
{
register int siz;
register struct nfssvc_sock *slp;
@@ -461,7 +462,7 @@ nfssvc_nfsd(nsd, argp, p)
nsd->nsd_nfsd = nfsd = (struct nfsd *)
malloc(sizeof (struct nfsd), M_NFSD, M_WAITOK | M_ZERO);
s = splnet();
- nfsd->nfsd_procp = p;
+ nfsd->nfsd_td = td;
TAILQ_INSERT_TAIL(&nfsd_head, nfsd, nfsd_chain);
nfs_numnfsd++;
} else
@@ -622,10 +623,10 @@ nfssvc_nfsd(nsd, argp, p)
if (writes_todo || (nd->nd_procnum == NFSPROC_WRITE &&
procrastinate > 0 && !notstarted))
error = nfsrv_writegather(&nd, slp,
- nfsd->nfsd_procp, &mreq);
+ nfsd->nfsd_td, &mreq);
else
error = (*(nfsrv3_procs[nd->nd_procnum]))(nd,
- slp, nfsd->nfsd_procp, &mreq);
+ slp, nfsd->nfsd_td, &mreq);
if (mreq == NULL)
break;
if (error != 0 && error != NFSERR_RETVOID) {
@@ -757,7 +758,7 @@ nfsrv_zapsock(slp)
so->so_upcall = NULL;
so->so_upcallarg = NULL;
soshutdown(so, 2);
- closef(fp, (struct proc *)0);
+ closef(fp, (struct thread *)0);
if (slp->ns_nam)
FREE(slp->ns_nam, M_SONAME);
m_freem(slp->ns_raw);
@@ -935,8 +936,8 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, defect, CTLFLAG_RW, &nfs_defect, 0, "");
* Never returns unless it fails or gets killed.
*/
static int
-nfssvc_iod(p)
- struct proc *p;
+nfssvc_iod(td)
+ struct thread *td;
{
register struct buf *bp;
register int i, myiod;
@@ -965,7 +966,7 @@ nfssvc_iod(p)
&& error == 0) {
if (nmp)
nmp->nm_bufqiods--;
- nfs_iodwant[myiod] = p;
+ nfs_iodwant[myiod] = td->td_proc;
nfs_iodmount[myiod] = NULL;
error = tsleep((caddr_t)&nfs_iodwant[myiod],
PWAIT | PCATCH, "nfsidl", 0);
@@ -988,9 +989,9 @@ nfssvc_iod(p)
wakeup(&nmp->nm_bufq);
}
if (bp->b_iocmd == BIO_READ)
- (void) nfs_doio(bp, bp->b_rcred, (struct proc *)0);
+ (void) nfs_doio(bp, bp->b_rcred, (struct thread *)0);
else
- (void) nfs_doio(bp, bp->b_wcred, (struct proc *)0);
+ (void) nfs_doio(bp, bp->b_wcred, (struct thread *)0);
/*
* If there are more than one iod on this mount, then defect
* so that the iods can be shared out fairly between the mounts
@@ -1029,7 +1030,7 @@ nfs_getauth(nmp, rep, cred, auth_str, auth_len, verf_str, verf_len, key)
nmp->nm_state |= NFSSTA_WANTAUTH;
(void) tsleep((caddr_t)&nmp->nm_authtype, PSOCK,
"nfsauth1", 2 * hz);
- error = nfs_sigintr(nmp, rep, rep->r_procp);
+ error = nfs_sigintr(nmp, rep, rep->r_td->td_proc);
if (error) {
nmp->nm_state &= ~NFSSTA_WANTAUTH;
return (error);
@@ -1049,7 +1050,7 @@ nfs_getauth(nmp, rep, cred, auth_str, auth_len, verf_str, verf_len, key)
while ((nmp->nm_state & NFSSTA_HASAUTH) == 0 && error == 0) {
(void) tsleep((caddr_t)&nmp->nm_authlen, PSOCK,
"nfsauth2", 2 * hz);
- error = nfs_sigintr(nmp, rep, rep->r_procp);
+ error = nfs_sigintr(nmp, rep, rep->r_td->td_proc);
}
if (nmp->nm_state & NFSSTA_AUTHERR) {
nmp->nm_state &= ~NFSSTA_AUTHERR;
diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c
index dc21bc3..5fe3abc 100644
--- a/sys/nfsclient/nfs_node.c
+++ b/sys/nfsclient/nfs_node.c
@@ -169,7 +169,7 @@ nfs_nget(mntp, fhp, fhsize, npp)
int fhsize;
struct nfsnode **npp;
{
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
struct nfsnode *np, *np2;
struct nfsnodehashhead *nhpp;
register struct vnode *vp;
@@ -196,7 +196,7 @@ loop:
bcmp((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize))
continue;
vp = NFSTOV(np);
- if (vget(vp, LK_EXCLUSIVE, p))
+ if (vget(vp, LK_EXCLUSIVE, td))
goto loop;
*npp = np;
return(0);
@@ -266,7 +266,7 @@ loop:
/*
* Lock the new nfsnode.
*/
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
return (0);
}
@@ -275,12 +275,12 @@ int
nfs_inactive(ap)
struct vop_inactive_args /* {
struct vnode *a_vp;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct nfsnode *np;
register struct sillyrename *sp;
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
np = VTONFS(ap->a_vp);
if (prtactive && ap->a_vp->v_usecount != 0)
@@ -299,11 +299,11 @@ nfs_inactive(ap)
* have our own reference.
*/
if (ap->a_vp->v_usecount > 0)
- (void) nfs_vinvalbuf(ap->a_vp, 0, sp->s_cred, p, 1);
- else if (vget(ap->a_vp, 0, p))
+ (void) nfs_vinvalbuf(ap->a_vp, 0, sp->s_cred, td, 1);
+ else if (vget(ap->a_vp, 0, td))
panic("nfs_inactive: lost vnode");
else {
- (void) nfs_vinvalbuf(ap->a_vp, 0, sp->s_cred, p, 1);
+ (void) nfs_vinvalbuf(ap->a_vp, 0, sp->s_cred, td, 1);
vrele(ap->a_vp);
}
/*
@@ -316,7 +316,7 @@ nfs_inactive(ap)
}
np->n_flag &= (NMODIFIED | NFLUSHINPROG | NFLUSHWANT | NQNFSEVICTED |
NQNFSNONCACHE | NQNFSWRITE);
- VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
+ VOP_UNLOCK(ap->a_vp, 0, ap->a_td);
return (0);
}
@@ -459,7 +459,7 @@ int
nfs_islocked(ap)
struct vop_islocked_args /* {
struct vnode *a_vp;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
return VTONFS(ap->a_vp)->n_flag & NLOCKED ? 1 : 0;
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c
index 5772e4b..8991672 100644
--- a/sys/nfsclient/nfs_socket.c
+++ b/sys/nfsclient/nfs_socket.c
@@ -149,7 +149,7 @@ int nfsrtton = 0;
struct nfsrtt nfsrtt;
struct callout_handle nfs_timer_handle;
-static int nfs_msg __P((struct proc *,char *,char *));
+static int nfs_msg __P((struct thread *,char *,char *));
static int nfs_rcvlock __P((struct nfsreq *));
static void nfs_rcvunlock __P((struct nfsreq *));
static void nfs_realign __P((struct mbuf **pm, int hsiz));
@@ -162,7 +162,7 @@ static int nfsrv_getstream __P((struct nfssvc_sock *,int));
int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
struct nfssvc_sock *slp,
- struct proc *procp,
+ struct thread *td,
struct mbuf **mreqp)) = {
nfsrv_null,
nfsrv_getattr,
@@ -207,12 +207,12 @@ nfs_connect(nmp, rep)
int pktscale;
struct sockaddr *saddr;
struct sockaddr_in *sin;
- struct proc *p = &proc0; /* only used for socreate and sobind */
+ struct thread *td = thread0; /* only used for socreate and sobind */
nmp->nm_so = (struct socket *)0;
saddr = nmp->nm_nam;
error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype,
- nmp->nm_soproto, p);
+ nmp->nm_soproto, td);
if (error)
goto bad;
so = nmp->nm_so;
@@ -233,7 +233,7 @@ nfs_connect(nmp, rep)
sopt.sopt_name = IP_PORTRANGE;
sopt.sopt_val = (void *)&ip;
sopt.sopt_valsize = sizeof(ip);
- sopt.sopt_p = NULL;
+ sopt.sopt_td = NULL;
error = sosetopt(so, &sopt);
if (error)
goto bad;
@@ -243,7 +243,7 @@ nfs_connect(nmp, rep)
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = INADDR_ANY;
sin->sin_port = htons(0);
- error = sobind(so, (struct sockaddr *)sin, p);
+ error = sobind(so, (struct sockaddr *)sin, td);
if (error)
goto bad;
bzero(&sopt, sizeof sopt);
@@ -253,7 +253,7 @@ nfs_connect(nmp, rep)
sopt.sopt_name = IP_PORTRANGE;
sopt.sopt_val = (void *)&ip;
sopt.sopt_valsize = sizeof(ip);
- sopt.sopt_p = NULL;
+ sopt.sopt_td = NULL;
error = sosetopt(so, &sopt);
if (error)
goto bad;
@@ -269,7 +269,7 @@ nfs_connect(nmp, rep)
goto bad;
}
} else {
- error = soconnect(so, nmp->nm_nam, p);
+ error = soconnect(so, nmp->nm_nam, td);
if (error)
goto bad;
@@ -284,7 +284,8 @@ nfs_connect(nmp, rep)
"nfscon", 2 * hz);
if ((so->so_state & SS_ISCONNECTING) &&
so->so_error == 0 && rep &&
- (error = nfs_sigintr(nmp, rep, rep->r_procp)) != 0){
+ (error = nfs_sigintr(nmp, rep,
+ (rep->r_td ? rep->r_td->td_proc : NULL))) != 0){
so->so_state &= ~SS_ISCONNECTING;
splx(s);
goto bad;
@@ -489,7 +490,7 @@ nfs_send(so, nam, top, rep)
flags = 0;
error = so->so_proto->pr_usrreqs->pru_sosend(so, sendnam, 0, top, 0,
- flags, curproc /*XXX*/);
+ flags, curthread /*XXX*/);
/*
* ENOBUFS for dgram sockets is transient and non fatal.
* No need to log, and no need to break a soft mount.
@@ -547,7 +548,7 @@ nfs_receive(rep, aname, mp)
u_int32_t len;
struct sockaddr **getnam;
int error, sotype, rcvflg;
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
/*
* Set up arguments for soreceive()
@@ -614,7 +615,7 @@ tryagain:
auio.uio_rw = UIO_READ;
auio.uio_offset = 0;
auio.uio_resid = sizeof(u_int32_t);
- auio.uio_procp = p;
+ auio.uio_td = td;
do {
rcvflg = MSG_WAITALL;
error = so->so_proto->pr_usrreqs->pru_soreceive
@@ -682,7 +683,7 @@ tryagain:
* on.
*/
auio.uio_resid = len = 100000000; /* Anything Big */
- auio.uio_procp = p;
+ auio.uio_td = td;
do {
rcvflg = 0;
error = so->so_proto->pr_usrreqs->pru_soreceive
@@ -727,7 +728,7 @@ errout:
else
getnam = aname;
auio.uio_resid = len = 1000000;
- auio.uio_procp = p;
+ auio.uio_td = td;
do {
rcvflg = 0;
error = so->so_proto->pr_usrreqs->pru_soreceive
@@ -937,11 +938,11 @@ nfsmout:
* nb: always frees up mreq mbuf list
*/
int
-nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
+nfs_request(vp, mrest, procnum, td, cred, mrp, mdp, dposp)
struct vnode *vp;
struct mbuf *mrest;
int procnum;
- struct proc *procp;
+ struct thread *td;
struct ucred *cred;
struct mbuf **mrp;
struct mbuf **mdp;
@@ -969,7 +970,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
MALLOC(rep, struct nfsreq *, sizeof(struct nfsreq), M_NFSREQ, M_WAITOK);
rep->r_nmp = nmp;
rep->r_vp = vp;
- rep->r_procp = procp;
+ rep->r_td = td;
rep->r_procnum = procnum;
i = 0;
m = mrest;
@@ -1100,7 +1101,7 @@ tryagain:
* tprintf a response.
*/
if (!error && (rep->r_flags & R_TPRINTFMSG))
- nfs_msg(rep->r_procp, nmp->nm_mountp->mnt_stat.f_mntfromname,
+ nfs_msg(rep->r_td, nmp->nm_mountp->mnt_stat.f_mntfromname,
"is alive again");
mrep = rep->r_mrep;
md = rep->r_md;
@@ -1394,14 +1395,15 @@ nfs_timer(arg)
register struct nfssvc_sock *slp;
u_quad_t cur_usec;
#endif /* NFS_NOSERVER */
- struct proc *p = &proc0; /* XXX for credentials, will break if sleep */
+ struct thread *td = thread0; /* XXX for credentials, will break if sleep */
s = splnet();
for (rep = nfs_reqq.tqh_first; rep != 0; rep = rep->r_chain.tqe_next) {
nmp = rep->r_nmp;
if (rep->r_mrep || (rep->r_flags & R_SOFTTERM))
continue;
- if (nfs_sigintr(nmp, rep, rep->r_procp)) {
+ if (nfs_sigintr(nmp, rep,
+ (rep->r_td ? rep->r_td->td_proc : NULL))) {
nfs_softterm(rep);
continue;
}
@@ -1423,7 +1425,7 @@ nfs_timer(arg)
*/
if ((rep->r_flags & R_TPRINTFMSG) == 0 &&
rep->r_rexmit > nmp->nm_deadthresh) {
- nfs_msg(rep->r_procp,
+ nfs_msg(rep->r_td,
nmp->nm_mountp->mnt_stat.f_mntfromname,
"not responding");
rep->r_flags |= R_TPRINTFMSG;
@@ -1455,11 +1457,11 @@ nfs_timer(arg)
if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
error = (*so->so_proto->pr_usrreqs->pru_send)
(so, 0, m, (struct sockaddr *)0,
- (struct mbuf *)0, p);
+ (struct mbuf *)0, td);
else
error = (*so->so_proto->pr_usrreqs->pru_send)
(so, 0, m, nmp->nm_nam, (struct mbuf *)0,
- p);
+ td);
if (error) {
if (NFSIGNORE_SOERROR(nmp->nm_soflags, error))
so->so_error = 0;
@@ -1566,17 +1568,17 @@ nfs_sndlock(rep)
struct nfsreq *rep;
{
register int *statep = &rep->r_nmp->nm_state;
- struct proc *p;
+ struct thread *td;
int slpflag = 0, slptimeo = 0;
if (rep) {
- p = rep->r_procp;
+ td = rep->r_td;
if (rep->r_nmp->nm_flag & NFSMNT_INT)
slpflag = PCATCH;
} else
- p = (struct proc *)0;
+ td = (struct thread *)0;
while (*statep & NFSSTA_SNDLOCK) {
- if (nfs_sigintr(rep->r_nmp, rep, p))
+ if (nfs_sigintr(rep->r_nmp, rep, td ? td->td_proc : NULL))
return (EINTR);
*statep |= NFSSTA_WANTSND;
(void) tsleep((caddr_t)statep, slpflag | (PZERO - 1),
@@ -1620,7 +1622,8 @@ nfs_rcvlock(rep)
else
slpflag = 0;
while (*statep & NFSSTA_RCVLOCK) {
- if (nfs_sigintr(rep->r_nmp, rep, rep->r_procp))
+ if (nfs_sigintr(rep->r_nmp, rep,
+ (rep->r_td ? rep->r_td->td_proc : NULL)))
return (EINTR);
*statep |= NFSSTA_WANTRCV;
(void) tsleep((caddr_t)statep, slpflag | (PZERO - 1), "nfsrcvlk",
@@ -1966,12 +1969,12 @@ nfsmout:
#endif
static int
-nfs_msg(p, server, msg)
- struct proc *p;
+nfs_msg(td, server, msg)
+ struct thread *td;
char *server, *msg;
{
- tprintf(p, LOG_INFO, "nfs server %s: %s\n", server, msg);
+ tprintf(td->td_proc, LOG_INFO, "nfs server %s: %s\n", server, msg);
return (0);
}
@@ -2005,7 +2008,7 @@ nfsrv_rcv(so, arg, waitflag)
slp->ns_flag |= SLP_NEEDQ; goto dorecs;
}
#endif
- auio.uio_procp = NULL;
+ auio.uio_td = NULL;
if (so->so_type == SOCK_STREAM) {
/*
* If there are already records on the queue, defer soreceive()
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c
index ad8891c..4425129 100644
--- a/sys/nfsclient/nfs_subs.c
+++ b/sys/nfsclient/nfs_subs.c
@@ -554,11 +554,11 @@ extern struct nfsnodehashhead *nfsnodehashtbl;
extern u_long nfsnodehash;
struct nfssvc_args;
-extern int nfssvc(struct proc *, struct nfssvc_args *, int *);
+extern int nfssvc(struct thread *, struct nfssvc_args *, int *);
LIST_HEAD(nfsnodehashhead, nfsnode);
-int nfs_webnamei __P((struct nameidata *, struct vnode *, struct proc *));
+int nfs_webnamei __P((struct nameidata *, struct vnode *, struct thread *));
u_quad_t
nfs_curusec()
@@ -950,7 +950,7 @@ nfsm_disct(mdp, dposp, siz, left, cp2)
{
register struct mbuf *mp, *mp2;
register int siz2, xfer;
- register caddr_t p;
+ register caddr_t ptr;
mp = *mdp;
while (left == 0) {
@@ -973,10 +973,10 @@ nfsm_disct(mdp, dposp, siz, left, cp2)
mp->m_next = mp2;
mp->m_len -= left;
mp = mp2;
- *cp2 = p = mtod(mp, caddr_t);
- bcopy(*dposp, p, left); /* Copy what was left */
+ *cp2 = ptr = mtod(mp, caddr_t);
+ bcopy(*dposp, ptr, left); /* Copy what was left */
siz2 = siz-left;
- p += left;
+ ptr += left;
mp2 = mp->m_next;
/* Loop around copying up the siz2 bytes */
while (siz2 > 0) {
@@ -984,10 +984,10 @@ nfsm_disct(mdp, dposp, siz, left, cp2)
return (EBADRPC);
xfer = (siz2 > mp2->m_len) ? mp2->m_len : siz2;
if (xfer > 0) {
- bcopy(mtod(mp2, caddr_t), p, xfer);
+ bcopy(mtod(mp2, caddr_t), ptr, xfer);
NFSMADV(mp2, xfer);
mp2->m_len -= xfer;
- p += xfer;
+ ptr += xfer;
siz2 -= xfer;
}
if (siz2 > 0)
@@ -1464,7 +1464,7 @@ nfs_getattrcache(vp, vaper)
* released by the caller.
*/
int
-nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag)
+nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, td, kerbflag, pubflag)
register struct nameidata *ndp;
fhandle_t *fhp;
int len;
@@ -1473,7 +1473,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag)
struct mbuf **mdp;
caddr_t *dposp;
struct vnode **retdirp;
- struct proc *p;
+ struct thread *td;
int kerbflag, pubflag;
{
register int i, rem;
@@ -1613,7 +1613,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag)
* becuase lookup() will dereference ni_startdir.
*/
- cnp->cn_proc = p;
+ cnp->cn_thread = td;
VREF(dp);
ndp->ni_startdir = dp;
@@ -1649,7 +1649,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag)
* Validate symlink
*/
if ((cnp->cn_flags & LOCKPARENT) && ndp->ni_pathlen == 1)
- VOP_UNLOCK(ndp->ni_dvp, 0, p);
+ VOP_UNLOCK(ndp->ni_dvp, 0, td);
if (!pubflag) {
error = EINVAL;
goto badlink2;
@@ -1670,7 +1670,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag)
auio.uio_offset = 0;
auio.uio_rw = UIO_READ;
auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_procp = (struct proc *)0;
+ auio.uio_td = (struct thread *)0;
auio.uio_resid = MAXPATHLEN;
error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred);
if (error) {
@@ -1924,7 +1924,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag, pubflag)
int kerbflag;
int pubflag;
{
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
register struct mount *mp;
register int i;
struct ucred *credanon;
@@ -1988,7 +1988,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag, pubflag)
nfsrv_object_create(*vpp);
if (!lockflag)
- VOP_UNLOCK(*vpp, 0, p);
+ VOP_UNLOCK(*vpp, 0, td);
return (0);
}
@@ -2196,8 +2196,8 @@ nfsrv_object_create(vp)
if (vp == NULL || vp->v_type != VREG)
return (1);
- return (vfs_object_create(vp, curproc,
- curproc ? curproc->p_ucred : NULL));
+ return (vfs_object_create(vp, curthread,
+ curthread ? curthread->td_proc->p_ucred : NULL));
}
/*
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index bc6f3c0..c70600f 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -101,14 +101,14 @@ static void nfs_decode_args __P((struct nfsmount *nmp,
static int mountnfs __P((struct nfs_args *,struct mount *,
struct sockaddr *,char *,char *,struct vnode **));
static int nfs_mount __P(( struct mount *mp, char *path, caddr_t data,
- struct nameidata *ndp, struct proc *p));
+ struct nameidata *ndp, struct thread *p));
static int nfs_unmount __P(( struct mount *mp, int mntflags,
- struct proc *p));
+ struct thread *p));
static int nfs_root __P(( struct mount *mp, struct vnode **vpp));
static int nfs_statfs __P(( struct mount *mp, struct statfs *sbp,
- struct proc *p));
+ struct thread *p));
static int nfs_sync __P(( struct mount *mp, int waitfor,
- struct ucred *cred, struct proc *p));
+ struct ucred *cred, struct thread *p));
/*
* nfs vfs operations.
@@ -161,7 +161,7 @@ SYSCTL_OPAQUE(_vfs_nfs, OID_AUTO, diskless_swapaddr, CTLFLAG_RD,
void nfsargs_ntoh __P((struct nfs_args *));
static int nfs_mountdiskless __P((char *, char *, int,
struct sockaddr_in *, struct nfs_args *,
- struct proc *, struct vnode **,
+ struct thread *, struct vnode **,
struct mount **));
static void nfs_convert_diskless __P((void));
static void nfs_convert_oargs __P((struct nfs_args *args,
@@ -241,10 +241,10 @@ nfs_convert_diskless()
* nfs statfs call
*/
int
-nfs_statfs(mp, sbp, p)
+nfs_statfs(mp, sbp, td)
struct mount *mp;
register struct statfs *sbp;
- struct proc *p;
+ struct thread *td;
{
register struct vnode *vp;
register struct nfs_statfs *sfp;
@@ -266,11 +266,11 @@ nfs_statfs(mp, sbp, p)
return (error);
vp = NFSTOV(np);
if (v3 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0)
- (void)nfs_fsinfo(nmp, vp, p->p_ucred, p);
+ (void)nfs_fsinfo(nmp, vp, td->td_proc->p_ucred, td);
nfsstats.rpccnt[NFSPROC_FSSTAT]++;
nfsm_reqhead(vp, NFSPROC_FSSTAT, NFSX_FH(v3));
nfsm_fhtom(vp, v3);
- nfsm_request(vp, NFSPROC_FSSTAT, p, p->p_ucred);
+ nfsm_request(vp, NFSPROC_FSSTAT, td, td->td_proc->p_ucred);
if (v3)
nfsm_postop_attr(vp, retattr);
if (error) {
@@ -315,11 +315,11 @@ nfs_statfs(mp, sbp, p)
* nfs version 3 fsinfo rpc call
*/
int
-nfs_fsinfo(nmp, vp, cred, p)
+nfs_fsinfo(nmp, vp, cred, td)
register struct nfsmount *nmp;
register struct vnode *vp;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
{
register struct nfsv3_fsinfo *fsp;
register caddr_t cp;
@@ -333,7 +333,7 @@ nfs_fsinfo(nmp, vp, cred, p)
nfsstats.rpccnt[NFSPROC_FSINFO]++;
nfsm_reqhead(vp, NFSPROC_FSINFO, NFSX_FH(1));
nfsm_fhtom(vp, 1);
- nfsm_request(vp, NFSPROC_FSINFO, p, cred);
+ nfsm_request(vp, NFSPROC_FSINFO, td, cred);
nfsm_postop_attr(vp, retattr);
if (!error) {
nfsm_dissect(fsp, struct nfsv3_fsinfo *, NFSX_V3FSINFO);
@@ -394,7 +394,7 @@ nfs_mountroot(mp)
struct nfsv3_diskless *nd = &nfsv3_diskless;
struct socket *so;
struct vnode *vp;
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
int error, i;
u_long l;
char buf[128];
@@ -433,7 +433,7 @@ nfs_mountroot(mp)
* Do enough of ifconfig(8) so that the critical net interface can
* talk to the server.
*/
- error = socreate(nd->myif.ifra_addr.sa_family, &so, SOCK_DGRAM, 0, p);
+ error = socreate(nd->myif.ifra_addr.sa_family, &so, SOCK_DGRAM, 0, td);
if (error)
panic("nfs_mountroot: socreate(%04x): %d",
nd->myif.ifra_addr.sa_family, error);
@@ -449,12 +449,12 @@ nfs_mountroot(mp)
nd->myif.ifra_name[i] >= '0' &&
nd->myif.ifra_name[i] <= '9';
nd->myif.ifra_name[i] ++) {
- error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, p);
+ error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td);
if(!error)
break;
}
#endif
- error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, p);
+ error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td);
if (error)
panic("nfs_mountroot: SIOCAIFADDR: %d", error);
soclose(so);
@@ -488,7 +488,7 @@ nfs_mountroot(mp)
(l >> 8) & 0xff, (l >> 0) & 0xff,nd->root_hostnam);
printf("NFS ROOT: %s\n",buf);
if ((error = nfs_mountdiskless(buf, "/", MNT_RDONLY,
- &nd->root_saddr, &nd->root_args, p, &vp, &mp)) != 0) {
+ &nd->root_saddr, &nd->root_args, td, &vp, &mp)) != 0) {
if (swap_mp) {
mp->mnt_vfc->vfc_refcount--;
free(swap_mp, M_MOUNT);
@@ -514,9 +514,9 @@ nfs_mountroot(mp)
(l >> 8) & 0xff, (l >> 0) & 0xff,nd->swap_hostnam);
printf("NFS SWAP: %s\n",buf);
if ((error = nfs_mountdiskless(buf, "/swap", 0,
- &nd->swap_saddr, &nd->swap_args, p, &vp, &swap_mp)) != 0)
+ &nd->swap_saddr, &nd->swap_args, td, &vp, &swap_mp)) != 0)
return (error);
- vfs_unbusy(swap_mp, p);
+ vfs_unbusy(swap_mp, td);
VTONFS(vp)->n_size = VTONFS(vp)->n_vattr.va_size =
nd->swap_nblks * DEV_BSIZE ;
@@ -528,13 +528,13 @@ nfs_mountroot(mp)
vp->v_type = VREG;
vp->v_flag = 0;
VREF(vp);
- swaponvp(p, vp, NODEV, nd->swap_nblks);
+ swaponvp(td, vp, NODEV, nd->swap_nblks);
}
mp->mnt_flag |= MNT_ROOTFS;
mp->mnt_vnodecovered = NULLVP;
rootvp = vp;
- vfs_unbusy(mp, p);
+ vfs_unbusy(mp, td);
/*
* This is not really an nfs issue, but it is much easier to
@@ -554,13 +554,13 @@ nfs_mountroot(mp)
* Internal version of mount system call for diskless setup.
*/
static int
-nfs_mountdiskless(path, which, mountflag, sin, args, p, vpp, mpp)
+nfs_mountdiskless(path, which, mountflag, sin, args, td, vpp, mpp)
char *path;
char *which;
int mountflag;
struct sockaddr_in *sin;
struct nfs_args *args;
- struct proc *p;
+ struct thread *td;
struct vnode **vpp;
struct mount **mpp;
{
@@ -581,7 +581,7 @@ nfs_mountdiskless(path, which, mountflag, sin, args, p, vpp, mpp)
if ((error = mountnfs(args, mp, nam, which, path, vpp)) != 0) {
printf("nfs_mountroot: mount %s on %s: %d", path, which, error);
mp->mnt_vfc->vfc_refcount--;
- vfs_unbusy(mp, p);
+ vfs_unbusy(mp, td);
free(mp, M_MOUNT);
FREE(nam, M_SONAME);
return (error);
@@ -750,12 +750,12 @@ nfs_decode_args(nmp, argp)
*/
/* ARGSUSED */
static int
-nfs_mount(mp, path, data, ndp, p)
+nfs_mount(mp, path, data, ndp, td)
struct mount *mp;
char *path;
caddr_t data;
struct nameidata *ndp;
- struct proc *p;
+ struct thread *td;
{
int error;
struct nfs_args args;
@@ -930,12 +930,12 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
* Get file attributes for the mountpoint. This has the side
* effect of filling in (*vpp)->v_type with the correct value.
*/
- VOP_GETATTR(*vpp, &attrs, curproc->p_ucred, curproc);
+ VOP_GETATTR(*vpp, &attrs, curthread->td_proc->p_ucred, curthread);
/*
* Lose the lock but keep the ref.
*/
- VOP_UNLOCK(*vpp, 0, curproc);
+ VOP_UNLOCK(*vpp, 0, curthread);
return (0);
bad:
@@ -949,10 +949,10 @@ bad:
* unmount system call
*/
static int
-nfs_unmount(mp, mntflags, p)
+nfs_unmount(mp, mntflags, td)
struct mount *mp;
int mntflags;
- struct proc *p;
+ struct thread *td;
{
register struct nfsmount *nmp;
int error, flags = 0;
@@ -1027,11 +1027,11 @@ extern int syncprt;
*/
/* ARGSUSED */
static int
-nfs_sync(mp, waitfor, cred, p)
+nfs_sync(mp, waitfor, cred, td)
struct mount *mp;
int waitfor;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
{
struct vnode *vp, *vnp;
int error, allerror = 0;
@@ -1059,11 +1059,11 @@ loop:
mtx_lock(&mntvnode_mtx);
continue;
}
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) {
+ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) {
mtx_lock(&mntvnode_mtx);
goto loop;
}
- error = VOP_FSYNC(vp, cred, waitfor, p);
+ error = VOP_FSYNC(vp, cred, waitfor, td);
if (error)
allerror = error;
vput(vp);
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index 5b84741..8f9ff7d 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -102,8 +102,8 @@ 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 *));
#define nfs_poll vop_nopoll
-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_flush __P((struct vnode *,struct ucred *,int,struct thread *,int));
+static int nfs_setattrrpc __P((struct vnode *,struct vattr *,struct ucred *,struct thread *));
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 *));
@@ -123,7 +123,7 @@ static int nfs_symlink __P((struct vop_symlink_args *));
static int nfs_readdir __P((struct vop_readdir_args *));
static int nfs_strategy __P((struct vop_strategy_args *));
static int nfs_lookitup __P((struct vnode *, const char *, int,
- struct ucred *, struct proc *, struct nfsnode **));
+ struct ucred *, struct thread *, 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 *));
@@ -224,11 +224,11 @@ static int nfs_mknodrpc __P((struct vnode *dvp, struct vnode **vpp,
struct vattr *vap));
static int nfs_removerpc __P((struct vnode *dvp, const char *name,
int namelen,
- struct ucred *cred, struct proc *proc));
+ struct ucred *cred, struct thread *td));
static int nfs_renamerpc __P((struct vnode *fdvp, const char *fnameptr,
int fnamelen, struct vnode *tdvp,
const char *tnameptr, int tnamelen,
- struct ucred *cred, struct proc *proc));
+ struct ucred *cred, struct thread *td));
static int nfs_renameit __P((struct vnode *sdvp,
struct componentname *scnp,
struct sillyrename *sp));
@@ -268,7 +268,7 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_misses, CTLFLAG_RD,
static int
nfs3_access_otw(struct vnode *vp,
int wmode,
- struct proc *p,
+ struct thread *td,
struct ucred *cred)
{
const int v3 = 1;
@@ -287,7 +287,7 @@ nfs3_access_otw(struct vnode *vp,
nfsm_fhtom(vp, v3);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(wmode);
- nfsm_request(vp, NFSPROC_ACCESS, p, cred);
+ nfsm_request(vp, NFSPROC_ACCESS, td, cred);
nfsm_postop_attr(vp, attrflag);
if (!error) {
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
@@ -312,7 +312,7 @@ nfs_access(ap)
struct vnode *a_vp;
int a_mode;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
@@ -383,7 +383,7 @@ nfs_access(ap)
* Either a no, or a don't know. Go to the wire.
*/
nfsstats.accesscache_misses++;
- error = nfs3_access_otw(vp, wmode, ap->a_p,ap->a_cred);
+ error = nfs3_access_otw(vp, wmode, ap->a_td,ap->a_cred);
if (!error) {
if ((np->n_mode & mode) != mode) {
error = EACCES;
@@ -416,7 +416,7 @@ nfs_access(ap)
auio.uio_resid = 1;
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_rw = UIO_READ;
- auio.uio_procp = ap->a_p;
+ auio.uio_td = ap->a_td;
if (vp->v_type == VREG)
error = nfs_readrpc(vp, &auio, ap->a_cred);
@@ -450,7 +450,7 @@ nfs_open(ap)
struct vnode *a_vp;
int a_mode;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
@@ -472,14 +472,14 @@ nfs_open(ap)
if (NQNFS_CKINVALID(vp, np, ND_READ)) {
do {
error = nqnfs_getlease(vp, ND_READ, ap->a_cred,
- ap->a_p);
+ ap->a_td);
} while (error == NQNFS_EXPIRED);
if (error)
return (error);
if (np->n_lrev != np->n_brev ||
(np->n_flag & NQNFSNONCACHE)) {
if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
- ap->a_p, 1)) == EINTR)
+ ap->a_td, 1)) == EINTR)
return (error);
np->n_brev = np->n_lrev;
}
@@ -487,24 +487,24 @@ nfs_open(ap)
} else {
if (np->n_flag & NMODIFIED) {
if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
- ap->a_p, 1)) == EINTR)
+ ap->a_td, 1)) == EINTR)
return (error);
np->n_attrstamp = 0;
if (vp->v_type == VDIR)
np->n_direofoffset = 0;
- error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);
+ error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.tv_sec;
} else {
- error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);
+ error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td);
if (error)
return (error);
if (np->n_mtime != vattr.va_mtime.tv_sec) {
if (vp->v_type == VDIR)
np->n_direofoffset = 0;
if ((error = nfs_vinvalbuf(vp, V_SAVE,
- ap->a_cred, ap->a_p, 1)) == EINTR)
+ ap->a_cred, ap->a_td, 1)) == EINTR)
return (error);
np->n_mtime = vattr.va_mtime.tv_sec;
}
@@ -553,7 +553,7 @@ nfs_close(ap)
struct vnode *a_vp;
int a_fflag;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
@@ -578,10 +578,10 @@ nfs_close(ap)
* cannot clear it if we don't commit.
*/
int cm = nfsv3_commit_on_close ? 1 : 0;
- error = nfs_flush(vp, ap->a_cred, MNT_WAIT, ap->a_p, cm);
+ error = nfs_flush(vp, ap->a_cred, MNT_WAIT, ap->a_td, cm);
/* np->n_flag &= ~NMODIFIED; */
} else {
- error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 1);
+ error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_td, 1);
}
np->n_attrstamp = 0;
}
@@ -602,7 +602,7 @@ nfs_getattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
@@ -628,7 +628,7 @@ nfs_getattr(ap)
if (v3 && nfsaccess_cache_timeout > 0) {
nfsstats.accesscache_misses++;
- nfs3_access_otw(vp, NFSV3ACCESS_ALL, ap->a_p, ap->a_cred);
+ nfs3_access_otw(vp, NFSV3ACCESS_ALL, ap->a_td, ap->a_cred);
if (nfs_getattrcache(vp, ap->a_vap) == 0)
return (0);
}
@@ -636,7 +636,7 @@ nfs_getattr(ap)
nfsstats.rpccnt[NFSPROC_GETATTR]++;
nfsm_reqhead(vp, NFSPROC_GETATTR, NFSX_FH(v3));
nfsm_fhtom(vp, v3);
- nfsm_request(vp, NFSPROC_GETATTR, ap->a_p, ap->a_cred);
+ nfsm_request(vp, NFSPROC_GETATTR, ap->a_td, ap->a_cred);
if (!error) {
nfsm_loadattr(vp, ap->a_vap);
}
@@ -654,7 +654,7 @@ nfs_setattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
@@ -708,10 +708,10 @@ nfs_setattr(ap)
if (np->n_flag & NMODIFIED) {
if (vap->va_size == 0)
error = nfs_vinvalbuf(vp, 0,
- ap->a_cred, ap->a_p, 1);
+ ap->a_cred, ap->a_td, 1);
else
error = nfs_vinvalbuf(vp, V_SAVE,
- ap->a_cred, ap->a_p, 1);
+ ap->a_cred, ap->a_td, 1);
if (error) {
vnode_pager_setsize(vp, np->n_size);
return (error);
@@ -724,9 +724,9 @@ nfs_setattr(ap)
vap->va_atime.tv_sec != VNOVAL) && (np->n_flag & NMODIFIED) &&
vp->v_type == VREG &&
(error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
- ap->a_p, 1)) == EINTR)
+ ap->a_td, 1)) == EINTR)
return (error);
- error = nfs_setattrrpc(vp, vap, ap->a_cred, ap->a_p);
+ error = nfs_setattrrpc(vp, vap, ap->a_cred, ap->a_td);
if (error && vap->va_size != VNOVAL) {
np->n_size = np->n_vattr.va_size = tsize;
vnode_pager_setsize(vp, np->n_size);
@@ -738,11 +738,11 @@ nfs_setattr(ap)
* Do an nfs setattr rpc.
*/
static int
-nfs_setattrrpc(vp, vap, cred, procp)
+nfs_setattrrpc(vp, vap, cred, td)
register struct vnode *vp;
register struct vattr *vap;
struct ucred *cred;
- struct proc *procp;
+ struct thread *td;
{
register struct nfsv2_sattr *sp;
register caddr_t cp;
@@ -778,7 +778,7 @@ nfs_setattrrpc(vp, vap, cred, procp)
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
}
- nfsm_request(vp, NFSPROC_SETATTR, procp, cred);
+ nfsm_request(vp, NFSPROC_SETATTR, td, cred);
if (v3) {
nfsm_wcc_data(vp, wccflag);
} else
@@ -817,7 +817,7 @@ nfs_lookup(ap)
struct nfsnode *np;
int lockparent, wantparent, error = 0, attrflag, fhsize;
int v3 = NFS_ISV3(dvp);
- struct proc *p = cnp->cn_proc;
+ struct thread *td = cnp->cn_thread;
*vpp = NULLVP;
cnp->cn_flags &= ~PDIRUNLOCK;
@@ -834,7 +834,7 @@ nfs_lookup(ap)
struct vattr vattr;
int vpid;
- if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, p)) != 0) {
+ if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) {
*vpp = NULLVP;
return (error);
}
@@ -849,24 +849,24 @@ nfs_lookup(ap)
VREF(newvp);
error = 0;
} else if (flags & ISDOTDOT) {
- VOP_UNLOCK(dvp, 0, p);
+ VOP_UNLOCK(dvp, 0, td);
cnp->cn_flags |= PDIRUNLOCK;
- error = vget(newvp, LK_EXCLUSIVE, p);
+ error = vget(newvp, LK_EXCLUSIVE, td);
if (!error && lockparent && (flags & ISLASTCN)) {
- error = vn_lock(dvp, LK_EXCLUSIVE, p);
+ error = vn_lock(dvp, LK_EXCLUSIVE, td);
if (error == 0)
cnp->cn_flags &= ~PDIRUNLOCK;
}
} else {
- error = vget(newvp, LK_EXCLUSIVE, p);
+ error = vget(newvp, LK_EXCLUSIVE, td);
if (!lockparent || error || !(flags & ISLASTCN)) {
- VOP_UNLOCK(dvp, 0, p);
+ VOP_UNLOCK(dvp, 0, td);
cnp->cn_flags |= PDIRUNLOCK;
}
}
if (!error) {
if (vpid == newvp->v_id) {
- if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, p)
+ if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, td)
&& vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) {
nfsstats.lookupcache_hits++;
if (cnp->cn_nameiop != LOOKUP &&
@@ -878,9 +878,9 @@ nfs_lookup(ap)
}
vput(newvp);
if (lockparent && dvp != newvp && (flags & ISLASTCN))
- VOP_UNLOCK(dvp, 0, p);
+ VOP_UNLOCK(dvp, 0, td);
}
- error = vn_lock(dvp, LK_EXCLUSIVE, p);
+ error = vn_lock(dvp, LK_EXCLUSIVE, td);
*vpp = NULLVP;
if (error) {
cnp->cn_flags |= PDIRUNLOCK;
@@ -897,7 +897,7 @@ nfs_lookup(ap)
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len));
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, len, NFS_MAXNAMLEN);
- nfsm_request(dvp, NFSPROC_LOOKUP, cnp->cn_proc, cnp->cn_cred);
+ nfsm_request(dvp, NFSPROC_LOOKUP, cnp->cn_thread, cnp->cn_cred);
if (error) {
nfsm_postop_attr(dvp, attrflag);
m_freem(mrep);
@@ -928,22 +928,22 @@ nfs_lookup(ap)
m_freem(mrep);
cnp->cn_flags |= SAVENAME;
if (!lockparent) {
- VOP_UNLOCK(dvp, 0, p);
+ VOP_UNLOCK(dvp, 0, td);
cnp->cn_flags |= PDIRUNLOCK;
}
return (0);
}
if (flags & ISDOTDOT) {
- VOP_UNLOCK(dvp, 0, p);
+ VOP_UNLOCK(dvp, 0, td);
error = nfs_nget(dvp->v_mount, fhp, fhsize, &np);
if (error) {
- vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td);
return (error);
}
newvp = NFSTOV(np);
if (lockparent && (flags & ISLASTCN)) {
- error = vn_lock(dvp, LK_EXCLUSIVE, p);
+ error = vn_lock(dvp, LK_EXCLUSIVE, td);
if (error) {
cnp->cn_flags |= PDIRUNLOCK;
vput(newvp);
@@ -962,7 +962,7 @@ nfs_lookup(ap)
}
if (!lockparent || !(flags & ISLASTCN)) {
cnp->cn_flags |= PDIRUNLOCK;
- VOP_UNLOCK(dvp, 0, p);
+ VOP_UNLOCK(dvp, 0, td);
}
newvp = NFSTOV(np);
}
@@ -988,7 +988,7 @@ nfs_lookup(ap)
if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) &&
(flags & ISLASTCN) && error == ENOENT) {
if (!lockparent) {
- VOP_UNLOCK(dvp, 0, p);
+ VOP_UNLOCK(dvp, 0, td);
cnp->cn_flags |= PDIRUNLOCK;
}
if (dvp->v_mount->mnt_flag & MNT_RDONLY)
@@ -1061,7 +1061,7 @@ nfs_readlinkrpc(vp, uiop, cred)
nfsstats.rpccnt[NFSPROC_READLINK]++;
nfsm_reqhead(vp, NFSPROC_READLINK, NFSX_FH(v3));
nfsm_fhtom(vp, v3);
- nfsm_request(vp, NFSPROC_READLINK, uiop->uio_procp, cred);
+ nfsm_request(vp, NFSPROC_READLINK, uiop->uio_td, cred);
if (v3)
nfsm_postop_attr(vp, attrflag);
if (!error) {
@@ -1117,7 +1117,7 @@ nfs_readrpc(vp, uiop, cred)
*tl++ = txdr_unsigned(len);
*tl = 0;
}
- nfsm_request(vp, NFSPROC_READ, uiop->uio_procp, cred);
+ nfsm_request(vp, NFSPROC_READ, uiop->uio_td, cred);
if (v3) {
nfsm_postop_attr(vp, attrflag);
if (error) {
@@ -1195,7 +1195,7 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
*tl = x; /* size of this write */
}
nfsm_uiotom(uiop, len);
- nfsm_request(vp, NFSPROC_WRITE, uiop->uio_procp, cred);
+ nfsm_request(vp, NFSPROC_WRITE, uiop->uio_td, cred);
if (v3) {
wccflag = NFSV3_WCCCHK;
nfsm_wcc_data(vp, wccflag);
@@ -1288,7 +1288,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
else {
return (EOPNOTSUPP);
}
- if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_proc)) != 0) {
+ if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread)) != 0) {
return (error);
}
nfsstats.rpccnt[NFSPROC_MKNOD]++;
@@ -1314,7 +1314,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
}
- nfsm_request(dvp, NFSPROC_MKNOD, cnp->cn_proc, cnp->cn_cred);
+ nfsm_request(dvp, NFSPROC_MKNOD, cnp->cn_thread, cnp->cn_cred);
if (!error) {
nfsm_mtofh(dvp, newvp, v3, gotvp);
if (!gotvp) {
@@ -1323,7 +1323,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
newvp = (struct vnode *)0;
}
error = nfs_lookitup(dvp, cnp->cn_nameptr,
- cnp->cn_namelen, cnp->cn_cred, cnp->cn_proc, &np);
+ cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, &np);
if (!error)
newvp = NFSTOV(np);
}
@@ -1396,7 +1396,7 @@ nfs_create(ap)
if (vap->va_type == VSOCK)
return (nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap));
- if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_proc)) != 0) {
+ if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread)) != 0) {
return (error);
}
if (vap->va_vaflags & VA_EXCLUSIVE)
@@ -1432,7 +1432,7 @@ again:
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
}
- nfsm_request(dvp, NFSPROC_CREATE, cnp->cn_proc, cnp->cn_cred);
+ nfsm_request(dvp, NFSPROC_CREATE, cnp->cn_thread, cnp->cn_cred);
if (!error) {
nfsm_mtofh(dvp, newvp, v3, gotvp);
if (!gotvp) {
@@ -1441,7 +1441,7 @@ again:
newvp = (struct vnode *)0;
}
error = nfs_lookitup(dvp, cnp->cn_nameptr,
- cnp->cn_namelen, cnp->cn_cred, cnp->cn_proc, &np);
+ cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, &np);
if (!error)
newvp = NFSTOV(np);
}
@@ -1469,7 +1469,7 @@ again:
vfs_timestamp(&vap->va_mtime);
if (vap->va_atime.tv_sec == VNOVAL)
vap->va_atime = vap->va_mtime;
- error = nfs_setattrrpc(newvp, vap, cnp->cn_cred, cnp->cn_proc);
+ error = nfs_setattrrpc(newvp, vap, cnp->cn_cred, cnp->cn_thread);
}
if (!error) {
if (cnp->cn_flags & MAKEENTRY)
@@ -1518,7 +1518,7 @@ nfs_remove(ap)
if (vp->v_type == VDIR)
error = EPERM;
else if (vp->v_usecount == 1 || (np->n_sillyrename &&
- VOP_GETATTR(vp, &vattr, cnp->cn_cred, cnp->cn_proc) == 0 &&
+ VOP_GETATTR(vp, &vattr, cnp->cn_cred, cnp->cn_thread) == 0 &&
vattr.va_nlink > 1)) {
/*
* Purge the name cache so that the chance of a lookup for
@@ -1532,11 +1532,11 @@ nfs_remove(ap)
* throw away biocache buffers, mainly to avoid
* unnecessary delayed writes later.
*/
- error = nfs_vinvalbuf(vp, 0, cnp->cn_cred, cnp->cn_proc, 1);
+ error = nfs_vinvalbuf(vp, 0, cnp->cn_cred, cnp->cn_thread, 1);
/* Do the rpc */
if (error != EINTR)
error = nfs_removerpc(dvp, cnp->cn_nameptr,
- cnp->cn_namelen, cnp->cn_cred, cnp->cn_proc);
+ cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread);
/*
* Kludge City: If the first reply to the remove rpc is lost..
* the reply to the retransmitted request will be ENOENT
@@ -1560,19 +1560,19 @@ nfs_removeit(sp)
{
return (nfs_removerpc(sp->s_dvp, sp->s_name, sp->s_namlen, sp->s_cred,
- (struct proc *)0));
+ (struct thread *)0));
}
/*
* Nfs remove rpc, called from nfs_remove() and nfs_removeit().
*/
static int
-nfs_removerpc(dvp, name, namelen, cred, proc)
+nfs_removerpc(dvp, name, namelen, cred, td)
register struct vnode *dvp;
const char *name;
int namelen;
struct ucred *cred;
- struct proc *proc;
+ struct thread *td;
{
register u_int32_t *tl;
register caddr_t cp;
@@ -1587,7 +1587,7 @@ nfs_removerpc(dvp, name, namelen, cred, proc)
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(namelen));
nfsm_fhtom(dvp, v3);
nfsm_strtom(name, namelen, NFS_MAXNAMLEN);
- nfsm_request(dvp, NFSPROC_REMOVE, proc, cred);
+ nfsm_request(dvp, NFSPROC_REMOVE, td, cred);
if (v3)
nfsm_wcc_data(dvp, wccflag);
nfsm_reqdone;
@@ -1640,9 +1640,9 @@ nfs_rename(ap)
* often.
*/
- VOP_FSYNC(fvp, fcnp->cn_cred, MNT_WAIT, fcnp->cn_proc);
+ VOP_FSYNC(fvp, fcnp->cn_cred, MNT_WAIT, fcnp->cn_thread);
if (tvp)
- VOP_FSYNC(tvp, tcnp->cn_cred, MNT_WAIT, tcnp->cn_proc);
+ VOP_FSYNC(tvp, tcnp->cn_cred, MNT_WAIT, tcnp->cn_thread);
/*
* If the tvp exists and is in use, sillyrename it before doing the
@@ -1657,7 +1657,7 @@ nfs_rename(ap)
error = nfs_renamerpc(fdvp, fcnp->cn_nameptr, fcnp->cn_namelen,
tdvp, tcnp->cn_nameptr, tcnp->cn_namelen, tcnp->cn_cred,
- tcnp->cn_proc);
+ tcnp->cn_thread);
if (fvp->v_type == VDIR) {
if (tvp != NULL && tvp->v_type == VDIR)
@@ -1692,14 +1692,14 @@ nfs_renameit(sdvp, scnp, sp)
register struct sillyrename *sp;
{
return (nfs_renamerpc(sdvp, scnp->cn_nameptr, scnp->cn_namelen,
- sdvp, sp->s_name, sp->s_namlen, scnp->cn_cred, scnp->cn_proc));
+ sdvp, sp->s_name, sp->s_namlen, scnp->cn_cred, scnp->cn_thread));
}
/*
* Do an nfs rename rpc. Called from nfs_rename() and nfs_renameit().
*/
static int
-nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, proc)
+nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, td)
register struct vnode *fdvp;
const char *fnameptr;
int fnamelen;
@@ -1707,7 +1707,7 @@ nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, proc)
const char *tnameptr;
int tnamelen;
struct ucred *cred;
- struct proc *proc;
+ struct thread *td;
{
register u_int32_t *tl;
register caddr_t cp;
@@ -1725,7 +1725,7 @@ nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, proc)
nfsm_strtom(fnameptr, fnamelen, NFS_MAXNAMLEN);
nfsm_fhtom(tdvp, v3);
nfsm_strtom(tnameptr, tnamelen, NFS_MAXNAMLEN);
- nfsm_request(fdvp, NFSPROC_RENAME, proc, cred);
+ nfsm_request(fdvp, NFSPROC_RENAME, td, cred);
if (v3) {
nfsm_wcc_data(fdvp, fwccflag);
nfsm_wcc_data(tdvp, twccflag);
@@ -1771,7 +1771,7 @@ nfs_link(ap)
* doesn't get "out of sync" with the server.
* XXX There should be a better way!
*/
- VOP_FSYNC(vp, cnp->cn_cred, MNT_WAIT, cnp->cn_proc);
+ VOP_FSYNC(vp, cnp->cn_cred, MNT_WAIT, cnp->cn_thread);
v3 = NFS_ISV3(vp);
nfsstats.rpccnt[NFSPROC_LINK]++;
@@ -1780,7 +1780,7 @@ nfs_link(ap)
nfsm_fhtom(vp, v3);
nfsm_fhtom(tdvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
- nfsm_request(vp, NFSPROC_LINK, cnp->cn_proc, cnp->cn_cred);
+ nfsm_request(vp, NFSPROC_LINK, cnp->cn_thread, cnp->cn_cred);
if (v3) {
nfsm_postop_attr(vp, attrflag);
nfsm_wcc_data(tdvp, wccflag);
@@ -1852,7 +1852,7 @@ nfs_symlink(ap)
* a file handle that can be converted into newvp without having
* to do an extra lookup rpc.
*/
- nfsm_request(dvp, NFSPROC_SYMLINK, cnp->cn_proc, cnp->cn_cred);
+ nfsm_request(dvp, NFSPROC_SYMLINK, cnp->cn_thread, cnp->cn_cred);
if (v3) {
if (error == 0)
nfsm_mtofh(dvp, newvp, v3, gotvp);
@@ -1882,7 +1882,7 @@ nfs_symlink(ap)
struct nfsnode *np = NULL;
error = nfs_lookitup(dvp, cnp->cn_nameptr, cnp->cn_namelen,
- cnp->cn_cred, cnp->cn_proc, &np);
+ cnp->cn_cred, cnp->cn_thread, &np);
if (!error)
newvp = NFSTOV(np);
}
@@ -1927,7 +1927,7 @@ nfs_mkdir(ap)
struct vattr vattr;
int v3 = NFS_ISV3(dvp);
- if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_proc)) != 0) {
+ if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread)) != 0) {
return (error);
}
len = cnp->cn_namelen;
@@ -1947,7 +1947,7 @@ nfs_mkdir(ap)
txdr_nfsv2time(&vap->va_atime, &sp->sa_atime);
txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
}
- nfsm_request(dvp, NFSPROC_MKDIR, cnp->cn_proc, cnp->cn_cred);
+ nfsm_request(dvp, NFSPROC_MKDIR, cnp->cn_thread, cnp->cn_cred);
if (!error)
nfsm_mtofh(dvp, newvp, v3, gotvp);
if (v3)
@@ -1966,7 +1966,7 @@ nfs_mkdir(ap)
newvp = (struct vnode *)0;
}
error = nfs_lookitup(dvp, cnp->cn_nameptr, len, cnp->cn_cred,
- cnp->cn_proc, &np);
+ cnp->cn_thread, &np);
if (!error) {
newvp = NFSTOV(np);
if (newvp->v_type != VDIR)
@@ -2010,7 +2010,7 @@ nfs_rmdir(ap)
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(cnp->cn_namelen));
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
- nfsm_request(dvp, NFSPROC_RMDIR, cnp->cn_proc, cnp->cn_cred);
+ nfsm_request(dvp, NFSPROC_RMDIR, cnp->cn_thread, cnp->cn_cred);
if (v3)
nfsm_wcc_data(dvp, wccflag);
nfsm_reqdone;
@@ -2056,7 +2056,7 @@ nfs_readdir(ap)
nfsstats.direofcache_hits++;
return (0);
}
- } else if (VOP_GETATTR(vp, &vattr, ap->a_cred, uio->uio_procp) == 0 &&
+ } else if (VOP_GETATTR(vp, &vattr, ap->a_cred, uio->uio_td) == 0 &&
np->n_mtime == vattr.va_mtime.tv_sec) {
nfsstats.direofcache_hits++;
return (0);
@@ -2136,7 +2136,7 @@ nfs_readdirrpc(vp, uiop, cred)
*tl++ = cookie.nfsuquad[0];
}
*tl = txdr_unsigned(nmp->nm_readdirsize);
- nfsm_request(vp, NFSPROC_READDIR, uiop->uio_procp, cred);
+ nfsm_request(vp, NFSPROC_READDIR, uiop->uio_td, cred);
if (v3) {
nfsm_postop_attr(vp, attrflag);
if (!error) {
@@ -2326,7 +2326,7 @@ nfs_readdirplusrpc(vp, uiop, cred)
*tl++ = dnp->n_cookieverf.nfsuquad[1];
*tl++ = txdr_unsigned(nmp->nm_readdirsize);
*tl = txdr_unsigned(nmp->nm_rsize);
- nfsm_request(vp, NFSPROC_READDIRPLUS, uiop->uio_procp, cred);
+ nfsm_request(vp, NFSPROC_READDIRPLUS, uiop->uio_td, cred);
nfsm_postop_attr(vp, attrflag);
if (error) {
m_freem(mrep);
@@ -2525,12 +2525,12 @@ nfs_sillyrename(dvp, vp, cnp)
VREF(dvp);
/* Fudge together a funny name */
- pid = cnp->cn_proc->p_pid;
+ pid = cnp->cn_thread->td_proc->p_pid;
sp->s_namlen = sprintf(sp->s_name, ".nfsA%04x4.4", pid);
/* Try lookitups until we get one that isn't there */
while (nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred,
- cnp->cn_proc, (struct nfsnode **)0) == 0) {
+ cnp->cn_thread, (struct nfsnode **)0) == 0) {
sp->s_name[4]++;
if (sp->s_name[4] > 'z') {
error = EINVAL;
@@ -2541,7 +2541,7 @@ nfs_sillyrename(dvp, vp, cnp)
if (error)
goto bad;
error = nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred,
- cnp->cn_proc, &np);
+ cnp->cn_thread, &np);
np->n_sillyrename = sp;
return (0);
bad:
@@ -2560,12 +2560,12 @@ bad:
* *npp != NULL --> update the file handle in the vnode
*/
static int
-nfs_lookitup(dvp, name, len, cred, procp, npp)
+nfs_lookitup(dvp, name, len, cred, td, npp)
register struct vnode *dvp;
const char *name;
int len;
struct ucred *cred;
- struct proc *procp;
+ struct thread *td;
struct nfsnode **npp;
{
register u_int32_t *tl;
@@ -2584,7 +2584,7 @@ nfs_lookitup(dvp, name, len, cred, procp, npp)
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len));
nfsm_fhtom(dvp, v3);
nfsm_strtom(name, len, NFS_MAXNAMLEN);
- nfsm_request(dvp, NFSPROC_LOOKUP, procp, cred);
+ nfsm_request(dvp, NFSPROC_LOOKUP, td, cred);
if (npp && !error) {
nfsm_getfh(nfhp, fhlen, v3);
if (*npp) {
@@ -2640,12 +2640,12 @@ nfs_lookitup(dvp, name, len, cred, procp, npp)
* Nfs Version 3 commit rpc
*/
int
-nfs_commit(vp, offset, cnt, cred, procp)
+nfs_commit(vp, offset, cnt, cred, td)
struct vnode *vp;
u_quad_t offset;
int cnt;
struct ucred *cred;
- struct proc *procp;
+ struct thread *td;
{
register caddr_t cp;
register u_int32_t *tl;
@@ -2664,7 +2664,7 @@ nfs_commit(vp, offset, cnt, cred, procp)
txdr_hyper(offset, tl);
tl += 2;
*tl = txdr_unsigned(cnt);
- nfsm_request(vp, NFSPROC_COMMIT, procp, cred);
+ nfsm_request(vp, NFSPROC_COMMIT, td, cred);
nfsm_wcc_data(vp, wccflag);
if (!error) {
nfsm_dissect(tl, u_int32_t *, NFSX_V3WRITEVERF);
@@ -2691,7 +2691,7 @@ nfs_strategy(ap)
{
register struct buf *bp = ap->a_bp;
struct ucred *cr;
- struct proc *p;
+ struct thread *td;
int error = 0;
KASSERT(!(bp->b_flags & B_DONE), ("nfs_strategy: buffer %p unexpectedly marked B_DONE", bp));
@@ -2701,9 +2701,9 @@ nfs_strategy(ap)
panic("nfs physio");
if (bp->b_flags & B_ASYNC)
- p = (struct proc *)0;
+ td = (struct thread *)0;
else
- p = curproc; /* XXX */
+ td = curthread; /* XXX */
if (bp->b_iocmd == BIO_READ)
cr = bp->b_rcred;
@@ -2716,8 +2716,8 @@ nfs_strategy(ap)
* otherwise just do it ourselves.
*/
if ((bp->b_flags & B_ASYNC) == 0 ||
- nfs_asyncio(bp, NOCRED, p))
- error = nfs_doio(bp, cr, p);
+ nfs_asyncio(bp, NOCRED, td))
+ error = nfs_doio(bp, cr, td);
return (error);
}
@@ -2732,11 +2732,11 @@ nfs_fsync(ap)
struct vnode * a_vp;
struct ucred * a_cred;
int a_waitfor;
- struct proc * a_p;
+ struct thread * a_td;
} */ *ap;
{
- return (nfs_flush(ap->a_vp, ap->a_cred, ap->a_waitfor, ap->a_p, 1));
+ return (nfs_flush(ap->a_vp, ap->a_cred, ap->a_waitfor, ap->a_td, 1));
}
/*
@@ -2745,11 +2745,11 @@ nfs_fsync(ap)
* associated with the vnode.
*/
static int
-nfs_flush(vp, cred, waitfor, p, commit)
+nfs_flush(vp, cred, waitfor, td, commit)
register struct vnode *vp;
struct ucred *cred;
int waitfor;
- struct proc *p;
+ struct thread *td;
int commit;
{
register struct nfsnode *np = VTONFS(vp);
@@ -2878,7 +2878,7 @@ again:
*/
if (wcred != NOCRED)
retv = nfs_commit(vp, off, (int)(endoff - off),
- wcred, p);
+ wcred, td);
else {
retv = 0;
for (i = 0; i < bvecpos; i++) {
@@ -2889,7 +2889,7 @@ again:
size = (u_quad_t)(bp->b_dirtyend
- bp->b_dirtyoff);
retv = nfs_commit(vp, off, (int)size,
- bp->b_wcred, p);
+ bp->b_wcred, td);
if (retv) break;
}
}
@@ -2949,7 +2949,7 @@ loop:
panic("nfs_fsync: inconsistent lock");
if (error == ENOLCK)
goto loop;
- if (nfs_sigintr(nmp, (struct nfsreq *)0, p)) {
+ if (nfs_sigintr(nmp, (struct nfsreq *)0, td->td_proc)) {
error = EINTR;
goto done;
}
@@ -2985,7 +2985,7 @@ loop:
error = tsleep((caddr_t)&vp->v_numoutput,
slpflag | (PRIBIO + 1), "nfsfsync", slptimeo);
if (error) {
- if (nfs_sigintr(nmp, (struct nfsreq *)0, p)) {
+ if (nfs_sigintr(nmp, (struct nfsreq *)0, td->td_proc)) {
error = EINTR;
goto done;
}
@@ -3053,10 +3053,10 @@ nfs_print(ap)
* We set B_CACHE if this is a VMIO buffer.
*/
int
-nfs_writebp(bp, force, procp)
+nfs_writebp(bp, force, td)
register struct buf *bp;
int force;
- struct proc *procp;
+ struct thread *td;
{
int s;
int oldflags = bp->b_flags;
@@ -3086,7 +3086,7 @@ nfs_writebp(bp, force, procp)
bp->b_iocmd = BIO_WRITE;
bp->b_vp->v_numoutput++;
- curproc->p_stats->p_ru.ru_oublock++;
+ curthread->td_proc->p_stats->p_ru.ru_oublock++;
splx(s);
/*
@@ -3127,7 +3127,7 @@ nfsspec_access(ap)
struct vnode *a_vp;
int a_mode;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vattr *vap;
@@ -3161,7 +3161,7 @@ nfsspec_access(ap)
if (cred->cr_uid == 0)
return (0);
vap = &vattr;
- error = VOP_GETATTR(vp, vap, cred, ap->a_p);
+ error = VOP_GETATTR(vp, vap, cred, ap->a_td);
if (error)
return (error);
/*
@@ -3238,7 +3238,7 @@ nfsspec_close(ap)
struct vnode *a_vp;
int a_fflag;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
@@ -3254,7 +3254,7 @@ nfsspec_close(ap)
vattr.va_atime = np->n_atim;
if (np->n_flag & NUPD)
vattr.va_mtime = np->n_mtim;
- (void)VOP_SETATTR(vp, &vattr, ap->a_cred, ap->a_p);
+ (void)VOP_SETATTR(vp, &vattr, ap->a_cred, ap->a_td);
}
}
return (VOCALL(spec_vnodeop_p, VOFFSET(vop_close), ap));
@@ -3315,7 +3315,7 @@ nfsfifo_close(ap)
struct vnode *a_vp;
int a_fflag;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
@@ -3337,7 +3337,7 @@ nfsfifo_close(ap)
vattr.va_atime = np->n_atim;
if (np->n_flag & NUPD)
vattr.va_mtime = np->n_mtim;
- (void)VOP_SETATTR(vp, &vattr, ap->a_cred, ap->a_p);
+ (void)VOP_SETATTR(vp, &vattr, ap->a_cred, ap->a_td);
}
}
return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_close), ap));
diff --git a/sys/nfsclient/nfsargs.h b/sys/nfsclient/nfsargs.h
index 44d04b9..d5d0796 100644
--- a/sys/nfsclient/nfsargs.h
+++ b/sys/nfsclient/nfsargs.h
@@ -348,7 +348,7 @@ struct nfsreq {
int r_timer; /* tick counter on reply */
u_int32_t r_procnum; /* NFS procedure number */
int r_rtt; /* RTT for rpc */
- struct proc *r_procp; /* Proc that did I/O system call */
+ struct thread *r_td; /* Proc that did I/O system call */
};
/*
@@ -469,7 +469,7 @@ struct nfsd {
u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
int nfsd_verflen; /* and the Verifier */
u_char nfsd_verfstr[RPCVERF_MAXSIZ];
- struct proc *nfsd_procp; /* Proc ptr */
+ struct thread *nfsd_td; /* daemon thread ptr */
struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */
};
@@ -592,16 +592,16 @@ void nfs_sndunlock __P((struct nfsreq *));
int nfs_slplock __P((struct nfssvc_sock *, int));
void nfs_slpunlock __P((struct nfssvc_sock *));
int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
-int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
+int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct thread *,
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_commit __P((struct vnode *vp, u_quad_t offset, int cnt,
- struct ucred *cred, struct proc *procp));
+ struct ucred *cred, struct thread *));
int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
-int nfs_asyncio __P((struct buf *, struct ucred *, struct proc *));
-int nfs_doio __P((struct buf *, struct ucred *, struct proc *));
+int nfs_asyncio __P((struct buf *, struct ucred *, struct thread *));
+int nfs_doio __P((struct buf *, struct ucred *, struct thread *));
int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *));
int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *));
int nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *));
@@ -613,14 +613,14 @@ void nfsm_srvwcc __P((struct nfsrv_descript *, int, struct vattr *, int,
void nfsm_srvpostopattr __P((struct nfsrv_descript *, int, struct vattr *,
struct mbuf **, char **));
int netaddr_match __P((int, union nethostaddr *, struct sockaddr *));
-int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *,
+int nfs_request __P((struct vnode *, struct mbuf *, int, struct thread *,
struct ucred *, struct mbuf **, struct mbuf **,
caddr_t *));
int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
struct vattr *, int));
int nfs_namei __P((struct nameidata *, fhandle_t *, int,
struct nfssvc_sock *, struct sockaddr *, struct mbuf **,
- caddr_t *, struct vnode **, struct proc *, int, int));
+ caddr_t *, struct vnode **, struct thread *, int, int));
void nfsm_adj __P((struct mbuf *, int, int));
int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *));
void nfsrv_initcache __P((void));
@@ -652,21 +652,21 @@ void nfs_clearcommit __P((struct mount *));
int nfsrv_errmap __P((struct nfsrv_descript *, int));
void nfsrvw_sort __P((gid_t *, int));
void nfsrv_setcred __P((struct ucred *, struct ucred *));
-int nfs_writebp __P((struct buf *, int, struct proc *));
+int nfs_writebp __P((struct buf *, int, struct thread *));
int nfsrv_object_create __P((struct vnode *));
void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
- struct proc *, struct mbuf **));
+ struct thread *, struct mbuf **));
int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
- struct proc *p));
+ struct thread *p));
int nfsrv3_access __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *,
struct nfssvc_sock *, struct sockaddr *, int *,
int, int));
@@ -674,52 +674,52 @@ int nfsrv_setpublicfs __P((struct mount *, struct netexport *,
struct export_args *));
int nfs_ispublicfh __P((fhandle_t *));
int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_pathconf __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
+ struct nfssvc_sock *slp, struct thread *td,
struct mbuf **mrq));
int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_readdir __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
+ struct nfssvc_sock *slp, struct thread *td,
struct mbuf **mrq));
int nfsrv_readlink __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
+ struct nfssvc_sock *slp, struct thread *td,
struct mbuf **mrq));
int nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_setattr __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_statfs __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_symlink __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
void nfsrv_rcv __P((struct socket *so, void *arg, int waitflag));
void nfsrv_slpderef __P((struct nfssvc_sock *slp));
#endif /* _KERNEL */
diff --git a/sys/nfsclient/nfsnode.h b/sys/nfsclient/nfsnode.h
index 968f39c..ba99fea 100644
--- a/sys/nfsclient/nfsnode.h
+++ b/sys/nfsclient/nfsnode.h
@@ -171,16 +171,16 @@ extern struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON];
static __inline
int
-nfs_rslock(struct nfsnode *np, struct proc *p)
+nfs_rslock(struct nfsnode *np, struct thread *td)
{
- return(lockmgr(&np->n_rslock, LK_EXCLUSIVE | LK_CANRECURSE | LK_SLEEPFAIL, NULL, p));
+ return(lockmgr(&np->n_rslock, LK_EXCLUSIVE | LK_CANRECURSE | LK_SLEEPFAIL, NULL, td));
}
static __inline
void
-nfs_rsunlock(struct nfsnode *np, struct proc *p)
+nfs_rsunlock(struct nfsnode *np, struct thread *td)
{
- (void)lockmgr(&np->n_rslock, LK_RELEASE, NULL, p);
+ (void)lockmgr(&np->n_rslock, LK_RELEASE, NULL, td);
}
extern vop_t **fifo_nfsv2nodeop_p;
diff --git a/sys/nfsclient/nfsstats.h b/sys/nfsclient/nfsstats.h
index 44d04b9..d5d0796 100644
--- a/sys/nfsclient/nfsstats.h
+++ b/sys/nfsclient/nfsstats.h
@@ -348,7 +348,7 @@ struct nfsreq {
int r_timer; /* tick counter on reply */
u_int32_t r_procnum; /* NFS procedure number */
int r_rtt; /* RTT for rpc */
- struct proc *r_procp; /* Proc that did I/O system call */
+ struct thread *r_td; /* Proc that did I/O system call */
};
/*
@@ -469,7 +469,7 @@ struct nfsd {
u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
int nfsd_verflen; /* and the Verifier */
u_char nfsd_verfstr[RPCVERF_MAXSIZ];
- struct proc *nfsd_procp; /* Proc ptr */
+ struct thread *nfsd_td; /* daemon thread ptr */
struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */
};
@@ -592,16 +592,16 @@ void nfs_sndunlock __P((struct nfsreq *));
int nfs_slplock __P((struct nfssvc_sock *, int));
void nfs_slpunlock __P((struct nfssvc_sock *));
int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
-int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
+int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct thread *,
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_commit __P((struct vnode *vp, u_quad_t offset, int cnt,
- struct ucred *cred, struct proc *procp));
+ struct ucred *cred, struct thread *));
int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
-int nfs_asyncio __P((struct buf *, struct ucred *, struct proc *));
-int nfs_doio __P((struct buf *, struct ucred *, struct proc *));
+int nfs_asyncio __P((struct buf *, struct ucred *, struct thread *));
+int nfs_doio __P((struct buf *, struct ucred *, struct thread *));
int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *));
int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *));
int nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *));
@@ -613,14 +613,14 @@ void nfsm_srvwcc __P((struct nfsrv_descript *, int, struct vattr *, int,
void nfsm_srvpostopattr __P((struct nfsrv_descript *, int, struct vattr *,
struct mbuf **, char **));
int netaddr_match __P((int, union nethostaddr *, struct sockaddr *));
-int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *,
+int nfs_request __P((struct vnode *, struct mbuf *, int, struct thread *,
struct ucred *, struct mbuf **, struct mbuf **,
caddr_t *));
int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
struct vattr *, int));
int nfs_namei __P((struct nameidata *, fhandle_t *, int,
struct nfssvc_sock *, struct sockaddr *, struct mbuf **,
- caddr_t *, struct vnode **, struct proc *, int, int));
+ caddr_t *, struct vnode **, struct thread *, int, int));
void nfsm_adj __P((struct mbuf *, int, int));
int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *));
void nfsrv_initcache __P((void));
@@ -652,21 +652,21 @@ void nfs_clearcommit __P((struct mount *));
int nfsrv_errmap __P((struct nfsrv_descript *, int));
void nfsrvw_sort __P((gid_t *, int));
void nfsrv_setcred __P((struct ucred *, struct ucred *));
-int nfs_writebp __P((struct buf *, int, struct proc *));
+int nfs_writebp __P((struct buf *, int, struct thread *));
int nfsrv_object_create __P((struct vnode *));
void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
- struct proc *, struct mbuf **));
+ struct thread *, struct mbuf **));
int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
- struct proc *p));
+ struct thread *p));
int nfsrv3_access __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *,
struct nfssvc_sock *, struct sockaddr *, int *,
int, int));
@@ -674,52 +674,52 @@ int nfsrv_setpublicfs __P((struct mount *, struct netexport *,
struct export_args *));
int nfs_ispublicfh __P((fhandle_t *));
int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_pathconf __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
+ struct nfssvc_sock *slp, struct thread *td,
struct mbuf **mrq));
int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_readdir __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
+ struct nfssvc_sock *slp, struct thread *td,
struct mbuf **mrq));
int nfsrv_readlink __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
+ struct nfssvc_sock *slp, struct thread *td,
struct mbuf **mrq));
int nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_setattr __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_statfs __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_symlink __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
+ struct thread *td, struct mbuf **mrq));
void nfsrv_rcv __P((struct socket *so, void *arg, int waitflag));
void nfsrv_slpderef __P((struct nfssvc_sock *slp));
#endif /* _KERNEL */
OpenPOWER on IntegriCloud