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

Function vn_fullpath_global

freebsd/kern/vfs_cache.c:2992–3014  ·  view source on GitHub ↗

* This function is similar to vn_fullpath, but it attempts to lookup the * pathname relative to the global root mount point. This is required for the * auditing sub-system, as audited pathnames must be absolute, relative to the * global root mount point. */

Source from the content-addressed store, hash-verified

2990 * global root mount point.
2991 */
2992int
2993vn_fullpath_global(struct vnode *vp, char **retbuf, char **freebuf)
2994{
2995 char *buf;
2996 size_t buflen;
2997 int error;
2998
2999 if (__predict_false(vp == NULL))
3000 return (EINVAL);
3001 buflen = MAXPATHLEN;
3002 buf = malloc(buflen, M_TEMP, M_WAITOK);
3003 vfs_smr_enter();
3004 error = vn_fullpath_any_smr(vp, rootvnode, buf, retbuf, &buflen, 0);
3005 VFS_SMR_ASSERT_NOT_ENTERED();
3006 if (error < 0) {
3007 error = vn_fullpath_any(vp, rootvnode, buf, retbuf, &buflen);
3008 }
3009 if (error == 0)
3010 *freebuf = buf;
3011 else
3012 free(buf, M_TEMP);
3013 return (error);
3014}
3015
3016static struct namecache *
3017vn_dd_from_dst(struct vnode *vp)

Callers 3

audit_canon_path_vpFunction · 0.85
coredumpFunction · 0.85
vn_path_to_global_pathFunction · 0.85

Calls 4

mallocFunction · 0.85
vn_fullpath_any_smrFunction · 0.85
vn_fullpath_anyFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected