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.
}
static struct file_operations _stp_proc_fops = {
+ .owner = THIS_MODULE,
.read = _stp_proc_read,
.write = _stp_proc_write,
};
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:
{
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
* 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.
*/
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"
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
*/
/* 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;
}
/**