aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-07-27 18:19:01 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-10-06 20:08:26 -0400
commit1daef0a868370c5a96d031b9202e3354bea060e6 (patch)
treea072a8486c67f3d26b576e5bace8aa45def2d328 /fs/nfs/super.c
parentd5e66348bbe39dc78509e7561f7252aa443df8c0 (diff)
NFS: Clean up nfs_sb_active/nfs_sb_deactive
Instead of causing umount requests to block on server->active_wq while the asynchronous sillyrename deletes are executing, we can use the sb->s_active counter to obtain a reference to the super_block, and then release that reference in nfs_async_unlink_release(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c24
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
209static int nfs_xdev_get_sb(struct file_system_type *fs_type, 209static 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);
211static void nfs_kill_super(struct super_block *); 211static void nfs_kill_super(struct super_block *);
212static void nfs_put_super(struct super_block *);
213static int nfs_remount(struct super_block *sb, int *flags, char *raw_data); 212static int nfs_remount(struct super_block *sb, int *flags, char *raw_data);
214 213
215static struct file_system_type nfs_fs_type = { 214static 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
340void nfs_sb_active(struct nfs_server *server) 338void 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
345void 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
351static void nfs_put_super(struct super_block *sb) 346void 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/*