rw_init(&avc->rwlock, "vcache rwlock", RW_DEFAULT, NULL);
+#ifndef AFS_SUN511_ENV
/* This is required if the kaio (kernel aynchronous io)
** module is installed. Inside the kernel, the function
** check_vp( common/os/aio.c) checks to see if the kernel has
** for the time being, we fill up the v_data field with the
** vnode pointer itself. */
avc->v.v_data = (char *)avc;
+#endif /* !AFS_SUN511_ENV */
}
void
-osi_AttachVnode(struct vcache *avc, int seq) { }
+osi_AttachVnode(struct vcache *avc, int seq)
+{
+#ifdef AFS_SUN511_ENV
+ struct vnode *vp;
+
+ osi_Assert(AFSTOV(avc) == NULL);
+
+ vp = vn_alloc(KM_SLEEP);
+ osi_Assert(vp != NULL);
+
+ vp->v_data = avc;
+ AFSTOV(avc) = vp;
+#endif
+}
void
osi_PostPopulateVCache(struct vcache *avc) {
attrs->va_uid = fakedir ? 0 : avc->f.m.Owner;
attrs->va_gid = fakedir ? 0 : avc->f.m.Group; /* yeah! */
#if defined(AFS_SUN5_ENV)
- attrs->va_fsid = avc->v.v_vfsp->vfs_fsid.val[0];
+ attrs->va_fsid = AFSTOV(avc)->v_vfsp->vfs_fsid.val[0];
#elif defined(AFS_DARWIN80_ENV)
VATTR_RETURN(attrs, va_fsid, vfs_statfs(vnode_mount(AFSTOV(avc)))->f_fsid.val[0]);
#elif defined(AFS_DARWIN_ENV)
#define CPSIZE 2
#if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV)
#define vrefCount v->v_usecount
+#elif defined(AFS_SUN511_ENV)
+# define vrefCount v->v_count
#else
#define vrefCount v.v_count
#endif /* AFS_XBSD_ENV */
};
#define VTOAFS(v) ((((struct nbvdata *)((v)->v_data)))->afsvc)
#define AFSTOV(vc) ((vc)->v)
-#elif defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV) || (defined(AFS_LINUX22_ENV) && !defined(STRUCT_SUPER_OPERATIONS_HAS_ALLOC_INODE))
+#elif defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_SUN511_ENV) || (defined(AFS_LINUX22_ENV) && !defined(STRUCT_SUPER_OPERATIONS_HAS_ALLOC_INODE))
#define VTOAFS(v) ((struct vcache *)(v)->v_data)
#define AFSTOV(vc) ((vc)->v)
#else
* !(avc->nextfree) && !avc->vlruq.next => (FreeVCList == avc->nextfree)
*/
struct vcache {
-#if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV) || (defined(AFS_LINUX22_ENV) && !defined(STRUCT_SUPER_OPERATIONS_HAS_ALLOC_INODE))
+#if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_SUN511_ENV) || (defined(AFS_LINUX22_ENV) && !defined(STRUCT_SUPER_OPERATIONS_HAS_ALLOC_INODE))
struct vnode *v;
#else
struct vnode v; /* Has reference count in v.v_count */
* Darwin, all of the BSDs, and Linux have their own
*/
#if !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_LINUX20_ENV)
-# define vType(vc) (vc)->v.v_type
-# define vSetType(vc,type) (vc)->v.v_type = (type)
-# define vSetVfsp(vc,vfsp) (vc)->v.v_vfsp = (vfsp)
+# define vType(vc) AFSTOV(vc)->v_type
+# define vSetType(vc,type) AFSTOV(vc)->v_type = (type)
+# define vSetVfsp(vc,vfsp) AFSTOV(vc)->v_vfsp = (vfsp)
extern struct vnodeops *afs_ops;
# define IsAfsVnode(v) ((v)->v_op == afs_ops)
# define SetAfsVnode(v) (v)->v_op = afs_ops
#if defined (AFS_SUN5_ENV)
if (avc->f.states & CMAPPED) {
struct page *pg;
- for (pg = avc->v.v_s.v_Pages; pg; pg = pg->p_vpnext) {
+ for (pg = AFSTOV(avc)->v_s.v_Pages; pg; pg = pg->p_vpnext) {
if (pg->p_mod) {
return 1;
}
AFSTOV(avc) = NULL; /* also drop the ptr to vnode */
}
#endif
-#ifdef AFS_SUN510_ENV
+
+#ifdef AFS_SUN511_ENV
+ if (avc->v) {
+ vn_free(avc->v);
+ avc->v = NULL;
+ }
+#elif defined(AFS_SUN510_ENV)
/* As we use private vnodes, cleanup is up to us */
vn_reinit(AFSTOV(avc));
#endif