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.
22 #ifndef _LIBNFS_RAW_H_
23 #define _LIBNFS_RAW_H_
26 #include <nfsc/libnfs-zdr.h>
34 struct rpc_context
*rpc_init_context(void);
35 void rpc_destroy_context(struct rpc_context
*rpc
);
37 void rpc_set_auth(struct rpc_context
*rpc
, struct AUTH
*auth
);
39 int rpc_get_fd(struct rpc_context
*rpc
);
40 int rpc_which_events(struct rpc_context
*rpc
);
41 int rpc_service(struct rpc_context
*rpc
, int revents
);
42 char *rpc_get_error(struct rpc_context
*rpc
);
43 int rpc_queue_length(struct rpc_context
*rpc
);
45 /* Utility function to get an RPC context from a NFS context. Useful for doing low level NFSACL
46 * calls on a NFS context.
48 struct rpc_context
*nfs_get_rpc_context(struct nfs_context
*nfs
);
50 /* This function returns the nfs_fh3 structure from a nfsfh structure.
51 This allows to use a file onened with nfs_open() together with low-level
52 rpc functions that thake a nfs filehandle
54 struct nfs_fh3
*nfs_get_fh(struct nfsfh
*nfsfh
);
56 #define RPC_STATUS_SUCCESS 0
57 #define RPC_STATUS_ERROR 1
58 #define RPC_STATUS_CANCEL 2
61 * Async connection to the tcp port at server:port.
63 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
64 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
66 * When the callback is invoked, status indicates the result:
67 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
69 * RPC_STATUS_ERROR : The connection failed to establish.
70 * data is the erro string.
71 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
74 int rpc_connect_async(struct rpc_context
*rpc
, const char *server
, int port
, rpc_cb cb
, void *private_data
);
76 * When disconnecting a connection in flight. All commands in flight will be called with the callback
77 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
79 int rpc_disconnect(struct rpc_context
*rpc
, char *error
);
87 * Call PORTMAPPER/NULL
89 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
90 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
92 * When the callback is invoked, status indicates the result:
93 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
95 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
96 * data is the error string.
97 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
100 int rpc_pmap_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
104 * Call PORTMAPPER/GETPORT.
106 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
107 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
109 * When the callback is invoked, status indicates the result:
110 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
111 * data is a (uint32_t *), containing the port returned.
112 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
113 * data is the error string.
114 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
117 int rpc_pmap_getport_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, rpc_cb cb
, void *private_data
);
120 * Call PORTMAPPER/SET
122 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
123 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
125 * When the callback is invoked, status indicates the result:
126 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
127 * data is a (uint32_t *), containing status
128 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
129 * data is the error string.
130 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
133 int rpc_pmap_set_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
136 * Call PORTMAPPER/UNSET
138 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
139 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
141 * When the callback is invoked, status indicates the result:
142 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
143 * data is a (uint32_t *), containing status
144 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
145 * data is the error string.
146 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
149 int rpc_pmap_unset_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
152 * Call PORTMAPPER/CALLIT.
154 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
155 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
157 * When the callback is invoked, status indicates the result:
158 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
159 * data is a 'pmap_call_result' pointer.
160 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
161 * data is the error string.
162 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
165 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
);
170 char *mountstat3_to_str(int stat
);
171 int mountstat3_to_errno(int error
);
176 * 0 : The call was initiated. The callback will be invoked when the call completes.
177 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
179 * When the callback is invoked, status indicates the result:
180 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
182 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
183 * data is the error string.
184 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
187 int rpc_mount_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
192 * 0 : The call was initiated. The callback will be invoked when the call completes.
193 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
195 * When the callback is invoked, status indicates the result:
196 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
197 * data is union mountres3.
198 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
199 * data is the error string.
200 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
203 int rpc_mount_mnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
208 * 0 : The call was initiated. The callback will be invoked when the call completes.
209 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
211 * When the callback is invoked, status indicates the result:
212 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
213 * data is a mountlist.
214 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
215 * data is the error string.
216 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
219 int rpc_mount_dump_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
224 * 0 : The call was initiated. The callback will be invoked when the call completes.
225 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
227 * When the callback is invoked, status indicates the result:
228 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
230 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
231 * data is the error string.
232 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
235 int rpc_mount_umnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
240 * 0 : The call was initiated. The callback will be invoked when the call completes.
241 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
243 * When the callback is invoked, status indicates the result:
244 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
246 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
247 * data is the error string.
248 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
251 int rpc_mount_umntall_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
255 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
256 * returned structures.
259 * 0 : The call was initiated. The callback will be invoked when the call completes.
260 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
262 * When the callback is invoked, status indicates the result:
263 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
264 * data is a pointer to an exports pointer:
265 * exports export = *(exports *)data;
266 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
267 * data is the error string.
268 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
271 int rpc_mount_export_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
280 char *nfsstat3_to_str(int error
);
281 int nfsstat3_to_errno(int error
);
286 * 0 : The call was initiated. The callback will be invoked when the call completes.
287 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
289 * When the callback is invoked, status indicates the result:
290 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
292 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
293 * data is the error string.
294 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
297 int rpc_nfs_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
302 * 0 : The call was initiated. The callback will be invoked when the call completes.
303 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
305 * When the callback is invoked, status indicates the result:
306 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
307 * data is GETATTR3res
308 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
309 * data is the error string.
310 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
313 int rpc_nfs_getattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
318 * 0 : The call was initiated. The callback will be invoked when the call completes.
319 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
321 * When the callback is invoked, status indicates the result:
322 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
323 * data is PATHCONF3res
324 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
325 * data is the error string.
326 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
329 int rpc_nfs_pathconf_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
334 * 0 : The call was initiated. The callback will be invoked when the call completes.
335 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
337 * When the callback is invoked, status indicates the result:
338 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
340 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
341 * data is the error string.
342 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
345 int rpc_nfs_lookup_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
350 * 0 : The call was initiated. The callback will be invoked when the call completes.
351 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
353 * When the callback is invoked, status indicates the result:
354 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
356 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
357 * data is the error string.
358 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
361 int rpc_nfs_access_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, int access
, void *private_data
);
366 * 0 : The call was initiated. The callback will be invoked when the call completes.
367 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
369 * When the callback is invoked, status indicates the result:
370 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
372 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
373 * data is the error string.
374 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
377 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
);
382 * 0 : The call was initiated. The callback will be invoked when the call completes.
383 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
385 * When the callback is invoked, status indicates the result:
386 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
387 * data is WRITE3res *
388 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
389 * data is the error string.
390 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
393 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
);
398 * 0 : The call was initiated. The callback will be invoked when the call completes.
399 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
401 * When the callback is invoked, status indicates the result:
402 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
403 * data is COMMIT3res *
404 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
405 * data is the error string.
406 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
409 int rpc_nfs_commit_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
415 * 0 : The call was initiated. The callback will be invoked when the call completes.
416 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
418 * When the callback is invoked, status indicates the result:
419 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
420 * data is SETATTR3res *
421 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
422 * data is the error string.
423 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
427 int rpc_nfs_setattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETATTR3args
*args
, void *private_data
);
434 * 0 : The call was initiated. The callback will be invoked when the call completes.
435 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
437 * When the callback is invoked, status indicates the result:
438 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
439 * data is MKDIR3res *
440 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
441 * data is the error string.
442 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
446 int rpc_nfs_mkdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct MKDIR3args
*args
, void *private_data
);
455 * 0 : The call was initiated. The callback will be invoked when the call completes.
456 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
458 * When the callback is invoked, status indicates the result:
459 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
460 * data is RMDIR3res *
461 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
462 * data is the error string.
463 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
466 int rpc_nfs_rmdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *dir
, void *private_data
);
474 * 0 : The call was initiated. The callback will be invoked when the call completes.
475 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
477 * When the callback is invoked, status indicates the result:
478 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
479 * data is CREATE3res *
480 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
481 * data is the error string.
482 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
486 int rpc_nfs_create_async(struct rpc_context
*rpc
, rpc_cb cb
, struct CREATE3args
*args
, void *private_data
);
492 * 0 : The call was initiated. The callback will be invoked when the call completes.
493 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
495 * When the callback is invoked, status indicates the result:
496 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
497 * data is MKNOD3res *
498 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
499 * data is the error string.
500 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
503 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
);
509 * 0 : The call was initiated. The callback will be invoked when the call completes.
510 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
512 * When the callback is invoked, status indicates the result:
513 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
514 * data is REMOVE3res *
515 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
516 * data is the error string.
517 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
520 int rpc_nfs_remove_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
527 * 0 : The call was initiated. The callback will be invoked when the call completes.
528 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
530 * When the callback is invoked, status indicates the result:
531 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
532 * data is READDIR3res *
533 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
534 * data is the error string.
535 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
538 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
);
541 * Call NFS/READDIRPLUS
543 * 0 : The call was initiated. The callback will be invoked when the call completes.
544 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
546 * When the callback is invoked, status indicates the result:
547 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
548 * data is READDIRPLUS3res *
549 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
550 * data is the error string.
551 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
554 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
);
559 * 0 : The call was initiated. The callback will be invoked when the call completes.
560 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
562 * When the callback is invoked, status indicates the result:
563 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
565 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
566 * data is the error string.
567 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
570 int rpc_nfs_fsstat_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
577 * 0 : The call was initiated. The callback will be invoked when the call completes.
578 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
580 * When the callback is invoked, status indicates the result:
581 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
583 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
584 * data is the error string.
585 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
588 int rpc_nfs_fsinfo_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
595 * 0 : The call was initiated. The callback will be invoked when the call completes.
596 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
598 * When the callback is invoked, status indicates the result:
599 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
600 * data is READLINK3res *
601 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
602 * data is the error string.
603 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
606 struct READLINK3args
;
607 int rpc_nfs_readlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READLINK3args
*args
, void *private_data
);
614 * 0 : The call was initiated. The callback will be invoked when the call completes.
615 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
617 * When the callback is invoked, status indicates the result:
618 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
619 * data is SYMLINK3res *
620 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
621 * data is the error string.
622 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
626 int rpc_nfs_symlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SYMLINK3args
*args
, void *private_data
);
632 * 0 : The call was initiated. The callback will be invoked when the call completes.
633 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
635 * When the callback is invoked, status indicates the result:
636 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
637 * data is RENAME3res *
638 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
639 * data is the error string.
640 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
643 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
);
650 * 0 : The call was initiated. The callback will be invoked when the call completes.
651 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
653 * When the callback is invoked, status indicates the result:
654 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
656 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
657 * data is the error string.
658 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
661 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
);
669 char *rquotastat_to_str(int error
);
670 int rquotastat_to_errno(int error
);
675 * 0 : The call was initiated. The callback will be invoked when the call completes.
676 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
678 * When the callback is invoked, status indicates the result:
679 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
681 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
682 * data is the error string.
683 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
686 int rpc_rquota1_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
689 * Call RQUOTA1/GETQUOTA
691 * 0 : The call was initiated. The callback will be invoked when the call completes.
692 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
694 * When the callback is invoked, status indicates the result:
695 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
696 * data is a RQUOTA1res structure.
697 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
698 * data is the error string.
699 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
702 int rpc_rquota1_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
705 * Call RQUOTA1/GETACTIVEQUOTA
707 * 0 : The call was initiated. The callback will be invoked when the call completes.
708 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
710 * When the callback is invoked, status indicates the result:
711 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
712 * data is a RQUOTA1res structure.
713 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
714 * data is the error string.
715 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
718 int rpc_rquota1_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
726 * 0 : The call was initiated. The callback will be invoked when the call completes.
727 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
729 * When the callback is invoked, status indicates the result:
730 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
732 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
733 * data is the error string.
734 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
737 int rpc_rquota2_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
740 * Call RQUOTA2/GETQUOTA
742 * 0 : The call was initiated. The callback will be invoked when the call completes.
743 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
745 * When the callback is invoked, status indicates the result:
746 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
747 * data is a RQUOTA1res structure.
748 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
749 * data is the error string.
750 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
753 int rpc_rquota2_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
756 * Call RQUOTA2/GETACTIVEQUOTA
758 * 0 : The call was initiated. The callback will be invoked when the call completes.
759 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
761 * When the callback is invoked, status indicates the result:
762 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
763 * data is a RQUOTA1res structure.
764 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
765 * data is the error string.
766 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
769 int rpc_rquota2_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
782 * Call the NULL procedure for the NFSACL
785 * 0 : The call was initiated. The callback will be invoked when the call completes.
786 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
788 * When the callback is invoked, status indicates the result:
789 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
791 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
792 * data is the error string.
793 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
796 int rpc_nfsacl_null_async(struct rpc_context
*rpc
, rpc_cb cb
, 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 GETACL3res 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_getacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct GETACL3args
*args
, void *private_data
);
822 * 0 : The call was initiated. The callback will be invoked when the call completes.
823 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
825 * When the callback is invoked, status indicates the result:
826 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
827 * data is a SETACL3res pointer
828 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
829 * data is the error string.
830 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
834 int rpc_nfsacl_setacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETACL3args
*args
, void *private_data
);
842 char *nlmstat4_to_str(int stat
);
846 * Call the NULL procedure for the NLM protocol
849 * 0 : The call was initiated. The callback will be invoked when the call completes.
850 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
852 * When the callback is invoked, status indicates the result:
853 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
855 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
856 * data is the error string.
857 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
860 int rpc_nlm4_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
864 * Call the TEST procedure for the NLM protocol
867 * 0 : The call was initiated. The callback will be invoked when the call completes.
868 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
870 * When the callback is invoked, status indicates the result:
871 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
872 * data is NLM4_TESTres
873 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
874 * data is the error string.
875 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
878 struct NLM4_TESTargs
;
879 int rpc_nlm4_test_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_TESTargs
*args
, void *private_data
);
883 * Call the LOCK procedure for the NLM protocol
886 * 0 : The call was initiated. The callback will be invoked when the call completes.
887 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
889 * When the callback is invoked, status indicates the result:
890 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
891 * data is NLM4_LOCKres
892 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
893 * data is the error string.
894 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
897 struct NLM4_LOCKargs
;
898 int rpc_nlm4_lock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_LOCKargs
*args
, void *private_data
);
902 * Call the CANCEL procedure for the NLM protocol
905 * 0 : The call was initiated. The callback will be invoked when the call completes.
906 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
908 * When the callback is invoked, status indicates the result:
909 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
910 * data is NLM4_CANCres
911 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
912 * data is the error string.
913 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
916 struct NLM4_CANCargs
;
917 int rpc_nlm4_cancel_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_CANCargs
*args
, void *private_data
);
921 * Call the UNLOCK procedure for the NLM protocol
924 * 0 : The call was initiated. The callback will be invoked when the call completes.
925 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
927 * When the callback is invoked, status indicates the result:
928 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
929 * data is NLM4_UNLOCKres
930 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
931 * data is the error string.
932 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
935 struct NLM4_UNLOCKargs
;
936 int rpc_nlm4_unlock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_UNLOCKargs
*args
, void *private_data
);