On 09/07/14 11:01, Justin Cormack wrote:
> Attached is first pass at merging rumpfiber into netbsd source, still
> needs a bit of cleanup.
>
> Aim is to reuse the bits that are shared with rumpuser, so first patch
> split.diff splits out some shared pieces.
>
> Second is more or less the current rumpfiber with a few changes. It
> still exposes a bunch of the scheduler functions as public, without
> sane namespace, which is not particularly nice.

Nice.  Some minor comments, just to give the impression that I reviewed 
the diff:

RUMP_THREADS is not a good name.  First, RUMPUSER is more correct.  I'm 
not sure THREADS is good either.  How about MULTITASKING? (or is it too 
long?).  Also, maybe context->fibers?  I called the same swapcontext() 
mechanism "continuations" in puffs, but strictly speaking they're not 
continuations.  I think "fibers" is a good name.

-D_REENTRANT is not a property of the threading model used internally by 
librumpuser, so I think it should remain unconditionally defined.

Since you're splitting rumpuser_file.c, you could add a comment at the 
top saying that the interfaces implemented by that file will most likely 
be going away in hypercall rev 18.

Here's an (untested) implementation of the bio call:

void
rumpuser_bio(int fd, int op, void *data, size_t dlen, int64_t doff,
         rump_biodone_fn biodone, void *bioarg)
{
         ssize_t rv;
         int error = 0;

         if (op & RUMPUSER_BIO_READ) {
                 if ((rv = pread(fd, data, dlen, doff)) == -1)
                         error = errno;
         } else {
                 if ((rv = pread(fd, data, dlen, doff)) == -1)
                         error = errno;
                 if (error == 0 && (op & RUMPUSER_BIO_SYNC)) {
#ifdef __NetBSD__
                         fsync_range(fd, FDATASYNC, doff, dlen);
#else
                         fsync(fd);
#endif
                 }
         }
         if (rv == -1)
                 rv = 0;
         biodone(bioarg, (size_t)rv, error);
}

   - antti

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
rumpkernel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rumpkernel-users

Reply via email to