aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index a7e5f17f7776..3a47f7ce1e90 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -76,8 +76,11 @@ find_pnfs_driver(u32 id)
76void 76void
77unset_pnfs_layoutdriver(struct nfs_server *nfss) 77unset_pnfs_layoutdriver(struct nfs_server *nfss)
78{ 78{
79 if (nfss->pnfs_curr_ld) 79 if (nfss->pnfs_curr_ld) {
80 if (nfss->pnfs_curr_ld->clear_layoutdriver)
81 nfss->pnfs_curr_ld->clear_layoutdriver(nfss);
80 module_put(nfss->pnfs_curr_ld->owner); 82 module_put(nfss->pnfs_curr_ld->owner);
83 }
81 nfss->pnfs_curr_ld = NULL; 84 nfss->pnfs_curr_ld = NULL;
82} 85}
83 86
@@ -88,7 +91,8 @@ unset_pnfs_layoutdriver(struct nfs_server *nfss)
88 * @id layout type. Zero (illegal layout type) indicates pNFS not in use. 91 * @id layout type. Zero (illegal layout type) indicates pNFS not in use.
89 */ 92 */
90void 93void
91set_pnfs_layoutdriver(struct nfs_server *server, u32 id) 94set_pnfs_layoutdriver(struct nfs_server *server, const struct nfs_fh *mntfh,
95 u32 id)
92{ 96{
93 struct pnfs_layoutdriver_type *ld_type = NULL; 97 struct pnfs_layoutdriver_type *ld_type = NULL;
94 98
@@ -115,6 +119,13 @@ set_pnfs_layoutdriver(struct nfs_server *server, u32 id)
115 goto out_no_driver; 119 goto out_no_driver;
116 } 120 }
117 server->pnfs_curr_ld = ld_type; 121 server->pnfs_curr_ld = ld_type;
122 if (ld_type->set_layoutdriver
123 && ld_type->set_layoutdriver(server, mntfh)) {
124 printk(KERN_ERR "%s: Error initializing pNFS layout driver %u.\n",
125 __func__, id);
126 module_put(ld_type->owner);
127 goto out_no_driver;
128 }
118 129
119 dprintk("%s: pNFS module for %u set\n", __func__, id); 130 dprintk("%s: pNFS module for %u set\n", __func__, id);
120 return; 131 return;