137 lines
3.3 KiB
Text
137 lines
3.3 KiB
Text
$NetBSD: patch-ad,v 1.15 2008/05/17 23:53:29 christos Exp $
|
|
|
|
--- dialects/n+obsd/dnode.c.orig 2007-04-24 12:22:06.000000000 -0400
|
|
+++ dialects/n+obsd/dnode.c 2008-05-17 18:49:56.000000000 -0400
|
|
@@ -38,6 +38,9 @@
|
|
|
|
#include "lsof.h"
|
|
|
|
+#if __NetBSD_Version__ > 399001800
|
|
+#define NOLOCKF
|
|
+#endif
|
|
|
|
#if defined(HAS_DINODE_U)
|
|
#define DINODE_U dinode_u
|
|
@@ -194,12 +197,17 @@
|
|
unsigned char ns;
|
|
unsigned char rdevs;
|
|
char *ep, *ty;
|
|
+#ifndef NOLOCKF
|
|
struct lockf lf, *lff, *lfp;
|
|
+#endif
|
|
struct inode i;
|
|
struct mfsnode m;
|
|
+#if defined(HASTMPFS)
|
|
+ struct tmpfs_node tmp;
|
|
+#endif /* defined(HASTMPFS) */
|
|
struct nfsnode n;
|
|
enum nodetype {NONODE, CDFSNODE, DOSNODE, EXT2NODE, FDESCNODE, INODE,
|
|
- KERNFSNODE, MFSNODE, NFSNODE, PFSNODE, PTYFSNODE} nty;
|
|
+ KERNFSNODE, MFSNODE, NFSNODE, PFSNODE, PTYFSNODE, TMPFSNODE} nty;
|
|
enum vtype type;
|
|
struct vnode *v, vb;
|
|
struct l_vfs *vfs;
|
|
@@ -276,6 +284,11 @@
|
|
|
|
#if defined(HASPTYFS)
|
|
struct ptyfsnode pt;
|
|
+#if __NetBSD_Version__ >= 499006200
|
|
+#define specinfo specnode
|
|
+#define vu_specinfo vu_specnode
|
|
+#define si_rdev sn_rdev
|
|
+#endif
|
|
struct specinfo si;
|
|
#endif /* defined(HASPTYFS) */
|
|
|
|
@@ -414,7 +427,7 @@
|
|
*/
|
|
if (!v->v_data
|
|
|| kread((KA_T)v->v_data, (char *)&kn, sizeof(kn))) {
|
|
- if (v->v_type != VDIR || !(v->v_flag && VROOT)) {
|
|
+ if (v->v_type != VDIR || !(v->VNODE_VFLAG && NCACHE_VROOT)) {
|
|
(void) snpf(Namech, Namechl,
|
|
"can't read kernfs_node at: %s",
|
|
print_kptr((KA_T)v->v_data, (char *)NULL, 0));
|
|
@@ -449,7 +462,7 @@
|
|
* size are fixed; otherwise, safely stat() the file to get the
|
|
* inode number and size.
|
|
*/
|
|
- if (v->v_type == VDIR && (v->v_flag & VROOT)) {
|
|
+ if (v->v_type == VDIR && (v->VNODE_VFLAG & NCACHE_VROOT)) {
|
|
(void) snpf(Namech, Namechl, "%s", _PATH_KERNFS);
|
|
ksb.st_ino = (ino_t)2;
|
|
ksb.st_size = DEV_BSIZE;
|
|
@@ -471,6 +484,19 @@
|
|
nty = MFSNODE;
|
|
break;
|
|
|
|
+#if defined(HASTMPFS)
|
|
+ case VT_TMPFS:
|
|
+ if (!v->v_data
|
|
+ || kread((KA_T)v->v_data, (char *)&tmp, sizeof(tmp))) {
|
|
+ (void) snpf(Namech, Namechl, "can't read tmpfs_node at: %s",
|
|
+ print_kptr((KA_T)v->v_data, (char *)NULL, 0));
|
|
+ enter_nm(Namech);
|
|
+ return;
|
|
+ }
|
|
+ nty = TMPFSNODE;
|
|
+ break;
|
|
+#endif /* defined(HASTMPFS) */
|
|
+
|
|
#if defined(HASMSDOSFS)
|
|
case VT_MSDOSFS:
|
|
if (!v->v_data
|
|
@@ -619,6 +645,7 @@
|
|
|
|
}
|
|
|
|
+#ifndef NOLOCKF
|
|
if ((lff = i.i_lockf)) {
|
|
|
|
/*
|
|
@@ -667,6 +694,7 @@
|
|
break;
|
|
} while ((lfp = lf.lf_next) && lfp != lff);
|
|
}
|
|
+#endif
|
|
break;
|
|
default:
|
|
if (v->v_type == VBAD || v->v_type == VNON)
|
|
@@ -900,6 +928,13 @@
|
|
break;
|
|
#endif /* defined(HASPTYFS) */
|
|
|
|
+#if defined(HASTMPFS)
|
|
+ case TMPFSNODE:
|
|
+ Lf->inode = (INODETYPE)tmp.tn_id;
|
|
+ Lf->inp_ty = 1;
|
|
+ break;
|
|
+#endif /* defined(HASTMPFS) */
|
|
+
|
|
}
|
|
|
|
/*
|
|
@@ -1019,6 +1054,13 @@
|
|
Lf->sz_def = 1;
|
|
break;
|
|
|
|
+#if defined(HASTMPFS)
|
|
+ case TMPFSNODE:
|
|
+ Lf->sz = (SZOFFTYPE)tmp.tn_size;
|
|
+ Lf->sz_def = 1;
|
|
+ break;
|
|
+#endif /* defined(HASTMPFS) */
|
|
+
|
|
#if defined(HASEXT2FS)
|
|
case EXT2NODE:
|
|
# if defined(HASI_E2FS_PTR)
|
|
@@ -1221,6 +1263,9 @@
|
|
Lf->dev_def = Lf->rdev_def = 0;
|
|
(void) snpf(Namech, Namechl, "%#x", m.mfs_baseoff);
|
|
enter_dev_ch("memory");
|
|
+ } else if (nty == TMPFSNODE) {
|
|
+ Lf->dev_def = Lf->rdev_def = 0;
|
|
+ enter_dev_ch("memory");
|
|
}
|
|
|
|
#if defined(HASPROCFS)
|