diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2009-06-20 19:50:06 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2009-06-20 19:50:06 +0000 |
commit | 4402975a348938d8cad34341962b18854da39d93 (patch) | |
tree | 6e28c93ca566c8d3414efdb1b380fb43722021db /lib/libkvm/kvm_file2.c | |
parent | de7b3f1a5b22f9468caf434ec9772ba368c620c0 (diff) |
Split out cd9660 bits into their own .c file to avoid #define collisions
with ufs and add also udf support. OK miod@
Diffstat (limited to 'lib/libkvm/kvm_file2.c')
-rw-r--r-- | lib/libkvm/kvm_file2.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/lib/libkvm/kvm_file2.c b/lib/libkvm/kvm_file2.c index 10e508921cf..00fd9e115d1 100644 --- a/lib/libkvm/kvm_file2.c +++ b/lib/libkvm/kvm_file2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_file2.c,v 1.6 2009/06/20 13:10:21 millert Exp $ */ +/* $OpenBSD: kvm_file2.c,v 1.7 2009/06/20 19:50:05 millert Exp $ */ /* * Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com> @@ -46,7 +46,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: kvm_file2.c,v 1.6 2009/06/20 13:10:21 millert Exp $"; +static char *rcsid = "$OpenBSD: kvm_file2.c,v 1.7 2009/06/20 19:50:05 millert Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -80,10 +80,6 @@ static char *rcsid = "$OpenBSD: kvm_file2.c,v 1.6 2009/06/20 13:10:21 millert Ex #include <sys/stat.h> #include <sys/sysctl.h> -#include <isofs/cd9660/iso.h> -#include <isofs/cd9660/cd9660_extern.h> -#include <isofs/cd9660/cd9660_node.h> - #define _KERNEL #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> @@ -811,24 +807,6 @@ spec_filestat(kvm_t *kd, struct kinfo_file2 *kf, struct vnode *vp) } static int -isofs_filestat(kvm_t *kd, struct kinfo_file2 *kf, struct vnode *vp) -{ - struct iso_node inode; - - if (KREAD(kd, (u_long)VTOI(vp), &inode)) { - _kvm_err(kd, kd->program, "can't read inode at %p", VTOI(vp)); - return (-1); - } - kf->va_fsid = inode.i_dev & 0xffff; - kf->va_fileid = (long)inode.i_number; - kf->va_mode = inode.inode.iso_mode; - kf->va_size = inode.i_size; - kf->va_rdev = inode.i_dev; - - return (0); -} - -static int filestat(kvm_t *kd, struct kinfo_file2 *kf, struct vnode *vp) { int ret = 0; @@ -846,7 +824,7 @@ filestat(kvm_t *kd, struct kinfo_file2 *kf, struct vnode *vp) ret = ext2fs_filestat(kd, kf, vp); break; case VT_ISOFS: - ret = isofs_filestat(kd, kf, vp); + ret = _kvm_stat_cd9660(kd, kf, vp); break; case VT_MSDOSFS: ret = msdos_filestat(kd, kf, vp); @@ -854,6 +832,9 @@ filestat(kvm_t *kd, struct kinfo_file2 *kf, struct vnode *vp) case VT_NNPFS: ret = nnpfs_filestat(kd, kf, vp); break; + case VT_UDF: + ret = _kvm_stat_udf(kd, kf, vp); + break; case VT_NON: if (vp->v_flag & VCLONE) ret = spec_filestat(kd, kf, vp); |