* 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. */
| 2990 | * global root mount point. |
| 2991 | */ |
| 2992 | int |
| 2993 | vn_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 | |
| 3016 | static struct namecache * |
| 3017 | vn_dd_from_dst(struct vnode *vp) |
no test coverage detected