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/glfs-fops.c | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'api/src/glfs-fops.c') 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) -- cgit