Mass Storage driver IOMedia Object
Mass Storage driver IOMedia Object
- Subject: Mass Storage driver IOMedia Object
- From: Yogesh P <email@hidden>
- Date: 07 Oct 2005 13:32:44 +0530
Hi Mike,
Thanks for your quick reply.
As you mention that the write() routine is associated with specific
instance of the media,means every media object is associated with
particular instance of driver and the write() routine use this specific
instance of driver for writting on that specific media object.
Suppose, I have two media objects exposed by my driver say "Part1" and
"Part2".Now I am in default write() routine of "Part1" and want to write
some data on another media object.i.e on "Part2" before I exit from
"Part1" write() routine.
You will understand the problem by looking at the below code snippet:
// write routine for "Part1"
void MyDriver::write(IOService *provider, UInt64 byteStart,
IOMemoryDescriptor *buffer, IOStorageCompletion completion)
{
IOMedia* _filteredMedia; // MyDriver Media Object
IOMedia* _media; // MyDriver's provider Media
Object(IOBlockStorageDriver)
char MediaName[100];
sprintf(MediaName, "%s",_media->getName());//get the Media
Name
// Match the Media Names
if(strcmp(MediaName, "Part2") == 0)
{
// write on "Part2"
getProvider()->write(this, byteStart, buffer, completion);
// This should write the buffer on "Part2"
}
// write on "Part1"
getProvider()->write(this, byteStart,buffer, completion);
}
What I have found that if i have 2 media's then it goes in write routine
twice, first time for "Part1" and then next time for "Part2".But I want
that when it comes in write() for "Part1" it should write on "Part2" as
well, in the same write()routine before coming out of it.
Thanks,
Yogesh
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden