diff options
author | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2010-04-02 18:34:35 +0200 |
---|---|---|
committer | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2010-04-02 18:34:35 +0200 |
commit | 281cc3b98c7112bf0b349e6c32ff50ce1cf2722a (patch) | |
tree | e15223c4249aca0d80029e1b8acc8cfc56c8fbab | |
parent | acc5795db9fd1af91690d80ec483c745ad558f28 (diff) | |
download | tsnif-281cc3b98c7112bf0b349e6c32ff50ce1cf2722a.tar.gz tsnif-281cc3b98c7112bf0b349e6c32ff50ce1cf2722a.tar.xz tsnif-281cc3b98c7112bf0b349e6c32ff50ce1cf2722a.zip |
updating kernel patches
-rw-r--r-- | kernel/0001-tty-notifier.patch | 2 | ||||
-rw-r--r-- | kernel/0002-gennl-changes-adding-non-locking-multicast-functions.patch | 2 | ||||
-rw-r--r-- | kernel/0003-alive.patch | 60 |
3 files changed, 43 insertions, 21 deletions
diff --git a/kernel/0001-tty-notifier.patch b/kernel/0001-tty-notifier.patch index 519cd55..f949cdd 100644 --- a/kernel/0001-tty-notifier.patch +++ b/kernel/0001-tty-notifier.patch @@ -1,4 +1,4 @@ -From 6579fc26064c146dd886ddc1d63c8469e9d8fc65 Mon Sep 17 00:00:00 2001 +From cc94a9f1f292495947e5e9ece38020798640cf7c Mon Sep 17 00:00:00 2001 From: jolsa@redhat.com <jolsa@redhat.com> Date: Mon, 8 Mar 2010 17:52:48 +0100 Subject: [PATCH 1/3] tty notifier diff --git a/kernel/0002-gennl-changes-adding-non-locking-multicast-functions.patch b/kernel/0002-gennl-changes-adding-non-locking-multicast-functions.patch index dfa33d1..760bd83 100644 --- a/kernel/0002-gennl-changes-adding-non-locking-multicast-functions.patch +++ b/kernel/0002-gennl-changes-adding-non-locking-multicast-functions.patch @@ -1,4 +1,4 @@ -From e3c4d76ad2cf0bb12d2fe7949716ace17929c2c7 Mon Sep 17 00:00:00 2001 +From 4c9ff9c9e46ea60fa8505697e5d43e943e7e44fb Mon Sep 17 00:00:00 2001 From: jolsa@redhat.com <jolsa@redhat.com> Date: Thu, 25 Mar 2010 08:59:04 +0100 Subject: [PATCH 2/3] gennl changes - adding non locking multicast functions diff --git a/kernel/0003-alive.patch b/kernel/0003-alive.patch index e35a005..c858653 100644 --- a/kernel/0003-alive.patch +++ b/kernel/0003-alive.patch @@ -1,16 +1,16 @@ -From 602cf474beb50b6c367b3ebf02685223fb165b51 Mon Sep 17 00:00:00 2001 +From f1769465b8deb4d764fa1131b3d34d2d7f238e94 Mon Sep 17 00:00:00 2001 From: jolsa@redhat.com <jolsa@redhat.com> -Date: Thu, 25 Mar 2010 09:00:31 +0100 +Date: Tue, 30 Mar 2010 10:41:56 +0200 Subject: [PATCH 3/3] alive --- drivers/char/Kconfig | 9 + drivers/char/Makefile | 2 + - drivers/char/tsnif.c | 836 +++++++++++++++++++++++++++++++++++++++++++++++++ + drivers/char/tsnif.c | 857 +++++++++++++++++++++++++++++++++++++++++++++++++ drivers/char/tty_io.c | 29 ++ - include/linux/tsnif.h | 62 ++++ + include/linux/tsnif.h | 63 ++++ include/linux/tty.h | 1 + - 6 files changed, 939 insertions(+), 0 deletions(-) + 6 files changed, 961 insertions(+), 0 deletions(-) create mode 100644 drivers/char/tsnif.c create mode 100644 include/linux/tsnif.h @@ -48,10 +48,10 @@ index f957edf..537c771 100644 diff --git a/drivers/char/tsnif.c b/drivers/char/tsnif.c new file mode 100644 -index 0000000..ea31a35 +index 0000000..a076f1c --- /dev/null +++ b/drivers/char/tsnif.c -@@ -0,0 +1,836 @@ +@@ -0,0 +1,857 @@ + +#include <linux/module.h> +#include <linux/kernel.h> @@ -116,20 +116,38 @@ index 0000000..ea31a35 + .name = "tsnif-ctrl", +}; + ++static int term_del(struct tsnif_term *term); ++ ++static void ref_inc(atomic_t *r) ++{ ++ smp_mb__before_atomic_inc(); ++ atomic_inc(r); ++ smp_mb__after_atomic_inc(); ++} ++ ++static int ref_dec_and_test(atomic_t *r) ++{ ++ int ret; ++ ++ smp_mb__before_atomic_dec(); ++ ret = atomic_dec_and_test(r); ++ smp_mb__before_atomic_dec(); ++ ++ return ret; ++} ++ +static struct tsnif_term* get_term(struct tsnif_term* term) +{ + if (term) -+ atomic_inc(&term->refcnt); ++ ref_inc(&term->refcnt); ++ + return term; +} + -+static int term_del(struct tsnif_term *term); -+ +static int put_term(struct tsnif_term *term) +{ -+ if (!atomic_dec_and_test(&term->refcnt)) { ++ if (!ref_dec_and_test(&term->refcnt)) + return 1; -+ } + + __genl_unregister_mc_group(&gnl_family, &term->group); + @@ -620,11 +638,11 @@ index 0000000..ea31a35 + struct tsnif_term *term; + int type = get_type(tty); + -+ read_lock(&term_lock); ++ read_lock_irq(&term_lock); + term = term_find(type, tty->index); + if (term) + get_term(term); -+ read_unlock(&term_lock); ++ read_unlock_irq(&term_lock); + + if (!term) + return 1; @@ -732,6 +750,9 @@ index 0000000..ea31a35 + return 0; +} + ++/* XXX explain why to use TSNIF_OK for ACK */ ++#define TSNIF_RET(err) (err ? err : TSNIF_OK) ++ +static int cmd_attach(struct sk_buff *skb, struct genl_info *info) +{ + struct tsnif_term* term; @@ -766,7 +787,7 @@ index 0000000..ea31a35 + +out: + write_unlock(&term_lock); -+ return err; ++ return TSNIF_RET(err); +} + +static int cmd_detach(struct sk_buff *skb, struct genl_info *info) @@ -778,7 +799,7 @@ index 0000000..ea31a35 + if (err) + return err; + -+ return detach(type, idx); ++ return TSNIF_RET(detach(type,idx)); +} + +static int cmd_mgroup(struct sk_buff *skb, struct genl_info *info) @@ -794,7 +815,7 @@ index 0000000..ea31a35 + NLA_PUT_U32(skb_answer, TSNIF_ATTR_GROUP, gnl_ctrl_group.id); + + TSNIF_DEBUG("sending control group ID %d\n", gnl_ctrl_group.id); -+ return send_msg(skb_answer, info->snd_pid); ++ return TSNIF_RET(send_msg(skb_answer, info->snd_pid)); + +nla_put_failure: + nlmsg_free(skb); @@ -930,10 +951,10 @@ index 38f2d7b..11924dc 100644 * Locking: none diff --git a/include/linux/tsnif.h b/include/linux/tsnif.h new file mode 100644 -index 0000000..8582c1c +index 0000000..86e49fd --- /dev/null +++ b/include/linux/tsnif.h -@@ -0,0 +1,62 @@ +@@ -0,0 +1,63 @@ +#ifndef TSNIF_H +#define TSNIF_H + @@ -943,6 +964,7 @@ index 0000000..8582c1c +#endif + +#define TSNIF_VERSION 1 ++#define TSNIF_OK 1 + +/* attributes */ +enum { |