Newer updates to Solaris 11 have been including several changes to the
vnode struct. Since we embed a vnode in our struct vcache, our kernel
module must be recompiled for any such change in order for the openafs
client to work at all.
To avoid the need for this, switch Solaris to using a non-embedded
vnode in our struct vcache. Follow a similar technique as is used in
DARWIN and XBSD, where we allocate a vnode in osi_AttachVnode, and
free it in afs_FlushVCache.
Reviewed-on: https://gerrit.openafs.org/12696
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
2aafe7df403e6a848185d15495139c07bced2758)
Change-Id: I2f5b3e2b2b908ea9815fd7735a1abed511cec9cb
Reviewed-on: https://gerrit.openafs.org/13528
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
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