* 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
* <0 : An error occured when trying to set up the operation. The callback will not be invoked.
*
+ * Supported flags are
+ * O_RDONLY
+ * O_WRONLY
+ * O_RDWR
+ *
* When the callback is invoked, status indicates the result:
* 0 : Success.
* data is a struct *nfsfh;
* -errno : An error occured.
* data is the error string.
*/
-EXTERN int nfs_open_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb cb, void *private_data);
+EXTERN int nfs_open_async(struct nfs_context *nfs, const char *path, int flags, nfs_cb cb, void *private_data);
/*
* Sync open(<filename>)
* Function returns
* 0 : The operation was successfull. *nfsfh is filled in.
* -errno : The command failed.
*/
-EXTERN int nfs_open(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh);
+EXTERN int nfs_open(struct nfs_context *nfs, const char *path, int flags, struct nfsfh **nfsfh);
*nfsfh = fh;
}
-int nfs_open(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh)
+int nfs_open(struct nfs_context *nfs, const char *path, int flags, struct nfsfh **nfsfh)
{
struct sync_cb_data cb_data;
cb_data.is_finished = 0;
cb_data.return_data = nfsfh;
- if (nfs_open_async(nfs, path, mode, open_cb, &cb_data) != 0) {
+ if (nfs_open_async(nfs, path, flags, open_cb, &cb_data) != 0) {
nfs_set_error(nfs, "nfs_open_async failed");
return -1;
}
return 0;
}
-int nfs_open_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb cb, void *private_data)
+int nfs_open_async(struct nfs_context *nfs, const char *path, int flags, nfs_cb cb, void *private_data)
{
- if (nfs_lookuppath_async(nfs, path, cb, private_data, nfs_open_continue_internal, NULL, NULL, mode) != 0) {
+ if (nfs_lookuppath_async(nfs, path, cb, private_data, nfs_open_continue_internal, NULL, NULL, flags) != 0) {
rpc_set_error(nfs->rpc, "Out of memory: failed to start parsing the path components");
return -1;
}