2 Copyright (C) 2010 by Ronnie Sahlberg <ronniesahlberg@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, see <http://www.gnu.org/licenses/>.
18 * This is the lowlevel interface to access NFS resources.
19 * Through this interface you have access to the full gamut of nfs and nfs related
20 * protocol as well as the XDR encoded/decoded structures.
30 struct rpc_context
*rpc_init_context(void);
31 void rpc_destroy_context(struct rpc_context
*rpc
);
33 void rpc_set_auth(struct rpc_context
*rpc
, struct AUTH
*auth
);
35 int rpc_get_fd(struct rpc_context
*rpc
);
36 int rpc_which_events(struct rpc_context
*rpc
);
37 int rpc_service(struct rpc_context
*rpc
, int revents
);
38 char *rpc_get_error(struct rpc_context
*rpc
);
39 int rpc_queue_length(struct rpc_context
*rpc
);
41 /* Utility function to get an RPC context from a NFS context. Useful for doing low level NFSACL
42 * calls on a NFS context.
44 struct rpc_context
*nfs_get_rpc_context(struct nfs_context
*nfs
);
46 /* This function returns the nfs_fh3 structure from a nfsfh structure.
47 This allows to use a file onened with nfs_open() together with low-level
48 rpc functions that thake a nfs filehandle
50 struct nfs_fh3
*nfs_get_fh(struct nfsfh
*nfsfh
);
52 #define RPC_STATUS_SUCCESS 0
53 #define RPC_STATUS_ERROR 1
54 #define RPC_STATUS_CANCEL 2
57 * Async connection to the tcp port at server:port.
59 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
60 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
62 * When the callback is invoked, status indicates the result:
63 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
65 * RPC_STATUS_ERROR : The connection failed to establish.
66 * data is the erro string.
67 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
70 int rpc_connect_async(struct rpc_context
*rpc
, const char *server
, int port
, rpc_cb cb
, void *private_data
);
72 * When disconnecting a connection in flight. All commands in flight will be called with the callback
73 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
75 int rpc_disconnect(struct rpc_context
*rpc
, char *error
);
83 * Call PORTMAPPER/NULL
85 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
86 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
88 * When the callback is invoked, status indicates the result:
89 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
91 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
92 * data is the error string.
93 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
96 int rpc_pmap_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
100 * Call PORTMAPPER/GETPORT.
102 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
103 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
105 * When the callback is invoked, status indicates the result:
106 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
107 * data is a (uint32_t *), containing the port returned.
108 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
109 * data is the error string.
110 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
113 int rpc_pmap_getport_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, rpc_cb cb
, void *private_data
);
116 * Call PORTMAPPER/SET
118 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
119 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
121 * When the callback is invoked, status indicates the result:
122 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
123 * data is a (uint32_t *), containing status
124 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
125 * data is the error string.
126 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
129 int rpc_pmap_set_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
132 * Call PORTMAPPER/UNSET
134 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
135 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
137 * When the callback is invoked, status indicates the result:
138 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
139 * data is a (uint32_t *), containing status
140 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
141 * data is the error string.
142 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
145 int rpc_pmap_unset_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
148 * Call PORTMAPPER/CALLIT.
150 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
151 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
153 * When the callback is invoked, status indicates the result:
154 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
155 * data is a 'pmap_call_result' pointer.
156 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
157 * data is the error string.
158 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
161 int rpc_pmap_callit_async(struct rpc_context
*rpc
, int program
, int version
, int procedure
, char *data
, int datalen
, rpc_cb cb
, void *private_data
);
166 char *mountstat3_to_str(int stat
);
167 int mountstat3_to_errno(int error
);
172 * 0 : The call was initiated. The callback will be invoked when the call completes.
173 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
175 * When the callback is invoked, status indicates the result:
176 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
178 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
179 * data is the error string.
180 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
183 int rpc_mount_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
188 * 0 : The call was initiated. The callback will be invoked when the call completes.
189 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
191 * When the callback is invoked, status indicates the result:
192 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
193 * data is union mountres3.
194 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
195 * data is the error string.
196 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
199 int rpc_mount_mnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
204 * 0 : The call was initiated. The callback will be invoked when the call completes.
205 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
207 * When the callback is invoked, status indicates the result:
208 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
209 * data is a mountlist.
210 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
211 * data is the error string.
212 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
215 int rpc_mount_dump_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
220 * 0 : The call was initiated. The callback will be invoked when the call completes.
221 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
223 * When the callback is invoked, status indicates the result:
224 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
226 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
227 * data is the error string.
228 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
231 int rpc_mount_umnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
236 * 0 : The call was initiated. The callback will be invoked when the call completes.
237 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
239 * When the callback is invoked, status indicates the result:
240 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
242 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
243 * data is the error string.
244 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
247 int rpc_mount_umntall_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
251 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
252 * returned structures.
255 * 0 : The call was initiated. The callback will be invoked when the call completes.
256 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
258 * When the callback is invoked, status indicates the result:
259 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
260 * data is a pointer to an exports pointer:
261 * exports export = *(exports *)data;
262 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
263 * data is the error string.
264 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
267 int rpc_mount_export_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
276 char *nfsstat3_to_str(int error
);
277 int nfsstat3_to_errno(int error
);
282 * 0 : The call was initiated. The callback will be invoked when the call completes.
283 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
285 * When the callback is invoked, status indicates the result:
286 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
288 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
289 * data is the error string.
290 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
293 int rpc_nfs_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
298 * 0 : The call was initiated. The callback will be invoked when the call completes.
299 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
301 * When the callback is invoked, status indicates the result:
302 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
303 * data is GETATTR3res
304 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
305 * data is the error string.
306 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
309 int rpc_nfs_getattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
314 * 0 : The call was initiated. The callback will be invoked when the call completes.
315 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
317 * When the callback is invoked, status indicates the result:
318 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
320 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
321 * data is the error string.
322 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
325 int rpc_nfs_lookup_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
330 * 0 : The call was initiated. The callback will be invoked when the call completes.
331 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
333 * When the callback is invoked, status indicates the result:
334 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
336 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
337 * data is the error string.
338 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
341 int rpc_nfs_access_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, int access
, void *private_data
);
346 * 0 : The call was initiated. The callback will be invoked when the call completes.
347 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
349 * When the callback is invoked, status indicates the result:
350 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
352 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
353 * data is the error string.
354 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
357 int rpc_nfs_read_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, uint64_t offset
, uint64_t count
, void *private_data
);
362 * 0 : The call was initiated. The callback will be invoked when the call completes.
363 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
365 * When the callback is invoked, status indicates the result:
366 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
367 * data is WRITE3res *
368 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
369 * data is the error string.
370 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
373 int rpc_nfs_write_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *buf
, uint64_t offset
, uint64_t count
, int stable_how
, void *private_data
);
378 * 0 : The call was initiated. The callback will be invoked when the call completes.
379 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
381 * When the callback is invoked, status indicates the result:
382 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
383 * data is COMMIT3res *
384 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
385 * data is the error string.
386 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
389 int rpc_nfs_commit_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
395 * 0 : The call was initiated. The callback will be invoked when the call completes.
396 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
398 * When the callback is invoked, status indicates the result:
399 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
400 * data is SETATTR3res *
401 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
402 * data is the error string.
403 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
407 int rpc_nfs_setattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETATTR3args
*args
, void *private_data
);
414 * 0 : The call was initiated. The callback will be invoked when the call completes.
415 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
417 * When the callback is invoked, status indicates the result:
418 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
419 * data is MKDIR3res *
420 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
421 * data is the error string.
422 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
426 int rpc_nfs_mkdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct MKDIR3args
*args
, void *private_data
);
435 * 0 : The call was initiated. The callback will be invoked when the call completes.
436 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
438 * When the callback is invoked, status indicates the result:
439 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
440 * data is RMDIR3res *
441 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
442 * data is the error string.
443 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
446 int rpc_nfs_rmdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *dir
, void *private_data
);
454 * 0 : The call was initiated. The callback will be invoked when the call completes.
455 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
457 * When the callback is invoked, status indicates the result:
458 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
459 * data is CREATE3res *
460 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
461 * data is the error string.
462 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
466 int rpc_nfs_create_async(struct rpc_context
*rpc
, rpc_cb cb
, struct CREATE3args
*args
, void *private_data
);
472 * 0 : The call was initiated. The callback will be invoked when the call completes.
473 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
475 * When the callback is invoked, status indicates the result:
476 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
477 * data is MKNOD3res *
478 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
479 * data is the error string.
480 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
483 int rpc_nfs_mknod_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *file
, int mode
, int major
, int minor
, void *private_data
);
489 * 0 : The call was initiated. The callback will be invoked when the call completes.
490 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
492 * When the callback is invoked, status indicates the result:
493 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
494 * data is REMOVE3res *
495 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
496 * data is the error string.
497 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
500 int rpc_nfs_remove_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
507 * 0 : The call was initiated. The callback will be invoked when the call completes.
508 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
510 * When the callback is invoked, status indicates the result:
511 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
512 * data is READDIR3res *
513 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
514 * data is the error string.
515 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
518 int rpc_nfs_readdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, uint64_t cookie
, char *cookieverf
, int count
, void *private_data
);
521 * Call NFS/READDIRPLUS
523 * 0 : The call was initiated. The callback will be invoked when the call completes.
524 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
526 * When the callback is invoked, status indicates the result:
527 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
528 * data is READDIRPLUS3res *
529 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
530 * data is the error string.
531 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
534 int rpc_nfs_readdirplus_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, uint64_t cookie
, char *cookieverf
, int count
, void *private_data
);
539 * 0 : The call was initiated. The callback will be invoked when the call completes.
540 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
542 * When the callback is invoked, status indicates the result:
543 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
545 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
546 * data is the error string.
547 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
550 int rpc_nfs_fsstat_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
557 * 0 : The call was initiated. The callback will be invoked when the call completes.
558 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
560 * When the callback is invoked, status indicates the result:
561 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
563 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
564 * data is the error string.
565 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
568 int rpc_nfs_fsinfo_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
575 * 0 : The call was initiated. The callback will be invoked when the call completes.
576 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
578 * When the callback is invoked, status indicates the result:
579 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
580 * data is READLINK3res *
581 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
582 * data is the error string.
583 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
586 struct READLINK3args
;
587 int rpc_nfs_readlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READLINK3args
*args
, void *private_data
);
594 * 0 : The call was initiated. The callback will be invoked when the call completes.
595 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
597 * When the callback is invoked, status indicates the result:
598 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
599 * data is SYMLINK3res *
600 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
601 * data is the error string.
602 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
606 int rpc_nfs_symlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SYMLINK3args
*args
, void *private_data
);
612 * 0 : The call was initiated. The callback will be invoked when the call completes.
613 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
615 * When the callback is invoked, status indicates the result:
616 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
617 * data is RENAME3res *
618 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
619 * data is the error string.
620 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
623 int rpc_nfs_rename_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*olddir
, char *oldname
, struct nfs_fh3
*newdir
, char *newname
, void *private_data
);
630 * 0 : The call was initiated. The callback will be invoked when the call completes.
631 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
633 * When the callback is invoked, status indicates the result:
634 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
636 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
637 * data is the error string.
638 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
641 int rpc_nfs_link_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*file
, struct nfs_fh3
*newdir
, char *newname
, void *private_data
);
649 char *rquotastat_to_str(int error
);
650 int rquotastat_to_errno(int error
);
655 * 0 : The call was initiated. The callback will be invoked when the call completes.
656 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
658 * When the callback is invoked, status indicates the result:
659 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
661 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
662 * data is the error string.
663 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
666 int rpc_rquota1_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
669 * Call RQUOTA1/GETQUOTA
671 * 0 : The call was initiated. The callback will be invoked when the call completes.
672 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
674 * When the callback is invoked, status indicates the result:
675 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
676 * data is a RQUOTA1res structure.
677 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
678 * data is the error string.
679 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
682 int rpc_rquota1_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
685 * Call RQUOTA1/GETACTIVEQUOTA
687 * 0 : The call was initiated. The callback will be invoked when the call completes.
688 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
690 * When the callback is invoked, status indicates the result:
691 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
692 * data is a RQUOTA1res structure.
693 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
694 * data is the error string.
695 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
698 int rpc_rquota1_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
706 * 0 : The call was initiated. The callback will be invoked when the call completes.
707 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
709 * When the callback is invoked, status indicates the result:
710 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
712 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
713 * data is the error string.
714 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
717 int rpc_rquota2_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
720 * Call RQUOTA2/GETQUOTA
722 * 0 : The call was initiated. The callback will be invoked when the call completes.
723 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
725 * When the callback is invoked, status indicates the result:
726 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
727 * data is a RQUOTA1res structure.
728 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
729 * data is the error string.
730 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
733 int rpc_rquota2_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
736 * Call RQUOTA2/GETACTIVEQUOTA
738 * 0 : The call was initiated. The callback will be invoked when the call completes.
739 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
741 * When the callback is invoked, status indicates the result:
742 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
743 * data is a RQUOTA1res structure.
744 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
745 * data is the error string.
746 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
749 int rpc_rquota2_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
762 * Call the NULL procedure for the NFSACL
765 * 0 : The call was initiated. The callback will be invoked when the call completes.
766 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
768 * When the callback is invoked, status indicates the result:
769 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
771 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
772 * data is the error string.
773 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
776 int rpc_nfsacl_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
782 * 0 : The call was initiated. The callback will be invoked when the call completes.
783 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
785 * When the callback is invoked, status indicates the result:
786 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
787 * data is a GETACL3res pointer
788 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
789 * data is the error string.
790 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
794 int rpc_nfsacl_getacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct GETACL3args
*args
, void *private_data
);
802 * 0 : The call was initiated. The callback will be invoked when the call completes.
803 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
805 * When the callback is invoked, status indicates the result:
806 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
807 * data is a SETACL3res pointer
808 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
809 * data is the error string.
810 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
814 int rpc_nfsacl_setacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETACL3args
*args
, void *private_data
);
822 char *nlmstat4_to_str(int stat
);
826 * Call the NULL procedure for the NLM protocol
829 * 0 : The call was initiated. The callback will be invoked when the call completes.
830 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
832 * When the callback is invoked, status indicates the result:
833 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
835 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
836 * data is the error string.
837 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
840 int rpc_nlm4_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
844 * Call the TEST procedure for the NLM protocol
847 * 0 : The call was initiated. The callback will be invoked when the call completes.
848 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
850 * When the callback is invoked, status indicates the result:
851 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
852 * data is NLM4_TESTres
853 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
854 * data is the error string.
855 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
858 struct NLM4_TESTargs
;
859 int rpc_nlm4_test_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_TESTargs
*args
, void *private_data
);
863 * Call the LOCK procedure for the NLM protocol
866 * 0 : The call was initiated. The callback will be invoked when the call completes.
867 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
869 * When the callback is invoked, status indicates the result:
870 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
871 * data is NLM4_LOCKres
872 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
873 * data is the error string.
874 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
877 struct NLM4_LOCKargs
;
878 int rpc_nlm4_lock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_LOCKargs
*args
, void *private_data
);
882 * Call the CANCEL procedure for the NLM protocol
885 * 0 : The call was initiated. The callback will be invoked when the call completes.
886 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
888 * When the callback is invoked, status indicates the result:
889 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
890 * data is NLM4_CANCres
891 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
892 * data is the error string.
893 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
896 struct NLM4_CANCargs
;
897 int rpc_nlm4_cancel_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_CANCargs
*args
, void *private_data
);
901 * Call the UNLOCK procedure for the NLM protocol
904 * 0 : The call was initiated. The callback will be invoked when the call completes.
905 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
907 * When the callback is invoked, status indicates the result:
908 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
909 * data is NLM4_UNLOCKres
910 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
911 * data is the error string.
912 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
915 struct NLM4_UNLOCKargs
;
916 int rpc_nlm4_unlock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_UNLOCKargs
*args
, void *private_data
);