Vladimir Dronnikov convinced me to twiddle the semantics of the new shared
subtree stuff to look more like http://lwn.net/Articles/159077/ thinks they should.
This commit is contained in:
parent
721b46e0e6
commit
3ba7bd143e
@ -28,6 +28,7 @@
|
|||||||
// Not real flags, but we want to be able to check for this.
|
// Not real flags, but we want to be able to check for this.
|
||||||
#define MOUNT_NOAUTO (1<<29)
|
#define MOUNT_NOAUTO (1<<29)
|
||||||
#define MOUNT_SWAP (1<<30)
|
#define MOUNT_SWAP (1<<30)
|
||||||
|
|
||||||
/* Standard mount options (from -o options or --options), with corresponding
|
/* Standard mount options (from -o options or --options), with corresponding
|
||||||
* flags */
|
* flags */
|
||||||
|
|
||||||
@ -291,7 +292,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
|
|||||||
// Look at the file. (Not found isn't a failure for remount, or for
|
// Look at the file. (Not found isn't a failure for remount, or for
|
||||||
// a synthetic filesystem like proc or sysfs.)
|
// a synthetic filesystem like proc or sysfs.)
|
||||||
|
|
||||||
if (!lstat(mp->mnt_fsname, &st) && !(vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE | MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)))
|
if (!lstat(mp->mnt_fsname, &st) && !(vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE)))
|
||||||
{
|
{
|
||||||
// Do we need to allocate a loopback device for it?
|
// Do we need to allocate a loopback device for it?
|
||||||
|
|
||||||
@ -455,9 +456,15 @@ int mount_main(int argc, char **argv)
|
|||||||
goto clean_up;
|
goto clean_up;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have at least one argument, it's the storage location
|
// If we have a shared subtree flag, don't worry about fstab or mtab.
|
||||||
|
i = parse_mount_options(cmdopts,0);
|
||||||
if (optind < argc) storage_path = bb_simplify_path(argv[optind]);
|
if (ENABLE_FEATURE_MOUNT_FLAGS &&
|
||||||
|
(i & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE )))
|
||||||
|
{
|
||||||
|
rc = mount("", argv[optind], "", i, "");
|
||||||
|
if (rc) bb_perror_msg_and_die("%s", argv[optind]);
|
||||||
|
goto clean_up;
|
||||||
|
}
|
||||||
|
|
||||||
// Open either fstab or mtab
|
// Open either fstab or mtab
|
||||||
|
|
||||||
@ -465,6 +472,8 @@ int mount_main(int argc, char **argv)
|
|||||||
fstabname = bb_path_mtab_file;
|
fstabname = bb_path_mtab_file;
|
||||||
else fstabname="/etc/fstab";
|
else fstabname="/etc/fstab";
|
||||||
|
|
||||||
|
storage_path = bb_simplify_path(argv[optind]);
|
||||||
|
|
||||||
if (!(fstab=setmntent(fstabname,"r")))
|
if (!(fstab=setmntent(fstabname,"r")))
|
||||||
bb_perror_msg_and_die("Cannot read %s",fstabname);
|
bb_perror_msg_and_die("Cannot read %s",fstabname);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user