Reading and writing data blocks. More...
Functions | |
int | PhatSectorWrite (NUTDEVICE *dev, uint32_t sect, const void *data, int num) |
Directly write consecutive sectors. | |
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) |
void | PhatSectorBufferRelease (NUTDEVICE *dev, int bufnum) |
Reading and writing data blocks.
Directly write consecutive sectors.
References _NUTDEVICE::dev_dcb, _NUTDEVICE::dev_icb, EIO, errno, NUTBLKDEV_SEEK, NutEventPost(), NutEventWait(), _BLKPAR_SEEK::par_blknum, _BLKPAR_SEEK::par_nfp, rc, _PHATSECTBUF::sect_dirty, _PHATSECTBUF::sect_lock, _PHATSECTBUF::sect_num, _PHATVOL::vol_buf, and _PHATVOL::vol_iomutex.
Referenced by PhatFileWrite().
int PhatSectorFlush | ( | NUTDEVICE * | dev, |
int | bufnum | ||
) |
Flush sector buffers.
The volume must be locked before calling this function.
dev | Specifies the file system device. |
bufnum | The buffer number to flush. If -1, all buffers are flushed. |
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().
Read sector.
The volume must be locked before calling this function.
blkmnt | Specifies the mounted block device partition. |
sect | Sector to load. |
buf | Points to a buffer which will receive the sector data. |
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().
References _NUTDEVICE::dev_dcb, _NUTDEVICE::dev_icb, NutEventPost(), NutEventWait(), NutSleep(), PhatSectorFlush(), PhatSectorRead(), _PHATSECTBUF::sect_data, _PHATSECTBUF::sect_lock, _PHATSECTBUF::sect_num, _PHATVOL::vol_buf, and _PHATVOL::vol_iomutex.
Referenced by Phat12GetClusterLink(), Phat12SetClusterLink(), Phat16GetClusterLink(), Phat16SetClusterLink(), Phat32FreeClusters(), Phat32GetClusterLink(), Phat32SetClusterLink(), PhatDirEntryUpdate(), PhatFileRead(), and PhatFileWrite().
void PhatSectorBufferRelease | ( | NUTDEVICE * | dev, |
int | bufnum | ||
) |
References _NUTDEVICE::dev_dcb, _PHATSECTBUF::sect_lock, and _PHATVOL::vol_buf.
Referenced by Phat32FreeClusters(), Phat32GetClusterLink(), Phat32SetClusterLink(), PhatDirEntryUpdate(), PhatFileRead(), and PhatFileWrite().