diff options
author | Soumya Koduri <skoduri@redhat.com> | 2019-09-18 16:32:08 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2019-09-25 10:47:36 +0000 |
commit | 41a0f2aa755ec7162facd30209f2fa3f40308766 (patch) | |
tree | 95285259bbf5580f81796c379fe4383dce9226c7 /api/src/glfs-handles.h | |
parent | 5677b85a59ec98dbe8c99680308403f56d3ce014 (diff) |
gfapi: 'glfs_h_creat_open' - new API to create handle and open fd
Right now we have two separate APIs, one
- 'glfs_h_creat_handle' to create handle & another
- 'glfs_h_open' to create a glfd to return to application
Having two separate routines can result in access errors
while trying to create and write into a read-only file.
Since a fd is opened even during file/directory creation,
introducing a new API to make these two operations atomic i.e,
which can create both handle & fd and pass them to application
Change-Id: Ibf513fcfcdad175f4d7eb6fa7a61b8feec6d33b5
Fixes: bz#1753569
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Diffstat (limited to 'api/src/glfs-handles.h')
-rw-r--r-- | api/src/glfs-handles.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api/src/glfs-handles.h b/api/src/glfs-handles.h index f7e6a06453f..475f450801e 100644 --- a/api/src/glfs-handles.h +++ b/api/src/glfs-handles.h @@ -250,6 +250,11 @@ int glfs_h_access(glfs_t *fs, glfs_object_t *object, int mask) __THROW GFAPI_PUBLIC(glfs_h_access, 3.6.0); +struct glfs_object * +glfs_h_creat_open(struct glfs *fs, struct glfs_object *parent, const char *path, + int flags, mode_t mode, struct stat *stat, + struct glfs_fd **out_fd) __THROW + GFAPI_PUBLIC(glfs_h_creat_open, FUTURE); /* SYNOPSIS |