fs: fat: export fat_next_cluster()

Rename function next_cluster() to fat_next_cluster() and export it.

When creating a new directory entries we should reuse deleted entries.
This requires re-scanning the directory.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
Heinrich Schuchardt
2020-11-22 09:19:52 +01:00
parent c5924118c0
commit d236e825a2
2 changed files with 80 additions and 33 deletions

View File

@@ -9,8 +9,9 @@
#ifndef _FAT_H_
#define _FAT_H_
#include <asm/byteorder.h>
#include <fs.h>
#include <asm/byteorder.h>
#include <asm/cache.h>
struct disk_partition;
@@ -179,6 +180,9 @@ typedef struct {
int fats; /* Number of FATs */
} fsdata;
struct fat_itr;
typedef struct fat_itr fat_itr;
static inline u32 clust_to_sect(fsdata *fsdata, u32 clust)
{
return fsdata->data_begin + clust * fsdata->clust_size;
@@ -208,4 +212,5 @@ void fat_closedir(struct fs_dir_stream *dirs);
int fat_unlink(const char *filename);
int fat_mkdir(const char *dirname);
void fat_close(void);
void *fat_next_cluster(fat_itr *itr, unsigned int *nbytes);
#endif /* _FAT_H_ */