35,6 → 35,7 |
|
#include "../../vfs/vfs.h" |
#include <stdint.h> |
#include <libblock.h> |
|
#define FAT1 0 |
|
58,22 → 59,27 |
typedef uint16_t fat_cluster_t; |
|
#define fat_clusters_get(bs, dh, fc) \ |
fat_cluster_walk((bs), (dh), (fc), NULL, NULL, (uint16_t) -1) |
#define fat_block_get(bs, np, off) \ |
_fat_block_get((bs), (np)->idx->dev_handle, (np)->firstc, (off)) |
fat_cluster_walk((bs), (dh), (fc), NULL, (uint16_t) -1) |
extern uint16_t fat_cluster_walk(struct fat_bs *, dev_handle_t, fat_cluster_t, |
fat_cluster_t *, uint16_t); |
|
#define fat_block_get(bs, np, bn) \ |
_fat_block_get((bs), (np)->idx->dev_handle, (np)->firstc, (bn)) |
|
extern struct block *_fat_block_get(struct fat_bs *, dev_handle_t, |
fat_cluster_t, off_t); |
extern uint16_t fat_cluster_walk(struct fat_bs *, dev_handle_t, fat_cluster_t, |
fat_cluster_t *, fat_cluster_t *, uint16_t); |
fat_cluster_t, bn_t); |
|
extern void fat_append_clusters(struct fat_bs *, struct fat_node *, |
fat_cluster_t); |
extern void fat_chop_clusters(struct fat_bs *, struct fat_node *, |
fat_cluster_t); |
extern int fat_alloc_clusters(struct fat_bs *, dev_handle_t, unsigned, |
fat_cluster_t *, fat_cluster_t *); |
extern void fat_free_clusters(struct fat_bs *, dev_handle_t, fat_cluster_t); |
extern void fat_alloc_shadow_clusters(struct fat_bs *, dev_handle_t, |
fat_cluster_t *, unsigned); |
extern void fat_mark_cluster(struct fat_bs *, dev_handle_t, unsigned, |
extern fat_cluster_t fat_get_cluster(struct fat_bs *, dev_handle_t, fat_cluster_t); |
extern void fat_set_cluster(struct fat_bs *, dev_handle_t, unsigned, |
fat_cluster_t, fat_cluster_t); |
extern void fat_fill_gap(struct fat_bs *, struct fat_node *, fat_cluster_t, |
off_t); |