/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <nfs/nfs4_clnt.h>
struct sv_stats
{
int sv_activate;
int sv_find;
int sv_match;
int sv_inactive;
int sv_exchange;
} sv_stats;
/*
* Map a vnode back to the shadow which points to it. This is
* hard now that the vnode is not embedded in the shadow vnode.
*/
svnode_t *
{
/* Check to see if it's the master shadow vnode first. */
break;
}
return (svp_found);
}
/*
* sv_activate - find and activate the shadow vnode for the given
* directory file handle and name. May replace *vpp with a held reference
* to a different vnode, in which case the reference to the previous one is
* released.
*/
void
{
/*
* If make_rnode made a new rnode (ie. newnode != 0), then
* the master vnode was (partially) initialized there. If
* it was not a new rnode, then it returns the master vnode.
* vnode.
*/
if (newnode) {
/*
* Initialize the shadow vnode.
*/
} else {
/*
* No shadow vnodes (i.e. hard links) in this branch.
* If sv_activate() is called for an existing rnode
* (newnode isn't set) but with a new name, the sv_name
* needs to be updated and the old sv_name released.
*
* fname mismatches can occur due to server side renames,
* here is a chance to update the fname in case there is
* a mismatch. Since this is not a newnode we hold r_svlock
* to protect sv_name.
*/
/*
* Call fn_rele() to release the hold for the
* previous shadow vnode reference. Don't
* release the hold on the fname pointed to by
* namepp as we have new reference to it from
* this shadow vnode.
*/
} else {
}
}
}
/*
* sv_find - find the shadow vnode for the desired name and directory
* file handle. If one does not exist, then create it. Returns the shadow
* vnode. The caller is responsible for freeing the reference.
* Consumes the name reference and nulls it out.
*
* Side effects: increments the reference count on the master vnode if the
* shadow vnode had to be created.
*/
vnode_t *
{
/*
* At this point, all we know is that we have an rnode whose
* file handle matches the file handle of the object we want.
* We have to verify that component name and the directory
* match. If so, then we are done.
*
* Note: mvp is always the master vnode.
*/
return (mvp);
}
/*
* No match, search through the shadow vnode list.
* Hold the r_svlock to prevent changes.
*/
/*
* A matching shadow vnode is found, bump the
* reference count on it and return it.
*/
return (vp);
}
/*
* No match searching the list, go allocate a new shadow
*/
/* Initialize the vnode */
/* Initialize the shadow vnode */
return (vp);
}
/*
* sv_match - check to see if the shadow vnode matches the desired
* name and directory file handle. Returns non-zero if there's a match,
* zero if it's not a match.
*/
static int
{
}
/*
* sv_inactive - deactivate a shadow vnode. sv_inactive is called
* from nfs4_inactive. Whenever a shadow vnode is de-activated,
* sv_inactive cleans up the mess and releases the reference on the
* master vnode.
*/
void
{
/*
* Remove the shadow vnode from the list. The serialization
* is provided by the svnode list lock. This could be done
* with the r_statelock, but that would require more locking
* in the activation path.
*/
/* check if someone slipped in while locks were dropped */
return;
}
vn_invalid(vp);
/* release the reference held by this shadow on the master */
}
/*
* sv_uninit - free any data structures allocated by the shadow vnode.
*/
void
{
}
/*
* sv_exchange - exchange a shadow vnode for the master vnode. This
* occurs during nfs4_open, since only the master vnode owns the files
* resources (eg. pages).
*/
void
{
/* RTOV always returns the master vnode */
}
int
nfs4_shadow_init(void)
{
/*
* Allocate shadow vnode cache
*/
return (0);
}
int
nfs4_shadow_fini(void)
{
return (0);
}