diff options
Diffstat (limited to 'fs/super.c')
-rw-r--r-- | fs/super.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/fs/super.c b/fs/super.c index 1f72e0d42d8f..95adbb3d8e58 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -127,40 +127,14 @@ static inline void destroy_super(struct super_block *s) | |||
127 | /* Superblock refcounting */ | 127 | /* Superblock refcounting */ |
128 | 128 | ||
129 | /* | 129 | /* |
130 | * Drop a superblock's refcount. Returns non-zero if the superblock was | 130 | * Drop a superblock's refcount. The caller must hold sb_lock. |
131 | * destroyed. The caller must hold sb_lock. | ||
132 | */ | 131 | */ |
133 | int __put_super(struct super_block *sb) | 132 | void __put_super(struct super_block *sb) |
134 | { | 133 | { |
135 | int ret = 0; | ||
136 | |||
137 | if (!--sb->s_count) { | 134 | if (!--sb->s_count) { |
138 | list_del_init(&sb->s_list); | 135 | list_del_init(&sb->s_list); |
139 | destroy_super(sb); | 136 | destroy_super(sb); |
140 | ret = 1; | ||
141 | } | ||
142 | return ret; | ||
143 | } | ||
144 | |||
145 | /* | ||
146 | * Drop a superblock's refcount. | ||
147 | * Returns non-zero if the superblock is about to be destroyed and | ||
148 | * at least is already removed from super_blocks list, so if we are | ||
149 | * making a loop through super blocks then we need to restart. | ||
150 | * The caller must hold sb_lock. | ||
151 | */ | ||
152 | int __put_super_and_need_restart(struct super_block *sb) | ||
153 | { | ||
154 | /* check for race with generic_shutdown_super() */ | ||
155 | if (list_empty(&sb->s_instances)) { | ||
156 | /* super block is removed, need to restart... */ | ||
157 | __put_super(sb); | ||
158 | return 1; | ||
159 | } | 137 | } |
160 | /* can't be the last, since s_list is still in use */ | ||
161 | sb->s_count--; | ||
162 | BUG_ON(sb->s_count == 0); | ||
163 | return 0; | ||
164 | } | 138 | } |
165 | 139 | ||
166 | /** | 140 | /** |