Subversion Repositories HelenOS

Rev

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

Rev 4153 Rev 4581
Line 33... Line 33...
33
#ifndef FAT_FAT_H_
33
#ifndef FAT_FAT_H_
34
#define FAT_FAT_H_
34
#define FAT_FAT_H_
35
 
35
 
36
#include "fat_fat.h"
36
#include "fat_fat.h"
37
#include <ipc/ipc.h>
37
#include <ipc/ipc.h>
-
 
38
#include <fibril_sync.h>
38
#include <libfs.h>
39
#include <libfs.h>
39
#include <atomic.h>
40
#include <atomic.h>
40
#include <sys/types.h>
41
#include <sys/types.h>
41
#include <bool.h>
42
#include <bool.h>
42
#include "../../vfs/vfs.h"
43
#include "../../vfs/vfs.h"
Line 158... Line 159...
158
    /** Used indices (position) hash table link. */
159
    /** Used indices (position) hash table link. */
159
    link_t      uph_link;
160
    link_t      uph_link;
160
    /** Used indices (index) hash table link. */
161
    /** Used indices (index) hash table link. */
161
    link_t      uih_link;
162
    link_t      uih_link;
162
 
163
 
163
    futex_t     lock;
164
    fibril_mutex_t  lock;
164
    dev_handle_t    dev_handle;
165
    dev_handle_t    dev_handle;
165
    fs_index_t  index;
166
    fs_index_t  index;
166
    /**
167
    /**
167
     * Parent node's first cluster.
168
     * Parent node's first cluster.
168
     * Zero is used if this node is not linked, in which case nodep must
169
     * Zero is used if this node is not linked, in which case nodep must
Line 176... Line 177...
176
    struct fat_node *nodep;
177
    struct fat_node *nodep;
177
} fat_idx_t;
178
} fat_idx_t;
178
 
179
 
179
/** FAT in-core node. */
180
/** FAT in-core node. */
180
typedef struct fat_node {
181
typedef struct fat_node {
-
 
182
    /** Back pointer to the FS node. */
-
 
183
    fs_node_t       *bp;
-
 
184
   
181
    futex_t         lock;
185
    fibril_mutex_t      lock;
182
    fat_node_type_t     type;
186
    fat_node_type_t     type;
183
    fat_idx_t       *idx;
187
    fat_idx_t       *idx;
184
    /**
188
    /**
185
     *  Node's first cluster.
189
     *  Node's first cluster.
186
     *  Zero is used for zero-length nodes.
190
     *  Zero is used for zero-length nodes.
Line 201... Line 205...
201
extern void fat_mount(ipc_callid_t, ipc_call_t *);
205
extern void fat_mount(ipc_callid_t, ipc_call_t *);
202
extern void fat_lookup(ipc_callid_t, ipc_call_t *);
206
extern void fat_lookup(ipc_callid_t, ipc_call_t *);
203
extern void fat_read(ipc_callid_t, ipc_call_t *);
207
extern void fat_read(ipc_callid_t, ipc_call_t *);
204
extern void fat_write(ipc_callid_t, ipc_call_t *);
208
extern void fat_write(ipc_callid_t, ipc_call_t *);
205
extern void fat_truncate(ipc_callid_t, ipc_call_t *);
209
extern void fat_truncate(ipc_callid_t, ipc_call_t *);
-
 
210
extern void fat_close(ipc_callid_t, ipc_call_t *);
206
extern void fat_destroy(ipc_callid_t, ipc_call_t *);
211
extern void fat_destroy(ipc_callid_t, ipc_call_t *);
-
 
212
extern void fat_open_node(ipc_callid_t, ipc_call_t *);
-
 
213
extern void fat_device(ipc_callid_t, ipc_call_t *);
-
 
214
extern void fat_sync(ipc_callid_t, ipc_call_t *);
207
 
215
 
208
extern fat_idx_t *fat_idx_get_new(dev_handle_t);
216
extern fat_idx_t *fat_idx_get_new(dev_handle_t);
209
extern fat_idx_t *fat_idx_get_by_pos(dev_handle_t, fat_cluster_t, unsigned);
217
extern fat_idx_t *fat_idx_get_by_pos(dev_handle_t, fat_cluster_t, unsigned);
210
extern fat_idx_t *fat_idx_get_by_index(dev_handle_t, fs_index_t);
218
extern fat_idx_t *fat_idx_get_by_index(dev_handle_t, fs_index_t);
211
extern void fat_idx_destroy(fat_idx_t *);
219
extern void fat_idx_destroy(fat_idx_t *);