Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89777
b: refs/heads/master
c: 43ac9e6
h: refs/heads/master
i:
  89775: c205206
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Apr 18, 2008
1 parent 300e2da commit 8654bf2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 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: c3ff1b90d8924dd1c55c3b56a79bfc563ace4a42
refs/heads/master: 43ac9e62c4a0a47fe3de1f1eb9ca7b8c91dce234
14 changes: 6 additions & 8 deletions trunk/block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ static struct bsg_command *bsg_next_done_cmd(struct bsg_device *bd)

spin_lock_irq(&bd->lock);
if (bd->done_cmds) {
bc = list_entry(bd->done_list.next, struct bsg_command, list);
bc = list_first_entry(&bd->done_list, struct bsg_command, list);
list_del(&bc->list);
bd->done_cmds--;
}
Expand Down Expand Up @@ -772,21 +772,19 @@ static struct bsg_device *bsg_add_device(struct inode *inode,

static struct bsg_device *__bsg_get_device(int minor)
{
struct bsg_device *bd = NULL;
struct bsg_device *bd;
struct hlist_node *entry;

mutex_lock(&bsg_mutex);

hlist_for_each(entry, bsg_dev_idx_hash(minor)) {
bd = hlist_entry(entry, struct bsg_device, dev_list);
hlist_for_each_entry(bd, entry, bsg_dev_idx_hash(minor), dev_list) {
if (bd->minor == minor) {
atomic_inc(&bd->ref_count);
break;
goto found;
}

bd = NULL;
}

bd = NULL;
found:
mutex_unlock(&bsg_mutex);
return bd;
}
Expand Down

0 comments on commit 8654bf2

Please sign in to comment.