28.08.2015 Views

The Design and Implementation of the Anykernel and Rump Kernels

1F3KDce

1F3KDce

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

119<br />

int<br />

RUMP_VOP_READ(struct vnode *vp, struct uio *uio, int i<strong>of</strong>lag, struct kauth_cred *cred)<br />

{<br />

int error;<br />

rump_schedule();<br />

error = VOP_READ(vp, uio, i<strong>of</strong>lag, cred);<br />

rump_unschedule();<br />

}<br />

return error;<br />

Figure 3.14: <strong>Implementation</strong> <strong>of</strong> RUMP_VOP_READ(). <strong>The</strong> backend kernel call<br />

is wrapped around <strong>the</strong> rump kernel entrypoint <strong>and</strong> exitpoint.<br />

<strong>The</strong> rump vnode interface exports <strong>the</strong> vnode interfaces to rump kernel clients. <strong>The</strong><br />

intended users are microkernel file servers which use rump kernels as backends. <strong>The</strong><br />

benefits for exporting this interface readily are <strong>the</strong> ones we listed in <strong>the</strong> beginning <strong>of</strong><br />

this section: a prototype for client code <strong>and</strong> automated entry/exit point h<strong>and</strong>ling.<br />

<strong>The</strong> wrappers for <strong>the</strong> vnode interface are simpler than those <strong>of</strong> <strong>the</strong> system call<br />

interface. This simplicity is because <strong>the</strong>re is no need translate parameters <strong>and</strong> we<br />

can simply pass <strong>the</strong>m on to <strong>the</strong> kernel internal interface as such. To distinguish<br />

between <strong>the</strong> internal implementation <strong>and</strong> <strong>the</strong> rump application interface, we prefix<br />

rump client vnode interfaces with RUMP_.<br />

<strong>The</strong> kernel vnode interface implementations <strong>and</strong> prototypes are autogenerated from<br />

<strong>the</strong> file sys/kern/vnode_if.src by sys/kern/vnode_if.sh. We made <strong>the</strong> script<br />

to generate our prototypes into sys/rump/include/rump/rumpvnode_if.h <strong>and</strong><br />

wrapper functions into sys/rump/librump/rumpvfs/rumpvnode_if.c. Anexample<br />

result showing <strong>the</strong> RUMP_VOP_READ() interface is presented in Figure 3.14. <strong>The</strong><br />

VOP_READ() routine called by <strong>the</strong> wrapper is <strong>the</strong> st<strong>and</strong>ard implementation which is<br />

extracted into a rump kernel from sys/kern/vnode_if.c.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!