version 1.49, 2007/09/27 21:14:50 |
version 1.50, 2007/09/27 21:44:12 |
Line 453 puffs_makeroot(struct puffs_mount *pmp) |
|
Line 453 puffs_makeroot(struct puffs_mount *pmp) |
|
* not. Locking always might cause us to lock against ourselves |
* not. Locking always might cause us to lock against ourselves |
* in situations where we want the vnode but don't care for the |
* in situations where we want the vnode but don't care for the |
* vnode lock, e.g. file server issued putpages. |
* vnode lock, e.g. file server issued putpages. |
* |
|
* XXX: this has the problem of returning an error even if a |
|
* node does exist |
|
*/ |
*/ |
int |
int |
puffs_cookie2vnode(struct puffs_mount *pmp, void *cookie, int lock, |
puffs_cookie2vnode(struct puffs_mount *pmp, void *cookie, int lock, |
Line 482 puffs_cookie2vnode(struct puffs_mount *p |
|
Line 479 puffs_cookie2vnode(struct puffs_mount *p |
|
|
|
mutex_enter(&pmp->pmp_lock); |
mutex_enter(&pmp->pmp_lock); |
pnode = puffs_cookie2pnode(pmp, cookie); |
pnode = puffs_cookie2pnode(pmp, cookie); |
|
|
if (pnode == NULL) { |
if (pnode == NULL) { |
if (willcreate) { |
if (willcreate) { |
pnc = kmem_alloc(sizeof(struct puffs_newcookie), |
pnc = kmem_alloc(sizeof(struct puffs_newcookie), |
Line 491 puffs_cookie2vnode(struct puffs_mount *p |
|
Line 487 puffs_cookie2vnode(struct puffs_mount *p |
|
LIST_INSERT_HEAD(&pmp->pmp_newcookie, pnc, pnc_entries); |
LIST_INSERT_HEAD(&pmp->pmp_newcookie, pnc, pnc_entries); |
} |
} |
mutex_exit(&pmp->pmp_lock); |
mutex_exit(&pmp->pmp_lock); |
return ENOENT; |
return PUFFS_NOSUCHCOOKIE; |
} |
} |
|
|
vp = pnode->pn_vp; |
vp = pnode->pn_vp; |
simple_lock(&vp->v_interlock); |
simple_lock(&vp->v_interlock); |
mutex_exit(&pmp->pmp_lock); |
mutex_exit(&pmp->pmp_lock); |