]> sourceware.org Git - systemtap.git/commitdiff
2005-08-19 Martin Hunt <hunt@redhat.com>
authorhunt <hunt>
Fri, 19 Aug 2005 18:29:21 +0000 (18:29 +0000)
committerhunt <hunt>
Fri, 19 Aug 2005 18:29:21 +0000 (18:29 +0000)
* transport.c (_stp_cmd_handler): Remove. This was used by
stp-control.

* procfs.c (_stp_proc_write_cmd): Call schedule_work() instead
of running _stp_exit_handler immediately. Fixes a problem where
the module couldn't exit if all the output buffers were full.
Set .owner for the filesystem entries.

runtime/transport/ChangeLog
runtime/transport/procfs.c
runtime/transport/transport.c

index ce0114743ae794511bcaf2e753059a5f8dacc49a..2405568bbfbdbd19a526f8ef802a8c6843b0bdd0 100644 (file)
@@ -1,5 +1,15 @@
 2005-08-19  Martin Hunt  <hunt@redhat.com>
 
+       * transport.c (_stp_cmd_handler): Remove. This was used by 
+       stp-control.
+
+       * procfs.c (_stp_proc_write_cmd): Call schedule_work() instead
+       of running _stp_exit_handler immediately. Fixes a problem where 
+       the module couldn't exit if all the output buffers were full.
+       Set .owner for the filesystem entries.
+
+2005-08-19  Martin Hunt  <hunt@redhat.com>
+       
        * transport.h: Remove netlink references.
        * transport.c: Remove netlink references. Ifdef relayfs code.
        * procfs.c: New file.
index 2e0e8e6c1a5b0e0b011f30463824ec7d2d58158a..8af2d018d88f4953748ccf7844a4de987c2b9857 100644 (file)
@@ -55,6 +55,7 @@ static ssize_t _stp_proc_write (struct file *file, const char __user *buf,
 }
 
 static struct file_operations _stp_proc_fops = {
+       .owner = THIS_MODULE,
        .read = _stp_proc_read,
        .write = _stp_proc_write,
 };
@@ -87,7 +88,10 @@ static ssize_t _stp_proc_write_cmd (struct file *file, const char __user *buf,
                break;
        }
        case STP_EXIT:
-               _stp_handle_exit(NULL);
+               /* Cannot call _stp_handle_exit() directly here */
+               /* because the buffers may be full and stpd won't be able */
+               /* to empty them until this handler returns. */
+               schedule_work (&stp_exit);
                break;
        case STP_TRANSPORT_INFO:
        {
@@ -191,6 +195,7 @@ _stp_proc_read_cmd (struct file *file, char __user *buf, size_t count, loff_t *p
 
 
 static struct file_operations _stp_proc_fops_cmd = {
+       .owner = THIS_MODULE,
        .read = _stp_proc_read_cmd,
        .write = _stp_proc_write_cmd,
 //     .poll = _stp_proc_poll_cmd
index b2df885c207000a8b4722ce70eb6cc9424b490da..f2df07c370a59e8bcc7e8f894b31e517f23e88a5 100644 (file)
@@ -5,7 +5,7 @@
  * transport.c - stp transport functions
  *
  * Copyright (C) IBM Corporation, 2005
- * Copyright (C) Redhat Inc, 2005
+ * Copyright (C) Red Hat Inc, 2005
  *
  * This file is released under the GPL.
  */
@@ -34,6 +34,7 @@ int probe_start(void);
 void _stp_exit(void);
 void _stp_handle_start (struct transport_start *st);
 static void _stp_handle_exit (void *data);
+static DECLARE_WORK(stp_exit, _stp_handle_exit, NULL);
 int _stp_transport_open(struct transport_info *info);
 
 #include "procfs.c"
@@ -118,15 +119,11 @@ static void _stp_cleanup_and_exit (int closing)
                        ssleep(2);
                }
 #endif
-               
                //printk ("SENDING STP_EXIT\n");
                _stp_transport_send(STP_EXIT, &closing, sizeof(int));
        }
 }
 
-static void _stp_handle_exit (void *data);
-static DECLARE_WORK(stp_exit, _stp_handle_exit, NULL);
-
 /*
  *     _stp_handle_exit - handle STP_EXIT
  */
@@ -203,46 +200,6 @@ int _stp_transport_open(struct transport_info *info)
 
        /* send reply */
        return _stp_transport_send (STP_TRANSPORT_INFO, info, sizeof(*info));
-       }
-
-
-/**
- *     _stp_cmd_handler - control channel command handler callback
- *     @pid: the pid of the daemon the command was sent from
- *     @cmd: the command id
- *     @data: command-specific data
- *
- *     This function must return 0 if the command was handled, nonzero
- *     otherwise.
- */
-static int _stp_cmd_handler(int pid, int cmd, void *data)
-{
-       int err = 0;
-
-       switch (cmd) {
-#ifdef STP_RELAYFS
-       case STP_BUF_INFO:
-               _stp_handle_buf_info(data);
-               break;
-       case STP_SUBBUFS_CONSUMED:
-               _stp_handle_subbufs_consumed(pid, data);
-               break;
-#endif
-       case STP_EXIT:
-               _stp_handle_exit (data);
-               break;
-       case STP_TRANSPORT_INFO:
-               _stp_transport_open (data);
-               break;
-       case STP_START:
-               _stp_handle_start (data);
-               break;
-       default:
-               err = -1;
-               break;
-       }
-       
-       return err;
 }
 
 /**
This page took 0.03353 seconds and 5 git commands to generate.