Lines Matching defs:unp

91 	struct unionfs_node *unp;
94 unp = VTOUNIONFS(dvp);
100 return (&(unp->un_hashtbl[hash & (unp->un_hashmask)]));
111 struct unionfs_node *unp;
121 LIST_FOREACH(unp, hd, un_hash) {
122 if (!strcmp(unp->un_path, path)) {
123 vp = UNIONFSTOV(unp);
148 struct unionfs_node *unp;
158 LIST_FOREACH(unp, hd, un_hash) {
159 if (!strcmp(unp->un_path, path)) {
160 vp = UNIONFSTOV(unp);
184 unionfs_rem_cached_vnode(struct unionfs_node *unp, struct vnode *dvp)
186 KASSERT((unp != NULL), ("unionfs_rem_cached_vnode: null node"));
189 KASSERT((unp->un_hash.le_prev != NULL),
193 LIST_REMOVE(unp, un_hash);
194 unp->un_hash.le_next = NULL;
195 unp->un_hash.le_prev = NULL;
213 struct unionfs_node *unp;
250 unp = malloc(sizeof(struct unionfs_node),
255 free(unp, M_UNIONFSNODE);
260 free(unp, M_UNIONFSNODE);
271 unp->un_hashtbl = hashinit(NUNIONFSNODECACHE, M_UNIONFSHASH,
272 &(unp->un_hashmask));
274 unp->un_vnode = vp;
275 unp->un_uppervp = uppervp;
276 unp->un_lowervp = lowervp;
277 unp->un_dvp = dvp;
284 unp->un_path = (char *)
286 bcopy(cnp->cn_nameptr, unp->un_path, cnp->cn_namelen);
287 unp->un_path[cnp->cn_namelen] = '\0';
290 vp->v_data = unp;
297 *vpp = unionfs_ins_cached_vnode(unp, dvp, path);
306 unp->un_uppervp = NULLVP;
307 unp->un_lowervp = NULLVP;
308 unp->un_dvp = NULLVP;
329 struct unionfs_node *unp, *unp_t1, *unp_t2;
341 unp = VTOUNIONFS(vp);
342 lvp = unp->un_lowervp;
343 uvp = unp->un_uppervp;
344 dvp = unp->un_dvp;
345 unp->un_lowervp = unp->un_uppervp = NULLVP;
356 if (dvp != NULLVP && unp->un_hash.le_prev != NULL)
357 unionfs_rem_cached_vnode(unp, dvp);
368 unp->un_dvp = NULLVP;
370 if (unp->un_path != NULL) {
371 free(unp->un_path, M_UNIONFSPATH);
372 unp->un_path = NULL;
375 if (unp->un_hashtbl != NULL) {
376 for (count = 0; count <= unp->un_hashmask; count++) {
377 hd = unp->un_hashtbl + count;
384 hashdestroy(unp->un_hashtbl, M_UNIONFSHASH, unp->un_hashmask);
387 LIST_FOREACH_SAFE(unsp, &(unp->un_unshead), uns_list, unsp_tmp) {
391 free(unp, M_UNIONFSNODE);
399 unionfs_get_node_status(struct unionfs_node *unp, struct thread *td,
406 ASSERT_VOP_ELOCKED(UNIONFSTOV(unp), "unionfs_get_node_status");
408 LIST_FOREACH(unsp, &(unp->un_unshead), uns_list) {
420 LIST_INSERT_HEAD(&(unp->un_unshead), unsp, uns_list);
430 unionfs_tryrem_node_status(struct unionfs_node *unp,
434 ASSERT_VOP_ELOCKED(UNIONFSTOV(unp), "unionfs_get_node_status");
697 unionfs_node_update(struct unionfs_node *unp, struct vnode *uvp,
705 vp = UNIONFSTOV(unp);
706 lvp = unp->un_lowervp;
708 dvp = unp->un_dvp;
714 unp->un_uppervp = uvp;
724 if (unp->un_path != NULL && dvp != NULLVP && vp->v_type == VDIR) {
728 hd = unionfs_get_hashhead(dvp, unp->un_path);
729 LIST_REMOVE(unp, un_hash);
730 LIST_INSERT_HEAD(hd, unp, un_hash);
740 * If no error returned, unp will be updated.
744 struct unionfs_node *unp, struct componentname *cnp,
758 if (unp->un_uppervp != NULLVP)
761 lvp = unp->un_lowervp;
803 unionfs_node_update(unp, uvp, td);
882 * unp is never updated.
886 struct unionfs_node *unp, struct vattr *uvap,
898 ump = MOUNTTOUNIONFSMOUNT(UNIONFSTOV(unp)->v_mount);
900 lvp = unp->un_lowervp;
909 if (unp->un_path == NULL)
912 cn.cn_namelen = strlen(unp->un_path);
914 bcopy(unp->un_path, cn.cn_pnbuf, cn.cn_namelen + 1);
1033 * If no error returned, unp will be updated.
1036 unionfs_copyfile(struct unionfs_node *unp, int docopy, struct ucred *cred,
1046 lvp = unp->un_lowervp;
1049 if ((UNIONFSTOV(unp)->v_mount->mnt_flag & MNT_RDONLY))
1051 if (unp->un_dvp == NULLVP)
1053 if (unp->un_uppervp != NULLVP)
1055 udvp = VTOUNIONFS(unp->un_dvp)->un_uppervp;
1067 error = unionfs_vn_create_on_upper(&uvp, udvp, unp, &uva, td);
1093 unionfs_node_update(unp, uvp, td);
1232 struct unionfs_node *unp;
1234 unp = VTOUNIONFS(vp);
1246 return (unp->un_uppervp);
1252 struct unionfs_node *unp;
1254 unp = VTOUNIONFS(vp);
1266 return (unp->un_lowervp);