Fork us on GitHub Follow us on Facebook Follow us on Twitter

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


Ignore:
Timestamp:
2017-04-05T18:10:39Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
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/vfs/vfs.h

    r39f892a9 r368ee04  
    4242#include <stdio.h>
    4343#include <async.h>
    44 #include "vfs_mtab.h"
    4544
     45#define MAX_OPEN_FILES  128
    4646
    4747enum vfs_change_state_type {
     
    4949};
    5050
     51typedef enum {
     52        KIND_FILE,
     53        KIND_DIRECTORY,
     54} vfs_file_kind_t;
    5155
    52 extern char *vfs_absolutize(const char *, size_t *);
    5356
    54 extern int vfs_mount(const char *, const char *, const char *, const char *,
    55     unsigned int, unsigned int);
    56 extern int vfs_unmount(const char *);
     57struct stat {
     58        fs_handle_t fs_handle;
     59        service_id_t service_id;
     60        fs_index_t index;
     61        unsigned int lnkcnt;
     62        bool is_file;
     63        bool is_directory;
     64        aoff64_t size;
     65        service_id_t service;
     66};
     67
     68struct statfs {
     69        char fs_name[FS_NAME_MAXLEN + 1];
     70        uint32_t f_bsize;    /* fundamental file system block size */
     71        uint64_t f_blocks;   /* total data blocks in file system */
     72        uint64_t f_bfree;    /* free blocks in fs */
     73};
    5774
    5875extern int vfs_fhandle(FILE *, int *);
    5976
    60 extern int vfs_fd_wait(void);
    61 extern int vfs_get_mtab_list(list_t *mtab_list);
    62 
     77extern char *vfs_absolutize(const char *, size_t *);
     78extern int vfs_clone(int, int, bool);
     79extern int vfs_cwd_get(char *path, size_t);
     80extern int vfs_cwd_set(const char *path);
    6381extern async_exch_t *vfs_exchange_begin(void);
    6482extern void vfs_exchange_end(async_exch_t *);
     83extern int vfs_link(int, const char *, vfs_file_kind_t, int *);
     84extern int vfs_link_path(const char *, vfs_file_kind_t, int *);
     85extern int vfs_lookup(const char *, int);
     86extern int vfs_lookup_open(const char *, int, int);
     87extern int vfs_mount_path(const char *, const char *, const char *,
     88    const char *, unsigned int, unsigned int);
     89extern int vfs_mount(int, const char *, service_id_t, const char *, unsigned,
     90    unsigned, int *);
     91extern int vfs_open(int, int);
     92extern int vfs_pass_handle(async_exch_t *, int, async_exch_t *);
     93extern int vfs_put(int);
     94extern ssize_t vfs_read(int, aoff64_t *, void *, size_t);
     95extern int vfs_read_short(int, aoff64_t, void *, size_t, ssize_t *);
     96extern int vfs_receive_handle(bool);
     97extern int vfs_rename_path(const char *, const char *);
     98extern int vfs_resize(int, aoff64_t);
     99extern int vfs_root(void);
     100extern void vfs_root_set(int);
     101extern int vfs_stat(int, struct stat *);
     102extern int vfs_stat_path(const char *, struct stat *);
     103extern int vfs_statfs(int, struct statfs *);
     104extern int vfs_statfs_path(const char *, struct statfs *);
     105extern int vfs_sync(int);
     106extern int vfs_unlink(int, const char *, int);
     107extern int vfs_unlink_path(const char *);
     108extern int vfs_unmount(int);
     109extern int vfs_unmount_path(const char *);
     110extern int vfs_walk(int, const char *, int);
     111extern ssize_t vfs_write(int, aoff64_t *, const void *, size_t);
     112extern int vfs_write_short(int, aoff64_t, const void *, size_t, ssize_t *);
    65113
    66114#endif
Note: See TracChangeset for help on using the changeset viewer.