Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/ptyfs - support advisory locking on ptys
details: https://anonhg.NetBSD.org/src/rev/a76637abbf69
branches: trunk
changeset: 791113:a76637abbf69
user: christos <christos%NetBSD.org@localhost>
date: Tue Nov 05 00:40:33 2013 +0000
description:
- support advisory locking on ptys
- get the link count correct for .
XXX: pullup 6
diffstat:
sys/fs/ptyfs/ptyfs_vnops.c | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diffs (77 lines):
diff -r 1aa71c0f75cf -r a76637abbf69 sys/fs/ptyfs/ptyfs_vnops.c
--- a/sys/fs/ptyfs/ptyfs_vnops.c Tue Nov 05 00:36:02 2013 +0000
+++ b/sys/fs/ptyfs/ptyfs_vnops.c Tue Nov 05 00:40:33 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptyfs_vnops.c,v 1.41 2013/03/18 19:35:38 plunky Exp $ */
+/* $NetBSD: ptyfs_vnops.c,v 1.42 2013/11/05 00:40:33 christos Exp $ */
/*
* Copyright (c) 1993, 1995
@@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ptyfs_vnops.c,v 1.41 2013/03/18 19:35:38 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ptyfs_vnops.c,v 1.42 2013/11/05 00:40:33 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -148,7 +148,7 @@
int ptyfs_print (void *);
int ptyfs_pathconf (void *);
#define ptyfs_islocked genfs_islocked
-#define ptyfs_advlock genfs_einval
+int ptyfs_advlock (void *);
#define ptyfs_bwrite genfs_eopnotsupp
#define ptyfs_putpages genfs_null_putpages
@@ -283,6 +283,26 @@
}
/*
+ * support advisory locking on pty nodes
+ */
+int
+ptyfs_advlock(void *v)
+{
+ struct vop_print_args /* {
+ struct vnode *a_vp;
+ } */ *ap = v;
+ struct ptyfsnode *ptyfs = VTOPTYFS(ap->a_vp);
+
+ switch (ptyfs->ptyfs_type) {
+ case PTYFSpts:
+ case PTYFSptc:
+ return spec_advlock(v);
+ default:
+ return EOPNOTSUPP;
+ }
+}
+
+/*
* Invent attributes for ptyfsnode (vp) and store
* them in (vap).
* Directories lengths are returned as zero since
@@ -313,7 +333,6 @@
vap->va_fileid = ptyfs->ptyfs_fileno;
vap->va_gen = 0;
vap->va_flags = 0;
- vap->va_nlink = 1;
vap->va_blocksize = PAGE_SIZE;
vap->va_atime = ptyfs->ptyfs_atime;
@@ -332,12 +351,13 @@
return ENOENT;
vap->va_bytes = vap->va_size = 0;
vap->va_rdev = ap->a_vp->v_rdev;
+ vap->va_nlink = 1;
break;
case PTYFSroot:
vap->va_rdev = 0;
vap->va_bytes = vap->va_size = DEV_BSIZE;
+ vap->va_nlink = 2;
break;
-
default:
return EOPNOTSUPP;
}
Home |
Main Index |
Thread Index |
Old Index