Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/smbfs/smbfs_node.c
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | smbfs_node_alloc(struct mount *mp, struct vnode *dvp, const char *dirnm, | ||||
} | } | ||||
error = vfs_hash_get(mp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, td, | error = vfs_hash_get(mp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, td, | ||||
vpp, smbfs_vnode_cmp, &sc); | vpp, smbfs_vnode_cmp, &sc); | ||||
if (error) | if (error) | ||||
return (error); | return (error); | ||||
if (*vpp) { | if (*vpp) { | ||||
np = VTOSMB(*vpp); | np = VTOSMB(*vpp); | ||||
/* Force cached attributes to be refreshed if stale. */ | /* Force cached attributes to be refreshed if stale. */ | ||||
(void)VOP_GETATTR(*vpp, &vattr, td->td_ucred); | (void)VOP_GETATTR(*vpp, 0, &vattr, td->td_ucred); | ||||
/* | /* | ||||
* If the file type on the server is inconsistent with | * If the file type on the server is inconsistent with | ||||
* what it was when we created the vnode, kill the | * what it was when we created the vnode, kill the | ||||
* bogus vnode now and fall through to the code below | * bogus vnode now and fall through to the code below | ||||
* to create a new one with the right type. | * to create a new one with the right type. | ||||
*/ | */ | ||||
if (((*vpp)->v_type == VDIR && | if (((*vpp)->v_type == VDIR && | ||||
(np->n_dosattr & SMB_FA_DIR) == 0) || | (np->n_dosattr & SMB_FA_DIR) == 0) || | ||||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | smbfs_inactive(struct vop_inactive_args *ap) | ||||
struct vattr va; | struct vattr va; | ||||
SMBVDEBUG("%s: %d\n", VTOSMB(vp)->n_name, vrefcnt(vp)); | SMBVDEBUG("%s: %d\n", VTOSMB(vp)->n_name, vrefcnt(vp)); | ||||
if ((np->n_flag & NOPEN) != 0) { | if ((np->n_flag & NOPEN) != 0) { | ||||
scred = smbfs_malloc_scred(); | scred = smbfs_malloc_scred(); | ||||
smb_makescred(scred, td, cred); | smb_makescred(scred, td, cred); | ||||
smbfs_vinvalbuf(vp, td); | smbfs_vinvalbuf(vp, td); | ||||
if (vp->v_type == VREG) { | if (vp->v_type == VREG) { | ||||
VOP_GETATTR(vp, &va, cred); | VOP_GETATTR(vp, 0, &va, cred); | ||||
smbfs_smb_close(np->n_mount->sm_share, np->n_fid, | smbfs_smb_close(np->n_mount->sm_share, np->n_fid, | ||||
&np->n_mtime, scred); | &np->n_mtime, scred); | ||||
} else if (vp->v_type == VDIR) { | } else if (vp->v_type == VDIR) { | ||||
if (np->n_dirseq != NULL) { | if (np->n_dirseq != NULL) { | ||||
smbfs_findclose(np->n_dirseq, scred); | smbfs_findclose(np->n_dirseq, scred); | ||||
np->n_dirseq = NULL; | np->n_dirseq = NULL; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |