xref: /freebsd/lib/libprocstat/common_kvm.h (revision 0daf62d9f5f7d2c15d00d71eb519b90516df016f)
1*0daf62d9SStanislav Sedov /*-
2*0daf62d9SStanislav Sedov  * Copyright (c) 2009 Stanislav Sedov <stas@FreeBSD.org>
3*0daf62d9SStanislav Sedov  * All rights reserved.
4*0daf62d9SStanislav Sedov  *
5*0daf62d9SStanislav Sedov  * Redistribution and use in source and binary forms, with or without
6*0daf62d9SStanislav Sedov  * modification, are permitted provided that the following conditions
7*0daf62d9SStanislav Sedov  * are met:
8*0daf62d9SStanislav Sedov  * 1. Redistributions of source code must retain the above copyright
9*0daf62d9SStanislav Sedov  *    notice, this list of conditions and the following disclaimer.
10*0daf62d9SStanislav Sedov  * 2. Redistributions in binary form must reproduce the above copyright
11*0daf62d9SStanislav Sedov  *    notice, this list of conditions and the following disclaimer in the
12*0daf62d9SStanislav Sedov  *    documentation and/or other materials provided with the distribution.
13*0daf62d9SStanislav Sedov  *
14*0daf62d9SStanislav Sedov  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
15*0daf62d9SStanislav Sedov  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*0daf62d9SStanislav Sedov  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*0daf62d9SStanislav Sedov  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18*0daf62d9SStanislav Sedov  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*0daf62d9SStanislav Sedov  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*0daf62d9SStanislav Sedov  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*0daf62d9SStanislav Sedov  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*0daf62d9SStanislav Sedov  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*0daf62d9SStanislav Sedov  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*0daf62d9SStanislav Sedov  * SUCH DAMAGE.
25*0daf62d9SStanislav Sedov  *
26*0daf62d9SStanislav Sedov  * $FreeBSD$
27*0daf62d9SStanislav Sedov  */
28*0daf62d9SStanislav Sedov 
29*0daf62d9SStanislav Sedov #ifndef	_COMMON_KVM_H_
30*0daf62d9SStanislav Sedov #define	_COMMON_KVM_H_
31*0daf62d9SStanislav Sedov 
32*0daf62d9SStanislav Sedov dev_t	dev2udev(kvm_t *kd, struct cdev *dev);
33*0daf62d9SStanislav Sedov int	kdevtoname(kvm_t *kd, struct cdev *dev, char *);
34*0daf62d9SStanislav Sedov int	kvm_read_all(kvm_t *kd, unsigned long addr, void *buf,
35*0daf62d9SStanislav Sedov     size_t nbytes);
36*0daf62d9SStanislav Sedov 
37*0daf62d9SStanislav Sedov /*
38*0daf62d9SStanislav Sedov  * Filesystems specific access routines.
39*0daf62d9SStanislav Sedov  */
40*0daf62d9SStanislav Sedov int	devfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
41*0daf62d9SStanislav Sedov int	isofs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
42*0daf62d9SStanislav Sedov int	msdosfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
43*0daf62d9SStanislav Sedov int	nfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
44*0daf62d9SStanislav Sedov int	ntfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
45*0daf62d9SStanislav Sedov int	nwfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
46*0daf62d9SStanislav Sedov int	smbfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
47*0daf62d9SStanislav Sedov int	udf_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
48*0daf62d9SStanislav Sedov int	ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
49*0daf62d9SStanislav Sedov int	zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
50*0daf62d9SStanislav Sedov void	*getvnodedata(struct vnode *vp);
51*0daf62d9SStanislav Sedov struct mount	*getvnodemount(struct vnode *vp);
52*0daf62d9SStanislav Sedov 
53*0daf62d9SStanislav Sedov #endif	/* _COMMON_KVM_H_ */
54