
|
[openbeosstorage]
||
[Date Prev]
[02-2002 Date Index]
[Date Next]
||
[Thread Prev]
[02-2002 Thread Index]
[Thread Next]
[openbeosstorage] Re: R5 VFS API
- From: Keith Poole <keef@xxxxxxxxxxxxxxx>
- To: Tyler Dauwalder <tyler@xxxxxxxxxxxxx>
- Date: Fri, 01 Feb 2002 08:32:38 +0000
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Tyler Dauwalder wrote:
>Keith had a good idea this morning:
>
>>Before we do too much coding, its probably best to get the routines
>>documented, so we can write proper test cases & make sure we know how
>>they work. If we divide them up between us, it shouldn't take toolong
>>to do. I propose we produce them in HTML as attached.
>>
>
>>The html files could become part of the open bebook (which would mean
>>the kernel people could code to the same docs & make our life easier
>>
>later).
>
>He did up a page for the opendir() call as an example. I think it'd be a
>good
>thing to go ahead with. It'll help us all get acquainted with the underlying
>filesystem api, and it'd be a handy reference.
>
>I went ahead and created a Storage Kit web page and put up the opendir()
>page that Keith made. It's at:
>
>http://www.dauwalder.net/OpenBeOS/StorageKit.html
>
>The page isn't finished yet (I ran out of time tonight), but I'll get it
>polished
>up in a day or two.
>
>I haven't heard from Brander yet, so I'm pretty much going to assume it's
>just the three of us for now. We could break up the documenting task as
>follows, if this works for everyone (it's about 20 each):
>
>----------------------------------------------------------------------------
>----
>Keith:
>----------------------------------------------------------------------------
>----
>typedef int op_read_vnode(void *ns, vnode_id vnid, char r, void **node);
>typedef int op_write_vnode(void *ns, void *node, char r);
>typedef int op_remove_vnode(void *ns, void *node, char r);
>typedef int op_secure_vnode(void *ns, void *node);
>typedef int op_walk(void *ns, void *base, const char *file, char
>**newpath, vnode_id *vnid);
>typedef int op_access(void *ns, void *node, int mode);
>typedef int op_create(void *ns, void *dir, const char *name, int omode,
>int perms, vnode_id *vnid, void **cookie);
>typedef int op_mkdir(void *ns, void *dir, const char *name, int
>perms);
>typedef int op_symlink(void *ns, void *dir, const char *name, const char
>*path);
>typedef int op_link(void *ns, void *dir, const char *name, void *node);
>typedef int op_rename(void *ns, void *olddir, const char *oldname, void
>*newdir, const char *newname);
>typedef int op_unlink(void *ns, void *dir, const char *name);
>typedef int op_rmdir(void *ns, void *dir, const char *name);
>typedef int op_readlink(void *ns, void *node, char *buf, size_t
>*bufsize);
>typedef int op_opendir(void *ns, void *node, void **cookie);
>typedef int op_closedir(void *ns, void *node, void *cookie);
>typedef int op_rewinddir(void *ns, void *node, void *cookie);
>typedef int op_readdir(void *ns, void *node, void *cookie, long *num,
>struct dirent *buf, size_t bufsize);
>
>----------------------------------------------------------------------------
>----
>Tyler:
>----------------------------------------------------------------------------
>----
>typedef int op_open(void *ns, void *node, int omode, void **cookie);
>typedef int op_close(void *ns, void *node, void *cookie);
>typedef int op_free_cookie(void *ns, void *node, void *cookie);
>typedef int op_read(void *ns, void *node, void *cookie, off_t pos, void
>*buf, size_t *len);
>typedef int op_write(void *ns, void *node, void *cookie, off_t pos, const
>void *buf, size_t *len);
>typedef int op_readv(void *ns, void *node, void *cookie, off_t pos, const
>iovec *vec, size_t count, size_t *len);
>typedef int op_writev(void *ns, void *node, void *cookie, off_t pos, const
>iovec *vec, size_t count, size_t *len);
>typedef int op_ioctl(void *ns, void *node, void *cookie, int cmd, void
>*buf,size_t len);
>typedef int op_setflags(void *ns, void *node, void *cookie, int
>flags);
>typedef int op_rstat(void *ns, void *node, struct stat *);
>typedef int op_wstat(void *ns, void *node, struct stat *, long mask);
>typedef int op_fsync(void *ns, void *node);
>typedef int op_select(void *ns, void *node, void *cookie, uint8 event,
>uint32 ref, selectsync *sync);
>typedef int op_deselect(void *ns, void *node, void *cookie, uint8 event,
>selectsync *sync);
>typedef int op_initialize(const char *devname, void *parms, size_t len);
>typedef int op_mount(nspace_id nsid, const char *devname, ulong flags,
>void *parms, size_t len, void **data, vnode_id *vnid);
>typedef int op_unmount(void *ns);
>typedef int op_sync(void *ns);
>typedef int op_rfsstat(void *ns, struct fs_info *);
>typedef int op_wfsstat(void *ns, struct fs_info *, long mask);
>
>----------------------------------------------------------------------------
>----
>Michael:
>
>----------------------------------------------------------------------------
>----
>typedef int op_open_attrdir(void *ns, void *node, void **cookie);
>typedef int op_close_attrdir(void *ns, void *node, void *cookie);
>typedef int op_rewind_attrdir(void *ns, void *node, void *cookie);
>typedef int op_read_attrdir(void *ns, void *node, void *cookie, long
>*num, struct dirent *buf, size_t bufsize);
>typedef int op_remove_attr(void *ns, void *node, const char *name);
>typedef int op_rename_attr(void *ns, void *node, const char *oldname,
>const char *newname);
>typedef int op_stat_attr(void *ns, void *node, const char *name, struct
>attr_info *buf);
>typedef int op_write_attr(void *ns, void *node, const char *name, int
>type, const void *buf, size_t *len, off_t pos);
>typedef int op_read_attr(void *ns, void *node, const char *name, int
>type, void *buf, size_t *len, off_t pos);
>typedef int op_open_indexdir(void *ns, void **cookie);
>typedef int op_close_indexdir(void *ns, void *cookie);
>typedef int op_rewind_indexdir(void *ns, void *cookie);
>typedef int op_read_indexdir(void *ns, void *cookie, long *num, struct
>dirent *buf, size_t bufsize);
>typedef int op_create_index(void *ns, const char *name, int type, int
>flags);
>typedef int op_remove_index(void *ns, const char *name);
>typedef int op_rename_index(void *ns, const char *oldname, const char
>*newname);
>typedef int op_stat_index(void *ns, const char *name, struct index_info
>*buf);
>typedef int op_open_query(void *ns, const char *query, ulong flags,
>port_id port, long token, void **cookie);
>typedef int op_close_query(void *ns, void *cookie);
>typedef int op_read_query(void *ns, void *cookie, long *num, struct
>dirent *buf, size_t bufsize);
>
>Any thoughts?
>
>-Tyler
>
>
>
>
-- HTML Attachment decoded to text by Listar --
-- File: closedir.html
closedir
closedir - Close a Directory
Close a directory previously opened by opendir
Declaration int closedir(void* pVolume, void* pNode, void* pCookie );
Parameters pVolume - pointer to a volume structure
pNode - pointer to a valid node structure representing a file on the volume
pCookie - 'magic cookie' to be used for other directory calls
Return B_OK - Operation completed
EINVAL - invalid parameter
Notes Close a cookie opened by opendir
This definition was devised using the source for the AtheOS file system
driver (downloadable from bebits.com)
-- HTML Attachment decoded to text by Listar --
-- File: readdir.html
readdir
readdir - Read a Directory Entry
Reads the next entry from the directory
Declaration int readdir(void* pVolume, void* pNode, void* pCookie, long*
pnNum, struct dirent* psFileInfo, size_t nBufSize );
Parameters pVolume - pointer to a volume structure
pNode - pointer to a valid node structure representing a file on the volume
pCookie - 'magic cookie' to be used for other directory calls
pnNum - number of entries read
psFileInfo - File information structure(s) returned by call
nBufSize - size of psFileInfo buffers
Return B_OK - Operation completed
ENOENT - End of directory listing
EINVAL - invalid parameter
Notes It is possible to return multiple entries by passng in a buffer which
can hold multiple file info structures.
This definition was devised using the source for the AtheOS file system
driver (downloadable from bebits.com)
-- HTML Attachment decoded to text by Listar --
-- File: rewinddir.html
rewinddir
rewinddir - Rewind the Directory Entry Pointer Set a directory pointer back
to the start of the directory so that the next readdir command will return
the first element.
Declaration int rewinddir(void* pVolume, void* pNode, void* pCookie );
Parameters pVolume - pointer to a volume structure
pNode - pointer to a valid node structure representing a file on the volume
pCookie - 'magic cookie' to be used for other directory calls
Return B_OK - Operation completed
EINVAL - invalid parameter
ENOTDIR - File is not a diretory
Notes Close a cookie opened by opendir
This definition was devised using the source for the AtheOS file system
driver (downloadable from bebits.com)
|

|