Require statvfs info from startreq so that we have that info available.
Also, don't pass fsid to userspace and just fill it in the kernel.
This commit is contained in:
parent
d1beedb632
commit
0eca4b2eaa
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: puffs_msgif.h,v 1.7 2006/11/17 17:48:02 pooka Exp $ */
|
||||
/* $NetBSD: puffs_msgif.h,v 1.8 2006/11/18 12:39:48 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
|
||||
|
@ -200,8 +200,8 @@ struct puffs_cn {
|
|||
|
||||
|
||||
struct puffs_startreq {
|
||||
void *psr_cookie; /* IN: root node cookie */
|
||||
fsid_t psr_fsidx; /* OUT: fsid value */
|
||||
void *psr_cookie; /* IN: root node cookie */
|
||||
struct statvfs psr_sb; /* IN: statvfs buffer */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: puffs_vfsops.c,v 1.8 2006/11/17 17:48:02 pooka Exp $ */
|
||||
/* $NetBSD: puffs_vfsops.c,v 1.9 2006/11/18 12:39:48 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
|
||||
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.8 2006/11/17 17:48:02 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.9 2006/11/18 12:39:48 pooka Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
|
@ -168,10 +168,12 @@ puffs_start2(struct puffs_mount *pmp, struct puffs_startreq *sreq)
|
|||
/* We're good to fly */
|
||||
pmp->pmp_rootcookie = sreq->psr_cookie;
|
||||
pmp->pmp_status = PUFFSTAT_RUNNING;
|
||||
sreq->psr_fsidx = mp->mnt_stat.f_fsidx;
|
||||
|
||||
simple_unlock(&pmp->pmp_lock);
|
||||
|
||||
/* do the VFS_STATVFS() we missed out on in sys_mount() */
|
||||
copy_statvfs_info(&sreq->psr_sb, mp);
|
||||
(void)memcpy(&mp->mnt_stat, &sreq->psr_sb, sizeof(mp->mnt_stat));
|
||||
|
||||
DPRINTF(("puffs_start2: root vp %p, cur root pnode %p, cookie %p\n",
|
||||
pmp->pmp_root, pn, sreq->psr_cookie));
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: puffs_vnops.c,v 1.12 2006/11/18 08:18:24 pooka Exp $ */
|
||||
/* $NetBSD: puffs_vnops.c,v 1.13 2006/11/18 12:39:48 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
|
||||
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.12 2006/11/18 08:18:24 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.13 2006/11/18 12:39:48 pooka Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/vnode.h>
|
||||
|
@ -542,10 +542,13 @@ puffs_getattr(void *v)
|
|||
kauth_cred_t a_cred;
|
||||
struct lwp *a_l;
|
||||
} */ *ap = v;
|
||||
struct mount *mp;
|
||||
int error;
|
||||
|
||||
PUFFS_VNREQ(getattr);
|
||||
|
||||
mp = ap->a_vp->v_mount;
|
||||
|
||||
vattr_null(&getattr_arg.pvnr_va);
|
||||
puffs_credcvt(&getattr_arg.pvnr_cred, ap->a_cred);
|
||||
getattr_arg.pvnr_pid = puffs_lwp2pid(ap->a_l);
|
||||
|
@ -564,6 +567,12 @@ puffs_getattr(void *v)
|
|||
|
||||
(void)memcpy(ap->a_vap, &getattr_arg.pvnr_va, sizeof(struct vattr));
|
||||
|
||||
/*
|
||||
* fill in information userspace does not have
|
||||
* XXX: but would it be better to do fsid at the generic level?
|
||||
*/
|
||||
ap->a_vap->va_fsid = mp->mnt_stat.f_fsidx.__fsid_val[0];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue