Home
last modified time | relevance | path

Searched refs:cnp (Results 1 – 25 of 25) sorted by relevance

/openbsd/src/sys/kern/
Dvfs_lookup.c60 component_push(struct componentname *cnp, char *component, size_t len) in component_push() argument
62 if (cnp->cn_rpi + len + 1 >= MAXPATHLEN) in component_push()
64 if (cnp->cn_rpi > 1) in component_push()
65 cnp->cn_rpbuf[cnp->cn_rpi++] = '/'; in component_push()
66 memcpy(cnp->cn_rpbuf + cnp->cn_rpi, component, len); in component_push()
67 cnp->cn_rpi+=len; in component_push()
68 cnp->cn_rpbuf[cnp->cn_rpi] = '\0'; in component_push()
73 component_pop(struct componentname *cnp) in component_pop() argument
75 while(cnp->cn_rpi && cnp->cn_rpbuf[cnp->cn_rpi] != '/' ) in component_pop()
76 cnp->cn_rpi--; in component_pop()
[all …]
Dvfs_cache.c139 struct componentname *cnp) in cache_lookup() argument
150 cnp->cn_flags &= ~MAKEENTRY; in cache_lookup()
153 if (cnp->cn_namelen > NAMECACHE_MAXLEN) { in cache_lookup()
155 cnp->cn_flags &= ~MAKEENTRY; in cache_lookup()
160 n.nc_nlen = cnp->cn_namelen; in cache_lookup()
161 memcpy(n.nc_name, cnp->cn_nameptr, n.nc_nlen); in cache_lookup()
168 if ((cnp->cn_flags & MAKEENTRY) == 0) { in cache_lookup()
172 if (cnp->cn_nameiop != CREATE || in cache_lookup()
173 (cnp->cn_flags & ISLASTCN) == 0) { in cache_lookup()
206 } else if (cnp->cn_flags & ISDOTDOT) { in cache_lookup()
[all …]
Dvfs_vops.c75 struct componentname *cnp) in VOP_LOOKUP() argument
80 a.a_cnp = cnp; in VOP_LOOKUP()
90 struct componentname *cnp, struct vattr *vap) in VOP_CREATE() argument
95 a.a_cnp = cnp; in VOP_CREATE()
108 struct componentname *cnp, struct vattr *vap) in VOP_MKNOD() argument
113 a.a_cnp = cnp; in VOP_MKNOD()
320 VOP_REMOVE(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) in VOP_REMOVE() argument
326 a.a_cnp = cnp; in VOP_REMOVE()
343 VOP_LINK(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) in VOP_LINK() argument
348 a.a_cnp = cnp; in VOP_LINK()
[all …]
/openbsd/src/sys/miscfs/fuse/
Dfuse_lookup.c44 struct componentname *cnp = ap->a_cnp; in fusefs_lookup() local
45 struct proc *p = cnp->cn_proc; in fusefs_lookup()
46 struct ucred *cred = cnp->cn_cred; in fusefs_lookup()
50 int nameiop = cnp->cn_nameiop; in fusefs_lookup()
54 flags = cnp->cn_flags; in fusefs_lookup()
62 if ((error = VOP_ACCESS(vdp, VEXEC, cred, cnp->cn_proc)) != 0) in fusefs_lookup()
66 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) in fusefs_lookup()
69 if (cnp->cn_namelen == 1 && *(cnp->cn_nameptr) == '.') { in fusefs_lookup()
76 fbuf = fb_setup(cnp->cn_namelen + 1, dp->i_number, in fusefs_lookup()
79 memcpy(fbuf->fb_dat, cnp->cn_nameptr, cnp->cn_namelen); in fusefs_lookup()
[all …]
Dfuse_vnops.c627 struct componentname *cnp = ap->a_cnp; in fusefs_link() local
628 struct proc *p = cnp->cn_proc; in fusefs_link()
640 VOP_ABORTOP(dvp, cnp); in fusefs_link()
645 VOP_ABORTOP(dvp, cnp); in fusefs_link()
650 VOP_ABORTOP(dvp, cnp); in fusefs_link()
654 fbuf = fb_setup(cnp->cn_namelen + 1, dip->i_number, in fusefs_link()
658 memcpy(fbuf->fb_dat, cnp->cn_nameptr, cnp->cn_namelen); in fusefs_link()
659 fbuf->fb_dat[cnp->cn_namelen] = '\0'; in fusefs_link()
676 pool_put(&namei_pool, cnp->cn_pnbuf); in fusefs_link()
689 struct componentname *cnp = ap->a_cnp; in fusefs_symlink() local
[all …]
/openbsd/src/sys/msdosfs/
Dmsdosfs_lookup.c87 struct componentname *cnp = ap->a_cnp; in msdosfs_lookup() local
111 int nameiop = cnp->cn_nameiop; in msdosfs_lookup()
116 cnp->cn_flags &= ~PDIRUNLOCK; /* XXX why this ?? */ in msdosfs_lookup()
117 flags = cnp->cn_flags; in msdosfs_lookup()
120 printf("msdosfs_lookup(): looking for %s\n", cnp->cn_nameptr); in msdosfs_lookup()
137 if ((error = VOP_ACCESS(vdp, VEXEC, cnp->cn_cred, cnp->cn_proc)) != 0) in msdosfs_lookup()
147 if ((error = cache_lookup(vdp, vpp, cnp)) >= 0) in msdosfs_lookup()
155 if ((vdp->v_flag & VROOT) && cnp->cn_nameptr[0] == '.' && in msdosfs_lookup()
156 (cnp->cn_namelen == 1 || in msdosfs_lookup()
157 (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.'))) { in msdosfs_lookup()
[all …]
Dmsdosfs_fat.c135 pcbmap(struct denode *dep, uint32_t findcn, daddr_t *bnp, uint32_t *cnp, in pcbmap() argument
156 if (bnp == NULL && cnp == NULL && sp == NULL) in pcbmap()
169 if (cnp) in pcbmap()
170 *cnp = de_bn2cn(pmp, pmp->pm_rootdirsize); in pcbmap()
175 if (cnp) in pcbmap()
176 *cnp = MSDOSFSROOT; in pcbmap()
182 if (cnp) in pcbmap()
183 *cnp = 0; in pcbmap()
256 if (cnp) in pcbmap()
257 *cnp = cn; in pcbmap()
[all …]
Dmsdosfs_vnops.c115 struct componentname *cnp = ap->a_cnp; in msdosfs_create() local
123 printf("msdosfs_create(cnp %p, vap %p\n", cnp, ap->a_vap); in msdosfs_create()
144 if ((cnp->cn_flags & HASBUF) == 0) in msdosfs_create()
148 if ((error = uniqdosname(pdep, cnp, ndirent.de_Name)) != 0) in msdosfs_create()
161 if ((error = createde(&ndirent, pdep, &dep, cnp)) != 0) in msdosfs_create()
163 if ((cnp->cn_flags & SAVESTART) == 0) in msdosfs_create()
164 pool_put(&namei_pool, cnp->cn_pnbuf); in msdosfs_create()
170 pool_put(&namei_pool, cnp->cn_pnbuf); in msdosfs_create()
1229 struct componentname *cnp = ap->a_cnp; in msdosfs_mkdir() local
1307 if ((cnp->cn_flags & HASBUF) == 0) in msdosfs_mkdir()
[all …]
/openbsd/src/sys/isofs/cd9660/
Dcd9660_lookup.c120 struct componentname *cnp = ap->a_cnp; in cd9660_lookup() local
121 struct ucred *cred = cnp->cn_cred; in cd9660_lookup()
123 int nameiop = cnp->cn_nameiop; in cd9660_lookup()
125 cnp->cn_flags &= ~PDIRUNLOCK; in cd9660_lookup()
126 flags = cnp->cn_flags; in cd9660_lookup()
138 if ((error = VOP_ACCESS(vdp, VEXEC, cred, cnp->cn_proc)) != 0) in cd9660_lookup()
142 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) in cd9660_lookup()
152 if ((error = cache_lookup(vdp, vpp, cnp)) >= 0) in cd9660_lookup()
155 len = cnp->cn_namelen; in cd9660_lookup()
156 name = cnp->cn_nameptr; in cd9660_lookup()
[all …]
/openbsd/src/sys/ufs/ufs/
Dufs_lookup.c125 struct componentname *cnp = ap->a_cnp; in ufs_lookup() local
126 struct ucred *cred = cnp->cn_cred; in ufs_lookup()
128 int nameiop = cnp->cn_nameiop; in ufs_lookup()
130 cnp->cn_flags &= ~PDIRUNLOCK; in ufs_lookup()
131 flags = cnp->cn_flags; in ufs_lookup()
146 if ((error = VOP_ACCESS(vdp, VEXEC, cred, cnp->cn_proc)) != 0) in ufs_lookup()
150 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) in ufs_lookup()
160 if ((error = cache_lookup(vdp, vpp, cnp)) >= 0) in ufs_lookup()
175 cnp->cn_namelen + 3) &~ 3; in ufs_lookup()
214 switch (ufsdirhash_lookup(dp, cnp->cn_nameptr, cnp->cn_namelen, in ufs_lookup()
[all …]
Dufs_vnops.c610 struct componentname *cnp = ap->a_cnp; in ufs_link() local
616 if ((cnp->cn_flags & HASBUF) == 0) in ufs_link()
620 VOP_ABORTOP(dvp, cnp); in ufs_link()
625 VOP_ABORTOP(dvp, cnp); in ufs_link()
630 VOP_ABORTOP(dvp, cnp); in ufs_link()
638 ufs_makedirentry(ip, cnp, &newdir); in ufs_link()
639 error = ufs_direnter(dvp, vp, &newdir, cnp, NULL); in ufs_link()
646 pool_put(&namei_pool, cnp->cn_pnbuf); in ufs_link()
1088 struct componentname *cnp = ap->a_cnp; in ufs_mkdir() local
1097 if ((cnp->cn_flags & HASBUF) == 0) in ufs_mkdir()
[all …]
/openbsd/src/sys/ufs/ext2fs/
Dext2fs_lookup.c252 struct componentname *cnp = ap->a_cnp; in ext2fs_lookup() local
253 struct ucred *cred = cnp->cn_cred; in ext2fs_lookup()
254 int flags = cnp->cn_flags; in ext2fs_lookup()
255 int nameiop = cnp->cn_nameiop; in ext2fs_lookup()
273 if ((error = VOP_ACCESS(vdp, VEXEC, cred, cnp->cn_proc)) != 0) in ext2fs_lookup()
277 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) in ext2fs_lookup()
287 if ((error = cache_lookup(vdp, vpp, cnp)) >= 0) in ext2fs_lookup()
298 ss.slotneeded = EXT2FS_DIRSIZ(cnp->cn_namelen); in ext2fs_lookup()
353 cnp, &entryoffsetinblock, &prevoff, &enduseful, &ss); in ext2fs_lookup()
397 if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0) in ext2fs_lookup()
[all …]
Dext2fs_vnops.c425 struct componentname *cnp = ap->a_cnp; in ext2fs_link() local
430 if ((cnp->cn_flags & HASBUF) == 0) in ext2fs_link()
434 VOP_ABORTOP(dvp, cnp); in ext2fs_link()
439 VOP_ABORTOP(dvp, cnp); in ext2fs_link()
444 VOP_ABORTOP(dvp, cnp); in ext2fs_link()
452 error = ext2fs_direnter(ip, dvp, cnp); in ext2fs_link()
457 pool_put(&namei_pool, cnp->cn_pnbuf); in ext2fs_link()
874 struct componentname *cnp = ap->a_cnp; in ext2fs_mkdir() local
882 if ((cnp->cn_flags & HASBUF) == 0) in ext2fs_mkdir()
897 if ((error = ext2fs_inode_alloc(dp, dmode, cnp->cn_cred, &tvp)) != 0) in ext2fs_mkdir()
[all …]
Dext2fs_extern.h135 struct componentname *cnp);
/openbsd/src/sys/nfs/
Dnfs_vnops.c256 nfs_cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) in nfs_cache_enter() argument
269 cache_enter(dvp, vp, cnp); in nfs_cache_enter()
804 struct componentname *cnp = ap->a_cnp; in nfs_lookup() local
819 cnp->cn_flags &= ~PDIRUNLOCK; in nfs_lookup()
820 flags = cnp->cn_flags; in nfs_lookup()
825 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) in nfs_lookup()
843 if ((error = cache_lookup(dvp, vpp, cnp)) >= 0) { in nfs_lookup()
852 if (cnp->cn_flags & PDIRUNLOCK) { in nfs_lookup()
858 cnp->cn_flags &= ~PDIRUNLOCK; in nfs_lookup()
861 err2 = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, cnp->cn_proc); in nfs_lookup()
[all …]
Dnfs_srvsubs.c81 struct componentname *cnp = &ndp->ni_cnd; in nfs_namei() local
84 cnp->cn_pnbuf = pool_get(&namei_pool, PR_WAITOK); in nfs_namei()
90 tocp = cnp->cn_pnbuf; in nfs_namei()
120 ndp->ni_pathlen = tocp - cnp->cn_pnbuf; in nfs_namei()
121 cnp->cn_nameptr = cnp->cn_pnbuf; in nfs_namei()
138 cnp->cn_flags |= (NOCROSSMOUNT | RDONLY); in nfs_namei()
140 cnp->cn_flags |= NOCROSSMOUNT; in nfs_namei()
145 cnp->cn_proc = p; in nfs_namei()
152 if (cnp->cn_flags & ISSYMLINK) { in nfs_namei()
153 if ((cnp->cn_flags & LOCKPARENT) && ndp->ni_pathlen == 1) in nfs_namei()
[all …]
/openbsd/src/sys/ntfs/
Dntfs_vnops.c535 struct componentname *cnp = ap->a_cnp; in ntfs_lookup() local
536 struct ucred *cred = cnp->cn_cred; in ntfs_lookup()
538 int lockparent = cnp->cn_flags & LOCKPARENT; in ntfs_lookup()
540 int wantparent = cnp->cn_flags & (LOCKPARENT|WANTPARENT); in ntfs_lookup()
543 (unsigned int)cnp->cn_namelen, cnp->cn_nameptr, cnp->cn_namelen, in ntfs_lookup()
546 error = VOP_ACCESS(dvp, VEXEC, cred, cnp->cn_proc); in ntfs_lookup()
550 if ((cnp->cn_flags & ISLASTCN) && in ntfs_lookup()
551 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) in ntfs_lookup()
562 if ((error = cache_lookup(ap->a_dvp, ap->a_vpp, cnp)) >= 0) in ntfs_lookup()
565 if(cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { in ntfs_lookup()
[all …]
Dntfs_subr.c826 struct componentname *cnp, struct vnode **vpp) in ntfs_ntlookupfile() argument
861 fname = cnp->cn_nameptr; in ntfs_ntlookupfile()
864 for (fnamelen = 0; fnamelen < cnp->cn_namelen; fnamelen++) in ntfs_ntlookupfile()
867 anamelen = cnp->cn_namelen - fnamelen - 1; in ntfs_ntlookupfile()
1068 if ((cnp->cn_flags & ISLASTCN) && in ntfs_ntlookupfile()
1069 (cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME)) in ntfs_ntlookupfile()
/openbsd/src/sys/tmpfs/
Dtmpfs_vnops.c115 struct componentname *cnp = ap->a_cnp; in tmpfs_lookup() local
116 struct ucred *cred = cnp->cn_cred; in tmpfs_lookup()
117 const int lastcn = (cnp->cn_flags & ISLASTCN) != 0; in tmpfs_lookup()
118 const int lockparent = (cnp->cn_flags & LOCKPARENT) != 0; in tmpfs_lookup()
127 cnp->cn_flags &= ~PDIRUNLOCK; in tmpfs_lookup()
141 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) { in tmpfs_lookup()
150 cachefound = cache_lookup(dvp, vpp, cnp); in tmpfs_lookup()
156 if (cnp->cn_flags & ISDOTDOT) { in tmpfs_lookup()
163 if (cnp->cn_nameiop == RENAME) { in tmpfs_lookup()
167 if (cnp->cn_nameiop == DELETE) { in tmpfs_lookup()
[all …]
Dtmpfs_subr.c370 struct componentname *cnp, char *target) in tmpfs_alloc_file() argument
401 error = tmpfs_alloc_node(tmp, vap->va_type, cnp->cn_cred->cr_uid, in tmpfs_alloc_file()
407 error = tmpfs_alloc_dirent(tmp, cnp->cn_nameptr, cnp->cn_namelen, &de); in tmpfs_alloc_file()
426 if (error == 0 && (cnp->cn_flags & SAVESTART) == 0) in tmpfs_alloc_file()
427 pool_put(&namei_pool, cnp->cn_pnbuf); in tmpfs_alloc_file()
582 tmpfs_dir_lookup(tmpfs_node_t *node, struct componentname *cnp) in tmpfs_dir_lookup() argument
584 const char *name = cnp->cn_nameptr; in tmpfs_dir_lookup()
585 const uint16_t nlen = cnp->cn_namelen; in tmpfs_dir_lookup()
/openbsd/src/usr.sbin/makefs/msdos/
Dmsdosfs_lookup.c70 createde(struct denode *dep, struct denode *ddep, struct denode **depp, struct componentname *cnp) in createde() argument
84 dep, ddep, depp, cnp); in createde()
135 u_char *un = cnp->cn_nameptr; in createde()
136 int unlen = cnp->cn_namelen; in createde()
305 uniqdosname(struct denode *dep, struct componentname *cnp, u_char *cp) in uniqdosname() argument
320 if (!unix2dosfn(cnp->cn_nameptr, cp, cnp->cn_namelen, gen)) in uniqdosname()
Dmsdosfs_vnops.c118 msdosfs_findslot(struct denode *dp, struct componentname *cnp) in msdosfs_findslot() argument
139 switch (unix2dosfn(cnp->cn_nameptr, dosfilename, cnp->cn_namelen, 0)) { in msdosfs_findslot()
145 wincnt = winSlotCnt(cnp->cn_nameptr, cnp->cn_namelen) + 1; in msdosfs_findslot()
149 wincnt = winSlotCnt(cnp->cn_nameptr, cnp->cn_namelen) + 1; in msdosfs_findslot()
230 chksum = winChkName(cnp->cn_nameptr, in msdosfs_findslot()
231 cnp->cn_namelen, in msdosfs_findslot()
Dmsdosfs_fat.c142 pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp, u_long *cnp, int *sp) in pcbmap() argument
166 if (bnp == NULL && cnp == NULL && sp == NULL) in pcbmap()
180 if (cnp) in pcbmap()
181 *cnp = de_bn2cn(pmp, pmp->pm_rootdirsize); in pcbmap()
188 if (cnp) in pcbmap()
189 *cnp = MSDOSFSROOT; in pcbmap()
198 if (cnp) in pcbmap()
199 *cnp = 0; in pcbmap()
287 if (cnp) in pcbmap()
288 *cnp = cn; in pcbmap()
[all …]
/openbsd/src/sys/sys/
Dnamei.h195 struct componentname *cnp);
/openbsd/src/gnu/usr.bin/binutils-2.17/cpu/
Dcris.cpu501 np cnp vnp cvnp znp cznp vznp cvznp