summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorShyamsundarR <srangana@redhat.com>2018-09-13 17:20:02 -0400
committerShyamsundar Ranganathan <srangana@redhat.com>2018-09-17 14:26:06 +0000
commit5cd9c22a4fd041a27275a465d0117af39cf4e616 (patch)
treedd288db2310aa41bfca755fa2c00aa8e055b7637 /api
parent822dd79db99e0aa221ed90fdf8bb91fbcdfcd66f (diff)
gfapi: revert "gfapi: return pre/post attributes at callback for glfs api"
This reverts commit 384562b294e9a7847403961e878a4daa0fff33eb. The revert is done manually owing to the clang format changes, and the 4.1 patch that reverts this fix is used as the source for the revert. The 4.1 patch has the commit ID: 98376e0c0a Change-Id: Ib2cbce9940f6a2a2755eb47bf332832147835e4d Updates: bz#1628620 Signed-off-by: ShyamsundarR <srangana@redhat.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/gfapi.aliases31
-rw-r--r--api/src/gfapi.map26
-rw-r--r--api/src/glfs-fops.c371
-rw-r--r--api/src/glfs.h29
4 files changed, 91 insertions, 366 deletions
diff --git a/api/src/gfapi.aliases b/api/src/gfapi.aliases
index 854a7d42f8f..a2c6077b6e4 100644
--- a/api/src/gfapi.aliases
+++ b/api/src/gfapi.aliases
@@ -18,24 +18,30 @@ _pub_glfs_from_glfd _glfs_from_glfd$GFAPI_3.4.0
_pub_glfs_set_xlator_option _glfs_set_xlator_option$GFAPI_3.4.0
_pub_glfs_read _glfs_read$GFAPI_3.4.0
_pub_glfs_write _glfs_write$GFAPI_3.4.0
+_pub_glfs_read_async _glfs_read_async$GFAPI_3.4.0
+_pub_glfs_write_async _glfs_write_async$GFAPI_3.4.0
_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_async34 _glfs_pread_async$GFAPI_3.4.0
-_pub_glfs_pwrite_async34 _glfs_pwrite_async$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
_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_async34 _glfs_ftruncate_async$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_async34 _glfs_fsync_async$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_async34 _glfs_fdatasync_async$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
_pub_glfs_readlink _glfs_readlink$GFAPI_3.4.0
@@ -106,7 +112,9 @@ _pub_glfs_readdir _glfs_readdir$GFAPI_3.5.0
_pub_glfs_readdirplus _glfs_readdirplus$GFAPI_3.5.0
_pub_glfs_fallocate _glfs_fallocate$GFAPI_3.5.0
_pub_glfs_discard _glfs_discard$GFAPI_3.5.0
+_pub_glfs_discard_async _glfs_discard_async$GFAPI_3.5.0
_pub_glfs_zerofill _glfs_zerofill$GFAPI_3.5.0
+_pub_glfs_zerofill_async _glfs_zerofill_async$GFAPI_3.5.0
_pub_glfs_caller_specific_init _glfs_caller_specific_init$GFAPI_3.5.0
_pub_glfs_h_setxattrs _glfs_h_setxattrs$GFAPI_3.5.0
@@ -170,21 +178,8 @@ _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_read_async _glfs_read_async$GFAPI_future
-_pub_glfs_write_async _glfs_write_async$GFAPI_future
-_pub_glfs_readv_async _glfs_readv_async$GFAPI_future
-_pub_glfs_writev_async _glfs_writev_async$GFAPI_future
_pub_glfs_pread _glfs_pread$GFAPI_future
_pub_glfs_pwrite _glfs_pwrite$GFAPI_future
-_pub_glfs_pread_async _glfs_pread_async$GFAPI_future
-_pub_glfs_pwrite_async _glfs_pwrite_async$GFAPI_future
-_pub_glfs_preadv_async _glfs_preadv_async$GFAPI_future
-_pub_glfs_pwritev_async _glfs_pwritev_async$GFAPI_future
_pub_glfs_fsync _glfs_fsync$GFAPI_future
-_pub_glfs_fsync_async _glfs_fsync_async$GFAPI_future
_pub_glfs_fdatasync _glfs_fdatasync$GFAPI_future
-_pub_glfs_fdatasync_async _glfs_fdatasync_async$GFAPI_future
_pub_glfs_ftruncate _glfs_ftruncate$GFAPI_future
-_pub_glfs_ftruncate_async _glfs_ftruncate_async$GFAPI_future
-_pub_glfs_discard_async _glfs_discard_async$GFAPI_future
-_pub_glfs_zerofill_async _glfs_zerofill_async$GFAPI_future
diff --git a/api/src/gfapi.map b/api/src/gfapi.map
index 29a25fbf2e4..e1b37e6855a 100644
--- a/api/src/gfapi.map
+++ b/api/src/gfapi.map
@@ -24,14 +24,25 @@ GFAPI_3.4.0 {
glfs_set_xlator_option;
glfs_read;
glfs_write;
+ glfs_read_async;
+ glfs_write_async;
glfs_readv;
glfs_writev;
+ glfs_readv_async;
+ glfs_writev_async;
+ glfs_pread_async;
+ glfs_pwrite_async;
glfs_preadv;
glfs_pwritev;
+ glfs_preadv_async;
+ glfs_pwritev_async;
glfs_lseek;
+ glfs_ftruncate_async;
glfs_lstat;
glfs_stat;
glfs_fstat;
+ glfs_fsync_async;
+ glfs_fdatasync_async;
glfs_access;
glfs_symlink;
glfs_readlink;
@@ -119,7 +130,9 @@ GFAPI_3.5.0 {
glfs_readdirplus;
glfs_fallocate;
glfs_discard;
+ glfs_discard_async;
glfs_zerofill;
+ glfs_zerofill_async;
glfs_caller_specific_init;
glfs_h_setxattrs;
} GFAPI_3.4.2;
@@ -225,23 +238,10 @@ GFAPI_4.0.0 {
GFAPI_future {
global:
- glfs_read_async;
- glfs_write_async;
- glfs_readv_async;
- glfs_writev_async;
glfs_pread;
glfs_pwrite;
- glfs_pread_async;
- glfs_pwrite_async;
- glfs_preadv_async;
- glfs_pwritev_async;
glfs_fsync;
- glfs_fsync_async;
glfs_fdatasync;
- glfs_fdatasync_async;
glfs_ftruncate;
- glfs_ftruncate_async;
- glfs_discard_async;
- glfs_zerofill_async;
} GFAPI_4.0.0;
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index f6786845a4f..ed46ab44bea 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -920,26 +920,19 @@ struct glfs_io {
struct iovec *iov;
int count;
int flags;
- gf_boolean_t oldcb;
- union {
- glfs_io_cbk34 fn34;
- glfs_io_cbk fn;
- };
+ glfs_io_cbk fn;
void *data;
};
static int
glfs_io_async_cbk(int op_ret, int op_errno, call_frame_t *frame, void *cookie,
- struct iovec *iovec, int count, struct iatt *prebuf,
- struct iatt *postbuf)
+ struct iovec *iovec, int count)
{
struct glfs_io *gio = NULL;
xlator_t *subvol = NULL;
struct glfs *fs = NULL;
struct glfs_fd *glfd = NULL;
int ret = -1;
- struct stat prestat = {}, *prestatp = NULL;
- struct stat poststat = {}, *poststatp = NULL;
GF_VALIDATE_OR_GOTO("gfapi", frame, inval);
GF_VALIDATE_OR_GOTO("gfapi", cookie, inval);
@@ -970,21 +963,8 @@ glfs_io_async_cbk(int op_ret, int op_errno, call_frame_t *frame, void *cookie,
out:
errno = op_errno;
- if (gio->oldcb) {
- gio->fn34(gio->glfd, op_ret, gio->data);
- } else {
- if (prebuf) {
- prestatp = &prestat;
- glfs_iatt_to_stat(fs, prebuf, prestatp);
- }
+ gio->fn(gio->glfd, op_ret, gio->data);
- if (postbuf) {
- poststatp = &poststat;
- glfs_iatt_to_stat(fs, postbuf, poststatp);
- }
-
- gio->fn(gio->glfd, op_ret, prestatp, poststatp, gio->data);
- }
err:
fd_unref(glfd->fd);
/* Since the async operation is complete
@@ -1008,16 +988,15 @@ glfs_preadv_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, struct iovec *iovec, int count,
struct iatt *stbuf, struct iobref *iobref, dict_t *xdata)
{
- glfs_io_async_cbk(op_ret, op_errno, frame, cookie, iovec, count, NULL,
- stbuf);
+ glfs_io_async_cbk(op_ret, op_errno, frame, cookie, iovec, count);
return 0;
}
-static int
-glfs_preadv_async_common(struct glfs_fd *glfd, const struct iovec *iovec,
- int count, off_t offset, int flags, gf_boolean_t oldcb,
- glfs_io_cbk fn, void *data)
+int
+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;
@@ -1074,7 +1053,6 @@ glfs_preadv_async_common(struct glfs_fd *glfd, const struct iovec *iovec,
gio->count = count;
gio->offset = offset;
gio->flags = flags;
- gio->oldcb = oldcb;
gio->fn = fn;
gio->data = data;
@@ -1114,47 +1092,7 @@ invalid_fs:
return -1;
}
-int
-pub_glfs_preadv_async34(struct glfs_fd *glfd, const struct iovec *iovec,
- int count, off_t offset, int flags, glfs_io_cbk34 fn,
- void *data)
-{
- return glfs_preadv_async_common(glfd, iovec, count, offset, flags, _gf_true,
- (void *)fn, data);
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_preadv_async34, glfs_preadv_async, 3.4.0);
-
-int
-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)
-{
- return glfs_preadv_async_common(glfd, iovec, count, offset, flags,
- _gf_false, fn, data);
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_preadv_async, future);
-
-int
-pub_glfs_read_async34(struct glfs_fd *glfd, void *buf, size_t count, int flags,
- glfs_io_cbk34 fn, void *data)
-{
- struct iovec iov = {
- 0,
- };
- ssize_t ret = 0;
-
- iov.iov_base = buf;
- iov.iov_len = count;
-
- ret = glfs_preadv_async_common(glfd, &iov, 1, glfd->offset, flags, _gf_true,
- (void *)fn, data);
-
- return ret;
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_read_async34, glfs_read_async, 3.4.0);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_preadv_async, 3.4.0);
int
pub_glfs_read_async(struct glfs_fd *glfd, void *buf, size_t count, int flags,
@@ -1168,33 +1106,12 @@ pub_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_common(glfd, &iov, 1, glfd->offset, flags,
- _gf_false, fn, data);
-
- return ret;
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_read_async, future);
-
-int
-pub_glfs_pread_async34(struct glfs_fd *glfd, void *buf, size_t count,
- off_t offset, int flags, glfs_io_cbk34 fn, void *data)
-{
- struct iovec iov = {
- 0,
- };
- ssize_t ret = 0;
-
- iov.iov_base = buf;
- iov.iov_len = count;
-
- ret = glfs_preadv_async_common(glfd, &iov, 1, offset, flags, _gf_true,
- (void *)fn, data);
+ ret = pub_glfs_preadv_async(glfd, &iov, 1, glfd->offset, flags, fn, data);
return ret;
}
-GFAPI_SYMVER_PUBLIC(glfs_pread_async34, glfs_pread_async, 3.4.0);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_read_async, 3.4.0);
int
pub_glfs_pread_async(struct glfs_fd *glfd, void *buf, size_t count,
@@ -1208,26 +1125,12 @@ pub_glfs_pread_async(struct glfs_fd *glfd, void *buf, size_t count,
iov.iov_base = buf;
iov.iov_len = count;
- ret = glfs_preadv_async_common(glfd, &iov, 1, offset, flags, _gf_false, fn,
- data);
-
- return ret;
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread_async, future);
-
-int
-pub_glfs_readv_async34(struct glfs_fd *glfd, const struct iovec *iov, int count,
- int flags, glfs_io_cbk34 fn, void *data)
-{
- ssize_t ret = 0;
+ ret = pub_glfs_preadv_async(glfd, &iov, 1, offset, flags, fn, data);
- ret = glfs_preadv_async_common(glfd, iov, count, glfd->offset, flags,
- _gf_true, (void *)fn, data);
return ret;
}
-GFAPI_SYMVER_PUBLIC(glfs_readv_async34, glfs_readv_async, 3.4.0);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread_async, 3.4.0);
int
pub_glfs_readv_async(struct glfs_fd *glfd, const struct iovec *iov, int count,
@@ -1235,12 +1138,12 @@ pub_glfs_readv_async(struct glfs_fd *glfd, const struct iovec *iov, int count,
{
ssize_t ret = 0;
- ret = glfs_preadv_async_common(glfd, iov, count, glfd->offset, flags,
- _gf_false, fn, data);
+ ret = pub_glfs_preadv_async(glfd, iov, count, glfd->offset, flags, fn,
+ data);
return ret;
}
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readv_async, future);
+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,
@@ -1414,16 +1317,15 @@ glfs_pwritev_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata)
{
- glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0, prebuf,
- postbuf);
+ glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0);
return 0;
}
-static int
-glfs_pwritev_async_common(struct glfs_fd *glfd, const struct iovec *iovec,
- int count, off_t offset, int flags,
- gf_boolean_t oldcb, glfs_io_cbk fn, void *data)
+int
+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 = -1;
@@ -1464,7 +1366,6 @@ glfs_pwritev_async_common(struct glfs_fd *glfd, const struct iovec *iovec,
gio->glfd = glfd;
gio->offset = offset;
gio->flags = flags;
- gio->oldcb = oldcb;
gio->fn = fn;
gio->data = data;
gio->count = 1;
@@ -1524,47 +1425,7 @@ invalid_fs:
return ret;
}
-int
-pub_glfs_pwritev_async34(struct glfs_fd *glfd, const struct iovec *iovec,
- int count, off_t offset, int flags, glfs_io_cbk34 fn,
- void *data)
-{
- return glfs_pwritev_async_common(glfd, iovec, count, offset, flags,
- _gf_true, (void *)fn, data);
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_pwritev_async34, glfs_pwritev_async, 3.4.0);
-
-int
-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)
-{
- return glfs_pwritev_async_common(glfd, iovec, count, offset, flags,
- _gf_false, fn, data);
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwritev_async, future);
-
-int
-pub_glfs_write_async34(struct glfs_fd *glfd, const void *buf, size_t count,
- int flags, glfs_io_cbk34 fn, void *data)
-{
- struct iovec iov = {
- 0,
- };
- ssize_t ret = 0;
-
- iov.iov_base = (void *)buf;
- iov.iov_len = count;
-
- ret = glfs_pwritev_async_common(glfd, &iov, 1, glfd->offset, flags,
- _gf_true, (void *)fn, data);
-
- return ret;
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_write_async34, glfs_write_async, 3.4.0);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwritev_async, 3.4.0);
int
pub_glfs_write_async(struct glfs_fd *glfd, const void *buf, size_t count,
@@ -1578,33 +1439,12 @@ pub_glfs_write_async(struct glfs_fd *glfd, const void *buf, size_t count,
iov.iov_base = (void *)buf;
iov.iov_len = count;
- ret = glfs_pwritev_async_common(glfd, &iov, 1, glfd->offset, flags,
- _gf_false, fn, data);
-
- return ret;
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_write_async, future);
-
-int
-pub_glfs_pwrite_async34(struct glfs_fd *glfd, const void *buf, int count,
- off_t offset, int flags, glfs_io_cbk34 fn, void *data)
-{
- struct iovec iov = {
- 0,
- };
- ssize_t ret = 0;
-
- iov.iov_base = (void *)buf;
- iov.iov_len = count;
-
- ret = glfs_pwritev_async_common(glfd, &iov, 1, offset, flags, _gf_true,
- (void *)fn, data);
+ ret = pub_glfs_pwritev_async(glfd, &iov, 1, glfd->offset, flags, fn, data);
return ret;
}
-GFAPI_SYMVER_PUBLIC(glfs_pwrite_async34, glfs_pwrite_async, 3.4.0);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_write_async, 3.4.0);
int
pub_glfs_pwrite_async(struct glfs_fd *glfd, const void *buf, int count,
@@ -1618,26 +1458,12 @@ pub_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_common(glfd, &iov, 1, offset, flags, _gf_false, fn,
- data);
-
- return ret;
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite_async, future);
-
-int
-pub_glfs_writev_async34(struct glfs_fd *glfd, const struct iovec *iov,
- int count, int flags, glfs_io_cbk34 fn, void *data)
-{
- ssize_t ret = 0;
+ ret = pub_glfs_pwritev_async(glfd, &iov, 1, offset, flags, fn, data);
- ret = glfs_pwritev_async_common(glfd, iov, count, glfd->offset, flags,
- _gf_true, (void *)fn, data);
return ret;
}
-GFAPI_SYMVER_PUBLIC(glfs_writev_async34, glfs_writev_async, 3.4.0);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite_async, 3.4.0);
int
pub_glfs_writev_async(struct glfs_fd *glfd, const struct iovec *iov, int count,
@@ -1645,12 +1471,12 @@ pub_glfs_writev_async(struct glfs_fd *glfd, const struct iovec *iov, int count,
{
ssize_t ret = 0;
- ret = glfs_pwritev_async_common(glfd, iov, count, glfd->offset, flags,
- _gf_false, fn, data);
+ ret = pub_glfs_pwritev_async(glfd, iov, count, glfd->offset, flags, fn,
+ data);
return ret;
}
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev_async, future);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev_async, 3.4.0);
static int
glfs_fsync_common(struct glfs_fd *glfd, struct stat *prestat,
@@ -1738,15 +1564,14 @@ glfs_fsync_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata)
{
- glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0, prebuf,
- postbuf);
+ glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0);
return 0;
}
static int
-glfs_fsync_async_common(struct glfs_fd *glfd, gf_boolean_t oldcb,
- glfs_io_cbk fn, void *data, int dataonly)
+glfs_fsync_async_common(struct glfs_fd *glfd, glfs_io_cbk fn, void *data,
+ int dataonly)
{
struct glfs_io *gio = NULL;
int ret = 0;
@@ -1790,7 +1615,6 @@ glfs_fsync_async_common(struct glfs_fd *glfd, gf_boolean_t oldcb,
gio->op = GF_FOP_FSYNC;
gio->glfd = glfd;
gio->flags = dataonly;
- gio->oldcb = oldcb;
gio->fn = fn;
gio->data = data;
@@ -1814,24 +1638,6 @@ out:
}
int
-pub_glfs_fsync_async34(struct glfs_fd *glfd, glfs_io_cbk34 fn, void *data)
-{
- int ret = -1;
-
- DECLARE_OLD_THIS;
- __GLFS_ENTRY_VALIDATE_FD(glfd, invalid_fs);
-
- ret = glfs_fsync_async_common(glfd, _gf_true, (void *)fn, data, 0);
-
- __GLFS_EXIT_FS;
-
-invalid_fs:
- return ret;
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_fsync_async34, glfs_fsync_async, 3.4.0);
-
-int
pub_glfs_fsync_async(struct glfs_fd *glfd, glfs_io_cbk fn, void *data)
{
int ret = -1;
@@ -1839,7 +1645,7 @@ pub_glfs_fsync_async(struct glfs_fd *glfd, glfs_io_cbk fn, void *data)
DECLARE_OLD_THIS;
__GLFS_ENTRY_VALIDATE_FD(glfd, invalid_fs);
- ret = glfs_fsync_async_common(glfd, _gf_false, fn, data, 0);
+ ret = glfs_fsync_async_common(glfd, fn, data, 0);
__GLFS_EXIT_FS;
@@ -1847,7 +1653,7 @@ invalid_fs:
return ret;
}
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync_async, future);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync_async, 3.4.0);
static int
glfs_fdatasync_common(struct glfs_fd *glfd, struct stat *prestat,
@@ -1931,24 +1737,6 @@ pub_glfs_fdatasync(struct glfs_fd *glfd, struct stat *prestat,
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync, future);
int
-pub_glfs_fdatasync_async34(struct glfs_fd *glfd, glfs_io_cbk34 fn, void *data)
-{
- int ret = -1;
-
- DECLARE_OLD_THIS;
- __GLFS_ENTRY_VALIDATE_FD(glfd, invalid_fs);
-
- ret = glfs_fsync_async_common(glfd, _gf_true, (void *)fn, data, 1);
-
- __GLFS_EXIT_FS;
-
-invalid_fs:
- return ret;
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_fdatasync_async34, glfs_fdatasync_async, 3.4.0);
-
-int
pub_glfs_fdatasync_async(struct glfs_fd *glfd, glfs_io_cbk fn, void *data)
{
int ret = -1;
@@ -1956,7 +1744,7 @@ pub_glfs_fdatasync_async(struct glfs_fd *glfd, glfs_io_cbk fn, void *data)
DECLARE_OLD_THIS;
__GLFS_ENTRY_VALIDATE_FD(glfd, invalid_fs);
- ret = glfs_fsync_async_common(glfd, _gf_false, fn, data, 1);
+ ret = glfs_fsync_async_common(glfd, fn, data, 1);
__GLFS_EXIT_FS;
@@ -1964,7 +1752,7 @@ invalid_fs:
return ret;
}
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync_async, future);
+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,
@@ -2100,15 +1888,14 @@ glfs_ftruncate_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata)
{
- glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0, prebuf,
- postbuf);
+ glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0);
return 0;
}
-static int
-glfs_ftruncate_async_common(struct glfs_fd *glfd, off_t offset,
- gf_boolean_t oldcb, glfs_io_cbk fn, void *data)
+int
+pub_glfs_ftruncate_async(struct glfs_fd *glfd, off_t offset, glfs_io_cbk fn,
+ void *data)
{
struct glfs_io *gio = NULL;
int ret = -1;
@@ -2152,7 +1939,6 @@ glfs_ftruncate_async_common(struct glfs_fd *glfd, off_t offset,
gio->op = GF_FOP_FTRUNCATE;
gio->glfd = glfd;
gio->offset = offset;
- gio->oldcb = oldcb;
gio->fn = fn;
gio->data = data;
@@ -2187,24 +1973,7 @@ invalid_fs:
return ret;
}
-int
-pub_glfs_ftruncate_async34(struct glfs_fd *glfd, off_t offset, glfs_io_cbk34 fn,
- void *data)
-{
- return glfs_ftruncate_async_common(glfd, offset, _gf_true, (void *)fn,
- data);
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_ftruncate_async34, glfs_ftruncate_async, 3.4.0);
-
-int
-pub_glfs_ftruncate_async(struct glfs_fd *glfd, off_t offset, glfs_io_cbk fn,
- void *data)
-{
- return glfs_ftruncate_async_common(glfd, offset, _gf_false, fn, data);
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate_async, future);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate_async, 3.4.0);
int
pub_glfs_access(struct glfs *fs, const char *path, int mode)
@@ -3022,15 +2791,14 @@ glfs_discard_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
struct iatt *preop_stbuf, struct iatt *postop_stbuf,
dict_t *xdata)
{
- glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0, preop_stbuf,
- postop_stbuf);
+ glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0);
return 0;
}
-static int
-glfs_discard_async_common(struct glfs_fd *glfd, off_t offset, size_t len,
- gf_boolean_t oldcb, glfs_io_cbk fn, void *data)
+int
+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 = -1;
@@ -3075,7 +2843,6 @@ glfs_discard_async_common(struct glfs_fd *glfd, off_t offset, size_t len,
gio->glfd = glfd;
gio->offset = offset;
gio->count = len;
- gio->oldcb = oldcb;
gio->fn = fn;
gio->data = data;
@@ -3106,24 +2873,7 @@ invalid_fs:
return ret;
}
-int
-pub_glfs_discard_async35(struct glfs_fd *glfd, off_t offset, size_t len,
- glfs_io_cbk34 fn, void *data)
-{
- return glfs_discard_async_common(glfd, offset, len, _gf_true, (void *)fn,
- data);
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_discard_async35, glfs_discard_async, 3.5.0);
-
-int
-pub_glfs_discard_async(struct glfs_fd *glfd, off_t offset, size_t len,
- glfs_io_cbk fn, void *data)
-{
- return glfs_discard_async_common(glfd, offset, len, _gf_false, fn, data);
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_discard_async, future);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_discard_async, 3.5.0);
static int
glfs_zerofill_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
@@ -3131,15 +2881,14 @@ glfs_zerofill_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
struct iatt *preop_stbuf, struct iatt *postop_stbuf,
dict_t *xdata)
{
- glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0, preop_stbuf,
- postop_stbuf);
+ glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0);
return 0;
}
-static int
-glfs_zerofill_async_common(struct glfs_fd *glfd, off_t offset, off_t len,
- gf_boolean_t oldcb, glfs_io_cbk fn, void *data)
+int
+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 = -1;
@@ -3184,7 +2933,6 @@ glfs_zerofill_async_common(struct glfs_fd *glfd, off_t offset, off_t len,
gio->glfd = glfd;
gio->offset = offset;
gio->count = len;
- gio->oldcb = oldcb;
gio->fn = fn;
gio->data = data;
@@ -3217,24 +2965,7 @@ invalid_fs:
return ret;
}
-int
-pub_glfs_zerofill_async35(struct glfs_fd *glfd, off_t offset, off_t len,
- glfs_io_cbk34 fn, void *data)
-{
- return glfs_zerofill_async_common(glfd, offset, len, _gf_true, (void *)fn,
- data);
-}
-
-GFAPI_SYMVER_PUBLIC(glfs_zerofill_async35, glfs_zerofill_async, 3.5.0);
-
-int
-pub_glfs_zerofill_async(struct glfs_fd *glfd, off_t offset, off_t len,
- glfs_io_cbk fn, void *data)
-{
- return glfs_zerofill_async_common(glfd, offset, len, _gf_false, fn, data);
-}
-
-GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_zerofill_async, future);
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_zerofill_async, 3.5.0);
void
gf_dirent_to_dirent(gf_dirent_t *gf_dirent, struct dirent *dirent)
diff --git a/api/src/glfs.h b/api/src/glfs.h
index a007602fc8d..0673ca9505c 100644
--- a/api/src/glfs.h
+++ b/api/src/glfs.h
@@ -506,8 +506,7 @@ glfs_set_xlator_option(glfs_t *fs, const char *xlator, const char *key,
in a common callback function.
*/
-typedef void (*glfs_io_cbk)(glfs_fd_t *fd, ssize_t ret, struct stat *prestat,
- struct stat *poststat, void *data);
+typedef void (*glfs_io_cbk)(glfs_fd_t *fd, ssize_t ret, void *data);
// glfs_{read,write}[_async]
@@ -522,12 +521,12 @@ glfs_write(glfs_fd_t *fd, const void *buf, size_t count, int flags) __THROW
int
glfs_read_async(glfs_fd_t *fd, void *buf, size_t count, int flags,
glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_read_async, future);
+ GFAPI_PUBLIC(glfs_read_async, 3.4.0);
int
glfs_write_async(glfs_fd_t *fd, const void *buf, size_t count, int flags,
glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_write_async, future);
+ GFAPI_PUBLIC(glfs_write_async, 3.4.0);
// glfs_{read,write}v[_async]
@@ -542,12 +541,12 @@ glfs_writev(glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
int
glfs_readv_async(glfs_fd_t *fd, const struct iovec *iov, int count, int flags,
glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_readv_async, future);
+ GFAPI_PUBLIC(glfs_readv_async, 3.4.0);
int
glfs_writev_async(glfs_fd_t *fd, const struct iovec *iov, int count, int flags,
glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_writev_async, future);
+ GFAPI_PUBLIC(glfs_writev_async, 3.4.0);
// glfs_p{read,write}[_async]
@@ -563,12 +562,12 @@ glfs_pwrite(glfs_fd_t *fd, const void *buf, size_t count, off_t offset,
int
glfs_pread_async(glfs_fd_t *fd, void *buf, size_t count, off_t offset,
int flags, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_pread_async, future);
+ GFAPI_PUBLIC(glfs_pread_async, 3.4.0);
int
glfs_pwrite_async(glfs_fd_t *fd, const void *buf, int count, off_t offset,
int flags, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_pwrite_async, future);
+ GFAPI_PUBLIC(glfs_pwrite_async, 3.4.0);
// glfs_p{read,write}v[_async]
@@ -583,12 +582,12 @@ glfs_pwritev(glfs_fd_t *fd, const struct iovec *iov, int iovcnt, off_t offset,
int
glfs_preadv_async(glfs_fd_t *fd, const struct iovec *iov, int count,
off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_preadv_async, future);
+ GFAPI_PUBLIC(glfs_preadv_async, 3.4.0);
int
glfs_pwritev_async(glfs_fd_t *fd, const struct iovec *iov, int count,
off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_pwritev_async, future);
+ GFAPI_PUBLIC(glfs_pwritev_async, 3.4.0);
off_t
glfs_lseek(glfs_fd_t *fd, off_t offset, int whence) __THROW
@@ -606,7 +605,7 @@ glfs_ftruncate(glfs_fd_t *fd, off_t length, struct stat *prestat,
int
glfs_ftruncate_async(glfs_fd_t *fd, off_t length, glfs_io_cbk fn,
void *data) __THROW
- GFAPI_PUBLIC(glfs_ftruncate_async, future);
+ GFAPI_PUBLIC(glfs_ftruncate_async, 3.4.0);
int
glfs_lstat(glfs_t *fs, const char *path, struct stat *buf) __THROW
@@ -626,7 +625,7 @@ glfs_fsync(glfs_fd_t *fd, struct stat *prestat, struct stat *poststat) __THROW
int
glfs_fsync_async(glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_fsync_async, future);
+ GFAPI_PUBLIC(glfs_fsync_async, 3.4.0);
int
glfs_fdatasync(glfs_fd_t *fd, struct stat *prestat,
@@ -635,7 +634,7 @@ glfs_fdatasync(glfs_fd_t *fd, struct stat *prestat,
int
glfs_fdatasync_async(glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW
- GFAPI_PUBLIC(glfs_fdatasync_async, future);
+ GFAPI_PUBLIC(glfs_fdatasync_async, 3.4.0);
int
glfs_access(glfs_t *fs, const char *path, int mode) __THROW
@@ -817,7 +816,7 @@ glfs_discard(glfs_fd_t *fd, off_t offset, size_t len) __THROW
int
glfs_discard_async(glfs_fd_t *fd, off_t length, size_t lent, glfs_io_cbk fn,
- void *data) __THROW GFAPI_PUBLIC(glfs_discard_async, future);
+ void *data) __THROW GFAPI_PUBLIC(glfs_discard_async, 3.5.0);
int
glfs_zerofill(glfs_fd_t *fd, off_t offset, off_t len) __THROW
@@ -826,7 +825,7 @@ glfs_zerofill(glfs_fd_t *fd, off_t offset, off_t len) __THROW
int
glfs_zerofill_async(glfs_fd_t *fd, off_t length, off_t len, glfs_io_cbk fn,
void *data) __THROW
- GFAPI_PUBLIC(glfs_zerofill_async, future);
+ GFAPI_PUBLIC(glfs_zerofill_async, 3.5.0);
char *
glfs_getcwd(glfs_t *fs, char *buf, size_t size) __THROW