-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathfat32.h
More file actions
32 lines (22 loc) · 1010 Bytes
/
fat32.h
File metadata and controls
32 lines (22 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef FAT32_H
#define FAT32_H
#include "vfs.h"
#define FAT_BLOCK_SIZE 512
struct fat32_internel {
char name[12];
int size;
int start_cluster;
int entry_index;
struct vnode * next_sibling;
};
int fat32_setup(struct filesystem * fs, struct mount * mount);
int fat32_lookup(struct vnode * dir_node, struct vnode ** target, const char * component_name);
int fat32_create(struct vnode * dir_node, struct vnode ** target, const char * component_name);
int fat32_read(struct file * file, void * buf, size_t len);
int fat32_write(struct file * file, const void * buf, size_t len);
struct vnode * fat32_create_vnode(struct vnode * src, const char * name, int size, int start_cluster, int entry_index);
struct fat32_internel * fat32_create_internel(const char * name, int size, int start_cluster, int entry_index);
void fat32_append_child(struct vnode * parent, struct vnode * child);
void fat32_update_filesize(struct vnode * node, int size);
void sd_init_fs(struct vnode * root);
#endif