DragonFly BSD
DragonFly kernel List (threaded) for 2006-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: newer vnode ops

From: rick@xxxxxxxxxxxxxxxxxxxxxxxx
Date: Sat, 1 Apr 2006 20:12:44 -0500 (EST)

> Actually, I started work on converting the NFS vnops, but haven't done
> much with it since around new years.  I have it basically working, although
> the code handling the sillyrename is incomplete.  Also, I am still not entirely
> certain that the vnode locking is done correctly.
> I got a little ambitious in an attempt to make the sillyrename also work for
> directories, and be transparent on the client, but hit a few snags.  I think it
> could still work, but it would be more involved and perhaps not worth the
> extra complexity.
Yea, I've never heard people screaming for silly rename for dirs, but maybe
there's a need?

> If there is any interest, I can share my work in progress.  I will at least try
> to get the code working on preview again.

I'd be interested in seeing whatever you have. Also, if you're inspired
to continue working on it, it would be orthogonal to what I'm doing and
definitely useful.

I've got a client that does v2, 3 and 4, including rpcsec_gss. It's just
a set of rpc routines that get called by the stuff in nfs_vnops.c, instead
of the code that does the rpc. Currently works in OpenBSD3.8.

A simple example for nfs_setattrrpc(), after the changes:
nfs_setattrrpc(struct vnode *vp, struct vattr *vap,
	       struct ucred *cred, struct thread *td)
	struct nfsnode *np = VTONFS(vp);
	struct nfsvattr nfsva;	/* vattr plus some nfsv4 stuff */
	int error, attrflag, ret;

	error = nfsrpc_setattr(vp, vap, cred, td, &nfsva, &attrflag, NULL);
	if (NFS_ISV34(vp))
		np->n_modestamp = 0;
	if (attrflag) {
		ret = nfscl_loadattrcache(&vp, &nfsva, NULL, &attrflag);
		if (ret && !error)
			error = ret;
	return (error);

The first function does the rpc (there's one for each of them). They use
vnode information, but never change anything vfs related. They return
the vnode attributes using nfsva and attrflag. The second is
specific to each port and is basically nfs_loadattrcache() with different
arguments. (nfsrpc_setattr() isn't that different from before, but has
been re-written without the ugly macros with side effects.)

So, I'm just taking what's already in nfs_vnops.c and replacing the rpc
code, hopefully without changing any of the vfs/caching semantics, since
every bsden has diverged w.r.t. this.

I'm at the stage where I have to do the hard ones, like lookup, so that's
why I'm interested in the new vops. Maybe one/both of us can get them


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]