Windows: cm_SymLink export created cm_scache_t

Permit the caller to request the cm_scache_t that represents
the created symlink or mount point object.

Change-Id: Ida8fdc4214844dad009362877f125aa5d20120a1
Reviewed-on: http://gerrit.openafs.org/5355
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2011-09-02 13:54:01 -04:00 committed by Jeffrey Altman
parent 537592f6bb
commit 9b0cb61438
3 changed files with 14 additions and 5 deletions

View File

@ -2058,7 +2058,7 @@ cm_IoctlCreateMountPoint(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_scac
tattr.unixModeBits = 0644;
tattr.clientModTime = time(NULL);
code = cm_SymLink(dscp, leaf, mpInfo, 0, &tattr, userp, reqp);
code = cm_SymLink(dscp, leaf, mpInfo, 0, &tattr, userp, reqp, NULL);
}
if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH))
@ -2129,7 +2129,7 @@ cm_IoctlSymlink(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_scache_t *dsc
tattr.mask = CM_ATTRMASK_UNIXMODEBITS;
tattr.unixModeBits = 0755;
code = cm_SymLink(dscp, leaf, cp, 0, &tattr, userp, reqp);
code = cm_SymLink(dscp, leaf, cp, 0, &tattr, userp, reqp, NULL);
}
if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH))

View File

@ -3195,7 +3195,7 @@ long cm_Link(cm_scache_t *dscp, clientchar_t *cnamep, cm_scache_t *sscp, long fl
}
long cm_SymLink(cm_scache_t *dscp, clientchar_t *cnamep, fschar_t *contentsp, long flags,
cm_attr_t *attrp, cm_user_t *userp, cm_req_t *reqp)
cm_attr_t *attrp, cm_user_t *userp, cm_req_t *reqp, cm_scache_t **scpp)
{
cm_conn_t *connp;
long code;
@ -3211,6 +3211,9 @@ long cm_SymLink(cm_scache_t *dscp, clientchar_t *cnamep, fschar_t *contentsp, lo
cm_dirOp_t dirop;
fschar_t *fnamep = NULL;
if (scpp)
*scpp = NULL;
/* Check for RO volume */
if (dscp->flags & CM_SCACHEFLAG_RO)
return CM_ERROR_READONLY;
@ -3299,7 +3302,12 @@ long cm_SymLink(cm_scache_t *dscp, clientchar_t *cnamep, fschar_t *contentsp, lo
userp, reqp, 0);
}
lock_ReleaseWrite(&scp->rw);
cm_ReleaseSCache(scp);
if (scpp) {
*scpp = scp;
} else {
cm_ReleaseSCache(scp);
}
}
}

View File

@ -142,7 +142,8 @@ extern long cm_Link(cm_scache_t *dscp, clientchar_t *namep, cm_scache_t *sscp,
long flags, cm_user_t *userp, cm_req_t *reqp);
extern long cm_SymLink(cm_scache_t *dscp, clientchar_t *namep, fschar_t *contentsp,
long flags, cm_attr_t *attrp, cm_user_t *userp, cm_req_t *reqp);
long flags, cm_attr_t *attrp, cm_user_t *userp, cm_req_t *reqp,
cm_scache_t **scpp);
extern long cm_AssembleLink(cm_scache_t *linkScp, fschar_t *pathSuffixp,
cm_scache_t **newRootScpp, cm_space_t **newSpaceBufferp,