error = fcache_get(&e, res, ce); if (error) { cred_free(ce); return error; } error = fcache_get_attr (e, ce); if (error) { ReleaseWriteLock (&e->lock); cred_free(ce); return error; } if (e->status.FileType != TYPE_LINK) {  ReleaseWriteLock (&e->lock); cred_free(ce); return EINVAL; } error = fcache_get_data (e, ce); if (error) { ReleaseWriteLock (&e->lock); cred_free(ce); return error; } symlink_fd = fcache_open_file (e, O_RDONLY, 0); if (symlink_fd < 0) { ReleaseWriteLock (&e->lock); cred_free(ce); return errno; } error = fbuf_create (&the_fbuf, symlink_fd, e->status.Length, FBUF_READ); if (error) { ReleaseWriteLock (&e->lock); cred_free(ce); return error; } buf = (char *)(the_fbuf.buf); if (buf[0] != '#' && buf[0] != '%') {  ReleaseWriteLock (&e->lock); fbuf_end (&the_fbuf); cred_free (ce); return EINVAL; }
vioc_afs_stat_mt_pt(int fd, struct xfs_message_pioctl *h, u_int size){    VenusFid fid;    VenusFid res;    CredCacheEntry *ce;    FCacheEntry *e;    fbuf the_fbuf;    char *buf;    int error;    int symlink_fd;    if (!h->handle.a && !h->handle.b && !h->handle.c && !h->handle.d)	return EINVAL;    fid.Cell = h->handle.a;    fid.fid.Volume = h->handle.b;    fid.fid.Vnode = h->handle.c;    fid.fid.Unique = h->handle.d;    ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);    assert (ce != NULL);    error = adir_lookup(fid, h->msg, &res, ce);    if (error) {	cred_free(ce);	return error;    }    error = fcache_get(&e, res, ce);    if (error) {	cred_free(ce);	return error;    }    error = fcache_get_attr (e, ce);    if (error) {	ReleaseWriteLock (&e->lock);	cred_free(ce);	return error;    }    if (e->status.FileType != TYPE_LINK) { /* Is not a mount point */	ReleaseWriteLock (&e->lock);	cred_free(ce);	return EINVAL;    }    error = fcache_get_data (e, ce);    if (error) {	ReleaseWriteLock (&e->lock);	cred_free(ce);	return error;    }    symlink_fd = fcache_open_file (e, O_RDONLY, 0);    if (symlink_fd < 0) {	ReleaseWriteLock (&e->lock);	cred_free(ce);	return errno;    }    error = fbuf_create (&the_fbuf, symlink_fd, e->status.Length, FBUF_READ);    if (error) {	ReleaseWriteLock (&e->lock);	cred_free(ce);	return error;    }    buf = (char *)(the_fbuf.buf);    if (buf[0] != '#' && buf[0] != '%') { /* Is not a mount point */	ReleaseWriteLock (&e->lock);	fbuf_end (&the_fbuf);	cred_free (ce);	return EINVAL;    }    xfs_send_message_wakeup_data (fd, h->header.sequence_num, error,				  the_fbuf.buf, the_fbuf.len - 1);    ReleaseWriteLock (&e->lock);    fbuf_end (&the_fbuf);    cred_free (ce);    return 0;}