xref: /freebsd/lib/libprocstat/common_kvm.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
10daf62d9SStanislav Sedov /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
35e53a4f9SPedro F. Giffuni  *
40daf62d9SStanislav Sedov  * Copyright (c) 2009 Stanislav Sedov <stas@FreeBSD.org>
50daf62d9SStanislav Sedov  * All rights reserved.
60daf62d9SStanislav Sedov  *
70daf62d9SStanislav Sedov  * Redistribution and use in source and binary forms, with or without
80daf62d9SStanislav Sedov  * modification, are permitted provided that the following conditions
90daf62d9SStanislav Sedov  * are met:
100daf62d9SStanislav Sedov  * 1. Redistributions of source code must retain the above copyright
110daf62d9SStanislav Sedov  *    notice, this list of conditions and the following disclaimer.
120daf62d9SStanislav Sedov  * 2. Redistributions in binary form must reproduce the above copyright
130daf62d9SStanislav Sedov  *    notice, this list of conditions and the following disclaimer in the
140daf62d9SStanislav Sedov  *    documentation and/or other materials provided with the distribution.
150daf62d9SStanislav Sedov  *
160daf62d9SStanislav Sedov  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
170daf62d9SStanislav Sedov  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
180daf62d9SStanislav Sedov  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
190daf62d9SStanislav Sedov  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
200daf62d9SStanislav Sedov  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
210daf62d9SStanislav Sedov  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
220daf62d9SStanislav Sedov  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
230daf62d9SStanislav Sedov  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
240daf62d9SStanislav Sedov  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
250daf62d9SStanislav Sedov  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
260daf62d9SStanislav Sedov  * SUCH DAMAGE.
270daf62d9SStanislav Sedov  */
280daf62d9SStanislav Sedov 
290daf62d9SStanislav Sedov #ifndef	_COMMON_KVM_H_
300daf62d9SStanislav Sedov #define	_COMMON_KVM_H_
310daf62d9SStanislav Sedov 
320daf62d9SStanislav Sedov dev_t	dev2udev(kvm_t *kd, struct cdev *dev);
330daf62d9SStanislav Sedov int	kdevtoname(kvm_t *kd, struct cdev *dev, char *);
340daf62d9SStanislav Sedov int	kvm_read_all(kvm_t *kd, unsigned long addr, void *buf,
350daf62d9SStanislav Sedov     size_t nbytes);
360daf62d9SStanislav Sedov 
370daf62d9SStanislav Sedov /*
380daf62d9SStanislav Sedov  * Filesystems specific access routines.
390daf62d9SStanislav Sedov  */
400daf62d9SStanislav Sedov int	devfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
410daf62d9SStanislav Sedov int	isofs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
420daf62d9SStanislav Sedov int	msdosfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
430daf62d9SStanislav Sedov int	nfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
44237abf0cSDavide Italiano int	smbfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
450daf62d9SStanislav Sedov int	udf_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
460daf62d9SStanislav Sedov int	ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
470daf62d9SStanislav Sedov int	zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn);
480daf62d9SStanislav Sedov void	*getvnodedata(struct vnode *vp);
490daf62d9SStanislav Sedov struct mount	*getvnodemount(struct vnode *vp);
500daf62d9SStanislav Sedov 
510daf62d9SStanislav Sedov #endif	/* _COMMON_KVM_H_ */
52