[Disksim-users] disk head position to logical block number and vice versa
Ashok Anand
ashok.anand at gmail.com
Tue Mar 25 22:49:26 EDT 2008
Hi, I was trying to find out how to get logical block number from given disk
head position by structure, currdisk->mech_state
i was using
currdisk->model->layout->dm_convert_atop(currdisk->model,&mech_state,&pbn);
to get the physical block number and then,
rval=currdisk->model->layout->dm_translate_ptol(currdisk->model, &pbn, 0);
to
get corresponding logical block number. Not sure, if this is the right thing
to do ?
Furthermore, i was looking at the disksim code, for disksim_diskctlr.c ,
line no. 3987 ( version 3),
currdisk->model->mech->dm_latency(currdisk->model,
&startstate,
curr->cause,
curr->bcount,
immed,
0);
curr is current request event, and i think its cause field denotes the
starting sector from/to which data needs to read/written.
the conversion of this sector to angle uses dm_pbn_skew , but if i convert
this angle to get pbn, its sector comes to be different.
Any suggestion, why this may happen?
thanks and regards,
ashok
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/disksim-users/attachments/20080325/f2c55430/attachment.html>
More information about the Disksim-users
mailing list