From acaea514b6c31099e657224adb116a96070d51a2 Mon Sep 17 00:00:00 2001 From: ShyamsundarR Date: Tue, 8 May 2018 11:02:25 -0400 Subject: Revert "gfapi: return pre/post attributes from glfs_ftruncate" This reverts commit 248152767b0599986bbb6bb35fc27197f6be6964. This is being reverted as the API signatures should adapt to a statx like structure, and also all APIs that need to return pre/post attrs are not complete. As a result, instead of fixing up part of the APIs and then refixing the same in a later release, removing these set of fixes from the branch. Additionally fixed up cloudsync.c code that was using the new syncop signature. Updates: bz#1575386 Change-Id: Idb59d20666c0d7b0c83e7fdc31dd68b8c7db9550 --- api/src/gfapi.aliases | 3 +-- api/src/gfapi.map | 2 +- api/src/glfs-fops.c | 36 +++++------------------------------- api/src/glfs.h | 5 ++--- 4 files changed, 9 insertions(+), 37 deletions(-) (limited to 'api') diff --git a/api/src/gfapi.aliases b/api/src/gfapi.aliases index 6ddfe623b41..8b774f09754 100644 --- a/api/src/gfapi.aliases +++ b/api/src/gfapi.aliases @@ -34,7 +34,7 @@ _pub_glfs_preadv_async _glfs_preadv_async$GFAPI_3.4.0 _pub_glfs_pwritev_async _glfs_pwritev_async$GFAPI_3.4.0 _pub_glfs_lseek _glfs_lseek$GFAPI_3.4.0 _pub_glfs_truncate _glfs_truncate$GFAPI_3.7.15 -_pub_glfs_ftruncate34 _glfs_ftruncate34$GFAPI_3.4.0 +_pub_glfs_ftruncate _glfs_ftruncate$GFAPI_3.4.0 _pub_glfs_ftruncate_async _glfs_ftruncate_async$GFAPI_3.4.0 _pub_glfs_lstat _glfs_lstat$GFAPI_3.4.0 _pub_glfs_stat _glfs_stat$GFAPI_3.4.0 @@ -177,4 +177,3 @@ _pub_glfs_pread _glfs_pread$GFAPI_4.0.0 _pub_glfs_pwrite _glfs_pwrite$GFAPI_4.0.0 _pub_glfs_fsync _glfs_fsync$GFAPI_4.0.0 _pub_glfs_fdatasync _glfs_fdatasync$GFAPI_4.0.0 -_pub_glfs_ftruncate _glfs_ftruncate$GFAPI_4.0.0 diff --git a/api/src/gfapi.map b/api/src/gfapi.map index 1e5bee17d9f..03ecee811da 100644 --- a/api/src/gfapi.map +++ b/api/src/gfapi.map @@ -37,6 +37,7 @@ GFAPI_3.4.0 { glfs_preadv_async; glfs_pwritev_async; glfs_lseek; + glfs_ftruncate; glfs_ftruncate_async; glfs_lstat; glfs_stat; @@ -225,5 +226,4 @@ GFAPI_4.0.0 { glfs_pwrite; glfs_fsync; glfs_fdatasync; - glfs_ftruncate; } GFAPI_3.13.0; diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index 8f24b77b0b5..f314c36463d 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -1774,14 +1774,12 @@ invalid_fs: GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync_async, 3.4.0); -static int -glfs_ftruncate_common (struct glfs_fd *glfd, off_t offset, - struct stat *prestat, struct stat *poststat) +int +pub_glfs_ftruncate (struct glfs_fd *glfd, off_t offset) { int ret = -1; xlator_t *subvol = NULL; fd_t *fd = NULL; - struct iatt preiatt = {0, }, postiatt = {0, }; dict_t *fop_attr = NULL; DECLARE_OLD_THIS; @@ -1807,16 +1805,9 @@ glfs_ftruncate_common (struct glfs_fd *glfd, off_t offset, if (ret) gf_msg_debug ("gfapi", 0, "Getting leaseid from thread failed"); - ret = syncop_ftruncate (subvol, fd, offset, &preiatt, &postiatt, - fop_attr, NULL); - DECODE_SYNCOP_ERR (ret); + ret = syncop_ftruncate (subvol, fd, offset, fop_attr, NULL); - if (ret >= 0) { - if (prestat) - glfs_iatt_to_stat (glfd->fs, &preiatt, prestat); - if (poststat) - glfs_iatt_to_stat (glfd->fs, &postiatt, poststat); - } + DECODE_SYNCOP_ERR (ret); out: if (fd) fd_unref (fd); @@ -1833,24 +1824,7 @@ invalid_fs: return ret; } -int -pub_glfs_ftruncate34 (struct glfs_fd *glfd, off_t offset) -{ - return glfs_ftruncate_common (glfd, offset, NULL, NULL); -} - -GFAPI_SYMVER_PUBLIC(glfs_ftruncate34, glfs_ftruncate, 3.4.0); - - -int -pub_glfs_ftruncate (struct glfs_fd *glfd, off_t offset, struct stat *prestat, - struct stat *poststat) -{ - return glfs_ftruncate_common (glfd, offset, prestat, poststat); -} - -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate, 4.0.0); - +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate, 3.4.0); int pub_glfs_truncate (struct glfs *fs, const char *path, off_t length) diff --git a/api/src/glfs.h b/api/src/glfs.h index b20bbf4450d..97331d2398c 100644 --- a/api/src/glfs.h +++ b/api/src/glfs.h @@ -571,9 +571,8 @@ off_t glfs_lseek (glfs_fd_t *fd, off_t offset, int whence) __THROW int glfs_truncate (glfs_t *fs, const char *path, off_t length) __THROW GFAPI_PUBLIC(glfs_truncate, 3.7.15); -int glfs_ftruncate (glfs_fd_t *fd, off_t length, struct stat *prestat, - struct stat *poststat) __THROW - GFAPI_PUBLIC(glfs_ftruncate, 4.0.0); +int glfs_ftruncate (glfs_fd_t *fd, off_t length) __THROW + GFAPI_PUBLIC(glfs_ftruncate, 3.4.0); int glfs_ftruncate_async (glfs_fd_t *fd, off_t length, glfs_io_cbk fn, void *data) __THROW GFAPI_PUBLIC(glfs_ftruncate_async, 3.4.0); -- cgit