Skip site navigation (1)Skip section navigation (2)
Date:      Fri,  7 Dec 2001 22:16:24 -0500 (EST)
From:      Chaskiel M Grundman <cg2v+@andrew.cmu.edu>
To:        freebsd-fs@freebsd.org
Subject:   Re: openafs and mmap
Message-ID:  <kw4MM85z0001RwBdRD@andrew.cmu.edu>

next in thread | raw e-mail | index | archive | help
> My biggest current problem is that mmap isn't working. cp seems to use
> mmap, and it always ends up creating a file full of nulls. It appears as
> though my getpages function is never being called, even though it seems
> to be properly listed in my vnodeopv_entry_desc (and my other vnodeops
> do get called)

I found the problem with my code that caused this.

In a vain attempt to prevent afs's vnodes from ever being vfree'd
(because they are not acquired from getnewvnode in the first place), I
was foolishly setting VDOOMED in v_flag since it didn't seem to be
referenced anywhere but in the VSHOULDFREE macro. I apparently missed
some references to it in vm/vnode_pager.c. If I don't set VDOOMED, mmap
seems to work ok. Now I'm left with my original problem: preventing vput
and vrele from ever calling vfree. 

When I was working on OpenAFS for Darwin, Umesh, on behalf of Apple,
added a new vnode flag for this purpose: VSTANDARD. getnewvnode set
VSTANDARD on all vnodes it returned (and places that did things like
vp->v_flag=VROOT were changed to use |=), and vfree, vgone, and vclean
returned immediately if the flag was not set. If a modification like
this were made to FreeBSD, I think that only VSHOULDFREE and VSHOULDBUSY
would need to test for the flag, as long as the afs code never itself
calls vgone, vclean, or vrecycle (which it does not)

If a special case hack like this is not acceptible (and I can forsee
that being the case.), then it is likely that an OpenAFS client will not
be available for FreeBSD until such time as someone works on divorcing
afs vcache objects from vnodes. Perhaps one of the other openafs/bsd
efforts will do it. (This was done once before, when jtkohl@mit ported
afs 3.3 to NetBSD 1.3 in 1994-1996, but the afs/openafs source has been
heavily restructured since then) 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?kw4MM85z0001RwBdRD>