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

Derrick Brashear shadow@gmail.com
Mon, 24 May 2010 12:19:00 -0400


On Mon, May 24, 2010 at 10:20 AM, Andrew Deason <adeason@sinenomine.net> wr=
ote:
> 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. =A0But 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).

Basically, this is the I/O-to-disk. You'll want to do your work in the
AFS module, which is to say, before VNOP_WRITE is called, and on
reads, on the result of VNOP_READ.



--=20
Derrick