Nut/OS  4.10.3
API Reference
PHAT Block I/O

Reading and writing data blocks. More...

Collaboration diagram for PHAT Block I/O:

Functions

int PhatSectorFlush (NUTDEVICE *dev, int bufnum)
 Flush sector buffers.
int PhatSectorRead (NUTFILE *blkmnt, uint32_t sect, uint8_t *buf)
 Read sector.
int PhatSectorLoad (NUTDEVICE *dev, uint32_t sect)

Detailed Description

Reading and writing data blocks.


Function Documentation

int PhatSectorFlush ( NUTDEVICE dev,
int  bufnum 
)

Flush sector buffers.

The volume must be locked before calling this function.

Parameters:
devSpecifies the file system device.
bufnumThe buffer number to flush. If -1, all buffers are flushed.
Returns:
0 on success, -1 on failures.

Definition at line 94 of file phatio.c.

References _NUTDEVICE::dev_dcb, _NUTDEVICE::dev_icb, EIO, errno, NUTBLKDEV_SEEK, _BLKPAR_SEEK::par_blknum, _BLKPAR_SEEK::par_nfp, _PHATSECTBUF::sect_data, _PHATSECTBUF::sect_dirty, _PHATSECTBUF::sect_num, and _PHATVOL::vol_buf.

Referenced by PhatSectorLoad().

int PhatSectorRead ( NUTFILE blkmnt,
uint32_t  sect,
uint8_t buf 
)

Read sector.

The volume must be locked before calling this function.

Parameters:
blkmntSpecifies the mounted block device partition.
sectSector to load.
bufPoints to a buffer which will receive the sector data.
Returns:
0 on success, -1 on failures.

Definition at line 144 of file phatio.c.

References _NUTDEVICE::dev_ioctl, _NUTDEVICE::dev_read, EIO, errno, _NUTFILE::nf_dev, NUTBLKDEV_SEEK, _BLKPAR_SEEK::par_blknum, and _BLKPAR_SEEK::par_nfp.

Referenced by PhatSectorLoad(), and PhatVolMount().