On Tue, 13 Nov 2012 18:48:33 +0300<snip>
Stanislav Kinsbursky <skinsbursky@xxxxxxxxxxxxx> wrote:
+
+static int
+nfs4_legacy_state_init(struct net *net)
+{
+ struct nfsd_net *nn = net_generic(net, nfsd_net_id);
+ int i;
+
+ nn->reclaim_str_hashtbl = kmalloc(sizeof(struct list_head) *
+ CLIENT_HASH_SIZE, GFP_KERNEL);
+ if (!nn->reclaim_str_hashtbl)
+ return -ENOMEM;
+
+ for (i = 0; i < CLIENT_HASH_SIZE; i++)
+ INIT_LIST_HEAD(&nn->reclaim_str_hashtbl[i]);
+ nn->reclaim_str_hashtbl_size = 0;
+
+ return 0;
+}
+
+static void
+nfs4_legacy_state_shutdown(struct net *net)
+{
+ struct nfsd_net *nn = net_generic(net, nfsd_net_id);
+
+ kfree(nn->reclaim_str_hashtbl);
+}
+
static int
nfsd4_load_reboot_recovery_data(struct net *net)
{
@@ -425,13 +454,23 @@ nfsd4_load_reboot_recovery_data(struct net *net)
return -EINVAL;
}
+ status = nfs4_legacy_state_init(net);
+ if (status)
+ return status;
+
nit: might be clearer to create a new legacy ->init function and have
it call the state_init and then load the recovery data.
Looks like a reasonable and good change, but may need reconciling with
the patches from me that Bruce merged recently into his for-next tree.