AIX provides a virtual file system interface that, well, basically allows one to create new file system types. Chapter 3, Virtual File Systems, in the Kernel Extensions and Device Support Programming Concepts manual covers much (but of course not all) of it. It makes for an interesting exercise. I currently have a file system skeleton in place. I can add files and directories and read and write to them but there are a few issues that I cannot seem to resolve ...
1. I cannot list the contents of a directory in the file system. I expected that an "ls" command would eventually call "vn_readdir" but it does not. An "ls" without parameters makes a "vn_lookup" call for a directory named "." to which I return a vnode pointer to the current directory (lets say we are currently in the V_ROOT directory). Truss tells me that "getdirent64" is called but my underlying vn_readdir" is not called. I'll enable the kernel debugger and dust off my "kdb" and take a closer look but I'm wondering if I'm missing something basic (yes the returned vnode is type VDIR) ...
2. I don't see any documentation about how file pointers (read/write) associated with the file descriptors are managed. I assumed that the logical layer would handle them mindelessly but several writes one after another do not affect the incoming "offset". I could manage them myself but that seems wrong since they are per process. The user file descriptor is not available to the "vn_" interfaces. None of the "vn_" man pages provide a clue ...
Pinned topic Anyone have file system development experience?
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-02-06T18:43:12Z at 2013-02-06T18:43:12Z by SystemAdmin
styerd 100000DF0K14 Posts
Re: Anyone have file system development experience?2010-11-16T18:03:16ZThis is the accepted answer. This is the accepted answer.I resolved my own problems ...
I was not setting va_mode to _S_IFDIR returned by vn_getattr ... even thought the vnode type, v_vntype, was correctly set to VDIR. With this now set vn_readdir is called as expected.
My other problem was just dumb. I was attempting to print a 64 bit offset value with uprintf in the kernel. And so it just always appeared to be zero. Sigh.
SystemAdmin 110000D4XK549 Posts
Re: Anyone have file system development experience?2013-02-06T18:43:12ZThis is the accepted answer. This is the accepted answer.
- styerd 100000DF0K