Subversion Repositories HelenOS

Rev

Rev 2763 | Rev 2770 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2763 Rev 2766
Line 33... Line 33...
33
#ifndef VFS_VFS_H_
33
#ifndef VFS_VFS_H_
34
#define VFS_VFS_H_
34
#define VFS_VFS_H_
35
 
35
 
36
#include <ipc/ipc.h>
36
#include <ipc/ipc.h>
37
#include <libadt/list.h>
37
#include <libadt/list.h>
38
#include <atomic.h>
38
#include <futex.h>
39
#include <rwlock.h>
39
#include <rwlock.h>
40
#include <sys/types.h>
40
#include <sys/types.h>
41
#include <bool.h>
41
#include <bool.h>
42
 
42
 
43
#define dprintf(...)    printf(__VA_ARGS__)
43
#define dprintf(...)    printf(__VA_ARGS__)
Line 105... Line 105...
105
 */
105
 */
106
typedef struct {
106
typedef struct {
107
    link_t fs_link;
107
    link_t fs_link;
108
    vfs_info_t vfs_info;
108
    vfs_info_t vfs_info;
109
    int fs_handle;
109
    int fs_handle;
110
    atomic_t phone_futex;   /**< Phone serializing futex. */
110
    futex_t phone_futex;    /**< Phone serializing futex. */
111
    ipcarg_t phone;
111
    ipcarg_t phone;
112
} fs_info_t;
112
} fs_info_t;
113
 
113
 
114
/**
114
/**
115
 * VFS_PAIR uniquely represents a file system instance.
115
 * VFS_PAIR uniquely represents a file system instance.
Line 230... Line 230...
230
 
230
 
231
    /** Current position in the file. */
231
    /** Current position in the file. */
232
    off_t pos;
232
    off_t pos;
233
} vfs_file_t;
233
} vfs_file_t;
234
 
234
 
-
 
235
extern futex_t nodes_futex;
-
 
236
 
235
extern link_t fs_head;      /**< List of registered file systems. */
237
extern link_t fs_head;      /**< List of registered file systems. */
236
 
238
 
237
extern vfs_triplet_t rootfs;    /**< Root node of the root file system. */
239
extern vfs_triplet_t rootfs;    /**< Root node of the root file system. */
238
 
240
 
239
#define MAX_PATH_LEN        (64 * 1024)
241
#define MAX_PATH_LEN        (64 * 1024)
Line 245... Line 247...
245
    link_t  plb_link;   /**< Active PLB entries list link. */
247
    link_t  plb_link;   /**< Active PLB entries list link. */
246
    unsigned index;     /**< Index of the first character in PLB. */
248
    unsigned index;     /**< Index of the first character in PLB. */
247
    size_t len;     /**< Number of characters in this PLB entry. */
249
    size_t len;     /**< Number of characters in this PLB entry. */
248
} plb_entry_t;
250
} plb_entry_t;
249
 
251
 
250
extern atomic_t plb_futex;  /**< Futex protecting plb and plb_head. */
252
extern futex_t plb_futex;   /**< Futex protecting plb and plb_head. */
251
extern uint8_t *plb;        /**< Path Lookup Buffer */
253
extern uint8_t *plb;        /**< Path Lookup Buffer */
252
extern link_t plb_head;     /**< List of active PLB entries. */
254
extern link_t plb_head;     /**< List of active PLB entries. */
253
 
255
 
254
/** Holding this rwlock prevents changes in file system namespace. */
256
/** Holding this rwlock prevents changes in file system namespace. */
255
extern rwlock_t namespace_rwlock;
257
extern rwlock_t namespace_rwlock;