47a6333f3d209b2f5912a27812184d7bfcfd6836
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 /* Control what the next XID value to be used on the context will be.
57 This can be used when multiple contexts are used to the same server
58 to avoid that the two contexts have xid collissions.
60 void rpc_set_next_xid(struct rpc_context
*rpc
, uint32_t xid
);
62 #define RPC_STATUS_SUCCESS 0
63 #define RPC_STATUS_ERROR 1
64 #define RPC_STATUS_CANCEL 2
67 * Async connection to the tcp port at server:port.
69 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
70 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
72 * When the callback is invoked, status indicates the result:
73 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
75 * RPC_STATUS_ERROR : The connection failed to establish.
76 * data is the erro string.
77 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
80 int rpc_connect_async(struct rpc_context
*rpc
, const char *server
, int port
, rpc_cb cb
, void *private_data
);
82 * When disconnecting a connection in flight. All commands in flight will be called with the callback
83 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
85 int rpc_disconnect(struct rpc_context
*rpc
, char *error
);
93 * Call PORTMAPPER/NULL
95 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
96 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
98 * When the callback is invoked, status indicates the result:
99 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
101 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
102 * data is the error string.
103 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
106 int rpc_pmap_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
110 * Call PORTMAPPER/GETPORT.
112 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
113 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
115 * When the callback is invoked, status indicates the result:
116 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
117 * data is a (uint32_t *), containing the port returned.
118 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
119 * data is the error string.
120 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
123 int rpc_pmap_getport_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, rpc_cb cb
, void *private_data
);
126 * Call PORTMAPPER/SET
128 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
129 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
131 * When the callback is invoked, status indicates the result:
132 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
133 * data is a (uint32_t *), containing status
134 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
135 * data is the error string.
136 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
139 int rpc_pmap_set_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
142 * Call PORTMAPPER/UNSET
144 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
145 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
147 * When the callback is invoked, status indicates the result:
148 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
149 * data is a (uint32_t *), containing status
150 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
151 * data is the error string.
152 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
155 int rpc_pmap_unset_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
158 * Call PORTMAPPER/CALLIT.
160 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
161 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
163 * When the callback is invoked, status indicates the result:
164 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
165 * data is a 'pmap_call_result' pointer.
166 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
167 * data is the error string.
168 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
171 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
);
176 char *mountstat3_to_str(int stat
);
177 int mountstat3_to_errno(int error
);
182 * 0 : The call was initiated. The callback will be invoked when the call completes.
183 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
185 * When the callback is invoked, status indicates the result:
186 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
188 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
189 * data is the error string.
190 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
193 int rpc_mount_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
198 * 0 : The call was initiated. The callback will be invoked when the call completes.
199 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
201 * When the callback is invoked, status indicates the result:
202 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
203 * data is union mountres3.
204 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
205 * data is the error string.
206 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
209 int rpc_mount_mnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
214 * 0 : The call was initiated. The callback will be invoked when the call completes.
215 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
217 * When the callback is invoked, status indicates the result:
218 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
219 * data is a mountlist.
220 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
221 * data is the error string.
222 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
225 int rpc_mount_dump_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
230 * 0 : The call was initiated. The callback will be invoked when the call completes.
231 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
233 * When the callback is invoked, status indicates the result:
234 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
236 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
237 * data is the error string.
238 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
241 int rpc_mount_umnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
246 * 0 : The call was initiated. The callback will be invoked when the call completes.
247 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
249 * When the callback is invoked, status indicates the result:
250 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
252 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
253 * data is the error string.
254 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
257 int rpc_mount_umntall_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
261 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
262 * returned structures.
265 * 0 : The call was initiated. The callback will be invoked when the call completes.
266 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
268 * When the callback is invoked, status indicates the result:
269 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
270 * data is a pointer to an exports pointer:
271 * exports export = *(exports *)data;
272 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
273 * data is the error string.
274 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
277 int rpc_mount_export_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
286 char *nfsstat3_to_str(int error
);
287 int nfsstat3_to_errno(int error
);
292 * 0 : The call was initiated. The callback will be invoked when the call completes.
293 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
295 * When the callback is invoked, status indicates the result:
296 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
298 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
299 * data is the error string.
300 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
303 int rpc_nfs_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
308 * 0 : The call was initiated. The callback will be invoked when the call completes.
309 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
311 * When the callback is invoked, status indicates the result:
312 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
313 * data is GETATTR3res
314 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
315 * data is the error string.
316 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
319 int rpc_nfs_getattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
324 * 0 : The call was initiated. The callback will be invoked when the call completes.
325 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
327 * When the callback is invoked, status indicates the result:
328 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
329 * data is PATHCONF3res
330 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
331 * data is the error string.
332 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
335 int rpc_nfs_pathconf_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
340 * 0 : The call was initiated. The callback will be invoked when the call completes.
341 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
343 * When the callback is invoked, status indicates the result:
344 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
346 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
347 * data is the error string.
348 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
351 int rpc_nfs_lookup_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
356 * 0 : The call was initiated. The callback will be invoked when the call completes.
357 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
359 * When the callback is invoked, status indicates the result:
360 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
362 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
363 * data is the error string.
364 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
367 int rpc_nfs_access_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, int access
, void *private_data
);
372 * 0 : The call was initiated. The callback will be invoked when the call completes.
373 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
375 * When the callback is invoked, status indicates the result:
376 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
378 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
379 * data is the error string.
380 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
383 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
);
388 * 0 : The call was initiated. The callback will be invoked when the call completes.
389 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
391 * When the callback is invoked, status indicates the result:
392 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
393 * data is WRITE3res *
394 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
395 * data is the error string.
396 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
399 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
);
404 * 0 : The call was initiated. The callback will be invoked when the call completes.
405 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
407 * When the callback is invoked, status indicates the result:
408 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
409 * data is COMMIT3res *
410 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
411 * data is the error string.
412 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
415 int rpc_nfs_commit_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
421 * 0 : The call was initiated. The callback will be invoked when the call completes.
422 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
424 * When the callback is invoked, status indicates the result:
425 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
426 * data is SETATTR3res *
427 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
428 * data is the error string.
429 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
433 int rpc_nfs_setattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETATTR3args
*args
, void *private_data
);
440 * 0 : The call was initiated. The callback will be invoked when the call completes.
441 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
443 * When the callback is invoked, status indicates the result:
444 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
445 * data is MKDIR3res *
446 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
447 * data is the error string.
448 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
452 int rpc_nfs_mkdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct MKDIR3args
*args
, void *private_data
);
461 * 0 : The call was initiated. The callback will be invoked when the call completes.
462 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
464 * When the callback is invoked, status indicates the result:
465 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
466 * data is RMDIR3res *
467 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
468 * data is the error string.
469 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
472 int rpc_nfs_rmdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *dir
, void *private_data
);
480 * 0 : The call was initiated. The callback will be invoked when the call completes.
481 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
483 * When the callback is invoked, status indicates the result:
484 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
485 * data is CREATE3res *
486 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
487 * data is the error string.
488 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
492 int rpc_nfs_create_async(struct rpc_context
*rpc
, rpc_cb cb
, struct CREATE3args
*args
, void *private_data
);
498 * 0 : The call was initiated. The callback will be invoked when the call completes.
499 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
501 * When the callback is invoked, status indicates the result:
502 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
503 * data is MKNOD3res *
504 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
505 * data is the error string.
506 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
509 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
);
515 * 0 : The call was initiated. The callback will be invoked when the call completes.
516 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
518 * When the callback is invoked, status indicates the result:
519 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
520 * data is REMOVE3res *
521 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
522 * data is the error string.
523 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
526 int rpc_nfs_remove_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
533 * 0 : The call was initiated. The callback will be invoked when the call completes.
534 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
536 * When the callback is invoked, status indicates the result:
537 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
538 * data is READDIR3res *
539 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
540 * data is the error string.
541 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
544 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
);
547 * Call NFS/READDIRPLUS
549 * 0 : The call was initiated. The callback will be invoked when the call completes.
550 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
552 * When the callback is invoked, status indicates the result:
553 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
554 * data is READDIRPLUS3res *
555 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
556 * data is the error string.
557 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
560 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
);
565 * 0 : The call was initiated. The callback will be invoked when the call completes.
566 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
568 * When the callback is invoked, status indicates the result:
569 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
571 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
572 * data is the error string.
573 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
576 int rpc_nfs_fsstat_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
583 * 0 : The call was initiated. The callback will be invoked when the call completes.
584 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
586 * When the callback is invoked, status indicates the result:
587 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
589 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
590 * data is the error string.
591 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
594 int rpc_nfs_fsinfo_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
601 * 0 : The call was initiated. The callback will be invoked when the call completes.
602 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
604 * When the callback is invoked, status indicates the result:
605 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
606 * data is READLINK3res *
607 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
608 * data is the error string.
609 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
612 struct READLINK3args
;
613 int rpc_nfs_readlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READLINK3args
*args
, void *private_data
);
620 * 0 : The call was initiated. The callback will be invoked when the call completes.
621 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
623 * When the callback is invoked, status indicates the result:
624 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
625 * data is SYMLINK3res *
626 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
627 * data is the error string.
628 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
632 int rpc_nfs_symlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SYMLINK3args
*args
, void *private_data
);
638 * 0 : The call was initiated. The callback will be invoked when the call completes.
639 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
641 * When the callback is invoked, status indicates the result:
642 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
643 * data is RENAME3res *
644 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
645 * data is the error string.
646 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
649 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
);
656 * 0 : The call was initiated. The callback will be invoked when the call completes.
657 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
659 * When the callback is invoked, status indicates the result:
660 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
662 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
663 * data is the error string.
664 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
667 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
);
675 char *rquotastat_to_str(int error
);
676 int rquotastat_to_errno(int error
);
681 * 0 : The call was initiated. The callback will be invoked when the call completes.
682 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
684 * When the callback is invoked, status indicates the result:
685 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
687 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
688 * data is the error string.
689 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
692 int rpc_rquota1_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
695 * Call RQUOTA1/GETQUOTA
697 * 0 : The call was initiated. The callback will be invoked when the call completes.
698 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
700 * When the callback is invoked, status indicates the result:
701 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
702 * data is a RQUOTA1res structure.
703 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
704 * data is the error string.
705 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
708 int rpc_rquota1_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
711 * Call RQUOTA1/GETACTIVEQUOTA
713 * 0 : The call was initiated. The callback will be invoked when the call completes.
714 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
716 * When the callback is invoked, status indicates the result:
717 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
718 * data is a RQUOTA1res structure.
719 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
720 * data is the error string.
721 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
724 int rpc_rquota1_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
732 * 0 : The call was initiated. The callback will be invoked when the call completes.
733 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
735 * When the callback is invoked, status indicates the result:
736 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
738 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
739 * data is the error string.
740 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
743 int rpc_rquota2_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
746 * Call RQUOTA2/GETQUOTA
748 * 0 : The call was initiated. The callback will be invoked when the call completes.
749 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
751 * When the callback is invoked, status indicates the result:
752 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
753 * data is a RQUOTA1res structure.
754 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
755 * data is the error string.
756 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
759 int rpc_rquota2_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
762 * Call RQUOTA2/GETACTIVEQUOTA
764 * 0 : The call was initiated. The callback will be invoked when the call completes.
765 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
767 * When the callback is invoked, status indicates the result:
768 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
769 * data is a RQUOTA1res structure.
770 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
771 * data is the error string.
772 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
775 int rpc_rquota2_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
788 * Call the NULL procedure for the NFSACL
791 * 0 : The call was initiated. The callback will be invoked when the call completes.
792 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
794 * When the callback is invoked, status indicates the result:
795 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
797 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
798 * data is the error string.
799 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
802 int rpc_nfsacl_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
808 * 0 : The call was initiated. The callback will be invoked when the call completes.
809 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
811 * When the callback is invoked, status indicates the result:
812 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
813 * data is a GETACL3res pointer
814 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
815 * data is the error string.
816 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
820 int rpc_nfsacl_getacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct GETACL3args
*args
, void *private_data
);
828 * 0 : The call was initiated. The callback will be invoked when the call completes.
829 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
831 * When the callback is invoked, status indicates the result:
832 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
833 * data is a SETACL3res pointer
834 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
835 * data is the error string.
836 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
840 int rpc_nfsacl_setacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETACL3args
*args
, void *private_data
);
848 char *nlmstat4_to_str(int stat
);
852 * Call the NULL procedure for the NLM protocol
855 * 0 : The call was initiated. The callback will be invoked when the call completes.
856 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
858 * When the callback is invoked, status indicates the result:
859 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
861 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
862 * data is the error string.
863 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
866 int rpc_nlm4_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
870 * Call the TEST procedure for the NLM protocol
873 * 0 : The call was initiated. The callback will be invoked when the call completes.
874 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
876 * When the callback is invoked, status indicates the result:
877 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
878 * data is NLM4_TESTres
879 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
880 * data is the error string.
881 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
884 struct NLM4_TESTargs
;
885 int rpc_nlm4_test_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_TESTargs
*args
, void *private_data
);
889 * Call the LOCK procedure for the NLM protocol
892 * 0 : The call was initiated. The callback will be invoked when the call completes.
893 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
895 * When the callback is invoked, status indicates the result:
896 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
897 * data is NLM4_LOCKres
898 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
899 * data is the error string.
900 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
903 struct NLM4_LOCKargs
;
904 int rpc_nlm4_lock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_LOCKargs
*args
, void *private_data
);
908 * Call the CANCEL procedure for the NLM protocol
911 * 0 : The call was initiated. The callback will be invoked when the call completes.
912 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
914 * When the callback is invoked, status indicates the result:
915 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
916 * data is NLM4_CANCres
917 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
918 * data is the error string.
919 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
922 struct NLM4_CANCargs
;
923 int rpc_nlm4_cancel_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_CANCargs
*args
, void *private_data
);
927 * Call the UNLOCK procedure for the NLM protocol
930 * 0 : The call was initiated. The callback will be invoked when the call completes.
931 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
933 * When the callback is invoked, status indicates the result:
934 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
935 * data is NLM4_UNLOCKres
936 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
937 * data is the error string.
938 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
941 struct NLM4_UNLOCKargs
;
942 int rpc_nlm4_unlock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_UNLOCKargs
*args
, void *private_data
);