PORTMAP: Rename the functions in PMAP to PMAP2 to desribe the version of PMAP we...
[deb_libnfs.git] / lib / libnfs.c
index 285e6dc2e42327252478f0d8f26c05a20a44baa7..36a05a8e9ce562f4c376af48b8d24f4a7c78f9bc 100644 (file)
@@ -469,7 +469,7 @@ static void rpc_connect_program_2_cb(struct rpc_context *rpc, int status, void *
                return;
        }
 
-       if (rpc_pmap_getport_async(rpc, data->program, data->version, IPPROTO_TCP, rpc_connect_program_3_cb, private_data) != 0) {
+       if (rpc_pmap2_getport_async(rpc, data->program, data->version, IPPROTO_TCP, rpc_connect_program_3_cb, private_data) != 0) {
                data->cb(rpc, status, command_data, data->private_data);
                free_rpc_cb_data(data);
                return;
@@ -496,7 +496,7 @@ static void rpc_connect_program_1_cb(struct rpc_context *rpc, int status, void *
                return;
        }
 
-       if (rpc_pmap_null_async(rpc, rpc_connect_program_2_cb, data) != 0) {
+       if (rpc_pmap2_null_async(rpc, rpc_connect_program_2_cb, data) != 0) {
                data->cb(rpc, status, command_data, data->private_data);
                free_rpc_cb_data(data);
                return;
@@ -812,7 +812,7 @@ static void nfs_mount_2_cb(struct rpc_context *rpc, int status, void *command_da
                return;
        }
 
-       if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, nfs_mount_3_cb, private_data) != 0) {
+       if (rpc_pmap2_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, nfs_mount_3_cb, private_data) != 0) {
                data->cb(-ENOMEM, nfs, command_data, data->private_data);
                free_nfs_cb_data(data);
                return;
@@ -840,7 +840,7 @@ static void nfs_mount_1_cb(struct rpc_context *rpc, int status, void *command_da
                return;
        }
 
-       if (rpc_pmap_null_async(rpc, nfs_mount_2_cb, data) != 0) {
+       if (rpc_pmap2_null_async(rpc, nfs_mount_2_cb, data) != 0) {
                data->cb(-ENOMEM, nfs, command_data, data->private_data);
                free_nfs_cb_data(data);
                return;
@@ -1664,8 +1664,7 @@ int nfs_pread_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offse
 
        assert(data->num_calls == 0);
 
-       /* trying to read more than maximum server read size, we has to chop it up into smaller
-        * reads and collect into a reassembly buffer.
+       /* chop requests into chunks of at most READMAX bytes if necessary.
         * we send all reads in parallel so that performance is still good.
         */
        data->max_offset = offset;
@@ -1688,6 +1687,7 @@ int nfs_pread_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offse
                                return -1;
                        }
                        data->oom = 1;
+                       break;
                }
                memset(mdata, 0, sizeof(struct nfs_mcb_data));
                mdata->data   = data;
@@ -1704,6 +1704,7 @@ int nfs_pread_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offse
                                return -1;
                        }
                        data->oom = 1;
+                       break;
                }
 
                count               -= readcount;
@@ -1843,8 +1844,7 @@ int nfs_pwrite_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offs
        /* hello, clang-analyzer */
        assert(data->num_calls == 0);
 
-       /* trying to write more than maximum server write size, we has to chop it up into smaller
-        * chunks.
+       /* chop requests into chunks of at most WRITEMAX bytes if necessary.
         * we send all writes in parallel so that performance is still good.
         */
        data->max_offset = offset;
@@ -1867,6 +1867,7 @@ int nfs_pwrite_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offs
                                return -1;
                        }
                        data->oom = 1;
+                       break;
                }
                memset(mdata, 0, sizeof(struct nfs_mcb_data));
                mdata->data   = data;
@@ -1883,6 +1884,7 @@ int nfs_pwrite_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offs
                                return -1;
                        }
                        data->oom = 1;
+                       break;
                }
 
                count               -= writecount;
@@ -4366,7 +4368,7 @@ static void mount_export_2_cb(struct rpc_context *rpc, int status, void *command
                return;
        }
 
-       if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, mount_export_3_cb, private_data) != 0) {
+       if (rpc_pmap2_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, IPPROTO_TCP, mount_export_3_cb, private_data) != 0) {
                data->cb(rpc, -ENOMEM, command_data, data->private_data);
                free_mount_cb_data(data);
                return;
@@ -4393,7 +4395,7 @@ static void mount_export_1_cb(struct rpc_context *rpc, int status, void *command
                return;
        }
 
-       if (rpc_pmap_null_async(rpc, mount_export_2_cb, data) != 0) {
+       if (rpc_pmap2_null_async(rpc, mount_export_2_cb, data) != 0) {
                data->cb(rpc, -ENOMEM, command_data, data->private_data);
                free_mount_cb_data(data);
                return;