On Tue, Feb 14, 2012 at 1:48 PM, harryxiyou <[email protected]> wrote:
> 1, Nbd kernel space just establishes device node like /dev/nbd*. And it also 
> has
>    drivers for nbd. It is related to nbd-client. But i am not sure
> the interactions
>    between nbd kernel space and nbd-client. Right?

Look at the nbd-client code and you'll see. It basically sets up the
connection with the server and does the initial negotation/handshake
and then performs a number of ioctls to set up the kernel nbd device,
which it then starts with a call to NBD_DO_IT. NBD_DO_IT is an unusual
ioctl in that it lasts for the life of the device. This allows the
client to go into a loop receiving replies back from the server.

Meanwhile, the nbd device, once started, handles I/O requests (read
and writes, usually coming from a filesystem) and forwards the
requests to the server over the socket (which was established in
userspace). The server sends replies back for each I/O and the
nbd-client (now in the kernel, running NBD_DO_IT) receives them.

--
Paul

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to