From efc364eebf15dd7e8b6c93e155af83b6d3971752 Mon Sep 17 00:00:00 2001 From: hunt Date: Fri, 19 Aug 2005 18:29:21 +0000 Subject: 2005-08-19 Martin Hunt * 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/procfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'runtime/transport/procfs.c') diff --git a/runtime/transport/procfs.c b/runtime/transport/procfs.c index 2e0e8e6c..8af2d018 100644 --- a/runtime/transport/procfs.c +++ b/runtime/transport/procfs.c @@ -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 -- cgit