Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr
All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.
XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 09:08:15 +04:00
|
|
|
/* $NetBSD: darwin_mount.c,v 1.20 2009/06/29 05:08:16 dholland Exp $ */
|
2003-09-03 01:31:01 +04:00
|
|
|
|
|
|
|
/*-
|
2008-03-22 00:54:58 +03:00
|
|
|
* Copyright (c) 2003, 2008 The NetBSD Foundation, Inc.
|
2003-09-03 01:31:01 +04:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Emmanuel Dreyfus.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr
All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.
XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 09:08:15 +04:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: darwin_mount.c,v 1.20 2009/06/29 05:08:16 dholland Exp $");
|
2003-09-03 01:31:01 +04:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/mount.h>
|
|
|
|
#include <sys/proc.h>
|
|
|
|
#include <sys/vnode.h>
|
|
|
|
#include <sys/namei.h>
|
|
|
|
#include <sys/file.h>
|
|
|
|
#include <sys/filedesc.h>
|
|
|
|
#include <sys/syscallargs.h>
|
|
|
|
|
2005-09-13 05:42:32 +04:00
|
|
|
#include <compat/sys/signal.h>
|
|
|
|
|
2003-09-03 01:31:01 +04:00
|
|
|
#include <compat/mach/mach_types.h>
|
|
|
|
#include <compat/mach/mach_vm.h>
|
|
|
|
|
2009-01-11 05:45:45 +03:00
|
|
|
#include <compat/darwin/darwin_types.h>
|
2004-07-29 02:24:06 +04:00
|
|
|
#include <compat/darwin/darwin_audit.h>
|
2003-09-03 01:31:01 +04:00
|
|
|
#include <compat/darwin/darwin_mount.h>
|
|
|
|
#include <compat/darwin/darwin_syscallargs.h>
|
|
|
|
|
2004-04-21 05:05:31 +04:00
|
|
|
static void native_to_darwin_statvfs(const struct statvfs *,
|
|
|
|
struct darwin_statfs *);
|
2003-09-03 01:31:01 +04:00
|
|
|
|
|
|
|
int
|
2007-12-21 02:02:38 +03:00
|
|
|
darwin_sys_fstatfs(struct lwp *l, const struct darwin_sys_fstatfs_args *uap, register_t *retval)
|
2003-09-03 01:31:01 +04:00
|
|
|
{
|
2007-12-21 02:02:38 +03:00
|
|
|
/* {
|
2003-09-03 01:31:01 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(struct darwin_statfs *) buf;
|
2007-12-21 02:02:38 +03:00
|
|
|
} */
|
2008-03-22 00:54:58 +03:00
|
|
|
file_t *fp;
|
2003-09-03 01:31:01 +04:00
|
|
|
struct mount *mp;
|
2004-04-21 05:05:31 +04:00
|
|
|
struct statvfs *bs;
|
2003-09-03 01:31:01 +04:00
|
|
|
struct darwin_statfs ds;
|
|
|
|
int error;
|
|
|
|
|
2008-06-24 15:18:14 +04:00
|
|
|
/* fd_getvnode() will use the descriptor for us */
|
2008-03-22 00:54:58 +03:00
|
|
|
if ((error = fd_getvnode(SCARG(uap, fd), &fp)))
|
2003-09-03 01:31:01 +04:00
|
|
|
return (error);
|
|
|
|
|
|
|
|
mp = ((struct vnode *)fp->f_data)->v_mount;
|
|
|
|
bs = &mp->mnt_stat;
|
|
|
|
|
2007-11-26 22:01:26 +03:00
|
|
|
if ((error = VFS_STATVFS(mp, bs)) != 0)
|
2003-09-03 01:31:01 +04:00
|
|
|
goto out;
|
|
|
|
|
2004-04-21 05:05:31 +04:00
|
|
|
native_to_darwin_statvfs(bs, &ds);
|
2003-09-03 01:31:01 +04:00
|
|
|
|
|
|
|
error = copyout(&ds, SCARG(uap, buf), sizeof(ds));
|
|
|
|
|
|
|
|
out:
|
2008-03-22 00:54:58 +03:00
|
|
|
fd_putfile(SCARG(uap, fd));
|
2003-09-03 01:31:01 +04:00
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-12-21 02:02:38 +03:00
|
|
|
darwin_sys_getfsstat(struct lwp *l, const struct darwin_sys_getfsstat_args *uap, register_t *retval)
|
2003-09-03 01:31:01 +04:00
|
|
|
{
|
2007-12-21 02:02:38 +03:00
|
|
|
/* {
|
2003-09-03 01:31:01 +04:00
|
|
|
syscallarg(struct darwin_statfs *) buf;
|
|
|
|
syscallarg(long) bufsize;
|
|
|
|
syscallarg(int) flags;
|
2007-12-21 02:02:38 +03:00
|
|
|
} */
|
2003-09-03 01:31:01 +04:00
|
|
|
struct mount *mp, *nmp;
|
2004-04-21 05:05:31 +04:00
|
|
|
struct statvfs *bs;
|
2003-09-03 01:31:01 +04:00
|
|
|
struct darwin_statfs ds;
|
|
|
|
struct darwin_statfs *uds;
|
|
|
|
long count, maxcount, error;
|
|
|
|
|
|
|
|
maxcount = SCARG(uap, bufsize) / sizeof(struct darwin_statfs);
|
|
|
|
uds = SCARG(uap, buf);
|
|
|
|
|
2005-02-27 01:58:54 +03:00
|
|
|
for (count = 0, mp = mountlist.cqh_first;
|
2003-09-03 01:31:01 +04:00
|
|
|
mp != (void *)&mountlist; mp = nmp) {
|
|
|
|
nmp = mp->mnt_list.cqe_next;
|
|
|
|
|
|
|
|
if ((uds != NULL) && (count < maxcount)) {
|
|
|
|
bs = &mp->mnt_stat;
|
|
|
|
|
|
|
|
if (((SCARG(uap, flags) & MNT_NOWAIT) == 0 ||
|
|
|
|
(SCARG(uap, flags) & MNT_WAIT)) &&
|
2007-11-26 22:01:26 +03:00
|
|
|
(error = VFS_STATVFS(mp, bs)))
|
2003-09-03 01:31:01 +04:00
|
|
|
continue;
|
|
|
|
|
2004-04-21 05:05:31 +04:00
|
|
|
native_to_darwin_statvfs(bs, &ds);
|
2003-09-03 01:31:01 +04:00
|
|
|
|
|
|
|
if ((error = copyout(&ds, uds, sizeof(*uds))) != 0)
|
|
|
|
return error;
|
|
|
|
uds++;
|
|
|
|
}
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((uds != NULL) && (count > maxcount))
|
|
|
|
*retval = maxcount;
|
|
|
|
else
|
|
|
|
*retval = count;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-12-21 02:02:38 +03:00
|
|
|
darwin_sys_statfs(struct lwp *l, const struct darwin_sys_statfs_args *uap, register_t *retval)
|
2003-09-03 01:31:01 +04:00
|
|
|
{
|
2007-12-21 02:02:38 +03:00
|
|
|
/* {
|
2003-09-03 01:31:01 +04:00
|
|
|
syscallarg(char *) path;
|
|
|
|
syscallarg(struct statfs *) buf;
|
2007-12-21 02:02:38 +03:00
|
|
|
} */
|
2003-09-03 01:31:01 +04:00
|
|
|
struct mount *mp;
|
2004-04-21 05:05:31 +04:00
|
|
|
struct statvfs *bs;
|
2003-09-03 01:31:01 +04:00
|
|
|
struct darwin_statfs ds;
|
Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr
All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.
XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 09:08:15 +04:00
|
|
|
struct vnode *vp;
|
2003-09-03 01:31:01 +04:00
|
|
|
int error;
|
|
|
|
|
Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr
All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.
XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 09:08:15 +04:00
|
|
|
error = namei_simple_user(SCARG(uap, path),
|
|
|
|
NSM_FOLLOW_TRYEMULROOT, &vp);
|
|
|
|
if (error != 0)
|
2003-09-03 01:31:01 +04:00
|
|
|
return error;
|
|
|
|
|
Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr
All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.
XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 09:08:15 +04:00
|
|
|
mp = vp->v_mount;
|
2003-09-03 01:31:01 +04:00
|
|
|
bs = &mp->mnt_stat;
|
Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr
All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.
XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 09:08:15 +04:00
|
|
|
vrele(vp);
|
2003-09-03 01:31:01 +04:00
|
|
|
|
2007-11-26 22:01:26 +03:00
|
|
|
if ((error = VFS_STATVFS(mp, bs)) != 0)
|
2003-09-03 01:31:01 +04:00
|
|
|
return error;
|
|
|
|
|
2004-04-21 05:05:31 +04:00
|
|
|
native_to_darwin_statvfs(bs, &ds);
|
2003-09-03 01:31:01 +04:00
|
|
|
|
|
|
|
error = copyout(&ds, SCARG(uap, buf), sizeof(ds));
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2007-12-08 21:35:53 +03:00
|
|
|
native_to_darwin_statvfs(const struct statvfs *bs, struct darwin_statfs *ds)
|
2003-09-03 01:31:01 +04:00
|
|
|
{
|
|
|
|
long dflags = 0;
|
2004-04-21 05:05:31 +04:00
|
|
|
long sflags = bs->f_flag & MNT_VISFLAGMASK;
|
2003-09-03 01:31:01 +04:00
|
|
|
|
2004-04-21 05:05:31 +04:00
|
|
|
if (sflags|MNT_RDONLY)
|
2003-09-03 01:31:01 +04:00
|
|
|
dflags |= DARWIN_MNT_RDONLY;
|
2004-04-21 05:05:31 +04:00
|
|
|
if (sflags|MNT_SYNCHRONOUS)
|
2003-09-03 01:31:01 +04:00
|
|
|
dflags |= DARWIN_MNT_SYNCHRONOUS;
|
2004-04-21 05:05:31 +04:00
|
|
|
if (sflags|MNT_NOEXEC)
|
2003-09-03 01:31:01 +04:00
|
|
|
dflags |= DARWIN_MNT_NOEXEC;
|
2004-04-21 05:05:31 +04:00
|
|
|
if (sflags|MNT_NOSUID)
|
2003-09-03 01:31:01 +04:00
|
|
|
dflags |= DARWIN_MNT_NOSUID;
|
2004-04-21 05:05:31 +04:00
|
|
|
if (sflags|MNT_NODEV)
|
2003-09-03 01:31:01 +04:00
|
|
|
dflags |= DARWIN_MNT_NODEV;
|
2004-04-21 05:05:31 +04:00
|
|
|
if (sflags|MNT_UNION)
|
2003-09-03 01:31:01 +04:00
|
|
|
dflags |= DARWIN_MNT_UNION;
|
2004-04-21 05:05:31 +04:00
|
|
|
if (sflags|MNT_ASYNC)
|
2003-09-03 01:31:01 +04:00
|
|
|
dflags |= DARWIN_MNT_ASYNC;
|
2004-04-21 05:05:31 +04:00
|
|
|
if (sflags|MNT_IGNORE)
|
2003-12-06 14:43:56 +03:00
|
|
|
dflags |= DARWIN_MNT_DONTBROWSE;
|
2003-09-03 01:31:01 +04:00
|
|
|
|
2004-04-21 05:05:31 +04:00
|
|
|
ds->f_otype = 0;
|
2003-09-03 01:31:01 +04:00
|
|
|
ds->f_oflags = dflags & 0xffff;
|
|
|
|
ds->f_bsize = bs->f_bsize;
|
|
|
|
ds->f_iosize = bs->f_iosize;
|
|
|
|
ds->f_blocks = bs->f_blocks;
|
|
|
|
ds->f_bfree = bs->f_bfree;
|
|
|
|
ds->f_bavail = bs->f_bavail;
|
|
|
|
ds->f_files = bs->f_files;
|
|
|
|
ds->f_ffree = bs->f_ffree;
|
2004-04-21 05:05:31 +04:00
|
|
|
(void)memcpy(&ds->f_fsid, &bs->f_fsidx, sizeof(ds->f_fsid));
|
2003-09-03 01:31:01 +04:00
|
|
|
ds->f_owner = bs->f_owner;
|
|
|
|
ds->f_reserved1 = 0;
|
2004-04-21 05:05:31 +04:00
|
|
|
ds->f_type = 0;
|
2003-09-03 01:31:01 +04:00
|
|
|
ds->f_flags = dflags;
|
|
|
|
(void)strlcpy(ds->f_fstypename, bs->f_fstypename, DARWIN_MFSNAMELEN);
|
|
|
|
(void)strlcpy(ds->f_mntonname, bs->f_mntonname, DARWIN_MNAMELEN);
|
|
|
|
(void)strlcpy(ds->f_mntfromname, bs->f_mntfromname, DARWIN_MNAMELEN);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|