[Disksim-users] Need help understanding cache_mem_event struct usage in disksim_cachemem.c

David Maung dmaung at earthlink.net
Mon Jul 6 19:56:13 EDT 2009


If anyone is familiar with disksim_cachemem.c, I have a question regarding
the usage of the cache_mem_event structure member lockstop.

 

In the function cachemem_getblock, it is used as:

 

rwdesc->lockstop = - (req->blkno % cache->atomsperbit);

 

Which would incline me to give it a definition of "Negative offset from the
requested logical block to the lock location for this block".  In another
function allocate_cache_space, it is used as:

 

allocdesc->lockstop = lbn - (lbn % linesize);

 

This would incline me to give it a definition of "Beginning of the
allocation unit for the specified logical block number."

 

In yet more places, it is assigned to lbn and vice versa.

 

These multiple uses for the same structure member are confusing me as to the
actual use in particular places.  Any help would be appreciated.

 

Sincerely,

 

David Maung

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/disksim-users/attachments/20090706/e2856788/attachment.html>


More information about the Disksim-users mailing list