X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=nfs%2Fnfs.c;h=c3cebc47517090f07328ce06f106096c7541c132;hb=cd954dd55eb47d88145393e0b3ba20bfd85a52a5;hp=361502ff5b797998f60d5684bce826241f21e78a;hpb=763cd6e3e2bbb6906186e7ed6a86660276b596b7;p=deb_libnfs.git diff --git a/nfs/nfs.c b/nfs/nfs.c index 361502f..c3cebc4 100644 --- a/nfs/nfs.c +++ b/nfs/nfs.c @@ -143,7 +143,36 @@ int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh } if (rpc_queue_pdu(rpc, pdu) != 0) { - rpc_set_error(rpc, "Out of memory. Failed to queue pdu for nfs/null call"); + rpc_set_error(rpc, "Out of memory. Failed to queue pdu for nfs/getattr call"); + rpc_free_pdu(rpc, pdu); + return -3; + } + + return 0; +} + +int rpc_nfs_pathconf_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data) +{ + struct rpc_pdu *pdu; + PATHCONF3args args; + + pdu = rpc_allocate_pdu(rpc, NFS_PROGRAM, NFS_V3, NFS3_PATHCONF, cb, private_data, (zdrproc_t)zdr_PATHCONF3res, sizeof(PATHCONF3res)); + if (pdu == NULL) { + rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for nfs/pathconf call"); + return -1; + } + + args.object.data.data_len = fh->data.data_len; + args.object.data.data_val = fh->data.data_val; + + if (zdr_PATHCONF3args(&pdu->zdr, &args) == 0) { + rpc_set_error(rpc, "ZDR error: Failed to encode PATHCONF3args"); + rpc_free_pdu(rpc, pdu); + return -2; + } + + if (rpc_queue_pdu(rpc, pdu) != 0) { + rpc_set_error(rpc, "Out of memory. Failed to queue pdu for nfs/pathconf call"); rpc_free_pdu(rpc, pdu); return -3; } @@ -261,7 +290,7 @@ int rpc_nfs_write_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, args.file.data.data_val = fh->data.data_val; args.offset = offset; args.count = count; - args.stable = stable_how;; + args.stable = stable_how; args.data.data_len = count; args.data.data_val = buf;