Lines Matching refs:kif

104 		    cap_rights_t *rightsp, struct kinfo_file *kif,
490 struct kinfo_file *kif; in kern_fcntl() local
885 if (kif_sz != sizeof(*kif)) { in kern_fcntl()
889 kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK | M_ZERO); in kern_fcntl()
893 export_file_to_kinfo(fp, fd, NULL, kif, fdp, 0); in kern_fcntl()
896 if ((kif->kf_status & KF_ATTR_VALID) != 0) { in kern_fcntl()
897 kif->kf_structsize = sizeof(*kif); in kern_fcntl()
898 error = copyout(kif, (void *)arg, sizeof(*kif)); in kern_fcntl()
907 free(kif, M_TEMP); in kern_fcntl()
4555 pack_kinfo(struct kinfo_file *kif) in pack_kinfo() argument
4558 kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + in pack_kinfo()
4559 strlen(kif->kf_path) + 1; in pack_kinfo()
4560 kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t)); in pack_kinfo()
4565 struct kinfo_file *kif, struct filedesc *fdp, int flags) in export_file_to_kinfo() argument
4569 bzero(kif, sizeof(*kif)); in export_file_to_kinfo()
4572 kif->kf_type = KF_TYPE_UNKNOWN; in export_file_to_kinfo()
4573 kif->kf_flags = xlate_fflags(fp->f_flag); in export_file_to_kinfo()
4575 kif->kf_cap_rights = *rightsp; in export_file_to_kinfo()
4577 cap_rights_init_zero(&kif->kf_cap_rights); in export_file_to_kinfo()
4578 kif->kf_fd = fd; in export_file_to_kinfo()
4579 kif->kf_ref_count = refcount_load(&fp->f_count); in export_file_to_kinfo()
4580 kif->kf_offset = foffset_get(fp); in export_file_to_kinfo()
4586 error = fo_fill_kinfo(fp, kif, fdp); in export_file_to_kinfo()
4588 kif->kf_status |= KF_ATTR_VALID; in export_file_to_kinfo()
4590 pack_kinfo(kif); in export_file_to_kinfo()
4592 kif->kf_structsize = roundup2(sizeof(*kif), sizeof(uint64_t)); in export_file_to_kinfo()
4597 struct kinfo_file *kif, int flags) in export_vnode_to_kinfo() argument
4601 bzero(kif, sizeof(*kif)); in export_vnode_to_kinfo()
4603 kif->kf_type = KF_TYPE_VNODE; in export_vnode_to_kinfo()
4604 error = vn_fill_kinfo_vnode(vp, kif); in export_vnode_to_kinfo()
4606 kif->kf_status |= KF_ATTR_VALID; in export_vnode_to_kinfo()
4607 kif->kf_flags = xlate_fflags(fflags); in export_vnode_to_kinfo()
4608 cap_rights_init_zero(&kif->kf_cap_rights); in export_vnode_to_kinfo()
4609 kif->kf_fd = fd; in export_vnode_to_kinfo()
4610 kif->kf_ref_count = -1; in export_vnode_to_kinfo()
4611 kif->kf_offset = -1; in export_vnode_to_kinfo()
4613 pack_kinfo(kif); in export_vnode_to_kinfo()
4615 kif->kf_structsize = roundup2(sizeof(*kif), sizeof(uint64_t)); in export_vnode_to_kinfo()
4624 struct kinfo_file kif; member
4631 struct kinfo_file *kif; in export_kinfo_to_sb() local
4633 kif = &efbuf->kif; in export_kinfo_to_sb()
4635 if (efbuf->remainder < kif->kf_structsize) in export_kinfo_to_sb()
4637 efbuf->remainder -= kif->kf_structsize; in export_kinfo_to_sb()
4639 if (sbuf_bcat(efbuf->sb, kif, kif->kf_structsize) != 0) in export_kinfo_to_sb()
4652 export_file_to_kinfo(fp, fd, rightsp, &efbuf->kif, efbuf->fdp, in export_file_to_sb()
4670 export_vnode_to_kinfo(vp, fd, fflags, &efbuf->kif, efbuf->flags); in export_vnode_to_sb()
4833 kinfo_to_okinfo(struct kinfo_file *kif, struct kinfo_ofile *okif) in kinfo_to_okinfo() argument
4837 okif->kf_type = kif->kf_type; in kinfo_to_okinfo()
4838 okif->kf_fd = kif->kf_fd; in kinfo_to_okinfo()
4839 okif->kf_ref_count = kif->kf_ref_count; in kinfo_to_okinfo()
4840 okif->kf_flags = kif->kf_flags & (KF_FLAG_READ | KF_FLAG_WRITE | in kinfo_to_okinfo()
4843 okif->kf_offset = kif->kf_offset; in kinfo_to_okinfo()
4844 if (kif->kf_type == KF_TYPE_VNODE) in kinfo_to_okinfo()
4845 okif->kf_vnode_type = kif->kf_un.kf_file.kf_file_type; in kinfo_to_okinfo()
4848 strlcpy(okif->kf_path, kif->kf_path, sizeof(okif->kf_path)); in kinfo_to_okinfo()
4849 if (kif->kf_type == KF_TYPE_SOCKET) { in kinfo_to_okinfo()
4850 okif->kf_sock_domain = kif->kf_un.kf_sock.kf_sock_domain0; in kinfo_to_okinfo()
4851 okif->kf_sock_type = kif->kf_un.kf_sock.kf_sock_type0; in kinfo_to_okinfo()
4852 okif->kf_sock_protocol = kif->kf_un.kf_sock.kf_sock_protocol0; in kinfo_to_okinfo()
4853 okif->kf_sa_local = kif->kf_un.kf_sock.kf_sa_local; in kinfo_to_okinfo()
4854 okif->kf_sa_peer = kif->kf_un.kf_sock.kf_sa_peer; in kinfo_to_okinfo()
4862 export_vnode_for_osysctl(struct vnode *vp, int type, struct kinfo_file *kif, in export_vnode_for_osysctl() argument
4869 export_vnode_to_kinfo(vp, type, 0, kif, KERN_FILEDESC_PACK_KINFO); in export_vnode_for_osysctl()
4870 kinfo_to_okinfo(kif, okif); in export_vnode_for_osysctl()
4883 struct kinfo_file *kif; in sysctl_kern_proc_ofiledesc() local
4909 kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); in sysctl_kern_proc_ofiledesc()
4915 export_vnode_for_osysctl(pwd->pwd_cdir, KF_FD_TYPE_CWD, kif, in sysctl_kern_proc_ofiledesc()
4918 export_vnode_for_osysctl(pwd->pwd_rdir, KF_FD_TYPE_ROOT, kif, in sysctl_kern_proc_ofiledesc()
4921 export_vnode_for_osysctl(pwd->pwd_jdir, KF_FD_TYPE_JAIL, kif, in sysctl_kern_proc_ofiledesc()
4931 export_file_to_kinfo(fp, i, NULL, kif, fdp, in sysctl_kern_proc_ofiledesc()
4934 kinfo_to_okinfo(kif, okif); in sysctl_kern_proc_ofiledesc()
4944 free(kif, M_TEMP); in sysctl_kern_proc_ofiledesc()
5303 badfo_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) in badfo_fill_kinfo() argument