[pnfs] [PATCH] pnfs: device destory
Marc Eshel
eshel at almaden.ibm.com
Wed Jul 30 19:52:43 EDT 2008
From: Marc Eshel <eshel at almaden.ibm.com>
Signed-off-by: Marc Eshel <eshel at almaden.ibm.com>
---
fs/nfs/nfs4filelayout.c | 14 +++++++-------
fs/nfs/pnfs.c | 4 +++-
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 7ed06ac..a72c51c 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -146,15 +146,15 @@ filelayout_uninitialize_mountpoint(struct pnfs_mount_type *mountid)
{
struct filelayout_mount_type *fl_mt = NULL;
- if (mountid)
+ if (mountid) {
fl_mt = (struct filelayout_mount_type *)mountid->mountid;
- nfs4_pnfs_devlist_destroy(fl_mt->hlist);
-
- if (fl_mt != NULL)
- kfree(fl_mt);
- kfree(mountid);
-
+ if (fl_mt != NULL) {
+ nfs4_pnfs_devlist_destroy(fl_mt->hlist);
+ kfree(fl_mt);
+ }
+ kfree(mountid);
+ }
return 0;
}
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 21c5c8d..9ee05f6 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -207,9 +207,11 @@ unmount_pnfs_layoutdriver(struct super_block *sb)
struct nfs_server *server = NFS_SB(sb);
if (server->pnfs_curr_ld &&
server->pnfs_curr_ld->ld_io_ops &&
- server->pnfs_curr_ld->ld_io_ops->uninitialize_mountpoint)
+ server->pnfs_curr_ld->ld_io_ops->uninitialize_mountpoint) {
server->pnfs_curr_ld->ld_io_ops->uninitialize_mountpoint(
server->pnfs_mountid);
+ server->pnfs_mountid = NULL;
+ }
}
/*
More information about the pNFS
mailing list