fat_fat.c File Reference

Functions that manipulate the File Allocation Tables. More...

#include "fat_fat.h"
#include "fat_dentry.h"
#include "fat.h"
#include "../../vfs/vfs.h"
#include <libfs.h>
#include <libblock.h>
#include <errno.h>
#include <byteorder.h>
#include <align.h>
#include <assert.h>
#include <fibril_synch.h>
#include <malloc.h>
#include <mem.h>

Go to the source code of this file.

Defines

#define CLBN2PBN(bs, cl, bn)   (SSA((bs)) + ((cl) - FAT_CLST_FIRST) * SPC((bs)) + (bn) % SPC((bs)))
#define RDS(bs)
#define SSA(bs)   (RSCNT((bs)) + FATCNT((bs)) * SF((bs)) + RDS(bs))

Functions

int _fat_block_get (block_t **block, fat_bs_t *bs, devmap_handle_t devmap_handle, fat_cluster_t fcl, fat_cluster_t *clp, aoff64_t bn, int flags)
 Read block from file located on a FAT file system.
int fat_alloc_clusters (fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned nclsts, fat_cluster_t *mcl, fat_cluster_t *lcl)
 Allocate clusters in all copies of FAT.
int fat_alloc_shadow_clusters (fat_bs_t *bs, devmap_handle_t devmap_handle, fat_cluster_t *lifo, unsigned nclsts)
 Replay the allocatoin of clusters in all shadow instances of FAT.
int fat_append_clusters (fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl, fat_cluster_t lcl)
 Append a cluster chain to the last file cluster in all FATs.
int fat_block_get (block_t **block, struct fat_bs *bs, fat_node_t *nodep, aoff64_t bn, int flags)
 Read block from file located on a FAT file system.
int fat_chop_clusters (fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t lcl)
 Chop off node clusters in all copies of FAT.
int fat_cluster_walk (fat_bs_t *bs, devmap_handle_t devmap_handle, fat_cluster_t firstc, fat_cluster_t *lastc, uint16_t *numc, uint16_t max_clusters)
 Walk the cluster chain.
int fat_fill_gap (fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl, aoff64_t pos)
 Fill the gap between EOF and a new file position.
int fat_free_clusters (fat_bs_t *bs, devmap_handle_t devmap_handle, fat_cluster_t firstc)
 Free clusters forming a cluster chain in all copies of FAT.
int fat_get_cluster (fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned fatno, fat_cluster_t clst, fat_cluster_t *value)
 Get cluster from the first FAT.
int fat_sanity_check (fat_bs_t *bs, devmap_handle_t devmap_handle)
 Perform basic sanity checks on the file system.
int fat_set_cluster (fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned fatno, fat_cluster_t clst, fat_cluster_t value)
 Set cluster in one instance of FAT.
int fat_zero_cluster (struct fat_bs *bs, devmap_handle_t devmap_handle, fat_cluster_t c)
static FIBRIL_MUTEX_INITIALIZE (fat_alloc_lock)
 The fat_alloc_lock mutex protects all copies of the File Allocation Table during allocation of clusters.


Detailed Description

Functions that manipulate the File Allocation Tables.

Definition in file fat_fat.c.


Generated on Thu Jun 2 07:45:54 2011 for HelenOS/USB by  doxygen 1.4.7