From: Dmitry Antipov <antipov@dev.rtsoft.ru>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.6.20-rc4: async I/O support for inotify
Date: Fri, 12 Jan 2007 12:48:24 +0300 [thread overview]
Message-ID: <45A75968.7010109@dev.rtsoft.ru> (raw)
Hello,
this is a proposal async I/O notification support for the inotify.
Dmitry
--- .orig-2.6.20-rc4/fs/inotify_user.c 2007-01-12 08:27:10.000000000 +0300
+++ 2.6.20-rc4/fs/inotify_user.c 2007-01-12 09:53:12.000000000 +0300
@@ -72,6 +72,7 @@
*/
struct inotify_device {
wait_queue_head_t wq; /* wait queue for i/o */
+ struct fasync_struct *fasync; /* async i/o notification */
struct mutex ev_mutex; /* protects event queue */
struct mutex up_mutex; /* synchronizes watch updates */
struct list_head events; /* list of queued events */
@@ -301,6 +302,7 @@
dev->queue_size += sizeof(struct inotify_event) + kevent->event.len;
list_add_tail(&kevent->list, &dev->events);
wake_up_interruptible(&dev->wq);
+ kill_fasync(&dev->fasync, SIGIO, POLL_IN);
out:
mutex_unlock(&dev->ev_mutex);
@@ -485,6 +487,7 @@
{
struct inotify_device *dev = file->private_data;
+ fasync_helper(-1, file, 0, &dev->fasync);
inotify_destroy(dev->ih);
/* destroy all of the events on this device */
@@ -518,12 +521,19 @@
return ret;
}
+static int inotify_fasync(int fd, struct file *file, int on)
+{
+ struct inotify_device *dev = file->private_data;
+ return fasync_helper(fd, file, on, &dev->fasync);
+}
+
static const struct file_operations inotify_fops = {
.poll = inotify_poll,
.read = inotify_read,
.release = inotify_release,
.unlocked_ioctl = inotify_ioctl,
.compat_ioctl = inotify_ioctl,
+ .fasync = inotify_fasync,
};
static const struct inotify_operations inotify_user_ops = {
reply other threads:[~2007-01-12 9:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45A75968.7010109@dev.rtsoft.ru \
--to=antipov@dev.rtsoft.ru \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox