kfree(clp->cl_implid);
 }
 
+void nfs4_free_client(struct nfs_client *clp)
+{
+       nfs4_shutdown_client(clp);
+       nfs_free_client(clp);
+}
+
 /* idr_remove_all is not needed as all id's are removed by nfs_put_client */
 void nfs_cleanup_cb_ident_idr(struct net *net)
 {
 }
 
 #else
-static void nfs4_shutdown_client(struct nfs_client *clp)
-{
-}
-
 void nfs_cleanup_cb_ident_idr(struct net *net)
 {
 }
 /*
  * Destroy a shared client record
  */
-static void nfs_free_client(struct nfs_client *clp)
+void nfs_free_client(struct nfs_client *clp)
 {
        dprintk("--> nfs_free_client(%u)\n", clp->rpc_ops->version);
 
-       nfs4_shutdown_client(clp);
-
        nfs_fscache_release_client_cookie(clp);
 
        /* -EIO all pending I/O */
 
                BUG_ON(!list_empty(&clp->cl_superblocks));
 
-               nfs_free_client(clp);
+               clp->rpc_ops->free_client(clp);
        }
 }
 EXPORT_SYMBOL_GPL(nfs_put_client);
                if (clp) {
                        spin_unlock(&nn->nfs_client_lock);
                        if (new)
-                               nfs_free_client(new);
+                               new->rpc_ops->free_client(new);
                        return nfs_found_client(cl_init, clp);
                }
                if (new) {
 
 
 extern void nfs_cleanup_cb_ident_idr(struct net *);
 extern void nfs_put_client(struct nfs_client *);
+extern void nfs_free_client(struct nfs_client *);
 extern struct nfs_client *nfs4_find_client_ident(struct net *, int);
 extern struct nfs_client *
 nfs4_find_client_sessionid(struct net *, const struct sockaddr *,
 
        .have_delegation = nfs3_have_delegation,
        .return_delegation = nfs3_return_delegation,
        .init_client    = nfs_init_client,
+       .free_client    = nfs_free_client,
 };
 
 extern const u32 nfs4_fsinfo_bitmap[3];
 extern const u32 nfs4_fs_locations_bitmap[2];
 
+void nfs4_free_client(struct nfs_client *);
+
 /* nfs4renewd.c */
 extern void nfs4_schedule_state_renewal(struct nfs_client *);
 extern void nfs4_renewd_prepare_shutdown(struct nfs_server *);
 
        .have_delegation = nfs4_have_delegation,
        .return_delegation = nfs4_inode_return_delegation,
        .init_client    = nfs4_init_client,
+       .free_client    = nfs4_free_client,
 };
 
 static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = {
 
        .have_delegation = nfs_have_delegation,
        .return_delegation = nfs_return_delegation,
        .init_client    = nfs_init_client,
+       .free_client    = nfs_free_client,
 };
 
        struct nfs_client *
                (*init_client) (struct nfs_client *, const struct rpc_timeout *,
                                const char *, rpc_authflavor_t);
+       void    (*free_client) (struct nfs_client *);
 };
 
 /*