vfs.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2009 Martin Decky
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  *   notice, this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright
00012  *   notice, this list of conditions and the following disclaimer in the
00013  *   documentation and/or other materials provided with the distribution.
00014  * - The name of the author may not be used to endorse or promote products
00015  *   derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00019  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00022  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00035 #ifndef LIBC_IPC_VFS_H_
00036 #define LIBC_IPC_VFS_H_
00037 
00038 #include <ipc/common.h>
00039 #include <sys/types.h>
00040 #include <bool.h>
00041 
00042 #define FS_NAME_MAXLEN  20
00043 #define MAX_PATH_LEN    (64 * 1024)
00044 #define PLB_SIZE        (2 * MAX_PATH_LEN)
00045 
00046 /* Basic types. */
00047 typedef int16_t fs_handle_t;
00048 typedef uint32_t fs_index_t;
00049 
00055 typedef struct {
00057         char name[FS_NAME_MAXLEN + 1];
00058         bool concurrent_read_write;
00059         bool write_retains_size;
00060 } vfs_info_t;
00061 
00062 typedef enum {
00063         VFS_IN_OPEN = IPC_FIRST_USER_METHOD,
00064         VFS_IN_OPEN_NODE,
00065         VFS_IN_READ,
00066         VFS_IN_WRITE,
00067         VFS_IN_SEEK,
00068         VFS_IN_TRUNCATE,
00069         VFS_IN_FSTAT,
00070         VFS_IN_CLOSE,
00071         VFS_IN_MOUNT,
00072         VFS_IN_UNMOUNT,
00073         VFS_IN_SYNC,
00074         VFS_IN_REGISTER,
00075         VFS_IN_MKDIR,
00076         VFS_IN_UNLINK,
00077         VFS_IN_RENAME,
00078         VFS_IN_STAT,
00079         VFS_IN_DUP
00080 } vfs_in_request_t;
00081 
00082 typedef enum {
00083         VFS_OUT_OPEN_NODE = IPC_FIRST_USER_METHOD,
00084         VFS_OUT_READ,
00085         VFS_OUT_WRITE,
00086         VFS_OUT_TRUNCATE,
00087         VFS_OUT_CLOSE,
00088         VFS_OUT_MOUNT,
00089         VFS_OUT_MOUNTED,
00090         VFS_OUT_UNMOUNT,
00091         VFS_OUT_UNMOUNTED,
00092         VFS_OUT_SYNC,
00093         VFS_OUT_STAT,
00094         VFS_OUT_LOOKUP,
00095         VFS_OUT_DESTROY,
00096         VFS_OUT_LAST
00097 } vfs_out_request_t;
00098 
00099 /*
00100  * Lookup flags.
00101  */
00102 
00106 #define L_NONE                  0
00107 
00113 #define L_FILE                  1
00114 
00120 #define L_DIRECTORY             2
00121 
00126 #define L_ROOT                  4
00127 
00132 #define L_MP                    8
00133 
00134 
00139 #define L_EXCLUSIVE             16
00140 
00144 #define L_CREATE                32
00145 
00149 #define L_LINK                  64
00150 
00156 #define L_UNLINK                128
00157 
00164 #define L_OPEN                  256
00165 
00166 #endif
00167 

Generated on Thu Jun 2 07:45:47 2011 for HelenOS/USB by  doxygen 1.4.7