Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31840
b: refs/heads/master
c: cf51624
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jul 3, 2006
1 parent ae65d87 commit 5f3e6a1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 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: 91ebe2a9320db7195d1e25152b5d158fc66dc133
refs/heads/master: cf51624999e56c88154b5f7d451a265db6aabff7
10 changes: 8 additions & 2 deletions trunk/fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ DEFINE_SPINLOCK(sb_lock);
* Allocates and initializes a new &struct super_block. alloc_super()
* returns a pointer new superblock or %NULL if allocation had failed.
*/
static struct super_block *alloc_super(void)
static struct super_block *alloc_super(struct file_system_type *type)
{
struct super_block *s = kzalloc(sizeof(struct super_block), GFP_USER);
static struct super_operations default_op;
Expand All @@ -72,6 +72,12 @@ static struct super_block *alloc_super(void)
INIT_LIST_HEAD(&s->s_inodes);
init_rwsem(&s->s_umount);
mutex_init(&s->s_lock);
/*
* The locking rules for s_lock are up to the
* filesystem. For example ext3fs has different
* lock ordering than usbfs:
*/
lockdep_set_class(&s->s_lock, &type->s_lock_key);
down_write(&s->s_umount);
s->s_count = S_BIAS;
atomic_set(&s->s_active, 1);
Expand Down Expand Up @@ -295,7 +301,7 @@ struct super_block *sget(struct file_system_type *type,
}
if (!s) {
spin_unlock(&sb_lock);
s = alloc_super();
s = alloc_super(type);
if (!s)
return ERR_PTR(-ENOMEM);
goto retry;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ struct file_system_type {
struct module *owner;
struct file_system_type * next;
struct list_head fs_supers;
struct lock_class_key s_lock_key;
};

extern int get_sb_bdev(struct file_system_type *fs_type,
Expand Down

0 comments on commit 5f3e6a1

Please sign in to comment.