diff options
Diffstat (limited to 'api/src/glfs-fops.c')
| -rw-r--r-- | api/src/glfs-fops.c | 614 | 
1 files changed, 396 insertions, 218 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index b09dd90f7b1..66460e6fb9c 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -66,7 +66,7 @@ glfs_loc_unlink (loc_t *loc)  struct glfs_fd * -glfs_open (struct glfs *fs, const char *path, int flags) +pub_glfs_open (struct glfs *fs, const char *path, int flags)  {  	int              ret = -1;  	struct glfs_fd  *glfd = NULL; @@ -77,7 +77,7 @@ glfs_open (struct glfs *fs, const char *path, int flags)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -138,14 +138,16 @@ out:  		glfs_fd_bind (glfd);  	} -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return glfd;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_open, 3.4.0); +  int -glfs_close (struct glfs_fd *glfd) +pub_glfs_close (struct glfs_fd *glfd)  {  	xlator_t  *subvol = NULL;  	int        ret = -1; @@ -154,7 +156,7 @@ glfs_close (struct glfs_fd *glfd)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);          if (!subvol) {                  ret = -1;                  errno = EIO; @@ -176,14 +178,16 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_close, 3.4.0); +  int -glfs_lstat (struct glfs *fs, const char *path, struct stat *stat) +pub_glfs_lstat (struct glfs *fs, const char *path, struct stat *stat)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -193,7 +197,7 @@ glfs_lstat (struct glfs *fs, const char *path, struct stat *stat)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -209,14 +213,16 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lstat, 3.4.0); +  int -glfs_stat (struct glfs *fs, const char *path, struct stat *stat) +pub_glfs_stat (struct glfs *fs, const char *path, struct stat *stat)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -226,7 +232,7 @@ glfs_stat (struct glfs *fs, const char *path, struct stat *stat)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -242,14 +248,16 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_stat, 3.4.0); +  int -glfs_fstat (struct glfs_fd *glfd, struct stat *stat) +pub_glfs_fstat (struct glfs_fd *glfd, struct stat *stat)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -258,7 +266,7 @@ glfs_fstat (struct glfs_fd *glfd, struct stat *stat)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -280,14 +288,16 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fstat, 3.4.0); +  struct glfs_fd * -glfs_creat (struct glfs *fs, const char *path, int flags, mode_t mode) +pub_glfs_creat (struct glfs *fs, const char *path, int flags, mode_t mode)  {  	int              ret = -1;  	struct glfs_fd  *glfd = NULL; @@ -300,7 +310,7 @@ glfs_creat (struct glfs *fs, const char *path, int flags, mode_t mode)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -416,14 +426,16 @@ out:  		glfs_fd_bind (glfd);  	} -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return glfd;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_creat, 3.4.0); +  off_t -glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence) +pub_glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence)  {  	struct stat sb = {0, };  	int         ret = -1; @@ -438,7 +450,7 @@ glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence)  		glfd->offset += offset;  		break;  	case SEEK_END: -		ret = glfs_fstat (glfd, &sb); +		ret = pub_glfs_fstat (glfd, &sb);  		if (ret) {  			/* seek cannot fail :O */  			break; @@ -450,12 +462,12 @@ glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence)  	return glfd->offset;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lseek, 3.4.0); -//////////////  ssize_t -glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, -	     off_t offset, int flags) +pub_glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, +                 off_t offset, int flags)  {  	xlator_t       *subvol = NULL;  	ssize_t         ret = -1; @@ -467,7 +479,7 @@ glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -501,14 +513,16 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_preadv, 3.4.0); +  ssize_t -glfs_read (struct glfs_fd *glfd, void *buf, size_t count, int flags) +pub_glfs_read (struct glfs_fd *glfd, void *buf, size_t count, int flags)  {  	struct iovec iov = {0, };  	ssize_t      ret = 0; @@ -516,15 +530,17 @@ glfs_read (struct glfs_fd *glfd, void *buf, size_t count, int flags)  	iov.iov_base = buf;  	iov.iov_len = count; -	ret = glfs_preadv (glfd, &iov, 1, glfd->offset, flags); +	ret = pub_glfs_preadv (glfd, &iov, 1, glfd->offset, flags);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_read, 3.4.0); +  ssize_t -glfs_pread (struct glfs_fd *glfd, void *buf, size_t count, off_t offset, -	    int flags) +pub_glfs_pread (struct glfs_fd *glfd, void *buf, size_t count, off_t offset, +                int flags)  {  	struct iovec iov = {0, };  	ssize_t      ret = 0; @@ -532,23 +548,27 @@ glfs_pread (struct glfs_fd *glfd, void *buf, size_t count, off_t offset,  	iov.iov_base = buf;  	iov.iov_len = count; -	ret = glfs_preadv (glfd, &iov, 1, offset, flags); +	ret = pub_glfs_preadv (glfd, &iov, 1, offset, flags);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread, 3.4.0); +  ssize_t -glfs_readv (struct glfs_fd *glfd, const struct iovec *iov, int count, -	    int flags) +pub_glfs_readv (struct glfs_fd *glfd, const struct iovec *iov, int count, +                int flags)  {  	ssize_t      ret = 0; -	ret = glfs_preadv (glfd, iov, count, glfd->offset, flags); +	ret = pub_glfs_preadv (glfd, iov, count, glfd->offset, flags);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readv, 3.4.0); +  struct glfs_io {  	struct glfs_fd      *glfd; @@ -575,6 +595,23 @@ glfs_io_async_cbk (int ret, call_frame_t *frame, void *data)  	return 0;  } +ssize_t +pub_glfs_pwritev (struct glfs_fd *, const struct iovec *, int, off_t, int); + +int +pub_glfs_ftruncate (struct glfs_fd *, off_t); + +int +pub_glfs_fdatasync (struct glfs_fd *); + +int +pub_glfs_fsync (struct glfs_fd *glfd); + +int +pub_glfs_discard (struct glfs_fd *, off_t, size_t); + +int +pub_glfs_zerofill (struct glfs_fd *, off_t, off_t);  static int  glfs_io_async_task (void *data) @@ -584,23 +621,23 @@ glfs_io_async_task (void *data)  	switch (gio->op) {  	case GF_FOP_WRITE: -		ret = glfs_pwritev (gio->glfd, gio->iov, gio->count, +		ret = pub_glfs_pwritev (gio->glfd, gio->iov, gio->count,  				    gio->offset, gio->flags);  		break;  	case GF_FOP_FTRUNCATE: -		ret = glfs_ftruncate (gio->glfd, gio->offset); +		ret = pub_glfs_ftruncate (gio->glfd, gio->offset);  		break;  	case GF_FOP_FSYNC:  		if (gio->flags) -			ret = glfs_fdatasync (gio->glfd); +			ret = pub_glfs_fdatasync (gio->glfd);  		else -			ret = glfs_fsync (gio->glfd); +			ret = pub_glfs_fsync (gio->glfd);  		break;  	case GF_FOP_DISCARD: -		ret = glfs_discard (gio->glfd, gio->offset, gio->count); +		ret = pub_glfs_discard (gio->glfd, gio->offset, gio->count);  		break;          case GF_FOP_ZEROFILL: -                ret = glfs_zerofill(gio->glfd, gio->offset, gio->count); +                ret = pub_glfs_zerofill(gio->glfd, gio->offset, gio->count);                  break;  	} @@ -639,15 +676,16 @@ out:  	GF_FREE (gio->iov);  	GF_FREE (gio);  	STACK_DESTROY (frame->root); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return 0;  }  int -glfs_preadv_async (struct glfs_fd *glfd, const struct iovec *iovec, int count, -		   off_t offset, int flags, glfs_io_cbk fn, void *data) +pub_glfs_preadv_async (struct glfs_fd *glfd, const struct iovec *iovec, +                       int count, off_t offset, int flags, glfs_io_cbk fn, +                       void *data)  {  	struct glfs_io *gio = NULL;  	int             ret = 0; @@ -658,7 +696,7 @@ glfs_preadv_async (struct glfs_fd *glfd, const struct iovec *iovec, int count,  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -718,7 +756,7 @@ out:                  if (frame) {                          STACK_DESTROY (frame->root);                  } -		glfs_subvol_done (fs, subvol); +		priv_glfs_subvol_done (fs, subvol);  	}  	if (fd) @@ -727,10 +765,12 @@ out:  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_preadv_async, 3.4.0); +  int -glfs_read_async (struct glfs_fd *glfd, void *buf, size_t count, int flags, -		 glfs_io_cbk fn, void *data) +pub_glfs_read_async (struct glfs_fd *glfd, void *buf, size_t count, int flags, +                     glfs_io_cbk fn, void *data)  {  	struct iovec iov = {0, };  	ssize_t      ret = 0; @@ -738,15 +778,17 @@ glfs_read_async (struct glfs_fd *glfd, void *buf, size_t count, int flags,  	iov.iov_base = buf;  	iov.iov_len = count; -	ret = glfs_preadv_async (glfd, &iov, 1, glfd->offset, flags, fn, data); +	ret = pub_glfs_preadv_async (glfd, &iov, 1, glfd->offset, flags, fn, data);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_read_async, 3.4.0); +  int -glfs_pread_async (struct glfs_fd *glfd, void *buf, size_t count, off_t offset, -		  int flags, glfs_io_cbk fn, void *data) +pub_glfs_pread_async (struct glfs_fd *glfd, void *buf, size_t count, +                      off_t offset, int flags, glfs_io_cbk fn, void *data)  {  	struct iovec iov = {0, };  	ssize_t      ret = 0; @@ -754,28 +796,31 @@ glfs_pread_async (struct glfs_fd *glfd, void *buf, size_t count, off_t offset,  	iov.iov_base = buf;  	iov.iov_len = count; -	ret = glfs_preadv_async (glfd, &iov, 1, offset, flags, fn, data); +	ret = pub_glfs_preadv_async (glfd, &iov, 1, offset, flags, fn, data);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread_async, 3.4.0); +  int -glfs_readv_async (struct glfs_fd *glfd, const struct iovec *iov, int count, -		  int flags, glfs_io_cbk fn, void *data) +pub_glfs_readv_async (struct glfs_fd *glfd, const struct iovec *iov, int count, +                      int flags, glfs_io_cbk fn, void *data)  {  	ssize_t      ret = 0; -	ret = glfs_preadv_async (glfd, iov, count, glfd->offset, flags, -				 fn, data); +	ret = pub_glfs_preadv_async (glfd, iov, count, glfd->offset, flags, +				  fn, data);  	return ret;  } -///// writev ///// +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readv_async, 3.4.0); +  ssize_t -glfs_pwritev (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, -	      off_t offset, int flags) +pub_glfs_pwritev (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, +                  off_t offset, int flags)  {  	xlator_t       *subvol = NULL;  	int             ret = -1; @@ -787,7 +832,7 @@ glfs_pwritev (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -846,14 +891,16 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwritev, 3.4.0); +  ssize_t -glfs_write (struct glfs_fd *glfd, const void *buf, size_t count, int flags) +pub_glfs_write (struct glfs_fd *glfd, const void *buf, size_t count, int flags)  {  	struct iovec iov = {0, };  	ssize_t      ret = 0; @@ -861,28 +908,31 @@ glfs_write (struct glfs_fd *glfd, const void *buf, size_t count, int flags)  	iov.iov_base = (void *) buf;  	iov.iov_len = count; -	ret = glfs_pwritev (glfd, &iov, 1, glfd->offset, flags); +	ret = pub_glfs_pwritev (glfd, &iov, 1, glfd->offset, flags);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_write, 3.4.0);  ssize_t -glfs_writev (struct glfs_fd *glfd, const struct iovec *iov, int count, -	     int flags) +pub_glfs_writev (struct glfs_fd *glfd, const struct iovec *iov, int count, +                 int flags)  {  	ssize_t      ret = 0; -	ret = glfs_pwritev (glfd, iov, count, glfd->offset, flags); +	ret = pub_glfs_pwritev (glfd, iov, count, glfd->offset, flags);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev, 3.4.0); +  ssize_t -glfs_pwrite (struct glfs_fd *glfd, const void *buf, size_t count, off_t offset, -	     int flags) +pub_glfs_pwrite (struct glfs_fd *glfd, const void *buf, size_t count, +                 off_t offset, int flags)  {  	struct iovec iov = {0, };  	ssize_t      ret = 0; @@ -890,15 +940,20 @@ glfs_pwrite (struct glfs_fd *glfd, const void *buf, size_t count, off_t offset,  	iov.iov_base = (void *) buf;  	iov.iov_len = count; -	ret = glfs_pwritev (glfd, &iov, 1, offset, flags); +	ret = pub_glfs_pwritev (glfd, &iov, 1, offset, flags);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite, 3.4.0); + + +extern glfs_t *pub_glfs_from_glfd (glfs_fd_t *);  int -glfs_pwritev_async (struct glfs_fd *glfd, const struct iovec *iovec, int count, -		    off_t offset, int flags, glfs_io_cbk fn, void *data) +pub_glfs_pwritev_async (struct glfs_fd *glfd, const struct iovec *iovec, +                        int count, off_t offset, int flags, glfs_io_cbk fn, +                        void *data)  {  	struct glfs_io *gio = NULL;  	int             ret = 0; @@ -924,7 +979,7 @@ glfs_pwritev_async (struct glfs_fd *glfd, const struct iovec *iovec, int count,  	gio->fn     = fn;  	gio->data   = data; -	ret = synctask_new (glfs_from_glfd (glfd)->ctx->env, +	ret = synctask_new (pub_glfs_from_glfd (glfd)->ctx->env,  			    glfs_io_async_task, glfs_io_async_cbk,  			    NULL, gio); @@ -936,10 +991,12 @@ glfs_pwritev_async (struct glfs_fd *glfd, const struct iovec *iovec, int count,  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwritev_async, 3.4.0); +  int -glfs_write_async (struct glfs_fd *glfd, const void *buf, size_t count, int flags, -		  glfs_io_cbk fn, void *data) +pub_glfs_write_async (struct glfs_fd *glfd, const void *buf, size_t count, +                      int flags, glfs_io_cbk fn, void *data)  {  	struct iovec iov = {0, };  	ssize_t      ret = 0; @@ -947,15 +1004,17 @@ glfs_write_async (struct glfs_fd *glfd, const void *buf, size_t count, int flags  	iov.iov_base = (void *) buf;  	iov.iov_len = count; -	ret = glfs_pwritev_async (glfd, &iov, 1, glfd->offset, flags, fn, data); +	ret = pub_glfs_pwritev_async (glfd, &iov, 1, glfd->offset, flags, fn, data);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_write_async, 3.4.0); +  int -glfs_pwrite_async (struct glfs_fd *glfd, const void *buf, int count, -		   off_t offset, int flags, glfs_io_cbk fn, void *data) +pub_glfs_pwrite_async (struct glfs_fd *glfd, const void *buf, int count, +                       off_t offset, int flags, glfs_io_cbk fn, void *data)  {  	struct iovec iov = {0, };  	ssize_t      ret = 0; @@ -963,26 +1022,30 @@ glfs_pwrite_async (struct glfs_fd *glfd, const void *buf, int count,  	iov.iov_base = (void *) buf;  	iov.iov_len = count; -	ret = glfs_pwritev_async (glfd, &iov, 1, offset, flags, fn, data); +	ret = pub_glfs_pwritev_async (glfd, &iov, 1, offset, flags, fn, data);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite_async, 3.4.0); +  int -glfs_writev_async (struct glfs_fd *glfd, const struct iovec *iov, int count, -		   int flags, glfs_io_cbk fn, void *data) +pub_glfs_writev_async (struct glfs_fd *glfd, const struct iovec *iov, int count, +                       int flags, glfs_io_cbk fn, void *data)  {  	ssize_t      ret = 0; -	ret = glfs_pwritev_async (glfd, iov, count, glfd->offset, flags, -				  fn, data); +	ret = pub_glfs_pwritev_async (glfd, iov, count, glfd->offset, flags, +				   fn, data);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev_async, 3.4.0); +  int -glfs_fsync (struct glfs_fd *glfd) +pub_glfs_fsync (struct glfs_fd *glfd)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -990,7 +1053,7 @@ glfs_fsync (struct glfs_fd *glfd)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1009,11 +1072,13 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync, 3.4.0); +  static int  glfs_fsync_async_common (struct glfs_fd *glfd, glfs_io_cbk fn, void *data, @@ -1034,7 +1099,7 @@ glfs_fsync_async_common (struct glfs_fd *glfd, glfs_io_cbk fn, void *data,  	gio->fn     = fn;  	gio->data   = data; -	ret = synctask_new (glfs_from_glfd (glfd)->ctx->env, +	ret = synctask_new (pub_glfs_from_glfd (glfd)->ctx->env,  			    glfs_io_async_task, glfs_io_async_cbk,  			    NULL, gio); @@ -1049,14 +1114,16 @@ glfs_fsync_async_common (struct glfs_fd *glfd, glfs_io_cbk fn, void *data,  int -glfs_fsync_async (struct glfs_fd *glfd, glfs_io_cbk fn, void *data) +pub_glfs_fsync_async (struct glfs_fd *glfd, glfs_io_cbk fn, void *data)  {  	return glfs_fsync_async_common (glfd, fn, data, 0);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync_async, 3.4.0); +  int -glfs_fdatasync (struct glfs_fd *glfd) +pub_glfs_fdatasync (struct glfs_fd *glfd)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1064,7 +1131,7 @@ glfs_fdatasync (struct glfs_fd *glfd)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1083,21 +1150,25 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync, 3.4.0); +  int -glfs_fdatasync_async (struct glfs_fd *glfd, glfs_io_cbk fn, void *data) +pub_glfs_fdatasync_async (struct glfs_fd *glfd, glfs_io_cbk fn, void *data)  {  	return glfs_fsync_async_common (glfd, fn, data, 1);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync_async, 3.4.0); +  int -glfs_ftruncate (struct glfs_fd *glfd, off_t offset) +pub_glfs_ftruncate (struct glfs_fd *glfd, off_t offset)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1105,7 +1176,7 @@ glfs_ftruncate (struct glfs_fd *glfd, off_t offset)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1124,15 +1195,17 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate, 3.4.0); +  int -glfs_ftruncate_async (struct glfs_fd *glfd, off_t offset, -		      glfs_io_cbk fn, void *data) +pub_glfs_ftruncate_async (struct glfs_fd *glfd, off_t offset, glfs_io_cbk fn, +                          void *data)  {  	struct glfs_io *gio = NULL;  	int             ret = 0; @@ -1149,7 +1222,7 @@ glfs_ftruncate_async (struct glfs_fd *glfd, off_t offset,  	gio->fn     = fn;  	gio->data   = data; -	ret = synctask_new (glfs_from_glfd (glfd)->ctx->env, +	ret = synctask_new (pub_glfs_from_glfd (glfd)->ctx->env,  			    glfs_io_async_task, glfs_io_async_cbk,  			    NULL, gio); @@ -1161,9 +1234,11 @@ glfs_ftruncate_async (struct glfs_fd *glfd, off_t offset,  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate_async, 3.4.0); +  int -glfs_access (struct glfs *fs, const char *path, int mode) +pub_glfs_access (struct glfs *fs, const char *path, int mode)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1173,7 +1248,7 @@ glfs_access (struct glfs *fs, const char *path, int mode)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1193,14 +1268,16 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_access, 3.4.0); +  int -glfs_symlink (struct glfs *fs, const char *data, const char *path) +pub_glfs_symlink (struct glfs *fs, const char *data, const char *path)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1212,7 +1289,7 @@ glfs_symlink (struct glfs *fs, const char *data, const char *path)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1274,14 +1351,16 @@ out:  	if (xattr_req)  		dict_unref (xattr_req); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_symlink, 3.4.0); +  int -glfs_readlink (struct glfs *fs, const char *path, char *buf, size_t bufsiz) +pub_glfs_readlink (struct glfs *fs, const char *path, char *buf, size_t bufsiz)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1292,7 +1371,7 @@ glfs_readlink (struct glfs *fs, const char *path, char *buf, size_t bufsiz)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1322,14 +1401,16 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readlink, 3.4.0); +  int -glfs_mknod (struct glfs *fs, const char *path, mode_t mode, dev_t dev) +pub_glfs_mknod (struct glfs *fs, const char *path, mode_t mode, dev_t dev)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1341,7 +1422,7 @@ glfs_mknod (struct glfs *fs, const char *path, mode_t mode, dev_t dev)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1403,14 +1484,16 @@ out:  	if (xattr_req)  		dict_unref (xattr_req); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_mknod, 3.4.0); +  int -glfs_mkdir (struct glfs *fs, const char *path, mode_t mode) +pub_glfs_mkdir (struct glfs *fs, const char *path, mode_t mode)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1422,7 +1505,7 @@ glfs_mkdir (struct glfs *fs, const char *path, mode_t mode)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1484,14 +1567,16 @@ out:  	if (xattr_req)  		dict_unref (xattr_req); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_mkdir, 3.4.0); +  int -glfs_unlink (struct glfs *fs, const char *path) +pub_glfs_unlink (struct glfs *fs, const char *path)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1501,7 +1586,7 @@ glfs_unlink (struct glfs *fs, const char *path)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1530,14 +1615,16 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_unlink, 3.4.0); +  int -glfs_rmdir (struct glfs *fs, const char *path) +pub_glfs_rmdir (struct glfs *fs, const char *path)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1547,7 +1634,7 @@ glfs_rmdir (struct glfs *fs, const char *path)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1576,14 +1663,16 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_rmdir, 3.4.0); +  int -glfs_rename (struct glfs *fs, const char *oldpath, const char *newpath) +pub_glfs_rename (struct glfs *fs, const char *oldpath, const char *newpath)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1595,7 +1684,7 @@ glfs_rename (struct glfs *fs, const char *oldpath, const char *newpath)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1649,14 +1738,16 @@ out:  	loc_wipe (&oldloc);  	loc_wipe (&newloc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_rename, 3.4.0); +  int -glfs_link (struct glfs *fs, const char *oldpath, const char *newpath) +pub_glfs_link (struct glfs *fs, const char *oldpath, const char *newpath)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -1668,7 +1759,7 @@ glfs_link (struct glfs *fs, const char *oldpath, const char *newpath)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1722,14 +1813,16 @@ out:  	loc_wipe (&oldloc);  	loc_wipe (&newloc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_link, 3.4.0); +  struct glfs_fd * -glfs_opendir (struct glfs *fs, const char *path) +pub_glfs_opendir (struct glfs *fs, const char *path)  {  	int              ret = -1;  	struct glfs_fd  *glfd = NULL; @@ -1740,7 +1833,7 @@ glfs_opendir (struct glfs *fs, const char *path)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1795,14 +1888,16 @@ out:  		glfs_fd_bind (glfd);  	} -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return glfd;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_opendir, 3.4.0); +  int -glfs_closedir (struct glfs_fd *glfd) +pub_glfs_closedir (struct glfs_fd *glfd)  {  	__glfs_entry_fd (glfd); @@ -1813,16 +1908,20 @@ glfs_closedir (struct glfs_fd *glfd)  	return 0;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_closedir, 3.4.0); +  long -glfs_telldir (struct glfs_fd *fd) +pub_glfs_telldir (struct glfs_fd *fd)  {  	return fd->offset;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_telldir, 3.4.0); +  void -glfs_seekdir (struct glfs_fd *fd, long offset) +pub_glfs_seekdir (struct glfs_fd *fd, long offset)  {  	gf_dirent_t *entry = NULL;  	gf_dirent_t *tmp = NULL; @@ -1848,9 +1947,12 @@ glfs_seekdir (struct glfs_fd *fd, long offset)  	*/  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_seekdir, 3.4.0); + +  int -glfs_discard_async (struct glfs_fd *glfd, off_t offset, size_t len, -		      glfs_io_cbk fn, void *data) +pub_glfs_discard_async (struct glfs_fd *glfd, off_t offset, size_t len, +                        glfs_io_cbk fn, void *data)  {  	struct glfs_io *gio = NULL;  	int             ret = 0; @@ -1868,7 +1970,7 @@ glfs_discard_async (struct glfs_fd *glfd, off_t offset, size_t len,  	gio->fn     = fn;  	gio->data   = data; -	ret = synctask_new (glfs_from_glfd (glfd)->ctx->env, +	ret = synctask_new (pub_glfs_from_glfd (glfd)->ctx->env,  			    glfs_io_async_task, glfs_io_async_cbk,  			    NULL, gio); @@ -1880,9 +1982,12 @@ glfs_discard_async (struct glfs_fd *glfd, off_t offset, size_t len,  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_discard_async, 3.5.0); + +  int -glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, off_t len, -                      glfs_io_cbk fn, void *data) +pub_glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, off_t len, +                         glfs_io_cbk fn, void *data)  {          struct glfs_io *gio  = NULL;          int             ret  = 0; @@ -1900,7 +2005,7 @@ glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, off_t len,          gio->fn     = fn;          gio->data   = data; -        ret = synctask_new (glfs_from_glfd (glfd)->ctx->env, +        ret = synctask_new (pub_glfs_from_glfd (glfd)->ctx->env,                              glfs_io_async_task, glfs_io_async_cbk,                              NULL, gio); @@ -1912,6 +2017,8 @@ glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, off_t len,          return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_zerofill_async, 3.5.0); +  void  gf_dirent_to_dirent (gf_dirent_t *gf_dirent, struct dirent *dirent) @@ -1943,7 +2050,7 @@ glfd_entry_refresh (struct glfs_fd *glfd, int plus)  	int              ret = -1;  	fd_t            *fd = NULL; -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -1991,7 +2098,7 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } @@ -2053,8 +2160,8 @@ unlock:  int -glfs_readdirplus_r (struct glfs_fd *glfd, struct stat *stat, struct dirent *ext, -		    struct dirent **res) +pub_glfs_readdirplus_r (struct glfs_fd *glfd, struct stat *stat, +                        struct dirent *ext, struct dirent **res)  {  	int              ret = 0;  	gf_dirent_t     *entry = NULL; @@ -2094,38 +2201,46 @@ glfs_readdirplus_r (struct glfs_fd *glfd, struct stat *stat, struct dirent *ext,  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readdirplus_r, 3.4.0); +  int -glfs_readdir_r (struct glfs_fd *glfd, struct dirent *buf, struct dirent **res) +pub_glfs_readdir_r (struct glfs_fd *glfd, struct dirent *buf, +                    struct dirent **res)  { -	return glfs_readdirplus_r (glfd, 0, buf, res); +	return pub_glfs_readdirplus_r (glfd, 0, buf, res);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readdir_r, 3.4.0); +  struct dirent * -glfs_readdirplus (struct glfs_fd *glfd, struct stat *stat) +pub_glfs_readdirplus (struct glfs_fd *glfd, struct stat *stat)  {          struct dirent *res = NULL;          int ret = -1; -        ret = glfs_readdirplus_r (glfd, stat, NULL, &res); +        ret = pub_glfs_readdirplus_r (glfd, stat, NULL, &res);          if (ret)                  return NULL;          return res;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readdirplus, 3.5.0);  struct dirent * -glfs_readdir (struct glfs_fd *glfd) +pub_glfs_readdir (struct glfs_fd *glfd)  { -        return glfs_readdirplus (glfd, NULL); +        return pub_glfs_readdirplus (glfd, NULL);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readdir, 3.5.0); +  int -glfs_statvfs (struct glfs *fs, const char *path, struct statvfs *buf) +pub_glfs_statvfs (struct glfs *fs, const char *path, struct statvfs *buf)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -2135,7 +2250,7 @@ glfs_statvfs (struct glfs *fs, const char *path, struct statvfs *buf)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2155,11 +2270,13 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_statvfs, 3.4.0); +  int  glfs_setattr (struct glfs *fs, const char *path, struct iatt *iatt, @@ -2173,7 +2290,7 @@ glfs_setattr (struct glfs *fs, const char *path, struct iatt *iatt,  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2196,7 +2313,7 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } @@ -2211,7 +2328,7 @@ glfs_fsetattr (struct glfs_fd *glfd, struct iatt *iatt, int valid)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2230,14 +2347,14 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  }  int -glfs_chmod (struct glfs *fs, const char *path, mode_t mode) +pub_glfs_chmod (struct glfs *fs, const char *path, mode_t mode)  {  	int              ret = -1;  	struct iatt      iatt = {0, }; @@ -2251,9 +2368,11 @@ glfs_chmod (struct glfs *fs, const char *path, mode_t mode)  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_chmod, 3.4.0); +  int -glfs_fchmod (struct glfs_fd *glfd, mode_t mode) +pub_glfs_fchmod (struct glfs_fd *glfd, mode_t mode)  {  	int              ret = -1;  	struct iatt      iatt = {0, }; @@ -2267,9 +2386,11 @@ glfs_fchmod (struct glfs_fd *glfd, mode_t mode)  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fchmod, 3.4.0); +  int -glfs_chown (struct glfs *fs, const char *path, uid_t uid, gid_t gid) +pub_glfs_chown (struct glfs *fs, const char *path, uid_t uid, gid_t gid)  {  	int              ret = -1;  	int              valid = 0; @@ -2284,9 +2405,11 @@ glfs_chown (struct glfs *fs, const char *path, uid_t uid, gid_t gid)  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_chown, 3.4.0); +  int -glfs_lchown (struct glfs *fs, const char *path, uid_t uid, gid_t gid) +pub_glfs_lchown (struct glfs *fs, const char *path, uid_t uid, gid_t gid)  {  	int              ret = -1;  	int              valid = 0; @@ -2301,9 +2424,11 @@ glfs_lchown (struct glfs *fs, const char *path, uid_t uid, gid_t gid)  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lchown, 3.4.0); +  int -glfs_fchown (struct glfs_fd *glfd, uid_t uid, gid_t gid) +pub_glfs_fchown (struct glfs_fd *glfd, uid_t uid, gid_t gid)  {  	int              ret = -1;  	int              valid = 0; @@ -2318,9 +2443,11 @@ glfs_fchown (struct glfs_fd *glfd, uid_t uid, gid_t gid)  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fchown, 3.4.0); +  int -glfs_utimens (struct glfs *fs, const char *path, struct timespec times[2]) +pub_glfs_utimens (struct glfs *fs, const char *path, struct timespec times[2])  {  	int              ret = -1;  	int              valid = 0; @@ -2338,9 +2465,11 @@ glfs_utimens (struct glfs *fs, const char *path, struct timespec times[2])  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_utimens, 3.4.0); +  int -glfs_lutimens (struct glfs *fs, const char *path, struct timespec times[2]) +pub_glfs_lutimens (struct glfs *fs, const char *path, struct timespec times[2])  {  	int              ret = -1;  	int              valid = 0; @@ -2358,9 +2487,11 @@ glfs_lutimens (struct glfs *fs, const char *path, struct timespec times[2])  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lutimens, 3.4.0); +  int -glfs_futimens (struct glfs_fd *glfd, struct timespec times[2]) +pub_glfs_futimens (struct glfs_fd *glfd, struct timespec times[2])  {  	int              ret = -1;  	int              valid = 0; @@ -2378,6 +2509,8 @@ glfs_futimens (struct glfs_fd *glfd, struct timespec times[2])  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_futimens, 3.4.0); +  int  glfs_getxattr_process (void *value, size_t size, dict_t *xattr, @@ -2424,7 +2557,7 @@ glfs_getxattr_common (struct glfs *fs, const char *path, const char *name,  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2452,31 +2585,35 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  }  ssize_t -glfs_getxattr (struct glfs *fs, const char *path, const char *name, -	       void *value, size_t size) +pub_glfs_getxattr (struct glfs *fs, const char *path, const char *name, +                   void *value, size_t size)  {  	return glfs_getxattr_common (fs, path, name, value, size, 1);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_getxattr, 3.4.0); +  ssize_t -glfs_lgetxattr (struct glfs *fs, const char *path, const char *name, -		void *value, size_t size) +pub_glfs_lgetxattr (struct glfs *fs, const char *path, const char *name, +                    void *value, size_t size)  {  	return glfs_getxattr_common (fs, path, name, value, size, 0);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lgetxattr, 3.4.0); +  ssize_t -glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value, -		size_t size) +pub_glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value, +                    size_t size)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -2485,7 +2622,7 @@ glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value,  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2508,11 +2645,13 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fgetxattr, 3.4.0); +  int  glfs_listxattr_process (void *value, size_t size, dict_t *xattr) @@ -2551,7 +2690,7 @@ glfs_listxattr_common (struct glfs *fs, const char *path, void *value,  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2580,28 +2719,32 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  }  ssize_t -glfs_listxattr (struct glfs *fs, const char *path, void *value, size_t size) +pub_glfs_listxattr (struct glfs *fs, const char *path, void *value, size_t size)  {  	return glfs_listxattr_common (fs, path, value, size, 1);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_listxattr, 3.4.0); +  ssize_t -glfs_llistxattr (struct glfs *fs, const char *path, void *value, size_t size) +pub_glfs_llistxattr (struct glfs *fs, const char *path, void *value, size_t size)  {  	return glfs_listxattr_common (fs, path, value, size, 0);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_llistxattr, 3.4.0); +  ssize_t -glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size) +pub_glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -2610,7 +2753,7 @@ glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2633,11 +2776,13 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_flistxattr, 3.4.0); +  dict_t *  dict_for_key_value (const char *name, const char *value, size_t size) @@ -2672,7 +2817,7 @@ glfs_setxattr_common (struct glfs *fs, const char *path, const char *name,  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2705,31 +2850,35 @@ out:  	if (xattr)  		dict_unref (xattr); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  }  int -glfs_setxattr (struct glfs *fs, const char *path, const char *name, -	       const void *value, size_t size, int flags) +pub_glfs_setxattr (struct glfs *fs, const char *path, const char *name, +                   const void *value, size_t size, int flags)  {  	return glfs_setxattr_common (fs, path, name, value, size, flags, 1);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_setxattr, 3.4.0); +  int -glfs_lsetxattr (struct glfs *fs, const char *path, const char *name, -		const void *value, size_t size, int flags) +pub_glfs_lsetxattr (struct glfs *fs, const char *path, const char *name, +                    const void *value, size_t size, int flags)  {  	return glfs_setxattr_common (fs, path, name, value, size, flags, 0);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lsetxattr, 3.4.0); +  int -glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value, -		size_t size, int flags) +pub_glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value, +                    size_t size, int flags)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -2738,7 +2887,7 @@ glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value,  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2767,11 +2916,13 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsetxattr, 3.4.0); +  int  glfs_removexattr_common (struct glfs *fs, const char *path, const char *name, @@ -2785,7 +2936,7 @@ glfs_removexattr_common (struct glfs *fs, const char *path, const char *name,  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2809,28 +2960,32 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  }  int -glfs_removexattr (struct glfs *fs, const char *path, const char *name) +pub_glfs_removexattr (struct glfs *fs, const char *path, const char *name)  {  	return glfs_removexattr_common (fs, path, name, 1);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_removexattr, 3.4.0); +  int -glfs_lremovexattr (struct glfs *fs, const char *path, const char *name) +pub_glfs_lremovexattr (struct glfs *fs, const char *path, const char *name)  {  	return glfs_removexattr_common (fs, path, name, 0);  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lremovexattr, 3.4.0); +  int -glfs_fremovexattr (struct glfs_fd *glfd, const char *name) +pub_glfs_fremovexattr (struct glfs_fd *glfd, const char *name)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -2838,7 +2993,7 @@ glfs_fremovexattr (struct glfs_fd *glfd, const char *name)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2857,14 +3012,16 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fremovexattr, 3.4.0); +  int -glfs_fallocate (struct glfs_fd *glfd, int keep_size, off_t offset, size_t len) +pub_glfs_fallocate (struct glfs_fd *glfd, int keep_size, off_t offset, size_t len)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -2872,7 +3029,7 @@ glfs_fallocate (struct glfs_fd *glfd, int keep_size, off_t offset, size_t len)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2891,14 +3048,16 @@ out:  	if (fd)  		fd_unref(fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fallocate, 3.5.0); +  int -glfs_discard (struct glfs_fd *glfd, off_t offset, size_t len) +pub_glfs_discard (struct glfs_fd *glfd, off_t offset, size_t len)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -2906,7 +3065,7 @@ glfs_discard (struct glfs_fd *glfd, off_t offset, size_t len)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2925,13 +3084,16 @@ out:  	if (fd)  		fd_unref(fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_discard, 3.5.0); + +  int -glfs_zerofill (struct glfs_fd *glfd, off_t offset, off_t len) +pub_glfs_zerofill (struct glfs_fd *glfd, off_t offset, off_t len)  {          int               ret             = -1;          xlator_t         *subvol          = NULL; @@ -2939,7 +3101,7 @@ glfs_zerofill (struct glfs_fd *glfd, off_t offset, off_t len)          __glfs_entry_fd (glfd); -        subvol = glfs_active_subvol (glfd->fs); +        subvol = priv_glfs_active_subvol (glfd->fs);          if (!subvol) {                  errno = EIO;                  goto out; @@ -2956,13 +3118,16 @@ out:          if (fd)                  fd_unref(fd); -        glfs_subvol_done (glfd->fs, subvol); +        priv_glfs_subvol_done (glfd->fs, subvol);          return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_zerofill, 3.5.0); + +  int -glfs_chdir (struct glfs *fs, const char *path) +pub_glfs_chdir (struct glfs *fs, const char *path)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -2972,7 +3137,7 @@ glfs_chdir (struct glfs *fs, const char *path)  	__glfs_entry_fs (fs); -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -2997,14 +3162,16 @@ retry:  out:  	loc_wipe (&loc); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_chdir, 3.4.0); +  int -glfs_fchdir (struct glfs_fd *glfd) +pub_glfs_fchdir (struct glfs_fd *glfd)  {  	int       ret = -1;  	inode_t  *inode = NULL; @@ -3013,7 +3180,7 @@ glfs_fchdir (struct glfs_fd *glfd)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -3041,14 +3208,16 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fchdir, 3.4.0); +  char * -glfs_realpath (struct glfs *fs, const char *path, char *resolved_path) +pub_glfs_realpath (struct glfs *fs, const char *path, char *resolved_path)  {  	int              ret = -1;  	char            *retpath = NULL; @@ -3071,7 +3240,7 @@ glfs_realpath (struct glfs *fs, const char *path, char *resolved_path)  		goto out;  	} -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -3099,14 +3268,16 @@ out:  		retpath = NULL;  	} -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return retpath;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_realpath, 3.4.0); +  char * -glfs_getcwd (struct glfs *fs, char *buf, size_t n) +pub_glfs_getcwd (struct glfs *fs, char *buf, size_t n)  {  	int              ret = -1;  	inode_t         *inode = NULL; @@ -3149,6 +3320,8 @@ out:  	return buf;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_getcwd, 3.4.0); +  static void  gf_flock_to_flock (struct gf_flock *gf_flock, struct flock *flock) @@ -3173,7 +3346,7 @@ gf_flock_from_flock (struct gf_flock *gf_flock, struct flock *flock)  int -glfs_posix_lock (struct glfs_fd *glfd, int cmd, struct flock *flock) +pub_glfs_posix_lock (struct glfs_fd *glfd, int cmd, struct flock *flock)  {  	int              ret = -1;  	xlator_t        *subvol = NULL; @@ -3183,7 +3356,7 @@ glfs_posix_lock (struct glfs_fd *glfd, int cmd, struct flock *flock)  	__glfs_entry_fd (glfd); -	subvol = glfs_active_subvol (glfd->fs); +	subvol = priv_glfs_active_subvol (glfd->fs);  	if (!subvol) {  		ret = -1;  		errno = EIO; @@ -3208,14 +3381,16 @@ out:  	if (fd)  		fd_unref (fd); -	glfs_subvol_done (glfd->fs, subvol); +	priv_glfs_subvol_done (glfd->fs, subvol);  	return ret;  } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_posix_lock, 3.4.0); +  struct glfs_fd * -glfs_dup (struct glfs_fd *glfd) +pub_glfs_dup (struct glfs_fd *glfd)  {  	xlator_t  *subvol = NULL;  	fd_t      *fd = NULL; @@ -3225,7 +3400,7 @@ glfs_dup (struct glfs_fd *glfd)  	__glfs_entry_fd (glfd);  	fs = glfd->fs; -	subvol = glfs_active_subvol (fs); +	subvol = priv_glfs_active_subvol (fs);  	if (!subvol) {  		errno = EIO;  		goto out; @@ -3250,7 +3425,10 @@ out:  	if (dupfd)  		glfs_fd_bind (dupfd); -	glfs_subvol_done (fs, subvol); +	priv_glfs_subvol_done (fs, subvol);  	return dupfd;  } + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_dup, 3.4.0); +  | 
