Changeset 368ee04 in mainline for uspace/lib/c/include/ipc/vfs.h


Ignore:
Timestamp:
2017-04-05T18:10:39Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
93ad8166
Parents:
39f892a9 (diff), 2166728 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~jakub/helenos/vfs-2.5-cherrypick

This merge cherry-picks some of the changesets from Jiri Zarevucky's:

lp:~zarevucky-jiri/helenos/vfs-2.5

and then continues independently, yet sometime in a similar vein.

Roughly speaking, Jiri's branch is merged entirely up to its revision
1926 and then cherry-picked on and off until its revision 1965. Among
these changes are:

  • relativization of the API,
  • client-side roots,
  • server-side mounts,
  • inbox for passing arbitrary files from parent to child,
  • some streamlining and cleanup.

Additional changes include:

  • addressing issues introduced by the above changes,
  • client-side I/O cursors (file positions),
  • all HelenOS file system APIs begin with the vfs_ prefix and can be used after including vfs/vfs.h,
  • removal of some POSIX-ish headers and definitions,
  • additional cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ipc/vfs.h

    r39f892a9 r368ee04  
    4141
    4242#define FS_NAME_MAXLEN  20
    43 #define MAX_PATH_LEN    (64 * 1024)
     43#define MAX_PATH_LEN    (32 * 1024)
    4444#define MAX_MNTOPTS_LEN 256
    4545#define PLB_SIZE        (2 * MAX_PATH_LEN)
     
    6363
    6464typedef enum {
    65         VFS_IN_OPEN = IPC_FIRST_USER_METHOD,
     65        VFS_IN_CLONE = IPC_FIRST_USER_METHOD,
     66        VFS_IN_MOUNT,
     67        VFS_IN_OPEN,
     68        VFS_IN_PUT,
    6669        VFS_IN_READ,
     70        VFS_IN_REGISTER,
     71        VFS_IN_RENAME,
     72        VFS_IN_RESIZE,
     73        VFS_IN_STAT,
     74        VFS_IN_STATFS,
     75        VFS_IN_SYNC,
     76        VFS_IN_UNLINK,
     77        VFS_IN_UNMOUNT,
     78        VFS_IN_WAIT_HANDLE,
     79        VFS_IN_WALK,
    6780        VFS_IN_WRITE,
    68         VFS_IN_SEEK,
    69         VFS_IN_TRUNCATE,
    70         VFS_IN_FSTAT,
    71         VFS_IN_CLOSE,
    72         VFS_IN_PING,
    73         VFS_IN_MOUNT,
    74         VFS_IN_UNMOUNT,
    75         VFS_IN_SYNC,
    76         VFS_IN_REGISTER,
    77         VFS_IN_MKDIR,
    78         VFS_IN_UNLINK,
    79         VFS_IN_RENAME,
    80         VFS_IN_STAT,
    81         VFS_IN_DUP,
    82         VFS_IN_WAIT_HANDLE,
    83         VFS_IN_MTAB_GET,
    84         VFS_IN_STATFS
    8581} vfs_in_request_t;
    8682
    8783typedef enum {
    88         VFS_OUT_OPEN_NODE = IPC_FIRST_USER_METHOD,
     84        VFS_OUT_CLOSE = IPC_FIRST_USER_METHOD,
     85        VFS_OUT_DESTROY,
     86        VFS_OUT_IS_EMPTY,
     87        VFS_OUT_LINK,
     88        VFS_OUT_LOOKUP,
     89        VFS_OUT_MOUNTED,
     90        VFS_OUT_OPEN_NODE,
    8991        VFS_OUT_READ,
     92        VFS_OUT_STAT,
     93        VFS_OUT_STATFS,
     94        VFS_OUT_SYNC,
     95        VFS_OUT_TRUNCATE,
     96        VFS_OUT_UNMOUNTED,
    9097        VFS_OUT_WRITE,
    91         VFS_OUT_TRUNCATE,
    92         VFS_OUT_CLOSE,
    93         VFS_OUT_MOUNT,
    94         VFS_OUT_MOUNTED,
    95         VFS_OUT_UNMOUNT,
    96         VFS_OUT_UNMOUNTED,
    97         VFS_OUT_SYNC,
    98         VFS_OUT_STAT,
    99         VFS_OUT_LOOKUP,
    100         VFS_OUT_DESTROY,
    101         VFS_OUT_STATFS,
    10298        VFS_OUT_LAST
    10399} vfs_out_request_t;
     
    127123
    128124/**
    129  * Lookup will succeed only if the object is a root directory. The flag is
    130  * mutually exclusive with L_FILE and L_MP.
     125 * Lookup will not cross any mount points.
     126 * If the lookup would have to cross a mount point, it returns EXDEV instead.
    131127 */
    132 #define L_ROOT                  4
     128#define L_DISABLE_MOUNTS        4
    133129
    134130/**
    135131 * Lookup will succeed only if the object is a mount point. The flag is mutually
    136  * exclusive with L_FILE and L_ROOT.
     132 * exclusive with L_FILE.
    137133 */
    138134#define L_MP                    8
     
    151147
    152148/**
    153  * L_LINK is used for linking to an already existing nodes.
    154  */
    155 #define L_LINK                  64
    156 
    157 /**
    158149 * L_UNLINK is used to remove leaves from the file system namespace. This flag
    159150 * cannot be passed directly by the client, but will be set by VFS during
    160151 * VFS_UNLINK.
    161152 */
    162 #define L_UNLINK                128
     153#define L_UNLINK                64
    163154
    164 /**
    165  * L_OPEN is used to indicate that the lookup operation is a part of VFS_IN_OPEN
    166  * call from the client. This means that the server might allocate some
    167  * resources for the opened file. This flag cannot be passed directly by the
    168  * client.
     155/*
     156 * Walk flags.
    169157 */
    170 #define L_OPEN                  256
     158enum {
     159        WALK_MAY_CREATE = (1 << 0),
     160        WALK_MUST_CREATE = (1 << 1),
     161       
     162        WALK_REGULAR = (1 << 2),
     163        WALK_DIRECTORY = (1 << 3),
     164        WALK_MOUNT_POINT = (1 << 4),
     165       
     166        WALK_ALL_FLAGS = WALK_MAY_CREATE | WALK_MUST_CREATE | WALK_REGULAR |
     167            WALK_DIRECTORY | WALK_MOUNT_POINT,
     168};
     169
     170enum {
     171        VFS_MOUNT_BLOCKING = 1,
     172        VFS_MOUNT_CONNECT_ONLY = 2,
     173        VFS_MOUNT_NO_REF = 4,
     174};
     175
     176enum {
     177        MODE_READ = 1,
     178        MODE_WRITE = 2,
     179        MODE_APPEND = 4,
     180};
    171181
    172182#endif
Note: See TracChangeset for help on using the changeset viewer.