* RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
* data is NULL.
*/
-int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
+struct READLINK3args;
+int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK3args *args, void *private_data);
static int nfs_readlink_continue_internal(struct nfs_context *nfs, struct nfs_cb_data *data)
{
- if (rpc_nfs_readlink_async(nfs->rpc, nfs_readlink_1_cb, &data->fh, data) != 0) {
+ READLINK3args args;
+
+ args.symlink.data.data_len = data->fh.data.data_len;
+ args.symlink.data.data_val = data->fh.data.data_val;
+
+ if (rpc_nfs_readlink_async(nfs->rpc, nfs_readlink_1_cb, &args, data) != 0) {
rpc_set_error(nfs->rpc, "RPC error: Failed to send READLINK call for %s", data->path);
data->cb(-ENOMEM, nfs, rpc_get_error(nfs->rpc), data->private_data);
free_nfs_cb_data(data);
return 0;
}
-int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data)
+int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, READLINK3args *args, void *private_data)
{
struct rpc_pdu *pdu;
- READLINK3args args;
pdu = rpc_allocate_pdu(rpc, NFS_PROGRAM, NFS_V3, NFS3_READLINK, cb, private_data, (xdrproc_t)xdr_READLINK3res, sizeof(READLINK3res));
if (pdu == NULL) {
return -1;
}
- args.symlink.data.data_len = fh->data.data_len;
- args.symlink.data.data_val = fh->data.data_val;
-
- if (xdr_READLINK3args(&pdu->xdr, &args) == 0) {
+ if (xdr_READLINK3args(&pdu->xdr, args) == 0) {
rpc_set_error(rpc, "XDR error: Failed to encode READLINK3args");
rpc_free_pdu(rpc, pdu);
return -2;