Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/ptyfs Ilya Zykov: Prepare readdir for multi-mountpoin...



details:   https://anonhg.NetBSD.org/src/rev/39357575a967
branches:  trunk
changeset: 794679:39357575a967
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Mar 21 17:21:53 2014 +0000

description:
Ilya Zykov: Prepare readdir for multi-mountpoint use

diffstat:

 sys/fs/ptyfs/ptyfs.h       |  3 ++-
 sys/fs/ptyfs/ptyfs_subr.c  |  7 +++----
 sys/fs/ptyfs/ptyfs_vnops.c |  6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diffs (79 lines):

diff -r a76333f290d8 -r 39357575a967 sys/fs/ptyfs/ptyfs.h
--- a/sys/fs/ptyfs/ptyfs.h      Fri Mar 21 17:00:18 2014 +0000
+++ b/sys/fs/ptyfs/ptyfs.h      Fri Mar 21 17:21:53 2014 +0000
@@ -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 @@
 #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);
diff -r a76333f290d8 -r 39357575a967 sys/fs/ptyfs/ptyfs_subr.c
--- a/sys/fs/ptyfs/ptyfs_subr.c Fri Mar 21 17:00:18 2014 +0000
+++ b/sys/fs/ptyfs/ptyfs_subr.c Fri Mar 21 17:21:53 2014 +0000
@@ -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_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 @@
  * 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.
diff -r a76333f290d8 -r 39357575a967 sys/fs/ptyfs/ptyfs_vnops.c
--- a/sys/fs/ptyfs/ptyfs_vnops.c        Fri Mar 21 17:00:18 2014 +0000
+++ b/sys/fs/ptyfs/ptyfs_vnops.c        Fri Mar 21 17:21:53 2014 +0000
@@ -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 @@
        }
        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);



Home | Main Index | Thread Index | Old Index