Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40506
b: refs/heads/master
c: 33f775e
h: refs/heads/master
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Oct 31, 2006
1 parent e4be922 commit 5d6d95e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d7fb2c3865ca0f95d92e2864c3dc9220789d83f5
refs/heads/master: 33f775eea185e8df7701c4afc2c8fcee85c83282
8 changes: 7 additions & 1 deletion trunk/arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data)

#define DRIVER_NAME "uml-blkdev"

/* Can be taken in interrupt context, and is passed to the block layer to lock
* the request queue. Kernel side code knows that. */
static DEFINE_SPINLOCK(ubd_io_lock);

static DEFINE_MUTEX(ubd_lock);
Expand Down Expand Up @@ -497,14 +499,16 @@ static void __ubd_finish(struct request *req, int error)
end_request(req, 1);
}

/* Callable only from interrupt context - otherwise you need to do
* spin_lock_irq()/spin_lock_irqsave() */
static inline void ubd_finish(struct request *req, int error)
{
spin_lock(&ubd_io_lock);
__ubd_finish(req, error);
spin_unlock(&ubd_io_lock);
}

/* Called without ubd_io_lock held */
/* Called without ubd_io_lock held, and only in interrupt context. */
static void ubd_handler(void)
{
struct io_thread_req req;
Expand All @@ -525,7 +529,9 @@ static void ubd_handler(void)

ubd_finish(rq, req.error);
reactivate_fd(thread_fd, UBD_IRQ);
spin_lock(&ubd_io_lock);
do_ubd_request(ubd_queue);
spin_unlock(&ubd_io_lock);
}

static irqreturn_t ubd_intr(int irq, void *dev)
Expand Down

0 comments on commit 5d6d95e

Please sign in to comment.