[OpenAFS-devel] Re: Some doubts with Kernel Module data structures

Andrew Deason adeason@sinenomine.net
Mon, 24 May 2010 09:20:40 -0500


On Mon, 24 May 2010 15:53:03 +0200
Sanket Agarwal <sanket@sanketagarwal.com> wrote:

> Okay, thanks for that help! It made reading the code easier.  But I
> continue with my doubts:
> 
> In lines in file src/afs/VNOPS/afs_vnop_read.c or
> src/afs/VNOPS/afs_vnop_write.c I am unable to track the macros for
> VNOP_READ and VNOP_WRITE.

VOP_* macros come from the target kernel; OpenAFS does not define them.
You have to look in the headers and source (or the API documentation)
for e.g. linux or opensolaris to see what they do for those platforms. 

Typically they just expand to a function call that calls a function
pointer derived from the vnode pointer. For example, on Solaris,
VOP_WRITE(vp, foo) is effectively a call to
(*(vp)->v_op->vop_write)(vp, foo).

When looking around for OS-defined stuff like that, convenient sites are
<http://lxr.linux.no/> for Linux, <http://src.opensolaris.org/> for
Solaris, and <http://fxr.watson.org/> for FreeBSD, Darwin, and others
(including Linux and Solaris, but with a different interface than LXR or
src.opensolaris.org).

-- 
Andrew Deason
adeason@sinenomine.net