]> err.no Git - linux-2.6/blobdiff - fs/nfs/client.c
proc: fix /proc/*/pagemap some more
[linux-2.6] / fs / nfs / client.c
index f2f3b284e6dd203a31c11032a195ecc9f6237f53..5ee23e7058b305c061a4e1449fdccc722a68eceb 100644 (file)
@@ -431,14 +431,14 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
 {
        to->to_initval = timeo * HZ / 10;
        to->to_retries = retrans;
-       if (!to->to_retries)
-               to->to_retries = 2;
 
        switch (proto) {
        case XPRT_TRANSPORT_TCP:
        case XPRT_TRANSPORT_RDMA:
+               if (to->to_retries == 0)
+                       to->to_retries = NFS_DEF_TCP_RETRANS;
                if (to->to_initval == 0)
-                       to->to_initval = 60 * HZ;
+                       to->to_initval = NFS_DEF_TCP_TIMEO * HZ / 10;
                if (to->to_initval > NFS_MAX_TCP_TIMEOUT)
                        to->to_initval = NFS_MAX_TCP_TIMEOUT;
                to->to_increment = to->to_initval;
@@ -450,14 +450,17 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
                to->to_exponential = 0;
                break;
        case XPRT_TRANSPORT_UDP:
-       default:
+               if (to->to_retries == 0)
+                       to->to_retries = NFS_DEF_UDP_RETRANS;
                if (!to->to_initval)
-                       to->to_initval = 11 * HZ / 10;
+                       to->to_initval = NFS_DEF_UDP_TIMEO * HZ / 10;
                if (to->to_initval > NFS_MAX_UDP_TIMEOUT)
                        to->to_initval = NFS_MAX_UDP_TIMEOUT;
                to->to_maxval = NFS_MAX_UDP_TIMEOUT;
                to->to_exponential = 1;
                break;
+       default:
+               BUG();
        }
 }
 
@@ -488,7 +491,7 @@ static int nfs_create_rpc_client(struct nfs_client *clp,
        clnt = rpc_create(&args);
        if (IS_ERR(clnt)) {
                dprintk("%s: cannot create RPC client. Error = %ld\n",
-                               __FUNCTION__, PTR_ERR(clnt));
+                               __func__, PTR_ERR(clnt));
                return PTR_ERR(clnt);
        }
 
@@ -576,7 +579,7 @@ static int nfs_init_server_rpcclient(struct nfs_server *server,
 
        server->client = rpc_clone_client(clp->cl_rpcclient);
        if (IS_ERR(server->client)) {
-               dprintk("%s: couldn't create rpc_client!\n", __FUNCTION__);
+               dprintk("%s: couldn't create rpc_client!\n", __func__);
                return PTR_ERR(server->client);
        }
 
@@ -590,7 +593,7 @@ static int nfs_init_server_rpcclient(struct nfs_server *server,
 
                auth = rpcauth_create(pseudoflavour, server->client);
                if (IS_ERR(auth)) {
-                       dprintk("%s: couldn't create credcache!\n", __FUNCTION__);
+                       dprintk("%s: couldn't create credcache!\n", __func__);
                        return PTR_ERR(auth);
                }
        }
@@ -985,7 +988,7 @@ static int nfs4_init_client(struct nfs_client *clp,
        error = nfs_idmap_new(clp);
        if (error < 0) {
                dprintk("%s: failed to create idmapper. Error = %d\n",
-                       __FUNCTION__, error);
+                       __func__, error);
                goto error;
        }
        __set_bit(NFS_CS_IDMAP, &clp->cl_res_state);
@@ -1321,6 +1324,7 @@ static const struct file_operations nfs_server_list_fops = {
        .read           = seq_read,
        .llseek         = seq_lseek,
        .release        = seq_release,
+       .owner          = THIS_MODULE,
 };
 
 static int nfs_volume_list_open(struct inode *inode, struct file *file);
@@ -1341,6 +1345,7 @@ static const struct file_operations nfs_volume_list_fops = {
        .read           = seq_read,
        .llseek         = seq_lseek,
        .release        = seq_release,
+       .owner          = THIS_MODULE,
 };
 
 /*
@@ -1500,33 +1505,29 @@ int __init nfs_fs_proc_init(void)
 {
        struct proc_dir_entry *p;
 
-       proc_fs_nfs = proc_mkdir("nfsfs", proc_root_fs);
+       proc_fs_nfs = proc_mkdir("fs/nfsfs", NULL);
        if (!proc_fs_nfs)
                goto error_0;
 
        proc_fs_nfs->owner = THIS_MODULE;
 
        /* a file of servers with which we're dealing */
-       p = create_proc_entry("servers", S_IFREG|S_IRUGO, proc_fs_nfs);
+       p = proc_create("servers", S_IFREG|S_IRUGO,
+                       proc_fs_nfs, &nfs_server_list_fops);
        if (!p)
                goto error_1;
 
-       p->proc_fops = &nfs_server_list_fops;
-       p->owner = THIS_MODULE;
-
        /* a file of volumes that we have mounted */
-       p = create_proc_entry("volumes", S_IFREG|S_IRUGO, proc_fs_nfs);
+       p = proc_create("volumes", S_IFREG|S_IRUGO,
+                       proc_fs_nfs, &nfs_volume_list_fops);
        if (!p)
                goto error_2;
-
-       p->proc_fops = &nfs_volume_list_fops;
-       p->owner = THIS_MODULE;
        return 0;
 
 error_2:
        remove_proc_entry("servers", proc_fs_nfs);
 error_1:
-       remove_proc_entry("nfsfs", proc_root_fs);
+       remove_proc_entry("fs/nfsfs", NULL);
 error_0:
        return -ENOMEM;
 }
@@ -1538,7 +1539,7 @@ void nfs_fs_proc_exit(void)
 {
        remove_proc_entry("volumes", proc_fs_nfs);
        remove_proc_entry("servers", proc_fs_nfs);
-       remove_proc_entry("nfsfs", proc_root_fs);
+       remove_proc_entry("fs/nfsfs", NULL);
 }
 
 #endif /* CONFIG_PROC_FS */