NetworkBlockDevice / nbd

Network Block Device
GNU General Public License v2.0
450 stars 116 forks source link

Does rawexpread() handle all file data reading works? #117

Closed liqin2016 closed 3 years ago

liqin2016 commented 3 years ago

Hi there,

I am doing some projects on nbd. Tring to modify nbd-server.c to let it read from my own apis rather than from local file. I found that even though I changed rawexpread() fuction, the client still get bs and sz from local file. I guess nbd are not get block size and file size by call rawexpread() to get superblock data. Please correct me if I am wrong. My question is how nbd get superblock data from local files? Which function are used to getting superblock data?

Thanks! Best regards

yoe commented 3 years ago

as you've indeed discovered, rawexpread() and friends are not used to figure out the file size.