Module Name: src Committed By: christos Date: Fri Mar 21 17:21:53 UTC 2014
Modified Files: src/sys/fs/ptyfs: ptyfs.h ptyfs_subr.c ptyfs_vnops.c Log Message: Ilya Zykov: Prepare readdir for multi-mountpoint use To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/fs/ptyfs/ptyfs.h cvs rdiff -u -r1.26 -r1.27 src/sys/fs/ptyfs/ptyfs_subr.c cvs rdiff -u -r1.43 -r1.44 src/sys/fs/ptyfs/ptyfs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/fs/ptyfs/ptyfs.h diff -u src/sys/fs/ptyfs/ptyfs.h:1.10 src/sys/fs/ptyfs/ptyfs.h:1.11 --- src/sys/fs/ptyfs/ptyfs.h:1.10 Wed Oct 24 19:36:15 2012 +++ src/sys/fs/ptyfs/ptyfs.h Fri Mar 21 13:21:53 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ptyfs.h,v 1.10 2012/10/24 23:36:15 christos Exp $ */ +/* $NetBSD: ptyfs.h,v 1.11 2014/03/21 17:21:53 christos Exp $ */ /* * Copyright (c) 1993 @@ -148,6 +148,7 @@ struct ptyfs_args { #define PTYFSTOV(ptyfs) ((ptyfs)->ptyfs_vnode) int ptyfs_freevp(struct vnode *); +struct vnode *ptyfs_used_get(ptyfstype, int, struct mount *, int); int ptyfs_allocvp(struct mount *, struct vnode **, ptyfstype, int, struct lwp *); void ptyfs_hashinit(void); Index: src/sys/fs/ptyfs/ptyfs_subr.c diff -u src/sys/fs/ptyfs/ptyfs_subr.c:1.26 src/sys/fs/ptyfs/ptyfs_subr.c:1.27 --- src/sys/fs/ptyfs/ptyfs_subr.c:1.26 Thu Feb 27 11:51:38 2014 +++ src/sys/fs/ptyfs/ptyfs_subr.c Fri Mar 21 13:21:53 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ptyfs_subr.c,v 1.26 2014/02/27 16:51:38 hannken Exp $ */ +/* $NetBSD: ptyfs_subr.c,v 1.27 2014/03/21 17:21:53 christos Exp $ */ /* * Copyright (c) 1993 @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ptyfs_subr.c,v 1.26 2014/02/27 16:51:38 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ptyfs_subr.c,v 1.27 2014/03/21 17:21:53 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -105,7 +105,6 @@ static void ptyfs_getinfo(struct ptyfsno static void ptyfs_hashins(struct ptyfsnode *); static void ptyfs_hashrem(struct ptyfsnode *); -static struct vnode *ptyfs_used_get(ptyfstype, int, struct mount *, int); static struct ptyfsnode *ptyfs_free_get(ptyfstype, int, struct lwp *); static void ptyfs_rehash(kmutex_t *, struct ptyfs_hashhead **, @@ -186,7 +185,7 @@ out: * allocate a ptyfsnode/vnode pair. the vnode is * referenced, and locked. * - * the pid, ptyfs_type, and mount point uniquely + * the pty, ptyfs_type, and mount point uniquely * identify a ptyfsnode. the mount point is needed * because someone might mount this filesystem * twice. Index: src/sys/fs/ptyfs/ptyfs_vnops.c diff -u src/sys/fs/ptyfs/ptyfs_vnops.c:1.43 src/sys/fs/ptyfs/ptyfs_vnops.c:1.44 --- src/sys/fs/ptyfs/ptyfs_vnops.c:1.43 Fri Feb 7 10:29:21 2014 +++ src/sys/fs/ptyfs/ptyfs_vnops.c Fri Mar 21 13:21:53 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ptyfs_vnops.c,v 1.43 2014/02/07 15:29:21 hannken Exp $ */ +/* $NetBSD: ptyfs_vnops.c,v 1.44 2014/03/21 17:21:53 christos Exp $ */ /* * Copyright (c) 1993, 1995 @@ -76,7 +76,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ptyfs_vnops.c,v 1.43 2014/02/07 15:29:21 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ptyfs_vnops.c,v 1.44 2014/03/21 17:21:53 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -711,7 +711,7 @@ ptyfs_readdir(void *v) } for (; uio->uio_resid >= UIO_MX && i < npty; i++) { /* check for used ptys */ - if (pty_isfree(i - 2, 1)) + if (ptyfs_used_get(PTYFSptc, i - 2, vp->v_mount, 0) == NULL) continue; dp->d_fileno = PTYFS_FILENO(i - 2, PTYFSpts);