2006-10-25 15:40:36 +02:00
|
|
|
#include "fs.h"
|
|
|
|
#include "inode.h"
|
|
|
|
#include "super.h"
|
|
|
|
#include <minix/vfsif.h>
|
2011-11-09 14:29:12 +01:00
|
|
|
#include <minix/bdev.h>
|
2006-10-25 15:40:36 +02:00
|
|
|
|
2007-08-07 14:38:35 +02:00
|
|
|
/*===========================================================================*
|
2014-08-24 12:06:03 +02:00
|
|
|
* fs_mount *
|
2007-08-07 14:38:35 +02:00
|
|
|
*===========================================================================*/
|
2014-08-24 12:06:03 +02:00
|
|
|
int fs_mount(dev_t dev, unsigned int flags, struct fsdriver_node *root_node,
|
|
|
|
unsigned int *res_flags)
|
2007-08-07 14:38:35 +02:00
|
|
|
{
|
|
|
|
/* This function reads the superblock of the partition, gets the root inode
|
2014-08-24 12:06:03 +02:00
|
|
|
* and sends back the details of them.
|
2007-08-07 14:38:35 +02:00
|
|
|
*/
|
|
|
|
struct inode *root_ip;
|
2014-08-24 12:06:03 +02:00
|
|
|
int r, readonly;
|
2007-08-07 14:38:35 +02:00
|
|
|
|
2014-08-24 12:06:03 +02:00
|
|
|
fs_dev = dev;
|
|
|
|
readonly = (flags & REQ_RDONLY) ? 1 : 0;
|
2007-08-07 14:38:35 +02:00
|
|
|
|
|
|
|
/* Open the device the file system lives on. */
|
2013-07-27 00:49:49 +02:00
|
|
|
if (bdev_open(fs_dev, readonly ? BDEV_R_BIT : (BDEV_R_BIT|BDEV_W_BIT) ) !=
|
|
|
|
OK) {
|
2007-08-07 14:38:35 +02:00
|
|
|
return(EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Fill in the super block. */
|
2008-11-19 13:26:10 +01:00
|
|
|
superblock.s_dev = fs_dev; /* read_super() needs to know which dev */
|
|
|
|
r = read_super(&superblock);
|
2007-08-07 14:38:35 +02:00
|
|
|
|
|
|
|
/* Is it recognized as a Minix filesystem? */
|
|
|
|
if (r != OK) {
|
2008-11-19 13:26:10 +01:00
|
|
|
superblock.s_dev = NO_DEV;
|
2011-11-09 14:29:12 +01:00
|
|
|
bdev_close(fs_dev);
|
2007-08-07 14:38:35 +02:00
|
|
|
return(r);
|
|
|
|
}
|
2008-11-19 13:26:10 +01:00
|
|
|
|
2011-12-22 01:29:27 +01:00
|
|
|
/* clean check: if rw and not clean, switch to readonly */
|
|
|
|
if(!(superblock.s_flags & MFSFLAG_CLEAN) && !readonly) {
|
|
|
|
if(bdev_close(fs_dev) != OK)
|
|
|
|
panic("couldn't bdev_close after found unclean FS");
|
|
|
|
readonly = 1;
|
|
|
|
|
2013-07-27 00:49:49 +02:00
|
|
|
if (bdev_open(fs_dev, BDEV_R_BIT) != OK) {
|
2011-12-22 01:29:27 +01:00
|
|
|
panic("couldn't bdev_open after found unclean FS");
|
|
|
|
return(EINVAL);
|
|
|
|
}
|
2013-11-15 19:01:25 +01:00
|
|
|
printf("MFS: WARNING: FS 0x%llx unclean, mounting readonly\n", fs_dev);
|
2011-12-22 01:29:27 +01:00
|
|
|
}
|
2015-03-29 17:26:23 +02:00
|
|
|
|
2015-03-28 01:45:28 +01:00
|
|
|
lmfs_set_blocksize(superblock.s_block_size);
|
2015-03-29 17:26:23 +02:00
|
|
|
|
|
|
|
/* Compute the current number of used zones, and report it to libminixfs.
|
|
|
|
* Note that libminixfs really wants numbers of *blocks*, but this MFS
|
|
|
|
* implementation dropped support for differing zone/block sizes a while ago.
|
|
|
|
*/
|
|
|
|
used_zones = superblock.s_zones - count_free_bits(&superblock, ZMAP);
|
|
|
|
|
|
|
|
lmfs_set_blockusage(superblock.s_zones, used_zones);
|
2007-08-07 14:38:35 +02:00
|
|
|
|
|
|
|
/* Get the root inode of the mounted file system. */
|
2010-05-10 15:26:00 +02:00
|
|
|
if( (root_ip = get_inode(fs_dev, ROOT_INODE)) == NULL) {
|
2011-11-09 14:29:12 +01:00
|
|
|
printf("MFS: couldn't get root inode\n");
|
|
|
|
superblock.s_dev = NO_DEV;
|
|
|
|
bdev_close(fs_dev);
|
|
|
|
return(EINVAL);
|
2007-09-26 17:06:41 +02:00
|
|
|
}
|
2007-08-07 14:38:35 +02:00
|
|
|
|
2010-06-01 14:35:33 +02:00
|
|
|
if(root_ip->i_mode == 0) {
|
2011-11-09 14:29:12 +01:00
|
|
|
printf("%s:%d zero mode for root inode?\n", __FILE__, __LINE__);
|
|
|
|
put_inode(root_ip);
|
|
|
|
superblock.s_dev = NO_DEV;
|
|
|
|
bdev_close(fs_dev);
|
|
|
|
return(EINVAL);
|
2007-08-07 14:38:35 +02:00
|
|
|
}
|
2006-10-25 15:40:36 +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
|
|
|
superblock.s_rd_only = readonly;
|
2007-08-07 14:38:35 +02:00
|
|
|
|
|
|
|
/* Root inode properties */
|
2014-08-24 12:06:03 +02:00
|
|
|
root_node->fn_ino_nr = root_ip->i_num;
|
|
|
|
root_node->fn_mode = root_ip->i_mode;
|
|
|
|
root_node->fn_size = root_ip->i_size;
|
|
|
|
root_node->fn_uid = root_ip->i_uid;
|
|
|
|
root_node->fn_gid = root_ip->i_gid;
|
|
|
|
root_node->fn_dev = NO_DEV;
|
|
|
|
|
|
|
|
*res_flags = RES_NOFLAGS;
|
2011-08-22 17:02:13 +02:00
|
|
|
|
2011-12-22 01:29:27 +01:00
|
|
|
/* Mark it dirty */
|
|
|
|
if(!superblock.s_rd_only) {
|
|
|
|
superblock.s_flags &= ~MFSFLAG_CLEAN;
|
|
|
|
if(write_super(&superblock) != OK)
|
|
|
|
panic("mounting: couldn't write dirty superblock");
|
|
|
|
}
|
|
|
|
|
- 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
|
|
|
return(r);
|
2007-08-07 14:38:35 +02:00
|
|
|
}
|
2006-10-25 15:40:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
2014-08-24 12:06:03 +02:00
|
|
|
* fs_mountpt *
|
2006-10-25 15:40:36 +02:00
|
|
|
*===========================================================================*/
|
2014-08-24 12:06:03 +02:00
|
|
|
int fs_mountpt(ino_t ino_nr)
|
2006-10-25 15:40:36 +02:00
|
|
|
{
|
|
|
|
/* This function looks up the mount point, it checks the condition whether
|
- 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
|
|
|
* the partition can be mounted on the inode or not.
|
2006-10-25 15:40:36 +02:00
|
|
|
*/
|
|
|
|
register struct inode *rip;
|
|
|
|
int r = OK;
|
2014-05-01 16:19:28 +02:00
|
|
|
mode_t bits;
|
2006-10-25 15:40:36 +02:00
|
|
|
|
|
|
|
/* Temporarily open the file. */
|
2014-08-24 12:06:03 +02:00
|
|
|
if( (rip = get_inode(fs_dev, ino_nr)) == NULL)
|
- 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
|
|
|
return(EINVAL);
|
2006-10-25 15:40:36 +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
|
|
|
if(rip->i_mountpoint) r = EBUSY;
|
2007-08-07 14:38:35 +02:00
|
|
|
|
|
|
|
/* It may not be special. */
|
|
|
|
bits = rip->i_mode & I_TYPE;
|
|
|
|
if (bits == I_BLOCK_SPECIAL || bits == I_CHAR_SPECIAL) r = ENOTDIR;
|
- 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
|
|
|
|
2007-08-07 14:38:35 +02:00
|
|
|
put_inode(rip);
|
|
|
|
|
- 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
|
|
|
if(r == OK) rip->i_mountpoint = TRUE;
|
|
|
|
|
|
|
|
return(r);
|
2007-08-07 14:38:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-10-25 15:40:36 +02:00
|
|
|
/*===========================================================================*
|
|
|
|
* fs_unmount *
|
|
|
|
*===========================================================================*/
|
2014-08-24 12:06:03 +02:00
|
|
|
void fs_unmount(void)
|
2006-10-25 15:40:36 +02:00
|
|
|
{
|
2014-08-24 12:06:03 +02:00
|
|
|
/* Unmount a file system. */
|
2006-10-25 15:40:36 +02:00
|
|
|
int count;
|
- 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
|
|
|
struct inode *rip, *root_ip;
|
2006-10-25 15:40:36 +02:00
|
|
|
|
|
|
|
/* See if the mounted device is busy. Only 1 inode using it should be
|
2014-08-24 12:06:03 +02:00
|
|
|
* open --the root inode-- and that inode only 1 time. This is an integrity
|
|
|
|
* check only: VFS expects the unmount to succeed either way.
|
|
|
|
*/
|
2006-10-25 15:40:36 +02:00
|
|
|
count = 0;
|
- 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
|
|
|
for (rip = &inode[0]; rip < &inode[NR_INODES]; rip++)
|
|
|
|
if (rip->i_count > 0 && rip->i_dev == fs_dev) count += rip->i_count;
|
2014-08-24 12:06:03 +02:00
|
|
|
if (count != 1)
|
|
|
|
printf("MFS: file system has %d in-use inodes!\n", count);
|
- 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
|
|
|
|
2014-08-24 12:06:03 +02:00
|
|
|
if ((root_ip = find_inode(fs_dev, ROOT_INODE)) == NULL)
|
|
|
|
panic("MFS: couldn't find root inode\n");
|
- 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
|
|
|
|
|
|
|
put_inode(root_ip);
|
2006-10-25 15:40:36 +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
|
|
|
/* force any cached blocks out of memory */
|
2014-08-24 12:06:03 +02:00
|
|
|
fs_sync();
|
- 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-12-22 01:29:27 +01:00
|
|
|
/* Mark it clean if we're allowed to write _and_ it was clean originally. */
|
2014-08-24 12:06:03 +02:00
|
|
|
if (!superblock.s_rd_only) {
|
2011-12-22 01:29:27 +01:00
|
|
|
superblock.s_flags |= MFSFLAG_CLEAN;
|
|
|
|
write_super(&superblock);
|
|
|
|
}
|
|
|
|
|
- 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
|
|
|
/* Close the device the file system lives on. */
|
2011-11-09 14:29:12 +01:00
|
|
|
bdev_close(fs_dev);
|
2006-10-25 15:40:36 +02:00
|
|
|
|
2013-09-15 18:55:42 +02:00
|
|
|
/* Throw out blocks out of the VM cache, to prevent corruption later. */
|
|
|
|
lmfs_invalidate(fs_dev);
|
|
|
|
|
2006-10-25 15:40:36 +02:00
|
|
|
/* Finish off the unmount. */
|
2008-11-19 13:26:10 +01:00
|
|
|
superblock.s_dev = NO_DEV;
|
2006-10-25 15:40:36 +02:00
|
|
|
}
|
|
|
|
|