Rename the nfs_open() argument from mode to flags
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 2 Feb 2014 19:41:22 +0000 (11:41 -0800)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 2 Feb 2014 19:41:22 +0000 (11:41 -0800)
include/nfsc/libnfs.h
lib/libnfs-sync.c
lib/libnfs.c

index e07506470c75afe2931b55f56b58e228c0fa0d8e..b9138c9066409ea3fab16053a4ebca4c9a2d793d 100644 (file)
@@ -272,6 +272,11 @@ EXTERN int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct stat *
  *  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;
@@ -279,14 +284,14 @@ EXTERN int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct stat *
  * -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);
 
 
 
index 8ab05d71d1501fe0c388d2ede5513d25f31a7332..580f76dd63ce3ef453f97a5fd675ce94c085a571 100644 (file)
@@ -258,14 +258,14 @@ static void open_cb(int status, struct nfs_context *nfs, void *data, void *priva
        *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;
        }
index 303615a247dbbbb67de010377fb4adee4803e6a0..bfb1b7ce70bba59dd312c0bd7bdd79935886b820 100644 (file)
@@ -1346,9 +1346,9 @@ static int nfs_open_continue_internal(struct nfs_context *nfs, struct nfs_cb_dat
        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;
        }