diff options
author | dillon <dillon@FreeBSD.org> | 2001-11-24 18:28:22 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-11-24 18:28:22 +0000 |
commit | 7b3d73bcc9fdbfb05a36d5838a697730b1b1a874 (patch) | |
tree | cefec4ce96d1c28a17e4f8c66a2cc43a02f8daeb | |
parent | 560d91adcd8df0fb872d314b33066950934e3fa0 (diff) | |
download | FreeBSD-src-7b3d73bcc9fdbfb05a36d5838a697730b1b1a874.zip FreeBSD-src-7b3d73bcc9fdbfb05a36d5838a697730b1b1a874.tar.gz |
convert holdsock() to fget(). Add XXX reminder for future socket locking.
-rw-r--r-- | sys/fs/portalfs/portal_vfsops.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/fs/portalfs/portal_vfsops.c b/sys/fs/portalfs/portal_vfsops.c index 80356e4..4e73131 100644 --- a/sys/fs/portalfs/portal_vfsops.c +++ b/sys/fs/portalfs/portal_vfsops.c @@ -99,10 +99,13 @@ portal_mount(mp, path, data, ndp, td) if (error) return (error); - error = holdsock(td->td_proc->p_fd, args.pa_socket, &fp); - if (error) + if ((error = fget(td, args.pa_socket, &fp)) != 0) return (error); - so = (struct socket *) fp->f_data; + if (fp->f_type != DTYPE_SOCKET) { + fdrop(fp, td); + return(ENOTSOCK); + } + so = (struct socket *) fp->f_data; /* XXX race against userland */ if (so->so_proto->pr_domain->dom_family != AF_UNIX) { fdrop(fp, td); return (ESOCKTNOSUPPORT); |