[OpenAFS-devel] Novice query about conversion of "struct vcache" to "struct vnode"

Amit Dang forumdang@gmail.com
Mon, 30 Oct 2006 16:57:56 +0530


I know that a very novice question but ......

I am new to openAFS. My prime objective was to get some idea about
DNLC behaviour on AIX (jfs). But couldn't find any references about
that so thought of reading openAFS source code.
My confusion is related to typecasting of "struct vnode **" to "struct
vcache **".
In file "openafs-1.4.2/src/afs/AIX/osi_vnodeops.c"
"afs_gn_open" calls
       |_ afs_open ("struct vnode **" is typecasted to "struct vcache **" )
               |_ afs_EvalFakeStat
                           |_ afs_EvalFakeStat_int ( if (tvc->mvstat != 1))

We have typecasted "struct vnode **" to "struct vcache **" which is
fine but in function "afs_EvalFakeStat_int" we accessed tvc->mvstat.
"tvc" actually points to a vnode. Then how are we accessing some
member of vcache (size of both the structs differ)

(I think I have missed out some code which does the conversion).
Is there any design document?

Thanks in advance.
Regards,
Dang