Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43501
b: refs/heads/master
c: 35a6027
h: refs/heads/master
i:
  43499: 90b1cf3
v: v3
  • Loading branch information
Peter Zijlstra authored and Linus Torvalds committed Dec 8, 2006
1 parent 44bb27f commit 75e0b87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2e7b651df113c8a463853e4169951c52c39f9d19
refs/heads/master: 35a6027f1ab6594068cb8bca7705e4567753946b
9 changes: 9 additions & 0 deletions trunk/fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,14 @@ static int bdev_set(struct inode *inode, void *data)

static LIST_HEAD(all_bdevs);

static struct lock_class_key bdev_part_lock_key;

struct block_device *bdget(dev_t dev)
{
struct block_device *bdev;
struct inode *inode;
struct gendisk *disk;
int part = 0;

inode = iget5_locked(bd_mnt->mnt_sb, hash(dev),
bdev_test, bdev_set, &dev);
Expand All @@ -384,6 +388,11 @@ struct block_device *bdget(dev_t dev)
list_add(&bdev->bd_list, &all_bdevs);
spin_unlock(&bdev_lock);
unlock_new_inode(inode);
mutex_init(&bdev->bd_mutex);
disk = get_gendisk(dev, &part);
if (part)
lockdep_set_class(&bdev->bd_mutex, &bdev_part_lock_key);
put_disk(disk);
}
return bdev;
}
Expand Down

0 comments on commit 75e0b87

Please sign in to comment.