Closed yakode closed 5 months ago
Hi @yakode
Thanks for your question!
zbd_
is an instance of ZonedBlockDevice
which defines the Read
as follows:
https://github.com/westerndigitalcorporation/zenfs/blob/8337de1d72ce76ec3c7329aac1ec352661953017/fs/zbd_zenfs.h#L218
I agree that the inconsistency of the Read
API is confusing.
Does that answer your question? :)
Dear @MaisenbacherD
Yesss! Very thank for your help! I understand it now :D Sorry for my carelessness ><
In the zenfs/fs /fszenfs.cc line 187, there is `ret = zbd->Read(data + read, readpos, to_read - read, false);`
I checked the definition of ZoneFsBackend:: Read and saw
int Read(char *buf, int size, uint64_t pos, bool direct);
I don't understand it. I think
ret = zbd_->Read(data + read, to_read - read, read_pos_, false);
is more reasonable.However, I saw many people compile and test ZenFS. So, it works correctly. My understanding is wrong. Please help me understand the source code. Thanks!!