vncache.c revision b819cea2f73f98c5662230cc9affc8cc84f77fcf
/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/
#include <sys/pathname.h>
#include <sys/sysmacros.h>
#include <fcntl.h>
#include <unistd.h>
#include "vncache.h"
/*
* You can dump this AVL tree with mdb, i.e.
* vncache_avl ::walk avl |::print -s1 vnode_t
*/
/*
* Vnode cache.
*/
/* ARGSUSED */
static int
{
return (0);
}
/* ARGSUSED */
static void
{
}
/*
* Used by file systems when fs-specific nodes (e.g., ufs inodes) are
* cached by the file system and vnodes remain associated.
*/
void
{
}
}
/*
* Used to reset the vnode fields including those that are directly accessible
* as well as those which require an accessor function.
*
* Does not initialize:
* synchronization objects: v_lock, v_vsd_lock, v_nbllock, v_cv
* v_data (since FS-nodes and vnodes point to each other and should
* be updated simultaneously)
* v_op (in case someone needs to make a VOP call on this object)
*/
void
{
vn_recycle(vp);
}
vnode_t *
{
}
return (vp);
}
void
{
/*
* Some file systems call vn_free() with v_count of zero,
* some with v_count of 1. In any case, the value should
* never be anything else.
*/
}
}
int
{
return (-1);
return (+1);
return (-1);
return (+1);
return (0);
}
vnode_t *
{
return (vp);
}
vnode_t *
{
char *vpath;
int len;
/*
* Fill in v_path
* Note: fsop_root() calls with dvp=NULL
*/
} else {
/* add to length for parent path + "/" */
}
else
/* If we lost the race, free new_vp */
return (old_vp);
}
return (new_vp);
}
/*
* Called after a successful rename to update v_path
*/
void
{
char *vpath;
char *ovpath;
int len;
/* add to length for parent path + "/" */
}
/*
* Last reference to this vnode is (possibly) going away.
* This is normally called by vn_rele() when v_count==1.
* Note that due to lock order concerns, we have to take
* the vncache_lock (for the avl tree) and then recheck
* v_count, which might have gained a ref during the time
* we did not hold vp->v_lock.
*/
void
{
/* This is (still) the last ref. */
}
if (count <= 1) {
}
}
#pragma init(vncache_init)
int
vncache_init(void)
{
NULL, 0);
sizeof (vnode_t),
return (0);
}
#pragma fini(vncache_fini)
void
vncache_fini(void)
{
}