]> sourceware.org Git - systemtap.git/commitdiff
2006-02-17 Martin Hunt <hunt@redhat.com>
authorhunt <hunt>
Fri, 17 Feb 2006 21:17:40 +0000 (21:17 +0000)
committerhunt <hunt>
Fri, 17 Feb 2006 21:17:40 +0000 (21:17 +0000)
* procfs.c (_stp_proc_read_cmd): Change spin_lock()
to spin_lock_irqsave().

* transport.c (_stp_work_queue): Ditto.

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

index 677a22ab994c9d7f6ccb15aa9e9c2d288037f0cc..6b0a772657c20c2d45bf9c99c506c46347060e03 100644 (file)
@@ -1,3 +1,10 @@
+2006-02-17  Martin Hunt  <hunt@redhat.com>
+
+       * procfs.c (_stp_proc_read_cmd): Change spin_lock()
+       to spin_lock_irqsave(). 
+
+       * transport.c (_stp_work_queue): Ditto.
+       
 2005-12-02  Martin Hunt  <hunt@redhat.com>
 
        * procfs.c (_stp_set_buffers): kmalloc the buffers instead
index 7818c4913e1ff73ca78f46f118a0c896476c9d7c..d083fb64c794fdf576c6857bde97bfb90fd67a95 100644 (file)
@@ -170,22 +170,23 @@ _stp_proc_read_cmd (struct file *file, char __user *buf, size_t count, loff_t *p
 {
        struct _stp_buffer *bptr;
        int len;
+       unsigned long flags;
 
        /* wait for nonempty ready queue */
-       spin_lock(&_stp_ready_lock);
+       spin_lock_irqsave(&_stp_ready_lock, flags);
        while (list_empty(&_stp_ready_q)) {
-               spin_unlock(&_stp_ready_lock);
+               spin_unlock_irqrestore(&_stp_ready_lock, flags);
                if (file->f_flags & O_NONBLOCK)
                        return -EAGAIN;
                if (wait_event_interruptible(_stp_proc_wq, !list_empty(&_stp_ready_q)))
                        return -ERESTARTSYS;
-               spin_lock(&_stp_ready_lock);
+               spin_lock_irqsave(&_stp_ready_lock, flags);
        }
   
        /* get the next buffer off the ready list */
        bptr = (struct _stp_buffer *)_stp_ready_q.next;
        list_del_init(&bptr->list);
-       spin_unlock(&_stp_ready_lock);
+       spin_unlock_irqrestore(&_stp_ready_lock, flags);
 
        /* write it out */
        len = bptr->len + 4;
@@ -198,9 +199,9 @@ _stp_proc_read_cmd (struct file *file, char __user *buf, size_t count, loff_t *p
        }
 
        /* put it on the pool of free buffers */
-       spin_lock(&_stp_pool_lock);
+       spin_lock_irqsave(&_stp_pool_lock, flags);
        list_add_tail(&bptr->list, &_stp_pool_q);
-       spin_unlock(&_stp_pool_lock);
+       spin_unlock_irqrestore(&_stp_pool_lock, flags);
 
        return len;
 }
@@ -228,13 +229,13 @@ static int _stp_set_buffers(int num)
 {
        int i;
        struct list_head *p;
-       
+       unsigned long flags;
+
        //printk("stp_set_buffers %d\n", num);
 
        if (num == 0 || num == _stp_current_buffers)
                return _stp_current_buffers;
        
-       spin_lock(&_stp_pool_lock);
        if (num > _stp_current_buffers) {
                for (i = 0; i < num - _stp_current_buffers; i++) {
                        p = (struct list_head *)kmalloc(sizeof(struct _stp_buffer),GFP_KERNEL);
@@ -242,18 +243,21 @@ static int _stp_set_buffers(int num)
                                _stp_current_buffers += i;
                                goto err;
                        }
+                       spin_lock_irqsave(&_stp_pool_lock, flags);
                        list_add (p, &_stp_pool_q);
+                       spin_unlock_irqrestore(&_stp_pool_lock, flags);
                }
        } else {
                for (i = 0; i < _stp_current_buffers - num; i++) {
+                       spin_lock_irqsave(&_stp_pool_lock, flags);
                        p = _stp_pool_q.next;
                        list_del(p);
+                       spin_unlock_irqrestore(&_stp_pool_lock, flags);
                        kfree(p);
                }
        }
        _stp_current_buffers = num;
 err:
-       spin_unlock(&_stp_pool_lock);
        return _stp_current_buffers;
 }
 
index c6c4b1b46c03b8c1227b56cccabb1e1f1e8d9949..da903f6d0bc0f1229bce2528f510966bf135f0c4 100644 (file)
@@ -148,11 +148,12 @@ static void _stp_cleanup_and_exit (int closing)
 static void _stp_work_queue (void *data)
 {
        int do_io = 0;
+       unsigned long flags;
 
-       spin_lock(&_stp_ready_lock);
+       spin_lock_irqsave(&_stp_ready_lock, flags);
        if (!list_empty(&_stp_ready_q))
                do_io = 1;
-       spin_unlock(&_stp_ready_lock);
+       spin_unlock_irqrestore(&_stp_ready_lock, flags);
 
        if (do_io)
                wake_up_interruptible(&_stp_proc_wq);
This page took 0.033112 seconds and 5 git commands to generate.