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


Ignore:
Timestamp:
2017-04-05T18:10:39Z (9 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.
Location:
uspace/lib/c/include/vfs
Files:
2 edited
1 moved

Legend:

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

    r39f892a9 r368ee04  
    11/*
    2  * Copyright (c) 2007 Jakub Jermar
     2 * Copyright (c) 2013 Jiri Zarevucky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libc
     29/** @addtogroup libc 
    3030 * @{
    31  */
    32 /** @file
     31 */
     32
     33/**
     34 * @file
     35 * @brief
    3336 */
    3437
    35 #ifndef LIBC_FCNTL_H_
    36 #define LIBC_FCNTL_H_
     38#ifndef LIBC_VFS_INBOX_H_
     39#define LIBC_VFS_INBOX_H_
    3740
    38 #define O_CREAT   1
    39 #define O_EXCL    2
    40 #define O_TRUNC   4
    41 #define O_APPEND  8
    42 #define O_RDONLY  16
    43 #define O_RDWR    32
    44 #define O_WRONLY  64
    45 #define O_DESC    128
     41enum {
     42        INBOX_MAX_ENTRIES = 256,
     43};
    4644
    47 extern int open(const char *, int, ...);
     45extern int inbox_set(const char *name, int file);
     46extern int inbox_get(const char *name);
     47
     48extern int inbox_list(const char **names, int capacity);
    4849
    4950#endif
    5051
    51 /** @}
     52/**
     53 * @}
    5254 */
  • 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
  • uspace/lib/c/include/vfs/vfs_mtab.h

    r39f892a9 r368ee04  
    4343        link_t link;
    4444        char mp[MAX_PATH_LEN];
    45         char opts[MAX_MNTOPTS_LEN];
    4645        char fs_name[FS_NAME_MAXLEN];
    47         unsigned int instance;
    4846        service_id_t service_id;
    4947} mtab_ent_t;
     48
     49extern int vfs_get_mtab_list(list_t *);
    5050
    5151#endif
Note: See TracChangeset for help on using the changeset viewer.