MCPcopy Create free account
hub / github.com/F-Stack/f-stack / export_vnode_to_kinfo

Function export_vnode_to_kinfo

freebsd/kern/kern_descrip.c:4364–4386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4362}
4363
4364static void
4365export_vnode_to_kinfo(struct vnode *vp, int fd, int fflags,
4366 struct kinfo_file *kif, int flags)
4367{
4368 int error;
4369
4370 bzero(kif, sizeof(*kif));
4371
4372 kif->kf_type = KF_TYPE_VNODE;
4373 error = vn_fill_kinfo_vnode(vp, kif);
4374 if (error == 0)
4375 kif->kf_status |= KF_ATTR_VALID;
4376 kif->kf_flags = xlate_fflags(fflags);
4377 cap_rights_init_zero(&kif->kf_cap_rights);
4378 kif->kf_fd = fd;
4379 kif->kf_ref_count = -1;
4380 kif->kf_offset = -1;
4381 if ((flags & KERN_FILEDESC_PACK_KINFO) != 0)
4382 pack_kinfo(kif);
4383 else
4384 kif->kf_structsize = roundup2(sizeof(*kif), sizeof(uint64_t));
4385 vrele(vp);
4386}
4387
4388struct export_fd_buf {
4389 struct filedesc *fdp;

Callers 2

export_vnode_to_sbFunction · 0.85
export_vnode_for_osysctlFunction · 0.85

Calls 5

bzeroFunction · 0.85
xlate_fflagsFunction · 0.85
pack_kinfoFunction · 0.85
vn_fill_kinfo_vnodeFunction · 0.70
vreleFunction · 0.70

Tested by

no test coverage detected