2009-10-01 16:00:27 +02:00
|
|
|
#include "inc.h"
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <minix/vfsif.h>
|
2011-11-09 14:29:12 +01:00
|
|
|
#include <minix/bdev.h>
|
2009-10-01 16:00:27 +02:00
|
|
|
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
|
2009-10-01 16:00:27 +02:00
|
|
|
/*===========================================================================*
|
|
|
|
* fs_sync *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int fs_sync()
|
2009-10-01 16:00:27 +02:00
|
|
|
{
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
/* Always mounted read only, so nothing to sync */
|
2009-10-01 16:00:27 +02:00
|
|
|
return(OK); /* sync() can't fail */
|
|
|
|
}
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
|
2011-11-09 14:29:12 +01:00
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* fs_new_driver *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int fs_new_driver(void)
|
2011-11-09 14:29:12 +01:00
|
|
|
{
|
|
|
|
/* Set a new driver endpoint for this device. */
|
|
|
|
dev_t dev;
|
2011-11-30 19:05:26 +01:00
|
|
|
cp_grant_id_t label_gid;
|
|
|
|
size_t label_len;
|
|
|
|
char label[sizeof(fs_dev_label)];
|
|
|
|
int r;
|
2011-11-09 14:29:12 +01:00
|
|
|
|
2014-04-29 21:13:28 +02:00
|
|
|
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;
|
2011-11-09 14:29:12 +01:00
|
|
|
|
2011-11-30 19:05:26 +01:00
|
|
|
if (label_len > sizeof(label))
|
|
|
|
return(EINVAL);
|
|
|
|
|
|
|
|
r = sys_safecopyfrom(fs_m_in.m_source, label_gid, (vir_bytes) 0,
|
2012-06-16 03:46:15 +02:00
|
|
|
(vir_bytes) label, label_len);
|
2011-11-30 19:05:26 +01:00
|
|
|
|
|
|
|
if (r != OK) {
|
|
|
|
printf("ISOFS: fs_new_driver safecopyfrom failed (%d)\n", r);
|
|
|
|
return(EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
bdev_driver(dev, label);
|
2011-11-09 14:29:12 +01:00
|
|
|
|
|
|
|
return(OK);
|
|
|
|
}
|