summaryrefslogtreecommitdiffstats
path: root/sys/fs/nwfs/nwfs_vfsops.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
committerjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
commit5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch)
treeb1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/fs/nwfs/nwfs_vfsops.c
parent83e00d4274950d2b531c24692cd123538ffbddb9 (diff)
downloadFreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip
FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/fs/nwfs/nwfs_vfsops.c')
-rw-r--r--sys/fs/nwfs/nwfs_vfsops.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/sys/fs/nwfs/nwfs_vfsops.c b/sys/fs/nwfs/nwfs_vfsops.c
index 2fb0752..de5ae2f 100644
--- a/sys/fs/nwfs/nwfs_vfsops.c
+++ b/sys/fs/nwfs/nwfs_vfsops.c
@@ -71,13 +71,13 @@ MODULE_DEPEND(nwfs, ncp, 1, 1, 1);
MODULE_DEPEND(nwfs, libmchain, 1, 1, 1);
static int nwfs_mount(struct mount *, char *, caddr_t,
- struct nameidata *, struct proc *);
-static int nwfs_quotactl(struct mount *, int, uid_t, caddr_t, struct proc *);
+ struct nameidata *, struct thread *);
+static int nwfs_quotactl(struct mount *, int, uid_t, caddr_t, struct thread *);
static int nwfs_root(struct mount *, struct vnode **);
-static int nwfs_start(struct mount *, int, struct proc *);
-static int nwfs_statfs(struct mount *, struct statfs *, struct proc *);
-static int nwfs_sync(struct mount *, int, struct ucred *, struct proc *);
-static int nwfs_unmount(struct mount *, int, struct proc *);
+static int nwfs_start(struct mount *, int, struct thread *);
+static int nwfs_statfs(struct mount *, struct statfs *, struct thread *);
+static int nwfs_sync(struct mount *, int, struct ucred *, struct thread *);
+static int nwfs_unmount(struct mount *, int, struct thread *);
static int nwfs_init(struct vfsconf *vfsp);
static int nwfs_uninit(struct vfsconf *vfsp);
@@ -144,7 +144,7 @@ nwfs_initnls(struct nwmount *nmp) {
* data - addr in user space of mount params
*/
static int nwfs_mount(struct mount *mp, char *path, caddr_t data,
- struct nameidata *ndp, struct proc *p)
+ struct nameidata *ndp, struct thread *td)
{
struct nwfs_args args; /* will hold data from mount request */
int error;
@@ -169,7 +169,7 @@ static int nwfs_mount(struct mount *mp, char *path, caddr_t data,
nwfs_printf("mount version mismatch: kernel=%d, mount=%d\n",NWFS_VERSION,args.version);
return (1);
}
- error = ncp_conn_getbyref(args.connRef,p,p->p_ucred,NCPM_EXECUTE,&conn);
+ error = ncp_conn_getbyref(args.connRef, td , td->td_proc->p_ucred,NCPM_EXECUTE,&conn);
if (error) {
nwfs_printf("invalid connection refernce %d\n",args.connRef);
return (error);
@@ -179,7 +179,7 @@ static int nwfs_mount(struct mount *mp, char *path, caddr_t data,
nwfs_printf("can't get connection handle\n");
return (error);
}
- ncp_conn_unlock(conn,p); /* we keep the ref */
+ ncp_conn_unlock(conn, td); /* we keep the ref */
mp->mnt_stat.f_iosize = conn->buffer_size;
/* We must malloc our own mount info */
MALLOC(nmp,struct nwmount *,sizeof(struct nwmount),M_NWFSDATA,M_USE_RESERVE | M_ZERO);
@@ -220,7 +220,7 @@ static int nwfs_mount(struct mount *mp, char *path, caddr_t data,
/*
* Lose the lock but keep the ref.
*/
- VOP_UNLOCK(vp, 0, curproc);
+ VOP_UNLOCK(vp, 0, curthread);
NCPVODEBUG("rootvp.vrefcnt=%d\n",vp->v_usecount);
return error;
bad:
@@ -233,7 +233,7 @@ bad:
/* Unmount the filesystem described by mp. */
static int
-nwfs_unmount(struct mount *mp, int mntflags, struct proc *p)
+nwfs_unmount(struct mount *mp, int mntflags, struct thread *td)
{
struct nwmount *nmp = VFSTONWFS(mp);
struct ncp_conn *conn;
@@ -249,9 +249,9 @@ nwfs_unmount(struct mount *mp, int mntflags, struct proc *p)
return (error);
conn = NWFSTOCONN(nmp);
ncp_conn_puthandle(nmp->connh,NULL,0);
- if (ncp_conn_lock(conn,p,p->p_ucred,NCPM_WRITE | NCPM_EXECUTE) == 0) {
+ if (ncp_conn_lock(conn, td, td->td_proc->p_ucred,NCPM_WRITE | NCPM_EXECUTE) == 0) {
if(ncp_conn_free(conn))
- ncp_conn_unlock(conn,p);
+ ncp_conn_unlock(conn, td);
}
mp->mnt_data = (qaddr_t)0;
if (nmp->m.flags & NWFS_MOUNT_HAVE_NLS)
@@ -269,8 +269,8 @@ nwfs_root(struct mount *mp, struct vnode **vpp) {
struct nwnode *np;
struct ncp_conn *conn;
struct nw_entry_info fattr;
- struct proc *p = curproc;
- struct ucred *cred = p->p_ucred;
+ struct thread *td = curthread;
+ struct ucred *cred = td->td_proc->p_ucred;
int error, nsf, opt;
u_char vol;
@@ -278,16 +278,16 @@ nwfs_root(struct mount *mp, struct vnode **vpp) {
conn = NWFSTOCONN(nmp);
if (nmp->n_root) {
*vpp = NWTOV(nmp->n_root);
- while (vget(*vpp, LK_EXCLUSIVE, curproc) != 0)
+ while (vget(*vpp, LK_EXCLUSIVE, curthread) != 0)
;
return 0;
}
error = ncp_lookup_volume(conn, nmp->m.mounted_vol, &vol,
- &nmp->n_rootent.f_id, p, cred);
+ &nmp->n_rootent.f_id, td, cred);
if (error)
return ENOENT;
nmp->n_volume = vol;
- error = ncp_get_namespaces(conn, vol, &nsf, p, cred);
+ error = ncp_get_namespaces(conn, vol, &nsf, td, cred);
if (error)
return ENOENT;
if (nsf & NW_NSB_OS2) {
@@ -313,7 +313,7 @@ nwfs_root(struct mount *mp, struct vnode **vpp) {
if (nmp->m.root_path[0]) {
nmp->m.root_path[0]--;
error = ncp_obtain_info(nmp, nmp->n_rootent.f_id,
- -nmp->m.root_path[0], nmp->m.root_path, &fattr, p, cred);
+ -nmp->m.root_path[0], nmp->m.root_path, &fattr, td, cred);
if (error) {
NCPFATAL("Invalid root path specified\n");
return ENOENT;
@@ -321,7 +321,7 @@ nwfs_root(struct mount *mp, struct vnode **vpp) {
nmp->n_rootent.f_parent = fattr.dirEntNum;
nmp->m.root_path[0]++;
error = ncp_obtain_info(nmp, nmp->n_rootent.f_id,
- -nmp->m.root_path[0], nmp->m.root_path, &fattr, p, cred);
+ -nmp->m.root_path[0], nmp->m.root_path, &fattr, td, cred);
if (error) {
NCPFATAL("Invalid root path specified\n");
return ENOENT;
@@ -329,7 +329,7 @@ nwfs_root(struct mount *mp, struct vnode **vpp) {
nmp->n_rootent.f_id = fattr.dirEntNum;
} else {
error = ncp_obtain_info(nmp, nmp->n_rootent.f_id,
- 0, NULL, &fattr, p, cred);
+ 0, NULL, &fattr, td, cred);
if (error) {
NCPFATAL("Can't obtain volume info\n");
return ENOENT;
@@ -345,7 +345,7 @@ nwfs_root(struct mount *mp, struct vnode **vpp) {
if (nmp->m.root_path[0] == 0)
np->n_flag |= NVOLUME;
nmp->n_root = np;
-/* error = VOP_GETATTR(vp, &vattr, cred, p);
+/* error = VOP_GETATTR(vp, &vattr, cred, td);
if (error) {
vput(vp);
NCPFATAL("Can't get root directory entry\n");
@@ -360,10 +360,10 @@ nwfs_root(struct mount *mp, struct vnode **vpp) {
*/
/* ARGSUSED */
static int
-nwfs_start(mp, flags, p)
+nwfs_start(mp, flags, td)
struct mount *mp;
int flags;
- struct proc *p;
+ struct thread *td;
{
NCPVODEBUG("flags=%04x\n",flags);
return (0);
@@ -374,12 +374,12 @@ nwfs_start(mp, flags, p)
*/
/* ARGSUSED */
static int
-nwfs_quotactl(mp, cmd, uid, arg, p)
+nwfs_quotactl(mp, cmd, uid, arg, td)
struct mount *mp;
int cmd;
uid_t uid;
caddr_t arg;
- struct proc *p;
+ struct thread *td;
{
NCPVODEBUG("return EOPNOTSUPP\n");
return (EOPNOTSUPP);
@@ -395,7 +395,7 @@ nwfs_init(struct vfsconf *vfsp)
name[0] = CTL_HW;
name[1] = HW_NCPU;
- error = kernel_sysctl(curproc, name, 2, &ncpu, &olen, NULL, 0, &plen);
+ error = kernel_sysctl(curthread, name, 2, &ncpu, &olen, NULL, 0, &plen);
if (error == 0 && ncpu > 1)
printf("warning: nwfs module compiled without SMP support.");
#endif
@@ -419,10 +419,10 @@ nwfs_uninit(struct vfsconf *vfsp)
* nwfs_statfs call
*/
int
-nwfs_statfs(mp, sbp, p)
+nwfs_statfs(mp, sbp, td)
struct mount *mp;
struct statfs *sbp;
- struct proc *p;
+ struct thread *td;
{
struct nwmount *nmp = VFSTONWFS(mp);
int error = 0, secsize;
@@ -430,7 +430,8 @@ nwfs_statfs(mp, sbp, p)
struct ncp_volume_info vi;
if (np == NULL) return EINVAL;
- error = ncp_get_volume_info_with_number(NWFSTOCONN(nmp), nmp->n_volume, &vi,p,p->p_ucred);
+ error = ncp_get_volume_info_with_number(NWFSTOCONN(nmp),
+ nmp->n_volume, &vi, td, td->td_proc->p_ucred);
if (error) return error;
secsize = 512; /* XXX how to get real value ??? */
sbp->f_spare2=0; /* placeholder */
@@ -465,11 +466,11 @@ nwfs_statfs(mp, sbp, p)
*/
/* ARGSUSED */
static int
-nwfs_sync(mp, waitfor, cred, p)
+nwfs_sync(mp, waitfor, cred, td)
struct mount *mp;
int waitfor;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
{
struct vnode *vp, *nvp;
int error, allerror = 0;
@@ -496,11 +497,11 @@ loop:
mtx_lock(&mntvnode_mtx);
continue;
}
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) {
+ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) {
mtx_lock(&mntvnode_mtx);
goto loop;
}
- error = VOP_FSYNC(vp, cred, waitfor, p);
+ error = VOP_FSYNC(vp, cred, waitfor, td);
if (error)
allerror = error;
vput(vp);
OpenPOWER on IntegriCloud