
The "bdev" library provides basic primitives for file systems to talk to block device drivers, hiding the details of the underlying protocol and interaction model. This version of libbdev is rather basic. It is planned to support the following features in the long run: - asynchronous requests and replies; - recovery support for underlying block drivers; - retrying of failed I/O requests. The commit also changes our block-based file systems (mfs, ext2, isofs) to make use of libbdev.
20 lines
649 B
C
20 lines
649 B
C
#ifndef __MINIX_BDEV_H
|
|
#define __MINIX_BDEV_H
|
|
|
|
#define BDEV_NOFLAGS 0
|
|
|
|
extern void bdev_driver(dev_t dev, endpoint_t endpt);
|
|
|
|
extern int bdev_open(dev_t dev, int access);
|
|
extern int bdev_close(dev_t dev);
|
|
|
|
extern int bdev_read(dev_t dev, u64_t pos, char *buf, int count, int flags);
|
|
extern int bdev_write(dev_t dev, u64_t pos, char *buf, int count, int flags);
|
|
extern int bdev_gather(dev_t dev, u64_t pos, iovec_t *vec, int count,
|
|
int flags, vir_bytes *size);
|
|
extern int bdev_scatter(dev_t dev, u64_t pos, iovec_t *vec, int count,
|
|
int flags, vir_bytes *size);
|
|
extern int bdev_ioctl(dev_t dev, int request, void *buf);
|
|
|
|
#endif /* __MINIX_BDEV_H */
|