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

Function vn_fullpath_any

freebsd/kern/vfs_cache.c:3362–3392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3360}
3361
3362static int
3363vn_fullpath_any(struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf,
3364 size_t *buflen)
3365{
3366 size_t orig_buflen, addend;
3367 int error;
3368
3369 if (*buflen < 2)
3370 return (EINVAL);
3371
3372 orig_buflen = *buflen;
3373
3374 vref(vp);
3375 addend = 0;
3376 if (vp->v_type != VDIR) {
3377 *buflen -= 1;
3378 buf[*buflen] = '\0';
3379 error = vn_vptocnp(&vp, buf, buflen);
3380 if (error)
3381 return (error);
3382 if (*buflen == 0) {
3383 vrele(vp);
3384 return (ENOMEM);
3385 }
3386 *buflen -= 1;
3387 buf[*buflen] = '/';
3388 addend = orig_buflen - *buflen;
3389 }
3390
3391 return (vn_fullpath_dir(vp, rdir, buf, retbuf, buflen, addend));
3392}
3393
3394/*
3395 * Resolve an arbitrary vnode to a pathname (taking care of hardlinks).

Callers 3

vn_getcwdFunction · 0.85
vn_fullpathFunction · 0.85
vn_fullpath_globalFunction · 0.85

Calls 4

vn_vptocnpFunction · 0.85
vn_fullpath_dirFunction · 0.85
vrefFunction · 0.70
vreleFunction · 0.70

Tested by

no test coverage detected