From 86ed17d675cb503ddb3f71f8b6f7c3af530bb29a Mon Sep 17 00:00:00 2001 From: dillon Date: Sat, 17 Nov 2001 03:07:11 +0000 Subject: Give struct socket structures a ref counting interface similar to vnodes. This will hopefully serve as a base from which we can expand the MP code. We currently do not attempt to obtain any mutex or SX locks, but the door is open to add them when we nail down exactly how that part of it is going to work. --- sys/nfsserver/nfs_syscalls.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/nfsserver') diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c index 17f90f7..73935f8 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -143,9 +143,12 @@ nfssvc(struct thread *td, struct nfssvc_args *uap) error = copyin(uap->argp, (caddr_t)&nfsdarg, sizeof(nfsdarg)); if (error) goto done2; - error = holdsock(td->td_proc->p_fd, nfsdarg.sock, &fp); - if (error) + if ((error = fget(td, nfsdarg.sock, &fp)) != 0) + goto done2; + if (fp->f_type != DTYPE_SOCKET) { + fdrop(fp, td); goto done2; + } /* * Get the client address for connected sockets. */ -- cgit v1.1