On 5/11/06, jvaquero <jordi.vaquero@xxxxxxxxx> wrote:
Hello, Sorry for my poor explanation. I'm trying to write a disk driver that opens a socket and sends some information to the other system. Its works perfectly.
Amaging..... But why would a disk driver have to do that.
My problem is that when the network fails, the information isn't sent. I want to lock the device when its occurs, and I thought that I could use the function media_changed to check if the network is ok. To do this lock I'm looking for some flag or instruction that marks the device as inaccessible, or busy. This helps me because in this way the device doesn't have requests and wait until network recover.
If you are writing the disk driver (block driver). You control all of the I/O. So you can create your own structure and put a flag it. Set the falg as busy and if threre are any I/O requests, check the flag and return -EBUSY (or whatever you like) without doing any operation. see LDD3 chapter 16 for implemention details. BTW: I was wondering what does your project actually do? Regards Manish Regmi -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/