diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2020-01-24 11:57:55 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2020-01-24 11:57:55 +0000 |
commit | b3fb13eb55ba3112eab8d6eb702ed2be762c642a (patch) | |
tree | 68805ea93a5470f5c28fe3dba47474c66c4470be /sys/compat/linux/linux_file.c | |
parent | 197f150c0c0f34514aae0aa8b3bfc9683221f422 (diff) | |
download | src-b3fb13eb55ba3112eab8d6eb702ed2be762c642a.tar.gz src-b3fb13eb55ba3112eab8d6eb702ed2be762c642a.zip |
Add kern_unmount() and use in Linuxulator. No functional changes.
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22646
Notes
Notes:
svn path=/head/; revision=357075
Diffstat (limited to 'sys/compat/linux/linux_file.c')
-rw-r--r-- | sys/compat/linux/linux_file.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index c335d6fd1ffd..eed8814634ef 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -1107,11 +1107,8 @@ out: int linux_oldumount(struct thread *td, struct linux_oldumount_args *args) { - struct linux_umount_args args2; - args2.path = args->path; - args2.flags = 0; - return (linux_umount(td, &args2)); + return (kern_unmount(td, args->path, 0)); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -1119,16 +1116,19 @@ linux_oldumount(struct thread *td, struct linux_oldumount_args *args) int linux_umount(struct thread *td, struct linux_umount_args *args) { - struct unmount_args bsd; int flags; flags = 0; - if ((args->flags & LINUX_MNT_FORCE) != 0) + if ((args->flags & LINUX_MNT_FORCE) != 0) { + args->flags &= ~LINUX_MNT_FORCE; flags |= MNT_FORCE; + } + if (args->flags != 0) { + linux_msg(td, "unsupported umount2 flags %#x", args->flags); + return (EINVAL); + } - bsd.path = args->path; - bsd.flags = flags; - return (sys_unmount(td, &bsd)); + return (kern_unmount(td, args->path, flags)); } #endif |