Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/namei.h
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | struct componentname { | ||||
/* | /* | ||||
* Shared between lookup and commit routines. | * Shared between lookup and commit routines. | ||||
*/ | */ | ||||
char *cn_pnbuf; /* pathname buffer */ | char *cn_pnbuf; /* pathname buffer */ | ||||
char *cn_nameptr; /* pointer to looked up name */ | char *cn_nameptr; /* pointer to looked up name */ | ||||
long cn_namelen; /* length of looked up component */ | long cn_namelen; /* length of looked up component */ | ||||
}; | }; | ||||
struct nameicap_tracker; | |||||
TAILQ_HEAD(nameicap_tracker_head, nameicap_tracker); | |||||
/* | /* | ||||
* Encapsulation of namei parameters. | * Encapsulation of namei parameters. | ||||
*/ | */ | ||||
struct nameidata { | struct nameidata { | ||||
/* | /* | ||||
* Arguments to namei/lookup. | * Arguments to namei/lookup. | ||||
*/ | */ | ||||
const char *ni_dirp; /* pathname pointer */ | const char *ni_dirp; /* pathname pointer */ | ||||
enum uio_seg ni_segflg; /* location of pathname */ | enum uio_seg ni_segflg; /* location of pathname */ | ||||
cap_rights_t ni_rightsneeded; /* rights required to look up vnode */ | cap_rights_t ni_rightsneeded; /* rights required to look up vnode */ | ||||
/* | /* | ||||
* Arguments to lookup. | * Arguments to lookup. | ||||
*/ | */ | ||||
struct vnode *ni_startdir; /* starting directory */ | struct vnode *ni_startdir; /* starting directory */ | ||||
struct vnode *ni_rootdir; /* logical root directory */ | struct vnode *ni_rootdir; /* logical root directory */ | ||||
struct vnode *ni_topdir; /* logical top directory */ | struct vnode *ni_topdir; /* logical top directory */ | ||||
int ni_dirfd; /* starting directory for *at functions */ | int ni_dirfd; /* starting directory for *at functions */ | ||||
int ni_strictrelative; /* relative lookup only; no '..' */ | int ni_lcf; /* local call flags */ | ||||
/* | /* | ||||
* Results: returned from namei | * Results: returned from namei | ||||
*/ | */ | ||||
struct filecaps ni_filecaps; /* rights the *at base has */ | struct filecaps ni_filecaps; /* rights the *at base has */ | ||||
/* | /* | ||||
* Results: returned from/manipulated by lookup | * Results: returned from/manipulated by lookup | ||||
*/ | */ | ||||
struct vnode *ni_vp; /* vnode of result */ | struct vnode *ni_vp; /* vnode of result */ | ||||
struct vnode *ni_dvp; /* vnode of intermediate directory */ | struct vnode *ni_dvp; /* vnode of intermediate directory */ | ||||
/* | /* | ||||
* Shared between namei and lookup/commit routines. | * Shared between namei and lookup/commit routines. | ||||
*/ | */ | ||||
size_t ni_pathlen; /* remaining chars in path */ | size_t ni_pathlen; /* remaining chars in path */ | ||||
char *ni_next; /* next location in pathname */ | char *ni_next; /* next location in pathname */ | ||||
u_int ni_loopcnt; /* count of symlinks encountered */ | u_int ni_loopcnt; /* count of symlinks encountered */ | ||||
/* | /* | ||||
* Lookup parameters: this structure describes the subset of | * Lookup parameters: this structure describes the subset of | ||||
* information from the nameidata structure that is passed | * information from the nameidata structure that is passed | ||||
* through the VOP interface. | * through the VOP interface. | ||||
*/ | */ | ||||
struct componentname ni_cnd; | struct componentname ni_cnd; | ||||
struct nameicap_tracker_head ni_cap_tracker; | |||||
}; | }; | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* | /* | ||||
* namei operations | * namei operations | ||||
*/ | */ | ||||
#define LOOKUP 0 /* perform name lookup only */ | #define LOOKUP 0 /* perform name lookup only */ | ||||
#define CREATE 1 /* setup for file creation */ | #define CREATE 1 /* setup for file creation */ | ||||
Show All 40 Lines | |||||
#define ISOPEN 0x00200000 /* caller is opening; return a real vnode. */ | #define ISOPEN 0x00200000 /* caller is opening; return a real vnode. */ | ||||
#define NOCROSSMOUNT 0x00400000 /* do not cross mount points */ | #define NOCROSSMOUNT 0x00400000 /* do not cross mount points */ | ||||
#define NOMACCHECK 0x00800000 /* do not perform MAC checks */ | #define NOMACCHECK 0x00800000 /* do not perform MAC checks */ | ||||
#define AUDITVNODE1 0x04000000 /* audit the looked up vnode information */ | #define AUDITVNODE1 0x04000000 /* audit the looked up vnode information */ | ||||
#define AUDITVNODE2 0x08000000 /* audit the looked up vnode information */ | #define AUDITVNODE2 0x08000000 /* audit the looked up vnode information */ | ||||
#define TRAILINGSLASH 0x10000000 /* path ended in a slash */ | #define TRAILINGSLASH 0x10000000 /* path ended in a slash */ | ||||
#define NOCAPCHECK 0x20000000 /* do not perform capability checks */ | #define NOCAPCHECK 0x20000000 /* do not perform capability checks */ | ||||
#define PARAMASK 0x3ffffe00 /* mask of parameter descriptors */ | #define PARAMASK 0x3ffffe00 /* mask of parameter descriptors */ | ||||
/* | |||||
* Flags in ni_lcf, valid for the duration of the namei call. | |||||
*/ | |||||
#define NI_LCF_STRICTRELATIVE 0x0001 /* relative lookup only */ | |||||
#define NI_LCF_CAP_DOTDOT 0x0002 /* ".." in strictrelative case */ | |||||
/* | /* | ||||
* Initialization of a nameidata structure. | * Initialization of a nameidata structure. | ||||
*/ | */ | ||||
#define NDINIT(ndp, op, flags, segflg, namep, td) \ | #define NDINIT(ndp, op, flags, segflg, namep, td) \ | ||||
NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, 0, td) | NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, 0, td) | ||||
#define NDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td) \ | #define NDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td) \ | ||||
NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, 0, td) | NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, 0, td) | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |