Date: Sat, 31 May 2003 10:39:33 +0300 From: Valentin Nechayev <netch@iv.nn.kiev.ua> To: Jayasheela Bhat <jaya_bhat100@yahoo.co.in> Cc: freebsd-hackers@freebsd.org Subject: Re: kqueue/kevent support in scsi device drivers Message-ID: <20030531073933.GB5288@iv.nn.kiev.ua> In-Reply-To: <20030530111450.51217.qmail@web8206.mail.in.yahoo.com> References: <20030530111450.51217.qmail@web8206.mail.in.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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-
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030531073933.GB5288>