Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/ptyfs Reorder ptyfs pseudo inode numbers so that 0 an...



details:   https://anonhg.NetBSD.org/src/rev/8308ab5ea1f7
branches:  trunk
changeset: 572074:8308ab5ea1f7
user:      atatat <atatat%NetBSD.org@localhost>
date:      Thu Dec 16 05:30:18 2004 +0000

description:
Reorder ptyfs pseudo inode numbers so that 0 and 1 are unused, 2 is
the root of the file system, and slaves and masters alternate starting
at 3.  This means the inode numbers won't be really large until you
really allocate a really lot of ptys.

diffstat:

 sys/fs/ptyfs/ptyfs.h |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 9393c80ff270 -r 8308ab5ea1f7 sys/fs/ptyfs/ptyfs.h
--- a/sys/fs/ptyfs/ptyfs.h      Thu Dec 16 04:37:25 2004 +0000
+++ b/sys/fs/ptyfs/ptyfs.h      Thu Dec 16 05:30:18 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ptyfs.h,v 1.2 2004/11/25 05:15:10 christos Exp $       */
+/*     $NetBSD: ptyfs.h,v 1.3 2004/12/16 05:30:18 atatat Exp $ */
 
 /*
  * Copyright (c) 1993
@@ -127,7 +127,8 @@
 #define UIO_MX 32
 
 #define PTYFS_FILENO(pty, type) \
-    ((((uint32_t)type) << 30) | (pty + 1))
+    ((type == PTYFSroot) ? 2 : \
+     ((((pty) + 1) * 2 + (((type) == PTYFSpts) ? 1 : 2))))
 
 #define PTYFS_MAKEDEV(ptyfs) \
     pty_makedev((ptyfs)->ptyfs_type == PTYFSpts ? 't' : 'p', (ptyfs)->ptyfs_pty)



Home | Main Index | Thread Index | Old Index