Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/namei.h
Show First 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | |||||
#define NOFOLLOW 0x0000 /* do not follow symbolic links (pseudo) */ | #define NOFOLLOW 0x0000 /* do not follow symbolic links (pseudo) */ | ||||
#define RBENEATH 0x100000000ULL /* No escape, even tmp, from start dir */ | #define RBENEATH 0x100000000ULL /* No escape, even tmp, from start dir */ | ||||
#define MODMASK 0xf000001ffULL /* mask of operational modifiers */ | #define MODMASK 0xf000001ffULL /* mask of operational modifiers */ | ||||
/* | /* | ||||
* Namei parameter descriptors. | * Namei parameter descriptors. | ||||
*/ | */ | ||||
#define RDONLY 0x00000200 /* lookup with read-only semantics */ | #define RDONLY 0x00000200 /* lookup with read-only semantics */ | ||||
/* UNUSED 0x00000400 */ | #define ISRESTARTED 0x00000400 /* restarted namei */ | ||||
/* UNUSED 0x00000800 */ | /* UNUSED 0x00000800 */ | ||||
#define ISWHITEOUT 0x00001000 /* found whiteout */ | #define ISWHITEOUT 0x00001000 /* found whiteout */ | ||||
#define DOWHITEOUT 0x00002000 /* do whiteouts */ | #define DOWHITEOUT 0x00002000 /* do whiteouts */ | ||||
#define WILLBEDIR 0x00004000 /* new files will be dirs; allow trailing / */ | #define WILLBEDIR 0x00004000 /* new files will be dirs; allow trailing / */ | ||||
#define ISOPEN 0x00008000 /* caller is opening; return a real vnode. */ | #define ISOPEN 0x00008000 /* caller is opening; return a real vnode. */ | ||||
#define NOCROSSMOUNT 0x00010000 /* do not cross mount points */ | #define NOCROSSMOUNT 0x00010000 /* do not cross mount points */ | ||||
#define NOMACCHECK 0x00020000 /* do not perform MAC checks */ | #define NOMACCHECK 0x00020000 /* do not perform MAC checks */ | ||||
#define AUDITVNODE1 0x00040000 /* audit the looked up vnode information */ | #define AUDITVNODE1 0x00040000 /* audit the looked up vnode information */ | ||||
Show All 11 Lines | |||||
#define TRAILINGSLASH 0x40000000 /* path ended in a slash */ | #define TRAILINGSLASH 0x40000000 /* path ended in a slash */ | ||||
#define PARAMASK 0x7ffffe00 /* mask of parameter descriptors */ | #define PARAMASK 0x7ffffe00 /* mask of parameter descriptors */ | ||||
/* | /* | ||||
* Flags which must not be passed in by callers. | * Flags which must not be passed in by callers. | ||||
*/ | */ | ||||
#define NAMEI_INTERNAL_FLAGS \ | #define NAMEI_INTERNAL_FLAGS \ | ||||
(NOEXECCHECK | MAKEENTRY | ISSYMLINK | ISLASTCN | ISDOTDOT | \ | (NOEXECCHECK | MAKEENTRY | ISSYMLINK | ISLASTCN | ISDOTDOT | \ | ||||
TRAILINGSLASH) | TRAILINGSLASH | ISRESTARTED) | ||||
/* | /* | ||||
* Namei results flags | * Namei results flags | ||||
*/ | */ | ||||
#define NIRES_ABS 0x00000001 /* Path was absolute */ | #define NIRES_ABS 0x00000001 /* Path was absolute */ | ||||
#define NIRES_STRICTREL 0x00000002 /* Restricted lookup result */ | #define NIRES_STRICTREL 0x00000002 /* Restricted lookup result */ | ||||
#define NIRES_EMPTYPATH 0x00000004 /* EMPTYPATH used */ | #define NIRES_EMPTYPATH 0x00000004 /* EMPTYPATH used */ | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | #define NDFREE_PNBUF(ndp) do { \ | ||||
uma_zfree(namei_zone, _ndp->ni_cnd.cn_pnbuf); \ | uma_zfree(namei_zone, _ndp->ni_cnd.cn_pnbuf); \ | ||||
_ndp->ni_cnd.cn_pnbuf = NULL; \ | _ndp->ni_cnd.cn_pnbuf = NULL; \ | ||||
} while (0) | } while (0) | ||||
int namei(struct nameidata *ndp); | int namei(struct nameidata *ndp); | ||||
int vfs_lookup(struct nameidata *ndp); | int vfs_lookup(struct nameidata *ndp); | ||||
int vfs_relookup(struct vnode *dvp, struct vnode **vpp, | int vfs_relookup(struct vnode *dvp, struct vnode **vpp, | ||||
struct componentname *cnp, bool refstart); | struct componentname *cnp, bool refstart); | ||||
#define namei_setup_rootdir(ndp, cnp, _rootvnode, pwd) do { \ | |||||
if ((cnp->cn_flags & ISRESTARTED) == 0) \ | |||||
ndp->ni_rootdir = pwd->pwd_adir; \ | |||||
else \ | |||||
ndp->ni_rootdir = pwd->pwd_rdir; \ | |||||
} while (0) | |||||
#endif | #endif | ||||
/* | /* | ||||
* Stats on usefulness of namei caches. | * Stats on usefulness of namei caches. | ||||
*/ | */ | ||||
struct nchstats { | struct nchstats { | ||||
long ncs_goodhits; /* hits that we can really use */ | long ncs_goodhits; /* hits that we can really use */ | ||||
long ncs_neghits; /* negative hits that we can use */ | long ncs_neghits; /* negative hits that we can use */ | ||||
Show All 11 Lines |