summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-fops.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/glfs-fops.c')
-rw-r--r--api/src/glfs-fops.c36
1 files changed, 5 insertions, 31 deletions
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)