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

[Nbd] For help, about struct 'nbd_request'



The 'from' and 'len' field of struct nbd_request tell us the block number
and data length of what data is being transferred, right?

Here are my questions:

1. Does the block number given by 'from' refer to the block number in the
    disk image file on remote server, not in local main memory?

2. If the answer of question 1 is positive, where do those data (data blocks
    from $from to $from + $len in remote disk image file) go when the request
    type is 'read'? Where are they saved? In local main memory? Or on local disk?
    How can I get them and save them in some other place specified by myself?

3. In kernel source file nbd.c, the function sock_xmit() is used to send or receive
    packet. There is a variable named 'iov' which contains 'void *iov_base' and
    'size_t iov_len'. Whatever read or write, 'iov' is always used. Is it used to
    represent a segment (or a data block) in local main memory? What does it mean
    when the request type is read or write respectively?

Thanks a lot!

Reply to: