summaryrefslogtreecommitdiffstats
path: root/api/src
diff options
context:
space:
mode:
authorShyamsundarR <srangana@redhat.com>2018-09-13 22:15:20 -0400
committerShyamsundar Ranganathan <srangana@redhat.com>2018-09-17 14:26:06 +0000
commitcee40c3e3c26ebfb3b98109d154501a5cce61c0d (patch)
tree8b36f23ed64e8b7c9fe4fd884bfba18fe36c2c66 /api/src
parent5cd9c22a4fd041a27275a465d0117af39cf4e616 (diff)
gfapi: revert several patchs that introduced pre/post attrs
Reverted the following: - 248152767b0599986bbb6bb35fc27197f6be6964 - 09943beb499617212f2985ca8ea9ecd1ed1b470e - d01f7244e9d9f7e3ef84e0ba7b48ef1b1b09d809 The reverts are redone by hand, due to clang format changes that made using git to revert the changes more tedious. Change-Id: I96489638a2b641fb2206a110298543225783f7be Updates: bz#1628620 Signed-off-by: ShyamsundarR <srangana@redhat.com>
Diffstat (limited to 'api/src')
-rw-r--r--api/src/gfapi.aliases15
-rw-r--r--api/src/gfapi.map10
-rw-r--r--api/src/glfs-fops.c221
-rw-r--r--api/src/glfs-resolve.c2
-rw-r--r--api/src/glfs.h19
5 files changed, 42 insertions, 225 deletions
diff --git a/api/src/gfapi.aliases b/api/src/gfapi.aliases
index a2c6077b6e4..9e097835a71 100644
--- a/api/src/gfapi.aliases
+++ b/api/src/gfapi.aliases
@@ -24,8 +24,8 @@ _pub_glfs_readv _glfs_readv$GFAPI_3.4.0
_pub_glfs_writev _glfs_writev$GFAPI_3.4.0
_pub_glfs_readv_async _glfs_readv_async$GFAPI_3.4.0
_pub_glfs_writev_async _glfs_writev_async$GFAPI_3.4.0
-_pub_glfs_pread34 _glfs_pread$GFAPI_3.4.0
-_pub_glfs_pwrite34 _glfs_pwrite$GFAPI_3.4.0
+_pub_glfs_pread _glfs_pread$GFAPI_3.4.0
+_pub_glfs_pwrite _glfs_pwrite$GFAPI_3.4.0
_pub_glfs_pread_async _glfs_pread_async$GFAPI_3.4.0
_pub_glfs_pwrite_async _glfs_pwrite_async$GFAPI_3.4.0
_pub_glfs_preadv _glfs_preadv$GFAPI_3.4.0
@@ -33,14 +33,14 @@ _pub_glfs_pwritev _glfs_pwritev$GFAPI_3.4.0
_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_ftruncate34 _glfs_ftruncate$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
_pub_glfs_fstat _glfs_fstat$GFAPI_3.4.0
-_pub_glfs_fsync34 _glfs_fsync$GFAPI_3.4.0
+_pub_glfs_fsync _glfs_fsync$GFAPI_3.4.0
_pub_glfs_fsync_async _glfs_fsync_async$GFAPI_3.4.0
-_pub_glfs_fdatasync34 _glfs_fdatasync$GFAPI_3.4.0
+_pub_glfs_fdatasync _glfs_fdatasync$GFAPI_3.4.0
_pub_glfs_fdatasync_async _glfs_fdatasync_async$GFAPI_3.4.0
_pub_glfs_access _glfs_access$GFAPI_3.4.0
_pub_glfs_symlink _glfs_symlink$GFAPI_3.4.0
@@ -178,8 +178,3 @@ _pub_glfs_h_lease _glfs_h_lease$GFAPI_4.0.0
_pub_glfs_recall_lease_fd _glfs_recall_lease_fd$GFAPI_future
_pub_glfs_recall_lease_upcall _glfs_recall_lease_upcall$GFAPI_future
-_pub_glfs_pread _glfs_pread$GFAPI_future
-_pub_glfs_pwrite _glfs_pwrite$GFAPI_future
-_pub_glfs_fsync _glfs_fsync$GFAPI_future
-_pub_glfs_fdatasync _glfs_fdatasync$GFAPI_future
-_pub_glfs_ftruncate _glfs_ftruncate$GFAPI_future
diff --git a/api/src/gfapi.map b/api/src/gfapi.map
index e1b37e6855a..8eeec71fb53 100644
--- a/api/src/gfapi.map
+++ b/api/src/gfapi.map
@@ -235,13 +235,3 @@ GFAPI_4.0.0 {
glfs_lease;
glfs_h_lease;
} GFAPI_3.13.0;
-
-GFAPI_future {
- global:
- glfs_pread;
- glfs_pwrite;
- glfs_fsync;
- glfs_fdatasync;
- glfs_ftruncate;
-} GFAPI_4.0.0;
-
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index ed46ab44bea..574e341f57d 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -758,9 +758,9 @@ invalid_fs:
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lseek, 3.4.0);
-static ssize_t
-glfs_preadv_common(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
- off_t offset, int flags, struct stat *poststat)
+ssize_t
+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;
@@ -769,9 +769,6 @@ glfs_preadv_common(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
int cnt = 0;
struct iobref *iobref = NULL;
fd_t *fd = NULL;
- struct iatt iatt = {
- 0,
- };
dict_t *fop_attr = NULL;
DECLARE_OLD_THIS;
@@ -799,13 +796,10 @@ glfs_preadv_common(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
if (ret)
gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed");
- ret = syncop_readv(subvol, fd, size, offset, 0, &iov, &cnt, &iobref, &iatt,
+ ret = syncop_readv(subvol, fd, size, offset, 0, &iov, &cnt, &iobref,
fop_attr, NULL);
DECODE_SYNCOP_ERR(ret);
- if (ret >= 0 && poststat)
- glfs_iatt_to_stat(glfd->fs, &iatt, poststat);
-
if (ret <= 0)
goto out;
@@ -835,13 +829,6 @@ invalid_fs:
return ret;
}
-ssize_t
-pub_glfs_preadv(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
- off_t offset, int flags)
-{
- return glfs_preadv_common(glfd, iovec, iovcnt, offset, flags, NULL);
-}
-
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_preadv, 3.4.0);
ssize_t
@@ -863,27 +850,8 @@ pub_glfs_read(struct glfs_fd *glfd, void *buf, size_t count, int flags)
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_read, 3.4.0);
ssize_t
-pub_glfs_pread34(struct glfs_fd *glfd, void *buf, size_t count, off_t offset,
- int flags)
-{
- struct iovec iov = {
- 0,
- };
- ssize_t ret = 0;
-
- iov.iov_base = buf;
- iov.iov_len = count;
-
- ret = pub_glfs_preadv(glfd, &iov, 1, offset, flags);
-
- return ret;
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_pread34, glfs_pread, 3.4.0);
-
-ssize_t
pub_glfs_pread(struct glfs_fd *glfd, void *buf, size_t count, off_t offset,
- int flags, struct stat *poststat)
+ int flags)
{
struct iovec iov = {
0,
@@ -893,12 +861,12 @@ pub_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_common(glfd, &iov, 1, offset, flags, poststat);
+ ret = pub_glfs_preadv(glfd, &iov, 1, offset, flags);
return ret;
}
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread, future);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread, 3.4.0);
ssize_t
pub_glfs_readv(struct glfs_fd *glfd, const struct iovec *iov, int count,
@@ -1145,10 +1113,9 @@ pub_glfs_readv_async(struct glfs_fd *glfd, const struct iovec *iov, int count,
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readv_async, 3.4.0);
-static ssize_t
-glfs_pwritev_common(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
- off_t offset, int flags, struct stat *prestat,
- struct stat *poststat)
+ssize_t
+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;
@@ -1158,13 +1125,6 @@ glfs_pwritev_common(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
0,
};
fd_t *fd = NULL;
- struct iatt preiatt =
- {
- 0,
- },
- postiatt = {
- 0,
- };
dict_t *fop_attr = NULL;
DECLARE_OLD_THIS;
@@ -1195,17 +1155,10 @@ glfs_pwritev_common(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
if (ret)
gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed");
- ret = syncop_writev(subvol, fd, &iov, 1, offset, iobref, flags, &preiatt,
- &postiatt, fop_attr, NULL);
+ ret = syncop_writev(subvol, fd, &iov, 1, offset, iobref, flags, fop_attr,
+ NULL);
DECODE_SYNCOP_ERR(ret);
- if (ret >= 0) {
- if (prestat)
- glfs_iatt_to_stat(glfd->fs, &preiatt, prestat);
- if (poststat)
- glfs_iatt_to_stat(glfd->fs, &postiatt, poststat);
- }
-
if (ret <= 0)
goto out;
@@ -1230,13 +1183,6 @@ invalid_fs:
return ret;
}
-ssize_t
-pub_glfs_pwritev(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
- off_t offset, int flags)
-{
- return glfs_pwritev_common(glfd, iovec, iovcnt, offset, flags, NULL, NULL);
-}
-
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwritev, 3.4.0);
ssize_t
@@ -1271,28 +1217,8 @@ pub_glfs_writev(struct glfs_fd *glfd, const struct iovec *iov, int count,
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev, 3.4.0);
ssize_t
-pub_glfs_pwrite34(struct glfs_fd *glfd, const void *buf, size_t count,
- off_t offset, int flags)
-{
- struct iovec iov = {
- 0,
- };
- ssize_t ret = 0;
-
- iov.iov_base = (void *)buf;
- iov.iov_len = count;
-
- ret = pub_glfs_pwritev(glfd, &iov, 1, offset, flags);
-
- return ret;
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_pwrite34, glfs_pwrite, 3.4.0);
-
-ssize_t
pub_glfs_pwrite(struct glfs_fd *glfd, const void *buf, size_t count,
- off_t offset, int flags, struct stat *prestat,
- struct stat *poststat)
+ off_t offset, int flags)
{
struct iovec iov = {
0,
@@ -1302,12 +1228,12 @@ pub_glfs_pwrite(struct glfs_fd *glfd, const void *buf, size_t count,
iov.iov_base = (void *)buf;
iov.iov_len = count;
- ret = glfs_pwritev_common(glfd, &iov, 1, offset, flags, prestat, poststat);
+ ret = pub_glfs_pwritev(glfd, &iov, 1, offset, flags);
return ret;
}
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite, future);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite, 3.4.0);
extern glfs_t *
pub_glfs_from_glfd(glfs_fd_t *);
@@ -1478,20 +1404,12 @@ pub_glfs_writev_async(struct glfs_fd *glfd, const struct iovec *iov, int count,
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev_async, 3.4.0);
-static int
-glfs_fsync_common(struct glfs_fd *glfd, struct stat *prestat,
- struct stat *poststat)
+int
+pub_glfs_fsync(struct glfs_fd *glfd)
{
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;
@@ -1517,15 +1435,9 @@ glfs_fsync_common(struct glfs_fd *glfd, struct stat *prestat,
if (ret)
gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed");
- ret = syncop_fsync(subvol, fd, 0, &preiatt, &postiatt, fop_attr, NULL);
+ ret = syncop_fsync(subvol, fd, 0, fop_attr, NULL);
DECODE_SYNCOP_ERR(ret);
- if (ret >= 0) {
- if (prestat)
- glfs_iatt_to_stat(glfd->fs, &preiatt, prestat);
- if (poststat)
- glfs_iatt_to_stat(glfd->fs, &postiatt, poststat);
- }
out:
if (fd)
fd_unref(fd);
@@ -1542,22 +1454,7 @@ invalid_fs:
return ret;
}
-int
-pub_glfs_fsync34(struct glfs_fd *glfd)
-{
- return glfs_fsync_common(glfd, NULL, NULL);
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_fsync34, glfs_fsync, 3.4.0);
-
-int
-pub_glfs_fsync(struct glfs_fd *glfd, struct stat *prestat,
- struct stat *poststat)
-{
- return glfs_fsync_common(glfd, prestat, poststat);
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync, future);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync, 3.4.0);
static int
glfs_fsync_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
@@ -1655,20 +1552,12 @@ invalid_fs:
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync_async, 3.4.0);
-static int
-glfs_fdatasync_common(struct glfs_fd *glfd, struct stat *prestat,
- struct stat *poststat)
+int
+pub_glfs_fdatasync(struct glfs_fd *glfd)
{
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;
@@ -1694,15 +1583,9 @@ glfs_fdatasync_common(struct glfs_fd *glfd, struct stat *prestat,
if (ret)
gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed");
- ret = syncop_fsync(subvol, fd, 1, &preiatt, &postiatt, fop_attr, NULL);
+ ret = syncop_fsync(subvol, fd, 1, fop_attr, NULL);
DECODE_SYNCOP_ERR(ret);
- if (ret >= 0) {
- if (prestat)
- glfs_iatt_to_stat(glfd->fs, &preiatt, prestat);
- if (poststat)
- glfs_iatt_to_stat(glfd->fs, &postiatt, poststat);
- }
out:
if (fd)
fd_unref(fd);
@@ -1719,22 +1602,7 @@ invalid_fs:
return ret;
}
-int
-pub_glfs_fdatasync34(struct glfs_fd *glfd)
-{
- return glfs_fdatasync_common(glfd, NULL, NULL);
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_fdatasync34, glfs_fdatasync, 3.4.0);
-
-int
-pub_glfs_fdatasync(struct glfs_fd *glfd, struct stat *prestat,
- struct stat *poststat)
-{
- return glfs_fdatasync_common(glfd, prestat, poststat);
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync, future);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync, 3.4.0);
int
pub_glfs_fdatasync_async(struct glfs_fd *glfd, glfs_io_cbk fn, void *data)
@@ -1754,20 +1622,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;
@@ -1793,16 +1653,9 @@ glfs_ftruncate_common(struct glfs_fd *glfd, off_t offset, struct stat *prestat,
if (ret)
gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed");
- ret = syncop_ftruncate(subvol, fd, offset, &preiatt, &postiatt, fop_attr,
- NULL);
+ ret = syncop_ftruncate(subvol, fd, offset, fop_attr, NULL);
DECODE_SYNCOP_ERR(ret);
- if (ret >= 0) {
- if (prestat)
- glfs_iatt_to_stat(glfd->fs, &preiatt, prestat);
- if (poststat)
- glfs_iatt_to_stat(glfd->fs, &postiatt, poststat);
- }
out:
if (fd)
fd_unref(fd);
@@ -1819,22 +1672,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, future);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate, 3.4.0);
int
pub_glfs_truncate(struct glfs *fs, const char *path, off_t length)
@@ -5237,8 +5075,7 @@ glfs_anonymous_pwritev(struct glfs *fs, struct glfs_object *object,
iov.iov_len = size;
/* TODO : set leaseid */
- ret = syncop_writev(subvol, fd, &iov, 1, offset, iobref, flags, NULL, NULL,
- NULL, NULL);
+ ret = syncop_writev(subvol, fd, &iov, 1, offset, iobref, flags, NULL, NULL);
DECODE_SYNCOP_ERR(ret);
iobuf_unref(iobuf);
@@ -5308,7 +5145,7 @@ glfs_anonymous_preadv(struct glfs *fs, struct glfs_object *object,
/* TODO : set leaseid */
ret = syncop_readv(subvol, fd, size, offset, flags, &iov, &cnt, &iobref,
- NULL, NULL, NULL);
+ NULL, NULL);
DECODE_SYNCOP_ERR(ret);
if (ret <= 0)
goto out;
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
index 34794b605e4..fc08311c59f 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -730,7 +730,7 @@ glfs_migrate_fd_safe(struct glfs *fs, xlator_t *newsubvol, fd_t *oldfd)
return fd_ref(oldfd);
if (!oldsubvol->switched) {
- ret = syncop_fsync(oldsubvol, oldfd, 0, NULL, NULL, NULL, NULL);
+ ret = syncop_fsync(oldsubvol, oldfd, 0, NULL, NULL);
DECODE_SYNCOP_ERR(ret);
if (ret) {
gf_msg(fs->volname, GF_LOG_WARNING, errno, API_MSG_FSYNC_FAILED,
diff --git a/api/src/glfs.h b/api/src/glfs.h
index 0673ca9505c..b54e050c9ed 100644
--- a/api/src/glfs.h
+++ b/api/src/glfs.h
@@ -551,13 +551,12 @@ glfs_writev_async(glfs_fd_t *fd, const struct iovec *iov, int count, int flags,
// glfs_p{read,write}[_async]
ssize_t
-glfs_pread(glfs_fd_t *fd, void *buf, size_t count, off_t offset, int flags,
- struct stat *poststat) __THROW GFAPI_PUBLIC(glfs_pread, future);
+glfs_pread(glfs_fd_t *fd, void *buf, size_t count, off_t offset,
+ int flags) __THROW GFAPI_PUBLIC(glfs_pread, 3.4.0);
ssize_t
glfs_pwrite(glfs_fd_t *fd, const void *buf, size_t count, off_t offset,
- int flags, struct stat *prestat, struct stat *poststat) __THROW
- GFAPI_PUBLIC(glfs_pwrite, future);
+ int flags) __THROW GFAPI_PUBLIC(glfs_pwrite, 3.4.0);
int
glfs_pread_async(glfs_fd_t *fd, void *buf, size_t count, off_t offset,
@@ -598,9 +597,8 @@ 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, future);
+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,
@@ -620,17 +618,14 @@ glfs_fstat(glfs_fd_t *fd, struct stat *buf) __THROW
GFAPI_PUBLIC(glfs_fstat, 3.4.0);
int
-glfs_fsync(glfs_fd_t *fd, struct stat *prestat, struct stat *poststat) __THROW
- GFAPI_PUBLIC(glfs_fsync, future);
+glfs_fsync(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_fsync, 3.4.0);
int
glfs_fsync_async(glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW
GFAPI_PUBLIC(glfs_fsync_async, 3.4.0);
int
-glfs_fdatasync(glfs_fd_t *fd, struct stat *prestat,
- struct stat *poststat) __THROW
- GFAPI_PUBLIC(glfs_fdatasync, future);
+glfs_fdatasync(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_fdatasync, 3.4.0);
int
glfs_fdatasync_async(glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW