Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/vfs_vnops.c
Show First 20 Lines • Show All 2,334 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif) | vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif) | ||||
{ | { | ||||
struct vattr va; | struct vattr va; | ||||
char *fullpath, *freepath; | char *fullpath, *freepath; | ||||
int error; | int error; | ||||
kif->kf_vnode_type = vntype_to_kinfo(vp->v_type); | kif->kf_un.kf_file.kf_file_type = vntype_to_kinfo(vp->v_type); | ||||
freepath = NULL; | freepath = NULL; | ||||
fullpath = "-"; | fullpath = "-"; | ||||
error = vn_fullpath(curthread, vp, &fullpath, &freepath); | error = vn_fullpath(curthread, vp, &fullpath, &freepath); | ||||
if (error == 0) { | if (error == 0) { | ||||
strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); | strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); | ||||
} | } | ||||
if (freepath != NULL) | if (freepath != NULL) | ||||
free(freepath, M_TEMP); | free(freepath, M_TEMP); | ||||
Show All 12 Lines | vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif) | ||||
VOP_UNLOCK(vp, 0); | VOP_UNLOCK(vp, 0); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
if (va.va_fsid != VNOVAL) | if (va.va_fsid != VNOVAL) | ||||
kif->kf_un.kf_file.kf_file_fsid = va.va_fsid; | kif->kf_un.kf_file.kf_file_fsid = va.va_fsid; | ||||
else | else | ||||
kif->kf_un.kf_file.kf_file_fsid = | kif->kf_un.kf_file.kf_file_fsid = | ||||
vp->v_mount->mnt_stat.f_fsid.val[0]; | vp->v_mount->mnt_stat.f_fsid.val[0]; | ||||
kif->kf_un.kf_file.kf_file_fsid_freebsd11 = | |||||
kif->kf_un.kf_file.kf_file_fsid; /* truncate */ | |||||
kif->kf_un.kf_file.kf_file_fileid = va.va_fileid; | kif->kf_un.kf_file.kf_file_fileid = va.va_fileid; | ||||
kif->kf_un.kf_file.kf_file_mode = MAKEIMODE(va.va_type, va.va_mode); | kif->kf_un.kf_file.kf_file_mode = MAKEIMODE(va.va_type, va.va_mode); | ||||
kif->kf_un.kf_file.kf_file_size = va.va_size; | kif->kf_un.kf_file.kf_file_size = va.va_size; | ||||
kif->kf_un.kf_file.kf_file_rdev = va.va_rdev; | kif->kf_un.kf_file.kf_file_rdev = va.va_rdev; | ||||
kif->kf_un.kf_file.kf_file_rdev_freebsd11 = | |||||
kif->kf_un.kf_file.kf_file_rdev; /* truncate */ | |||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
vn_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size, | vn_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size, | ||||
vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, | vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, | ||||
struct thread *td) | struct thread *td) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |