Subversion Repositories HelenOS

Rev

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

Rev 3550 Rev 3571
Line 33... Line 33...
33
#ifndef FAT_FAT_FAT_H_
33
#ifndef FAT_FAT_FAT_H_
34
#define FAT_FAT_FAT_H_
34
#define FAT_FAT_FAT_H_
35
 
35
 
36
#include "../../vfs/vfs.h"
36
#include "../../vfs/vfs.h"
37
#include <stdint.h>
37
#include <stdint.h>
-
 
38
#include <libblock.h>
38
 
39
 
39
#define FAT1        0
40
#define FAT1        0
40
 
41
 
41
#define FAT_CLST_RES0   0x0000
42
#define FAT_CLST_RES0   0x0000
42
#define FAT_CLST_RES1   0x0001
43
#define FAT_CLST_RES1   0x0001
Line 56... Line 57...
56
struct fat_bs;
57
struct fat_bs;
57
 
58
 
58
typedef uint16_t fat_cluster_t;
59
typedef uint16_t fat_cluster_t;
59
 
60
 
60
#define fat_clusters_get(bs, dh, fc) \
61
#define fat_clusters_get(bs, dh, fc) \
61
    fat_cluster_walk((bs), (dh), (fc), NULL, NULL, (uint16_t) -1)
62
    fat_cluster_walk((bs), (dh), (fc), NULL, (uint16_t) -1)
-
 
63
extern uint16_t fat_cluster_walk(struct fat_bs *, dev_handle_t, fat_cluster_t,
-
 
64
    fat_cluster_t *, uint16_t);
-
 
65
 
62
#define fat_block_get(bs, np, off) \
66
#define fat_block_get(bs, np, bn) \
63
    _fat_block_get((bs), (np)->idx->dev_handle, (np)->firstc, (off))
67
    _fat_block_get((bs), (np)->idx->dev_handle, (np)->firstc, (bn))
64
 
68
 
65
extern struct block *_fat_block_get(struct fat_bs *, dev_handle_t,
69
extern struct block *_fat_block_get(struct fat_bs *, dev_handle_t,
66
    fat_cluster_t, off_t);
70
    fat_cluster_t, bn_t);
67
extern uint16_t fat_cluster_walk(struct fat_bs *, dev_handle_t, fat_cluster_t,
-
 
68
    fat_cluster_t *, fat_cluster_t *, uint16_t);
-
 
69
 
71
 
70
extern void fat_append_clusters(struct fat_bs *, struct fat_node *,
72
extern void fat_append_clusters(struct fat_bs *, struct fat_node *,
71
    fat_cluster_t);
73
    fat_cluster_t);
72
extern int fat_alloc_clusters(struct fat_bs *, dev_handle_t, unsigned,
74
extern int fat_alloc_clusters(struct fat_bs *, dev_handle_t, unsigned,
73
    fat_cluster_t *, fat_cluster_t *);
75
    fat_cluster_t *, fat_cluster_t *);