static size_t bdev_read(struct file_desc *desc, void *buf, size_t size) { int n_read = block_dev_read_buffered((block_dev_t *) desc->node->nas->fi->privdata, buf, size, desc->cursor); if (n_read > 0) { desc->cursor += n_read; } return n_read; }
static int flash_emu_read (struct flash_dev *dev, uint32_t base, void* data, size_t len) { block_dev_t *bdev; bdev = dev->privdata; if(NULL == bdev) { return -ENODEV; } return block_dev_read_buffered(bdev, (char *) data, len, (uint32_t) base); }
static int tmpfs_read_sector(struct nas *nas, char *buffer, uint32_t count, uint32_t sector) { struct tmpfs_fs_info *fsi; fsi = nas->fs->fsi; if(0 > block_dev_read_buffered(nas->fs->bdev, buffer, count * fsi->block_size, sector * fsi->block_size)) { return -1; } else { return count; } }