diff options
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index e9b20173fef3..e527fab40419 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -209,7 +209,6 @@ static int nfs_get_sb(struct file_system_type *, int, const char *, void *, stru | |||
209 | static int nfs_xdev_get_sb(struct file_system_type *fs_type, | 209 | static int nfs_xdev_get_sb(struct file_system_type *fs_type, |
210 | int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); | 210 | int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); |
211 | static void nfs_kill_super(struct super_block *); | 211 | static void nfs_kill_super(struct super_block *); |
212 | static void nfs_put_super(struct super_block *); | ||
213 | static int nfs_remount(struct super_block *sb, int *flags, char *raw_data); | 212 | static int nfs_remount(struct super_block *sb, int *flags, char *raw_data); |
214 | 213 | ||
215 | static struct file_system_type nfs_fs_type = { | 214 | static struct file_system_type nfs_fs_type = { |
@@ -232,7 +231,6 @@ static const struct super_operations nfs_sops = { | |||
232 | .alloc_inode = nfs_alloc_inode, | 231 | .alloc_inode = nfs_alloc_inode, |
233 | .destroy_inode = nfs_destroy_inode, | 232 | .destroy_inode = nfs_destroy_inode, |
234 | .write_inode = nfs_write_inode, | 233 | .write_inode = nfs_write_inode, |
235 | .put_super = nfs_put_super, | ||
236 | .statfs = nfs_statfs, | 234 | .statfs = nfs_statfs, |
237 | .clear_inode = nfs_clear_inode, | 235 | .clear_inode = nfs_clear_inode, |
238 | .umount_begin = nfs_umount_begin, | 236 | .umount_begin = nfs_umount_begin, |
@@ -337,26 +335,20 @@ void __exit unregister_nfs_fs(void) | |||
337 | unregister_filesystem(&nfs_fs_type); | 335 | unregister_filesystem(&nfs_fs_type); |
338 | } | 336 | } |
339 | 337 | ||
340 | void nfs_sb_active(struct nfs_server *server) | 338 | void nfs_sb_active(struct super_block *sb) |
341 | { | 339 | { |
342 | atomic_inc(&server->active); | 340 | struct nfs_server *server = NFS_SB(sb); |
343 | } | ||
344 | 341 | ||
345 | void nfs_sb_deactive(struct nfs_server *server) | 342 | if (atomic_inc_return(&server->active) == 1) |
346 | { | 343 | atomic_inc(&sb->s_active); |
347 | if (atomic_dec_and_test(&server->active)) | ||
348 | wake_up(&server->active_wq); | ||
349 | } | 344 | } |
350 | 345 | ||
351 | static void nfs_put_super(struct super_block *sb) | 346 | void nfs_sb_deactive(struct super_block *sb) |
352 | { | 347 | { |
353 | struct nfs_server *server = NFS_SB(sb); | 348 | struct nfs_server *server = NFS_SB(sb); |
354 | /* | 349 | |
355 | * Make sure there are no outstanding ops to this server. | 350 | if (atomic_dec_and_test(&server->active)) |
356 | * If so, wait for them to finish before allowing the | 351 | deactivate_super(sb); |
357 | * unmount to continue. | ||
358 | */ | ||
359 | wait_event(server->active_wq, atomic_read(&server->active) == 0); | ||
360 | } | 352 | } |
361 | 353 | ||
362 | /* | 354 | /* |