X-Git-Url: http://git.onelab.eu/?p=linux-2.6.git;a=blobdiff_plain;f=fs%2Fsuper.c;h=8d9bff178bcac6ea625e79b2aa7a95d78153bba0;hp=e62838940bc7f2343641b9c3ac288f190d04b5be;hb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;hpb=c449269f45c2cdf53af08c8d0af37472f66539d9 diff --git a/fs/super.c b/fs/super.c index e62838940..8d9bff178 100644 --- a/fs/super.c +++ b/fs/super.c @@ -101,6 +101,21 @@ static inline void destroy_super(struct super_block *s) /* Superblock refcounting */ +/* + * Drop a superblock's refcount. Returns non-zero if the superblock was + * destroyed. The caller must hold sb_lock. + */ +int __put_super(struct super_block *sb) +{ + int ret = 0; + + if (!--sb->s_count) { + destroy_super(sb); + ret = 1; + } + return ret; +} + /** * put_super - drop a temporary reference to superblock * @s: superblock in question @@ -108,14 +123,14 @@ static inline void destroy_super(struct super_block *s) * Drops a temporary reference, frees superblock if there's no * references left. */ -static inline void put_super(struct super_block *s) +static void put_super(struct super_block *sb) { spin_lock(&sb_lock); - if (!--s->s_count) - destroy_super(s); + __put_super(sb); spin_unlock(&sb_lock); } + /** * deactivate_super - drop an active reference to superblock * @s: superblock to deactivate @@ -266,6 +281,7 @@ retry: return ERR_PTR(err); } s->s_type = type; + strlcpy(s->s_id, type->name, sizeof(s->s_id)); list_add(&s->s_list, super_blocks.prev); list_add(&s->s_instances, &type->fs_supers); spin_unlock(&sb_lock);