diff options
author | Arjun <arjsharm@redhat.com> | 2018-12-04 11:02:37 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-01-16 06:24:45 +0000 |
commit | 213f31bf9e72eee57a6579b66e259af8e59e9c67 (patch) | |
tree | d8b25d80f5e0422a8017deec97c2e3bc9e7d034b /api/src/glfs.h | |
parent | 2261e444a47ffffb5d64305efceee1d5a734cd75 (diff) | |
download | glusterfs-213f31bf9e72eee57a6579b66e259af8e59e9c67.tar.gz glusterfs-213f31bf9e72eee57a6579b66e259af8e59e9c67.tar.xz glusterfs-213f31bf9e72eee57a6579b66e259af8e59e9c67.zip |
gfapi : making glfs_setattr/glfs_fsetattr as public
Initially glfs_fsetattr and glfs_setattr, both functions accepted iatt as arguements
but now they accept stat and later in the function the stat is being converted to iatt
so that it can be passed to syncop_fsetattr/syncop_setattr.
Change-Id: I41a9e0124785a32ca19ef4d492c5ed5002e66ede
updates: #389
Signed-off-by: Arjun Sharma <arjsharm@redhat.com>
Diffstat (limited to 'api/src/glfs.h')
-rw-r--r-- | api/src/glfs.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/api/src/glfs.h b/api/src/glfs.h index fe305e8e16..9f6075669c 100644 --- a/api/src/glfs.h +++ b/api/src/glfs.h @@ -20,6 +20,17 @@ both the library and the application. */ +/* Values for valid flags to be used when using XXXsetattr, to set multiple + attribute values passed via the related stat structure. + */ + +#define GFAPI_SET_ATTR_MODE 0x1 +#define GFAPI_SET_ATTR_UID 0x2 +#define GFAPI_SET_ATTR_GID 0x4 +#define GFAPI_SET_ATTR_SIZE 0x8 +#define GFAPI_SET_ATTR_ATIME 0x10 +#define GFAPI_SET_ATTR_MTIME 0x20 + #ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 #endif @@ -1395,5 +1406,54 @@ int glfs_lease(glfs_fd_t *glfd, glfs_lease_t *lease, glfs_recall_cbk fn, void *data) __THROW GFAPI_PUBLIC(glfs_lease, 4.0.0); +/* + SYNOPSIS + + glfs_fsetattr: Function to set attributes. + glfs_setattr: Function to set attributes + + DESCRIPTION + + The functions are used to set attributes on the file. + + PARAMETERS + + @glfs_fsetattr + + @glfd: The fd of the file for which the attributes are to be set, + this fd is returned by glfs_open/glfs_create. + + @glfs_setattr + + @fs: File object. + + @path: The path of the file that is being operated on. + + @follow: Flag used to resolve symlink. + + + @stat: Struct that has information about the file. + + @valid: This is the mask bit, that accepts GFAPI_SET_ATTR* masks. + Refer glfs.h to see the mask definitions. + + Both functions are similar in functionality, just that the + func setattr() uses file path whereas the func fsetattr() + uses the fd. + + RETURN VALUES + 0: Successful completion + <0: Failure. @errno will be set with the type of failure + + */ + +int +glfs_fsetattr(struct glfs_fd *glfd, struct stat *stat, int valid) __THROW + GFAPI_PUBLIC(glfs_fsetattr, future); + +int +glfs_setattr(struct glfs *fs, const char *path, struct stat *stat, int valid, + int follow) __THROW GFAPI_PUBLIC(glfs_setattr, future); + __END_DECLS #endif /* !_GLFS_H */ |