aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-06-20 15:53:41 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-06-29 11:46:44 -0400
commiteeebf91675421b730448489ebf4720e5c419beec (patch)
tree84287ae7c6afaa29b5139e39c72a2c137f01bbf5 /fs/nfs/super.c
parente38eb6506ff426a2bb93433fecfcc863a95fcd03 (diff)
NFS: Use nfs4_destroy_server() to clean up NFS v4
I can use this function to return delegations and unset the pnfs layout driver rather than continuing to do these things in the generic client. With this change, we no longer need an nfs4_kill_super(). Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 906f09c7d84..5a1c860743c 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -347,13 +347,12 @@ static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type,
347 int flags, const char *dev_name, void *raw_data); 347 int flags, const char *dev_name, void *raw_data);
348static struct dentry *nfs4_remote_referral_mount(struct file_system_type *fs_type, 348static struct dentry *nfs4_remote_referral_mount(struct file_system_type *fs_type,
349 int flags, const char *dev_name, void *raw_data); 349 int flags, const char *dev_name, void *raw_data);
350static void nfs4_kill_super(struct super_block *sb);
351 350
352static struct file_system_type nfs4_fs_type = { 351static struct file_system_type nfs4_fs_type = {
353 .owner = THIS_MODULE, 352 .owner = THIS_MODULE,
354 .name = "nfs4", 353 .name = "nfs4",
355 .mount = nfs_fs_mount, 354 .mount = nfs_fs_mount,
356 .kill_sb = nfs4_kill_super, 355 .kill_sb = nfs_kill_super,
357 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, 356 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
358}; 357};
359 358
@@ -361,7 +360,7 @@ static struct file_system_type nfs4_remote_fs_type = {
361 .owner = THIS_MODULE, 360 .owner = THIS_MODULE,
362 .name = "nfs4", 361 .name = "nfs4",
363 .mount = nfs4_remote_mount, 362 .mount = nfs4_remote_mount,
364 .kill_sb = nfs4_kill_super, 363 .kill_sb = nfs_kill_super,
365 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, 364 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
366}; 365};
367 366
@@ -369,7 +368,7 @@ struct file_system_type nfs4_xdev_fs_type = {
369 .owner = THIS_MODULE, 368 .owner = THIS_MODULE,
370 .name = "nfs4", 369 .name = "nfs4",
371 .mount = nfs4_xdev_mount, 370 .mount = nfs4_xdev_mount,
372 .kill_sb = nfs4_kill_super, 371 .kill_sb = nfs_kill_super,
373 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, 372 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
374}; 373};
375 374
@@ -377,7 +376,7 @@ static struct file_system_type nfs4_remote_referral_fs_type = {
377 .owner = THIS_MODULE, 376 .owner = THIS_MODULE,
378 .name = "nfs4", 377 .name = "nfs4",
379 .mount = nfs4_remote_referral_mount, 378 .mount = nfs4_remote_referral_mount,
380 .kill_sb = nfs4_kill_super, 379 .kill_sb = nfs_kill_super,
381 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, 380 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
382}; 381};
383 382
@@ -385,7 +384,7 @@ struct file_system_type nfs4_referral_fs_type = {
385 .owner = THIS_MODULE, 384 .owner = THIS_MODULE,
386 .name = "nfs4", 385 .name = "nfs4",
387 .mount = nfs4_referral_mount, 386 .mount = nfs4_referral_mount,
388 .kill_sb = nfs4_kill_super, 387 .kill_sb = nfs_kill_super,
389 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, 388 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
390}; 389};
391 390
@@ -2874,18 +2873,6 @@ static struct dentry *nfs4_try_mount(int flags, const char *dev_name,
2874 return res; 2873 return res;
2875} 2874}
2876 2875
2877static void nfs4_kill_super(struct super_block *sb)
2878{
2879 struct nfs_server *server = NFS_SB(sb);
2880
2881 dprintk("--> %s\n", __func__);
2882 nfs_super_return_all_delegations(sb);
2883 kill_anon_super(sb);
2884 nfs_fscache_release_super_cookie(sb);
2885 nfs_free_server(server);
2886 dprintk("<-- %s\n", __func__);
2887}
2888
2889/* 2876/*
2890 * Clone an NFS4 server record on xdev traversal (FSID-change) 2877 * Clone an NFS4 server record on xdev traversal (FSID-change)
2891 */ 2878 */