1/* 2 * dnode1.c - Darwin node functions for /dev/kmem-based lsof 3 * 4 * This module must be separate to keep separate the multiple kernel inode 5 * structure definitions. 6 */ 7 8 9/* 10 * Copyright 1995 Purdue Research Foundation, West Lafayette, Indiana 11 * 47907. All rights reserved. 12 * 13 * Written by Victor A. Abell 14 * 15 * This software is not subject to any license of the American Telephone 16 * and Telegraph Company or the Regents of the University of California. 17 * 18 * Permission is granted to anyone to use this software for any purpose on 19 * any computer system, and to alter it and redistribute it freely, subject 20 * to the following restrictions: 21 * 22 * 1. Neither the authors nor Purdue University are responsible for any 23 * consequences of the use of this software. 24 * 25 * 2. The origin of this software must not be misrepresented, either by 26 * explicit claim or by omission. Credit to the authors and Purdue 27 * University must appear in documentation and sources. 28 * 29 * 3. Altered versions must be plainly marked as such, and must not be 30 * misrepresented as being the original software. 31 * 32 * 4. This notice may not be removed or altered. 33 */ 34 35#ifndef lint 36static char copyright[] = 37"@(#) Copyright 1994 Purdue Research Foundation.\nAll rights reserved.\n"; 38static char *rcsid = "$Id: dnode1.c,v 1.3 2005/11/01 20:24:51 abe Exp $"; 39#endif 40 41#include "lsof.h" 42 43#if defined(HAS9660FS) 44 45/* 46 * Do a little preparation for #include'ing cd9660_node.h, then #include it. 47 */ 48 49#undef i_size; 50#undef doff_t 51#undef IN_ACCESS 52 53struct vop_abortop_args { int dummy; }; 54struct vop_access_args { int dummy; }; 55struct vop_blkatoff_args { int dummy; }; 56struct vop_bmap_args { int dummy; }; 57struct vop_close_args { int dummy; }; 58struct vop_getattr_args { int dummy; }; 59struct vop_inactive_args { int dummy; }; 60struct vop_ioctl_args { int dummy; }; 61struct vop_islocked_args { int dummy; }; 62struct vop_lock_args { int dummy; }; 63struct vop_lookup_args { int dummy; }; 64struct vop_mmap_args { int dummy; }; 65struct vop_open_args { int dummy; }; 66struct vop_pathconf_args { int dummy; }; 67struct vop_print_args { int dummy; }; 68struct vop_read_args { int dummy; }; 69struct vop_readdir_args { int dummy; }; 70struct vop_readlink_args { int dummy; }; 71struct vop_reclaim_args { int dummy; }; 72struct vop_seek_args { int dummy; }; 73struct vop_select_args { int dummy; }; 74struct vop_strategy_args { int dummy; }; 75struct vop_unlock_args { int dummy; }; 76 77#include <isofs/cd9660/cd9660_node.h> 78 79/* 80 * read_iso_node() -- read CD 9660 iso_node 81 */ 82 83int 84read_iso_node(v, d, dd, ino, nl, sz) 85 struct vnode *v; /* containing vnode */ 86 dev_t *d; /* returned device number */ 87 int *dd; /* returned device-defined flag */ 88 INODETYPE *ino; /* returned inode number */ 89 long *nl; /* returned number of links */ 90 SZOFFTYPE *sz; /* returned size */ 91{ 92 93 struct iso_node i; 94 95 if (!v->v_data 96 || kread((KA_T)v->v_data, (char *)&i, sizeof(i))) 97 return(1); 98 99 *d = i.i_dev; 100 *dd = 1; 101 *ino = (INODETYPE)i.i_number; 102 *nl = (long)i.inode.iso_links; 103 *sz = (SZOFFTYPE)i.i_size; 104 105 return(0); 106} 107#endif /* defined(HAS9660FS) */ 108