[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: kqueue/kevent support in scsi device drivers
From:       Valentin Nechayev <netch () iv ! nn ! kiev ! ua>
Date:       2003-05-31 7:39:33
[Download RAW message or body]

 Fri, May 30, 2003 at 12:14:50, jaya_bhat100 (Jayasheela Bhat) wrote about \
"kqueue/kevent support in scsi device drivers": 

JB> At present, kevent is supported for vnode, fifos, pipes and sockets, I believe. 
JB> I would like to use kevent notification in scsi devices. But the drivers \
scsi_xx.c do not support it. Whether I can implement it in scsi device driver using \
KNOTE?  JB> I was going through tty.c where KNOTE is used. struct 'tty' has the \
support for it. The same is not available in struct 'disk'.   JB> Could anyone tell \
me whether it is possible to implement it and how??

What is the aim to do it? tty, sockets, pipes, fifos are sequential devices
with data pushing to it. Disks are random access devices, this is the main
reason why disk/filesystem read() can't be nonblocking by itself: there
are two different operations in them - 1) process says to kernel what it
want read, 2) kernel returns data. (And similarly for write().)
To read from random access devices, AIO API was created (aio_read(),
aio_write(), etc.), and it doesn't require your explicit KNOTE adding:
it already supports EVFILT_AIO and SIGEV_KEVENT.

If you can access something at SCSI subsystem as sequential device,
let you go. But, it's better to implement KNOTE in driver of this device
itself, not common SCSI layer, which is too complicated to allow it.


-netch-
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic