Sun May 3 16:01:44 2009 UTC ()
Add rump_vfs_getmp(), which returns struct mount for a given path.
(yes, it does not take a reference to the mountpoint)


(pooka)
diff -r1.14 -r1.15 src/sys/rump/include/rump/rump.h
diff -r1.18 -r1.19 src/sys/rump/librump/rumpvfs/rump_vfs.c

cvs diff -r1.14 -r1.15 src/sys/rump/include/rump/rump.h (expand / switch to unified diff)

--- src/sys/rump/include/rump/rump.h 2009/05/02 15:20:08 1.14
+++ src/sys/rump/include/rump/rump.h 2009/05/03 16:01:44 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rump.h,v 1.14 2009/05/02 15:20:08 pooka Exp $ */ 1/* $NetBSD: rump.h,v 1.15 2009/05/03 16:01:44 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2007 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Development of this software was supported by Google Summer of Code. 6 * Development of this software was supported by Google Summer of Code.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -124,26 +124,27 @@ void rump_cred_destroy(kauth_cred_t); @@ -124,26 +124,27 @@ void rump_cred_destroy(kauth_cred_t);
124 124
125#define rump_cred_suserput(c) rump_cred_destroy(c) 125#define rump_cred_suserput(c) rump_cred_destroy(c)
126/* COMPAT_NETHACK */ 126/* COMPAT_NETHACK */
127#define WizardMode() rump_cred_suserget() 127#define WizardMode() rump_cred_suserget()
128#define YASD(cred) rump_cred_suserput(cred) 128#define YASD(cred) rump_cred_suserput(cred)
129 129
130int rump_vfs_unmount(struct mount *, int); 130int rump_vfs_unmount(struct mount *, int);
131int rump_vfs_root(struct mount *, struct vnode **, int); 131int rump_vfs_root(struct mount *, struct vnode **, int);
132int rump_vfs_statvfs(struct mount *, struct statvfs *); 132int rump_vfs_statvfs(struct mount *, struct statvfs *);
133int rump_vfs_sync(struct mount *, int, kauth_cred_t); 133int rump_vfs_sync(struct mount *, int, kauth_cred_t);
134int rump_vfs_fhtovp(struct mount *, struct fid *, struct vnode **); 134int rump_vfs_fhtovp(struct mount *, struct fid *, struct vnode **);
135int rump_vfs_vptofh(struct vnode *, struct fid *, size_t *); 135int rump_vfs_vptofh(struct vnode *, struct fid *, size_t *);
136void rump_vfs_syncwait(struct mount *); 136void rump_vfs_syncwait(struct mount *);
 137int rump_vfs_getmp(const char *, struct mount **);
137 138
138struct lwp *rump_newproc_switch(void); 139struct lwp *rump_newproc_switch(void);
139struct lwp *rump_setup_curlwp(pid_t, lwpid_t, int); 140struct lwp *rump_setup_curlwp(pid_t, lwpid_t, int);
140struct lwp *rump_get_curlwp(void); 141struct lwp *rump_get_curlwp(void);
141void rump_clear_curlwp(void); 142void rump_clear_curlwp(void);
142 143
143void rump_rcvp_set(struct vnode *, struct vnode *); 144void rump_rcvp_set(struct vnode *, struct vnode *);
144struct vnode *rump_cdir_get(void); 145struct vnode *rump_cdir_get(void);
145 146
146/* I picked the wrong header to stop sniffin' glue */ 147/* I picked the wrong header to stop sniffin' glue */
147int rump_syspuffs_glueinit(int, int *); 148int rump_syspuffs_glueinit(int, int *);
148 149
149int rump_virtif_create(int); 150int rump_virtif_create(int);

cvs diff -r1.18 -r1.19 src/sys/rump/librump/rumpvfs/rump_vfs.c (expand / switch to unified diff)

--- src/sys/rump/librump/rumpvfs/rump_vfs.c 2009/05/01 11:01:34 1.18
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c 2009/05/03 16:01:44 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rump_vfs.c,v 1.18 2009/05/01 11:01:34 pooka Exp $ */ 1/* $NetBSD: rump_vfs.c,v 1.19 2009/05/03 16:01:44 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Development of this software was supported by the 6 * Development of this software was supported by the
7 * Finnish Cultural Foundation. 7 * Finnish Cultural Foundation.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -352,26 +352,43 @@ rump_vfslist_iterate(struct vfsops *ops) @@ -352,26 +352,43 @@ rump_vfslist_iterate(struct vfsops *ops)
352 if (ops == NULL) 352 if (ops == NULL)
353 return LIST_FIRST(&vfs_list); 353 return LIST_FIRST(&vfs_list);
354 else 354 else
355 return LIST_NEXT(ops, vfs_list); 355 return LIST_NEXT(ops, vfs_list);
356} 356}
357 357
358struct vfsops * 358struct vfsops *
359rump_vfs_getopsbyname(const char *name) 359rump_vfs_getopsbyname(const char *name)
360{ 360{
361 361
362 return vfs_getopsbyname(name); 362 return vfs_getopsbyname(name);
363} 363}
364 364
 365int
 366rump_vfs_getmp(const char *path, struct mount **mpp)
 367{
 368 struct nameidata nd;
 369 struct vnode *vp;
 370 int rv;
 371
 372 NDINIT(&nd, LOOKUP, FOLLOW | TRYEMULROOT, UIO_USERSPACE, path);
 373 if ((rv = namei(&nd)) != 0)
 374 return rv;
 375 vp = nd.ni_vp;
 376
 377 *mpp = vp->v_mount;
 378 vrele(vp);
 379 return 0;
 380}
 381
365struct vattr* 382struct vattr*
366rump_vattr_init(void) 383rump_vattr_init(void)
367{ 384{
368 struct vattr *vap; 385 struct vattr *vap;
369 386
370 vap = kmem_alloc(sizeof(struct vattr), KM_SLEEP); 387 vap = kmem_alloc(sizeof(struct vattr), KM_SLEEP);
371 vattr_null(vap); 388 vattr_null(vap);
372 389
373 return vap; 390 return vap;
374} 391}
375 392
376void 393void
377rump_vattr_settype(struct vattr *vap, enum vtype vt) 394rump_vattr_settype(struct vattr *vap, enum vtype vt)