Volume Support
[PHAT File System]

Collaboration diagram for Volume Support:


Detailed Description

Dealing with volumes.


Data Structures

struct  _PHATVBR
 Volume boot record. More...
struct  _PHATSECTBUF
 Sector buffer structure. More...
struct  _PHATVOL
 Volume info structure. More...

Typedefs

typedef _PHATVBR PHATVBR
 Volume boot record.
typedef _PHATSECTBUF PHATSECTBUF
 Sector buffer structure.
typedef _PHATVOL PHATVOL
 Volume info structure.

Functions

int PhatVolMount (NUTDEVICE *dev, NUTFILE *blkmnt, u_char part_type)
 Mount a PHAT volume.
int PhatVolUnmount (NUTDEVICE *dev)
 Unmount a PHAT volume.
u_long PhatClusterSector (NUTFILE *nfp, u_long clust)


Typedef Documentation

typedef struct _PHATVBR PHATVBR

Volume boot record.

typedef struct _PHATSECTBUF PHATSECTBUF

Sector buffer structure.

typedef struct _PHATVOL PHATVOL

Volume info structure.


Function Documentation

int PhatVolMount ( NUTDEVICE dev,
NUTFILE blkmnt,
u_char  part_type 
)

Mount a PHAT volume.

This routine is called by the block device driver while mounting a partition. It reads and verifies the volume boot record, which is located in the first sector of a volume.

The routine may also initializes any caching mechanism. Thus, it must be called before any other read or write access.

Parameters:
dev Specifies the file system device.
blkmnt Handle of the block device's partition mount.
part_type Partition type:
  • PTYPE_FAT32
  • PTYPE_FAT32_LBA
  • PTYPE_FAT16
  • PTYPE_FAT16_BIG
  • PTYPE_FAT16_LBA
  • PTYPE_FAT12
Returns:
0 on success or -1 in case of an error.

Definition at line 179 of file phatvol.c.

References _NUTDEVICE::dev_dcb, _NUTDEVICE::dev_ioctl, ENODEV, errno, free, malloc, memset(), _NUTFILE::nf_dev, NUTBLKDEV_INFO, _BLKPAR_INFO::par_blksz, _BLKPAR_INFO::par_nfp, PhatVolUnmount(), PTYPE_FAT12, PTYPE_FAT16, PTYPE_FAT16_BIG, PTYPE_FAT16_LBA, PTYPE_FAT32, PTYPE_FAT32_LBA, _PHATSECTBUF::sect_data, _PHATSECTBUF::sect_num, _PHATVOL::vol_buf, and _PHATVOL::vol_type.

int PhatVolUnmount ( NUTDEVICE dev  ) 

Unmount a PHAT volume.

This routine is called by the block device driver while unmounting a partition.

Parameters:
dev Specifies the file system device.
Returns:
0 on success or -1 in case of an error.

Definition at line 365 of file phatvol.c.

References _NUTDEVICE::dev_dcb, free, _PHATSECTBUF::sect_data, and _PHATVOL::vol_buf.

Referenced by PhatVolMount().

u_long PhatClusterSector ( NUTFILE nfp,
u_long  clust 
)

Definition at line 390 of file phatvol.c.

References _NUTDEVICE::dev_dcb, IsFixedRootDir(), _NUTFILE::nf_dev, _PHATVOL::vol_clustsz, _PHATVOL::vol_data_sect, and _PHATVOL::vol_root_sect.

Referenced by PhatDirOpen(), and PhatFileOpen().


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/