Deleted Added
full compact
vfs_cache.c (178046) vfs_cache.c (181060)
1/*-
2 * Copyright (c) 1989, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Poul-Henning Kamp of the FreeBSD Project.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 19 unchanged lines hidden (view full) ---

28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)vfs_cache.c 8.5 (Berkeley) 3/22/95
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1989, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Poul-Henning Kamp of the FreeBSD Project.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 19 unchanged lines hidden (view full) ---

28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)vfs_cache.c 8.5 (Berkeley) 3/22/95
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/kern/vfs_cache.c 178046 2008-04-09 20:19:55Z pjd $");
36__FBSDID("$FreeBSD: head/sys/kern/vfs_cache.c 181060 2008-07-31 16:57:41Z csjp $");
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/lock.h>
42#include <sys/mutex.h>
43#include <sys/sysctl.h>
44#include <sys/mount.h>

--- 704 unchanged lines hidden (view full) ---

749 if (!error)
750 *freebuf = buf;
751 else
752 free(buf, M_TEMP);
753 return (error);
754}
755
756/*
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/lock.h>
42#include <sys/mutex.h>
43#include <sys/sysctl.h>
44#include <sys/mount.h>

--- 704 unchanged lines hidden (view full) ---

749 if (!error)
750 *freebuf = buf;
751 else
752 free(buf, M_TEMP);
753 return (error);
754}
755
756/*
757 * This function is similar to vn_fullpath, but it attempts to lookup the
758 * pathname relative to the global root mount point. This is required for the
759 * auditing sub-system, as audited pathnames must be absolute, relative to the
760 * global root mount point.
761 */
762int
763vn_fullpath_global(struct thread *td, struct vnode *vn,
764 char **retbuf, char **freebuf)
765{
766 char *buf;
767 int error;
768
769 if (disablefullpath)
770 return (ENODEV);
771 if (vn == NULL)
772 return (EINVAL);
773 buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
774 error = vn_fullpath1(td, vn, rootvnode, buf, retbuf, MAXPATHLEN);
775 if (!error)
776 *freebuf = buf;
777 else
778 free(buf, M_TEMP);
779 return (error);
780}
781
782/*
757 * The magic behind kern___getcwd() and vn_fullpath().
758 */
759static int
760vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
761 char *buf, char **retbuf, u_int buflen)
762{
763 char *bp;
764 int error, i, slash_prefixed;

--- 97 unchanged lines hidden ---
783 * The magic behind kern___getcwd() and vn_fullpath().
784 */
785static int
786vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
787 char *buf, char **retbuf, u_int buflen)
788{
789 char *bp;
790 int error, i, slash_prefixed;

--- 97 unchanged lines hidden ---