FreeBSD kernel kern code
vfs_lookup.c File Reference
#include <sys/cdefs.h>
#include "opt_capsicum.h"
#include "opt_kdtrace.h"
#include "opt_ktrace.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/capability.h>
#include <sys/fcntl.h>
#include <sys/jail.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/filedesc.h>
#include <sys/proc.h>
#include <sys/sdt.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <security/audit/audit.h>
#include <security/mac/mac_framework.h>
#include <vm/uma.h>
Include dependency graph for vfs_lookup.c:

Go to the source code of this file.

Macros

#define NAMEI_DIAGNOSTIC   1
 

Functions

 __FBSDID ("$BSDSUniX$")
 
 SDT_PROVIDER_DECLARE (vfs)
 
 SDT_PROBE_DEFINE3 (vfs, namei, lookup, entry,"struct vnode *","char *","unsigned long")
 
 SDT_PROBE_DEFINE2 (vfs, namei, lookup, return,"int","struct vnode *")
 
static void nameiinit (void *dummy __unused)
 
 SYSINIT (vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL)
 
 SYSCTL_INT (_vfs, OID_AUTO, lookup_shared, CTLFLAG_RW,&lookup_shared, 0,"Enables/Disables shared locks for path name translation")
 
 TUNABLE_INT ("vfs.lookup_shared",&lookup_shared)
 
static void namei_cleanup_cnp (struct componentname *cnp)
 
int namei (struct nameidata *ndp)
 
static int compute_cn_lkflags (struct mount *mp, int lkflags, int cnflags)
 
static __inline int needs_exclusive_leaf (struct mount *mp, int flags)
 
int lookup (struct nameidata *ndp)
 
int relookup (struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
 
void NDFREE (struct nameidata *ndp, const u_int flags)
 
int kern_alternate_path (struct thread *td, const char *prefix, const char *path, enum uio_seg pathseg, char **pathbuf, int create, int dirfd)
 

Variables

uma_zone_t namei_zone
 
static struct vnode * vp_crossmp
 
static int lookup_shared = 1
 

Macro Definition Documentation

#define NAMEI_DIAGNOSTIC   1

Definition at line 69 of file vfs_lookup.c.

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
static int compute_cn_lkflags ( struct mount *  mp,
int  lkflags,
int  cnflags 
)
static

Definition at line 386 of file vfs_lookup.c.

Referenced by lookup().

Here is the caller graph for this function:

int kern_alternate_path ( struct thread *  td,
const char *  prefix,
const char *  path,
enum uio_seg  pathseg,
char **  pathbuf,
int  create,
int  dirfd 
)

Definition at line 1150 of file vfs_lookup.c.

References buf, free(), malloc(), namei(), NDFREE(), and vrele().

Here is the call graph for this function:

int lookup ( struct nameidata *  ndp)

Definition at line 473 of file vfs_lookup.c.

References compute_cn_lkflags(), lookup_shared, needs_exclusive_leaf(), panic(), pr, printf(), rootvnode, vfs_busy(), vfs_unbusy(), vp_crossmp, vput(), vref(), and vrele().

Referenced by cache_lookup_times(), and namei().

Here is the call graph for this function:

Here is the caller graph for this function:

static void namei_cleanup_cnp ( struct componentname *  cnp)
static

Definition at line 125 of file vfs_lookup.c.

References namei_zone.

Referenced by namei().

Here is the caller graph for this function:

static void nameiinit ( void *dummy  __unused)
static

Definition at line 87 of file vfs_lookup.c.

References getnewvnode(), namei_zone, and vp_crossmp.

Here is the call graph for this function:

static __inline int needs_exclusive_leaf ( struct mount *  mp,
int  flags 
)
static

Definition at line 400 of file vfs_lookup.c.

Referenced by lookup().

Here is the caller graph for this function:

int relookup ( struct vnode *  dvp,
struct vnode **  vpp,
struct componentname *  cnp 
)

Definition at line 957 of file vfs_lookup.c.

References panic(), printf(), vput(), and vrele().

Here is the call graph for this function:

SDT_PROBE_DEFINE2 ( vfs  ,
namei  ,
lookup  ,
return  ,
"int"  ,
"struct vnode *"   
)
SDT_PROBE_DEFINE3 ( vfs  ,
namei  ,
lookup  ,
entry  ,
"struct vnode *"  ,
"char *"  ,
"unsigned long"   
)
SDT_PROVIDER_DECLARE ( vfs  )
SYSCTL_INT ( _vfs  ,
OID_AUTO  ,
lookup_shared  ,
CTLFLAG_RW  ,
lookup_shared,
,
"Enables/Disables shared locks for path name translation"   
)
SYSINIT ( vfs  ,
SI_SUB_VFS  ,
SI_ORDER_SECOND  ,
nameiinit  ,
NULL   
)
TUNABLE_INT ( "vfs.lookup_shared"  ,
lookup_shared 
)

Variable Documentation

int lookup_shared = 1
static

Definition at line 99 of file vfs_lookup.c.

Referenced by lookup(), and namei().

uma_zone_t namei_zone

Definition at line 80 of file vfs_lookup.c.

Referenced by kern_symlinkat(), namei(), namei_cleanup_cnp(), nameiinit(), and NDFREE().

struct vnode* vp_crossmp
static

Definition at line 84 of file vfs_lookup.c.

Referenced by lookup(), and nameiinit().