X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=nfs%2Fnfs.c;h=a9775e7f3ab3d4cf5f9cc8a9c9287bd3c2c68490;hb=2060155945dcdf638499b0d95c1b938d5013c828;hp=34c0859e5e801d39ad763f41de141c4fe042c810;hpb=84004dbf9bb2ab8a7f8b968affc53ee3065fa911;p=deb_libnfs.git diff --git a/nfs/nfs.c b/nfs/nfs.c index 34c0859..a9775e7 100644 --- a/nfs/nfs.c +++ b/nfs/nfs.c @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include "libnfs.h" #include "libnfs-raw.h" @@ -537,6 +539,34 @@ int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, return 0; } +int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data) +{ + struct rpc_pdu *pdu; + FSINFO3args args; + + pdu = rpc_allocate_pdu(rpc, NFS_PROGRAM, NFS_V3, NFS3_FSINFO, cb, private_data, (xdrproc_t)xdr_FSINFO3res, sizeof(FSINFO3res)); + if (pdu == NULL) { + rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for nfs/fsinfo call"); + return -1; + } + + args.fsroot.data.data_len = fh->data.data_len; + args.fsroot.data.data_val = fh->data.data_val; + + if (xdr_FSINFO3args(&pdu->xdr, &args) == 0) { + rpc_set_error(rpc, "XDR error: Failed to encode FSINFO3args"); + 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/fsinfo call"); + rpc_free_pdu(rpc, pdu); + return -3; + } + + return 0; +} int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data) {