]> git.ipfire.org Git - people/ms/linux.git/blobdiff - fs/nfsd/nfsctl.c
Merge branch 'for-6.0/dax' into libnvdimm-fixes
[people/ms/linux.git] / fs / nfsd / nfsctl.c
index 0621c2faf242442cdc27a7513bccf33a0902a6f9..917fa1892fd2d5c12faea564499cbcff2514e4ec 100644 (file)
@@ -25,6 +25,7 @@
 #include "state.h"
 #include "netns.h"
 #include "pnfs.h"
+#include "filecache.h"
 
 /*
  *     We have a single directory with several nodes in it.
@@ -45,6 +46,7 @@ enum {
        NFSD_Ports,
        NFSD_MaxBlkSize,
        NFSD_MaxConnections,
+       NFSD_Filecache,
        NFSD_SupportedEnctypes,
        /*
         * The below MUST come last.  Otherwise we leave a hole in nfsd_files[]
@@ -229,6 +231,13 @@ static const struct file_operations reply_cache_stats_operations = {
        .release        = single_release,
 };
 
+static const struct file_operations filecache_ops = {
+       .open           = nfsd_file_cache_stats_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+};
+
 /*----------------------------------------------------------------------------*/
 /*
  * payload - write methods
@@ -633,7 +642,6 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
        }
 
        /* Now write current state into reply buffer */
-       len = 0;
        sep = "";
        remaining = SIMPLE_TRANSACTION_LIMIT;
        for (num=2 ; num <= 4 ; num++) {
@@ -1371,6 +1379,7 @@ static int nfsd_fill_super(struct super_block *sb, struct fs_context *fc)
                [NFSD_Ports] = {"portlist", &transaction_ops, S_IWUSR|S_IRUGO},
                [NFSD_MaxBlkSize] = {"max_block_size", &transaction_ops, S_IWUSR|S_IRUGO},
                [NFSD_MaxConnections] = {"max_connections", &transaction_ops, S_IWUSR|S_IRUGO},
+               [NFSD_Filecache] = {"filecache", &filecache_ops, S_IRUGO},
 #if defined(CONFIG_SUNRPC_GSS) || defined(CONFIG_SUNRPC_GSS_MODULE)
                [NFSD_SupportedEnctypes] = {"supported_krb5_enctypes", &supported_enctypes_ops, S_IRUGO},
 #endif /* CONFIG_SUNRPC_GSS or CONFIG_SUNRPC_GSS_MODULE */
@@ -1475,14 +1484,7 @@ static __net_init int nfsd_init_net(struct net *net)
        retval = nfsd_reply_cache_init(nn);
        if (retval)
                goto out_drc_error;
-       nn->nfsd4_lease = 90;   /* default lease time */
-       nn->nfsd4_grace = 90;
-       nn->somebody_reclaimed = false;
-       nn->track_reclaim_completes = false;
-       nn->clverifier_counter = prandom_u32();
-       nn->clientid_base = prandom_u32();
-       nn->clientid_counter = nn->clientid_base + 1;
-       nn->s2s_cp_cl_id = nn->clientid_counter++;
+       nfsd4_init_leases_net(nn);
 
        get_random_bytes(&nn->siphash_key, sizeof(nn->siphash_key));
        seqlock_init(&nn->writeverf_lock);
@@ -1517,7 +1519,6 @@ static struct pernet_operations nfsd_net_ops = {
 static int __init init_nfsd(void)
 {
        int retval;
-       printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n");
 
        retval = nfsd4_init_slabs();
        if (retval)