X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flibnfs-sync.c;h=e539a4559dbb5d03835c25e0415676bc1d0115e9;hb=2c0f57fa33371a55b798a9cca14a3d58e6b3cb26;hp=580f76dd63ce3ef453f97a5fd675ce94c085a571;hpb=3cea44dc5425410ad2ca0b5d5b471445def94a6c;p=deb_libnfs.git diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c index 580f76d..e539a45 100644 --- a/lib/libnfs-sync.c +++ b/lib/libnfs-sync.c @@ -236,6 +236,36 @@ int nfs_stat(struct nfs_context *nfs, const char *path, struct stat *st) return cb_data.status; } +static void stat64_cb(int status, struct nfs_context *nfs, void *data, void *private_data) +{ + struct sync_cb_data *cb_data = private_data; + + cb_data->is_finished = 1; + cb_data->status = status; + + if (status < 0) { + nfs_set_error(nfs, "stat call failed with \"%s\"", (char *)data); + return; + } + memcpy(cb_data->return_data, data, sizeof(struct nfs_stat_64)); +} + +int nfs_stat64(struct nfs_context *nfs, const char *path, struct nfs_stat_64 *st) +{ + struct sync_cb_data cb_data; + + cb_data.is_finished = 0; + cb_data.return_data = st; + + if (nfs_stat64_async(nfs, path, stat64_cb, &cb_data) != 0) { + nfs_set_error(nfs, "nfs_stat64_async failed"); + return -1; + } + + wait_for_nfs_reply(nfs, &cb_data); + + return cb_data.status; +} /* * open() @@ -1407,7 +1437,7 @@ static int send_nfsd_probes(struct rpc_context *rpc, INTERFACE_INFO *InterfaceLi return -1; } - if (rpc_pmap_callit_async(rpc, MOUNT_PROGRAM, 2, 0, NULL, 0, callit_cb, data) < 0) + if (rpc_pmap2_callit_async(rpc, MOUNT_PROGRAM, 2, 0, NULL, 0, callit_cb, data) < 0) { return -1; } @@ -1541,7 +1571,7 @@ static int send_nfsd_probes(struct rpc_context *rpc, struct ifconf *ifc, struct return -1; } - if (rpc_pmap_callit_async(rpc, MOUNT_PROGRAM, 2, 0, NULL, 0, callit_cb, data) < 0) { + if (rpc_pmap2_callit_async(rpc, MOUNT_PROGRAM, 2, 0, NULL, 0, callit_cb, data) < 0) { return -1; } }