Module Name: src
Committed By: pooka
Date: Sun May 3 16:01:44 UTC 2009
Modified Files:
src/sys/rump/include/rump: rump.h
src/sys/rump/librump/rumpvfs: rump_vfs.c
Log Message:
Add rump_vfs_getmp(), which returns struct mount for a given path.
(yes, it does not take a reference to the mountpoint)
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/rump/include/rump/rump.h
cvs rdiff -u -r1.18 -r1.19 src/sys/rump/librump/rumpvfs/rump_vfs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/rump/include/rump/rump.h
diff -u src/sys/rump/include/rump/rump.h:1.14 src/sys/rump/include/rump/rump.h:1.15
--- src/sys/rump/include/rump/rump.h:1.14 Sat May 2 15:20:08 2009
+++ src/sys/rump/include/rump/rump.h Sun May 3 16:01:44 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: rump.h,v 1.14 2009/05/02 15:20:08 pooka Exp $ */
+/* $NetBSD: rump.h,v 1.15 2009/05/03 16:01:44 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -134,6 +134,7 @@
int rump_vfs_fhtovp(struct mount *, struct fid *, struct vnode **);
int rump_vfs_vptofh(struct vnode *, struct fid *, size_t *);
void rump_vfs_syncwait(struct mount *);
+int rump_vfs_getmp(const char *, struct mount **);
struct lwp *rump_newproc_switch(void);
struct lwp *rump_setup_curlwp(pid_t, lwpid_t, int);
Index: src/sys/rump/librump/rumpvfs/rump_vfs.c
diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.18 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.19
--- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.18 Fri May 1 11:01:34 2009
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c Sun May 3 16:01:44 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_vfs.c,v 1.18 2009/05/01 11:01:34 pooka Exp $ */
+/* $NetBSD: rump_vfs.c,v 1.19 2009/05/03 16:01:44 pooka Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@@ -362,6 +362,23 @@
return vfs_getopsbyname(name);
}
+int
+rump_vfs_getmp(const char *path, struct mount **mpp)
+{
+ struct nameidata nd;
+ struct vnode *vp;
+ int rv;
+
+ NDINIT(&nd, LOOKUP, FOLLOW | TRYEMULROOT, UIO_USERSPACE, path);
+ if ((rv = namei(&nd)) != 0)
+ return rv;
+ vp = nd.ni_vp;
+
+ *mpp = vp->v_mount;
+ vrele(vp);
+ return 0;
+}
+
struct vattr*
rump_vattr_init(void)
{