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.
32 lines
814 B
C
32 lines
814 B
C
#include "inc.h"
|
|
#include <fcntl.h>
|
|
#include <minix/vfsif.h>
|
|
#include <minix/bdev.h>
|
|
|
|
|
|
/*===========================================================================*
|
|
* fs_sync *
|
|
*===========================================================================*/
|
|
PUBLIC int fs_sync()
|
|
{
|
|
/* Always mounted read only, so nothing to sync */
|
|
return(OK); /* sync() can't fail */
|
|
}
|
|
|
|
|
|
/*===========================================================================*
|
|
* fs_new_driver *
|
|
*===========================================================================*/
|
|
PUBLIC int fs_new_driver()
|
|
{
|
|
/* Set a new driver endpoint for this device. */
|
|
dev_t dev;
|
|
endpoint_t endpt;
|
|
|
|
dev = (dev_t) fs_m_in.REQ_DEV;
|
|
endpt = (endpoint_t) fs_m_in.REQ_DRIVER_E;
|
|
|
|
bdev_driver(dev, endpt);
|
|
|
|
return(OK);
|
|
}
|