minix/servers/iso9660fs/misc.c
Lionel Sambuc 5fb3a3e7d3 Message types for VFS new_driver
Change-Id: If1b6ee2c5beb43e72a69c27dbc32b72525831962
2014-07-28 17:05:27 +02:00

47 lines
1.2 KiB
C

#include "inc.h"
#include <fcntl.h>
#include <minix/vfsif.h>
#include <minix/bdev.h>
/*===========================================================================*
* fs_sync *
*===========================================================================*/
int fs_sync()
{
/* Always mounted read only, so nothing to sync */
return(OK); /* sync() can't fail */
}
/*===========================================================================*
* fs_new_driver *
*===========================================================================*/
int fs_new_driver(void)
{
/* Set a new driver endpoint for this device. */
dev_t dev;
cp_grant_id_t label_gid;
size_t label_len;
char label[sizeof(fs_dev_label)];
int r;
dev = fs_m_in.m_vfs_fs_new_driver.device;
label_gid = fs_m_in.m_vfs_fs_new_driver.grant;
label_len = fs_m_in.m_vfs_fs_new_driver.path_len;
if (label_len > sizeof(label))
return(EINVAL);
r = sys_safecopyfrom(fs_m_in.m_source, label_gid, (vir_bytes) 0,
(vir_bytes) label, label_len);
if (r != OK) {
printf("ISOFS: fs_new_driver safecopyfrom failed (%d)\n", r);
return(EINVAL);
}
bdev_driver(dev, label);
return(OK);
}