Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ntfs actually implement ntfs_mountroot()
details: https://anonhg.NetBSD.org/src/rev/0c996d4f1edb
branches: trunk
changeset: 476256:0c996d4f1edb
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Fri Sep 10 17:30:08 1999 +0000
description:
actually implement ntfs_mountroot()
diffstat:
sys/ntfs/ntfs_vfsops.c | 42 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 40 insertions(+), 2 deletions(-)
diffs (56 lines):
diff -r e3d09e9e915e -r 0c996d4f1edb sys/ntfs/ntfs_vfsops.c
--- a/sys/ntfs/ntfs_vfsops.c Fri Sep 10 16:59:04 1999 +0000
+++ b/sys/ntfs/ntfs_vfsops.c Fri Sep 10 17:30:08 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs_vfsops.c,v 1.10 1999/09/10 16:14:03 jdolecek Exp $ */
+/* $NetBSD: ntfs_vfsops.c,v 1.11 1999/09/10 17:30:08 jdolecek Exp $ */
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
@@ -155,7 +155,45 @@
static int
ntfs_mountroot()
{
- return (EINVAL);
+ struct mount *mp;
+ extern struct vnode *rootvp;
+ struct proc *p = curproc; /* XXX */
+ int error;
+ struct ntfs_args args;
+
+ if (root_device->dv_class != DV_DISK)
+ return (ENODEV);
+
+ /*
+ * Get vnodes for rootdev.
+ */
+ if (bdevvp(rootdev, &rootvp))
+ panic("ntfs_mountroot: can't setup rootvp");
+
+ if ((error = vfs_rootmountalloc(MOUNT_NTFS, "root_device", &mp))) {
+ vrele(rootvp);
+ return (error);
+ }
+
+ args.flag = 0;
+ args.uid = 0;
+ args.gid = 0;
+ args.mode = 0777;
+
+ if ((error = ntfs_mountfs(rootvp, mp, &args, p)) != 0) {
+ mp->mnt_op->vfs_refcount--;
+ vfs_unbusy(mp);
+ free(mp, M_MOUNT);
+ vrele(rootvp);
+ return (error);
+ }
+
+ simple_lock(&mountlist_slock);
+ CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list);
+ simple_unlock(&mountlist_slock);
+ (void)ntfs_statfs(mp, &mp->mnt_stat, p);
+ vfs_unbusy(mp);
+ return (0);
}
static void
Home |
Main Index |
Thread Index |
Old Index