[comp.unix.aix] vn_ routines

rmilner@zia.aoc.nrao.edu (Ruth Milner) (03/08/91)

Does anyone know where all the vn_ routines are kept? Only two of them are
described as "kernel services", the rest are all "subroutines". But ld can't
find them in the standard libraries, and despite doing "ar t" on all the .a
files in /lib and /usr/lib, none of them show up anywhere.

Searching within info didn't help either. There are no combinations of
"vn_" and "lib" in any article in the database.

Thank you.
-- 
Ruth Milner
Systems Manager                     NRAO/VLA                    Socorro NM
                            rmilner@zia.aoc.nrao.edu

rudy@chukran.austin.ibm.com (03/13/91)

In article <1991Mar8.002636.4940@nmt.edu>, rmilner@zia.aoc.nrao.edu
(Ruth Milner) writes:
> 
> Does anyone know where all the vn_ routines are kept? Only two of them are
> described as "kernel services", the rest are all "subroutines". But ld can't
> find them in the standard libraries, and despite doing "ar t" on all the .a
> files in /lib and /usr/lib, none of them show up anywhere.
These routines are in the kernel.  To resolve them at link time, you need to 
add the following option to your link command.

-bI:/lib/kernex.exp

This tells ld that those symbols contained in that file are resolved from
/unix (this is the first line of that file).  When the program is loaded
those symbols are resolved by the loader.

See "Kernel Extension Binding" in info.

*********************************************************************
Rudy Chukran            |       EMAIL:            
IBM AIX Porting Center  | RSCS: CHUKRAN at AUSTIN 
11400 Burnet Rd.        | AWDnet: rudy@chukran.austin.ibm.com    
Internal ZIP 2830       | internet: chukran@austin.iinus1.ibm.com
Austin, Texas 78758     | Voice: 512-838-4674  Tieline: 678-4674
*********************************************************************

web@farpoint.austin.ibm.com (Bill Baker) (03/13/91)

>Does anyone know where all the vn_ routines are kept? Only two of them are
>described as "kernel services", the rest are all "subroutines". But ld can't
>find them in the standard libraries, and despite doing "ar t" on all the .a
>files in /lib and /usr/lib, none of them show up anywhere.

>Ruth Milner
>Systems Manager                     NRAO/VLA                    Socorro NM
>                            rmilner@zia.aoc.nrao.edu

My apologies for the confusing documentation.  The vn_ routines described
in the documentation are an attempt to define the entry points for a new file
system type that you would write.  For example, if you were writing a dos
file system to run in AIX, you would have to define routines like dos_rdwr,
dos_rele, dos_lookup, and so on.  These routines would be called from the
AIX logical file system via a pointer in the vnode.

If you want to do file system I/O from a kernel extension, I'd recommend
the fp_ interfaces.  They roughly correspond to the system calls.  These
are only callable from a kernel extension.  If you're writing applications,
you're stuck with the system call interfaces (normal read, write, ...).

Hope it helps,
web

-- 
Bill Baker             Internet: web@glasnost.austin.ibm.com
IBM AWD                AWD net: web@farpoint.austin.ibm.com
11400 Burnet Rd.       VNET: WEBAKER AT AUSVMQ
Austin, TX; 78758-2502

rmilner@zia.aoc.nrao.edu (Ruth Milner) (03/14/91)

In article <5849@awdprime.UUCP> rudy@chukran.austin.ibm.com () writes:
>In article <1991Mar8.002636.4940@nmt.edu>, rmilner@zia.aoc.nrao.edu
>(Ruth Milner) writes:
>> 
>> Does anyone know where all the vn_ routines are kept? Only two of them are
>> described as "kernel services", the rest are all "subroutines". But ld can't
>> find them in the standard libraries, and despite doing "ar t" on all the .a
>> files in /lib and /usr/lib, none of them show up anywhere.
>These routines are in the kernel.  To resolve them at link time, you need to 
>add the following option to your link command.
>
>-bI:/lib/kernex.exp
>

Uh, no, not quite. We already found that file, and only the two which are 
described as "kernel services" in the documentation (vn_get and vn_free)
are in /lib/kernex.exp. Even when that kernel services file is imported into
ld, numerous symbols remain undefined, e.g. vn_create, vn_open, vn_close,
etc. etc. There's about a dozen or so of them described in the man pages
which are completely unknown. These are the ones listed as "subroutines".

In addition, if you read the documentation (even hardcopy stuff on writing
kernel code), it specifically says "the six kernel services" related to
virtual filesystem handling - and then proceeds to list the six of which, 
again, only two are vn_ routines, the same two. None of the rest are included
in any other list of kernel services, even the purely alphabetical one.

So there is either considerable misinformation, or considerable missing 
information.  

Maybe they are kernel services after all, but if so, nothing in either the
system or the documentation knows that. In which case, how do we get hold
of them? And why are they specifically called "subroutines" as distinct from
"kernel services"?

I did get a note via my local IBM software expert to the effect that there is
a missing include file, /usr/include/sys/vnops.h . Is it possible that the
above routines are actually macros which would be defined in there?

Thanks again.
-- 
Ruth Milner
Systems Manager                     NRAO/VLA                    Socorro NM
                            rmilner@zia.aoc.nrao.edu

rmilner@zia.aoc.nrao.edu (Ruth Milner) (03/14/91)

In article <5866@awdprime.UUCP> web@farpoint.austin.ibm.com (Bill Baker) writes:
>>Does anyone know where all the vn_ routines are kept? 

>My apologies for the confusing documentation.  The vn_ routines described
>in the documentation are an attempt to define the entry points for a new file
>system type that you would write.  

Does this mean they don't actually exist? I'll say the documentation is
confusing:
---------

    Description

      The vn_create subroutine creates a VREG type of  vnode (vir-
  tual node) in the directory specified by the dp parameter.
  (Other  vnode operations create directories and  special files.)

[...]
      Note:     The  logical file system calls the  vn_lookup subroutine
  before calling the vn_create subroutine.

     Execution Environment

      The vn_create subroutine can be called from the  process en-
  vironment only.
[...]
-----------
Sure is documented like a real routine. That "Note:" in particular seems to
imply these routines are actually used in AIX. And nothing anywhere in any of 
them to indicate they are only templates.

Apology accepted, but I would like to make a suggestion - please change the 
documentation in the next update. Thank you.
-- 
Ruth Milner
Systems Manager                     NRAO/VLA                    Socorro NM
                            rmilner@zia.aoc.nrao.edu

allyn@cpg.trs.reuter.com (Allyn Barnett) (03/15/91)

In article <1991Mar14.013705.18876@nmt.edu>, rmilner@zia.aoc.nrao.edu
(Ruth Milner) writes:
|> In article <5849@awdprime.UUCP> rudy@chukran.austin.ibm.com () writes:
|> >In article <1991Mar8.002636.4940@nmt.edu>, rmilner@zia.aoc.nrao.edu
|> >(Ruth Milner) writes:
|> >> 
|> >> Does anyone know where all the vn_ routines are kept? Only two of
them are
|> >> described as "kernel services", the rest are all "subroutines".
But ld can't
|> >> find them in the standard libraries, and despite doing "ar t" on
all the .a
|> >> files in /lib and /usr/lib, none of them show up anywhere.
|> >These routines are in the kernel.  To resolve them at link time, you
need to 
|> >add the following option to your link command.
|> >
|> >-bI:/lib/kernex.exp
|> >
|> 
|> Uh, no, not quite. We already found that file, and only the two which are 
|> described as "kernel services" in the documentation (vn_get and vn_free)
|> are in /lib/kernex.exp. Even when that kernel services file is imported into
|> ld, numerous symbols remain undefined, e.g. vn_create, vn_open, vn_close,
|> etc. etc. There's about a dozen or so of them described in the man pages
|> which are completely unknown. These are the ones listed as "subroutines".
|> 
|> In addition, if you read the documentation (even hardcopy stuff on writing
|> kernel code), it specifically says "the six kernel services" related to
|> virtual filesystem handling - and then proceeds to list the six of which, 
|> again, only two are vn_ routines, the same two. None of the rest are
included
|> in any other list of kernel services, even the purely alphabetical one.
|> 
|> So there is either considerable misinformation, or considerable missing 
|> information.  
|> 
|> Maybe they are kernel services after all, but if so, nothing in either the
|> system or the documentation knows that. In which case, how do we get hold
|> of them? And why are they specifically called "subroutines" as distinct from
|> "kernel services"?


Just because a symbol is no listed in a *.exp file does not mean that the 
service is not provided.  I found this out while trying to use kernel socket
services (socreate, sobind, etc.).  I found that the routines were available
in the kernel by running nm on the kernel and greping for the desired symbol.

So how did I get my code to link? I created my own .exp file and included
the required symbols.  Of course this might be dangerous if for example the
kernel services use a different parameter set and you don't have the
documentation to tell you that.  But with the kind of support that I have
gotten from IBM, experimentation may be your only option.

By the way, after I was able to make this work, I got the doc from for those
kernel services from Austin.  I was told that the reason that I had not been
made generally available was because they didn't have the staff to support it.
I believe them.

------------------------------------------------------------------------
My opinions are just that.  The facts are the facts.  You figure out
which is which.
------------------------------------------------------------------------
Allyn Barnett					allyn@cpg.trs.reuter.com
Reuters/Rich Trading Room Systems
1400 Kensington Rd
Oak Brook, IL  60521  USA