LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: David Miller <davem@davemloft.net>,
	Ulrich Drepper <drepper@redhat.com>,
	Andrew Morton <akpm@osdl.org>,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
	netdev <netdev@vger.kernel.org>,
	Zach Brown <zach.brown@oracle.com>,
	Christoph Hellwig <hch@infradead.org>,
	Chase Venters <chase.venters@clientec.com>,
	Johann Borck <johann.borck@densedata.com>,
	linux-kernel@vger.kernel.org, Jeff Garzik <jeff@garzik.org>,
	Jamal Hadi Salim <hadi@cyberus.ca>, Ingo Molnar <mingo@elte.hu>
Subject: [take37 9/10] kevent: Private userspace notifications.
Date: Thu, 22 Feb 2007 16:55:05 +0300	[thread overview]
Message-ID: <11721525051850@2ka.mipt.ru> (raw)
In-Reply-To: <11721525053583@2ka.mipt.ru>


Private userspace notifications.

Allows to register notifications of any private userspace
events over kevent. Events can be marked as ready using 
kevent_ctl(KEVENT_READY) command.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>

diff --git a/kernel/kevent/kevent_unotify.c b/kernel/kevent/kevent_unotify.c
new file mode 100644
index 0000000..618c09c
--- /dev/null
+++ b/kernel/kevent/kevent_unotify.c
@@ -0,0 +1,62 @@
+/*
+ * 2006 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru>
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/kevent.h>
+
+static int kevent_unotify_callback(struct kevent *k)
+{
+	return 1;
+}
+
+int kevent_unotify_enqueue(struct kevent *k)
+{
+	int err;
+
+	err = kevent_storage_enqueue(&k->user->st, k);
+	if (err)
+		goto err_out_exit;
+
+	if (k->event.req_flags & KEVENT_REQ_ALWAYS_QUEUE)
+		kevent_requeue(k);
+
+	return 0;
+
+err_out_exit:
+	return err;
+}
+
+int kevent_unotify_dequeue(struct kevent *k)
+{
+	kevent_storage_dequeue(k->st, k);
+	return 0;
+}
+
+static int __init kevent_init_unotify(void)
+{
+	struct kevent_callbacks sc = {
+		.callback = &kevent_unotify_callback,
+		.enqueue = &kevent_unotify_enqueue,
+		.dequeue = &kevent_unotify_dequeue,
+		.flags = 0,
+	};
+
+	return kevent_add_callbacks(&sc, KEVENT_UNOTIFY);
+}
+module_init(kevent_init_unotify);


  reply	other threads:[~2007-02-22 13:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <asasdasdzxczc036@2ka.mipt.ru>
2007-02-22 13:54 ` [take37 0/10] kevent: Generic event handling mechanism (socket, pipes, files, signals, AIO, timers, posix timers...) Evgeniy Polyakov
2007-02-22 13:54   ` [take37 1/10] kevent: Description Evgeniy Polyakov
2007-02-22 13:55     ` [take37 2/10] kevent: Core files Evgeniy Polyakov
2007-02-22 13:55       ` [take37 3/10] kevent: poll/select() notifications Evgeniy Polyakov
2007-02-22 13:55         ` [take37 4/10] kevent: Socket notifications Evgeniy Polyakov
2007-02-22 13:55           ` [take37 5/10] kevent: Timer notifications Evgeniy Polyakov
2007-02-22 13:55             ` [take37 6/10] kevent: Pipe notifications Evgeniy Polyakov
2007-02-22 13:55               ` [take37 7/10] kevent: Signal notifications Evgeniy Polyakov
2007-02-22 13:55                 ` [take37 8/10] kevent: Kevent posix timer notifications Evgeniy Polyakov
2007-02-22 13:55                   ` Evgeniy Polyakov [this message]
2007-02-22 13:55                     ` [take37 10/10] kevent: Kevent based generic AIO Evgeniy Polyakov
2007-11-20 15:24 ` [take8 0/4] dst: Distributed storage Evgeniy Polyakov
2007-11-20 15:24   ` [take8 1/4] dst: Distributed storage documentation Evgeniy Polyakov
2007-11-20 15:24     ` [take8 2/4] dst: Core distributed storage files Evgeniy Polyakov
2007-11-20 15:24       ` [take8 3/4] dst: Network state machine Evgeniy Polyakov
2007-11-20 15:24         ` [take8 4/4] dst: Algorithms used in distributed storage Evgeniy Polyakov

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=11721525051850@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=akpm@osdl.org \
    --cc=chase.venters@clientec.com \
    --cc=davem@davemloft.net \
    --cc=drepper@redhat.com \
    --cc=hadi@cyberus.ca \
    --cc=hch@infradead.org \
    --cc=jeff@garzik.org \
    --cc=johann.borck@densedata.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=zach.brown@oracle.com \
    --subject='Re: [take37 9/10] kevent: Private userspace notifications.' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).