Subversion Repositories HelenOS

Rev

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

Rev 3022 Rev 4055
Line 38... Line 38...
38
#include <atomic.h>
38
#include <atomic.h>
39
#include <sys/types.h>
39
#include <sys/types.h>
40
#include <bool.h>
40
#include <bool.h>
41
#include <libadt/hash_table.h>
41
#include <libadt/hash_table.h>
42
 
42
 
-
 
43
#ifndef dprintf
43
#define dprintf(...)    printf(__VA_ARGS__)
44
#define dprintf(...)    printf(__VA_ARGS__)
-
 
45
#endif
-
 
46
 
-
 
47
typedef enum {
-
 
48
    TMPFS_NONE,
-
 
49
    TMPFS_FILE,
-
 
50
    TMPFS_DIRECTORY
-
 
51
} tmpfs_dentry_type_t;
44
 
52
 
45
typedef struct tmpfs_dentry {
53
typedef struct tmpfs_dentry {
46
    fs_index_t index;   /**< TMPFS node index. */
54
    fs_index_t index;   /**< TMPFS node index. */
47
    link_t dh_link;     /**< Dentries hash table link. */
55
    link_t dh_link;     /**< Dentries hash table link. */
48
    struct tmpfs_dentry *sibling;
56
    struct tmpfs_dentry *sibling;
49
    struct tmpfs_dentry *child;
57
    struct tmpfs_dentry *child;
50
    hash_table_t names; /**< All names linking to this TMPFS node. */
58
    hash_table_t names; /**< All names linking to this TMPFS node. */
51
    enum {
-
 
52
        TMPFS_NONE,
-
 
53
        TMPFS_FILE,
-
 
54
        TMPFS_DIRECTORY
-
 
55
    } type;
59
    tmpfs_dentry_type_t type;
56
    unsigned lnkcnt;    /**< Link count. */
60
    unsigned lnkcnt;    /**< Link count. */
57
    size_t size;        /**< File size if type is TMPFS_FILE. */
61
    size_t size;        /**< File size if type is TMPFS_FILE. */
58
    void *data;     /**< File content's if type is TMPFS_FILE. */
62
    void *data;     /**< File content's if type is TMPFS_FILE. */
59
} tmpfs_dentry_t;
63
} tmpfs_dentry_t;
60
 
64
 
61
extern fs_reg_t tmpfs_reg;
65
extern fs_reg_t tmpfs_reg;
62
 
66
 
-
 
67
extern libfs_ops_t tmpfs_libfs_ops;
-
 
68
 
-
 
69
extern void tmpfs_mounted(ipc_callid_t, ipc_call_t *);
63
extern void tmpfs_mount(ipc_callid_t, ipc_call_t *);
70
extern void tmpfs_mount(ipc_callid_t, ipc_call_t *);
64
extern void tmpfs_lookup(ipc_callid_t, ipc_call_t *);
71
extern void tmpfs_lookup(ipc_callid_t, ipc_call_t *);
65
extern void tmpfs_read(ipc_callid_t, ipc_call_t *);
72
extern void tmpfs_read(ipc_callid_t, ipc_call_t *);
66
extern void tmpfs_write(ipc_callid_t, ipc_call_t *);
73
extern void tmpfs_write(ipc_callid_t, ipc_call_t *);
67
extern void tmpfs_truncate(ipc_callid_t, ipc_call_t *);
74
extern void tmpfs_truncate(ipc_callid_t, ipc_call_t *);
68
extern void tmpfs_destroy(ipc_callid_t, ipc_call_t *);
75
extern void tmpfs_destroy(ipc_callid_t, ipc_call_t *);
69
 
76
 
-
 
77
extern bool tmpfs_restore(dev_handle_t);
-
 
78
 
70
#endif
79
#endif
71
 
80
 
72
/**
81
/**
73
 * @}
82
 * @}
74
 */
83
 */