From cee40c3e3c26ebfb3b98109d154501a5cce61c0d Mon Sep 17 00:00:00 2001 From: ShyamsundarR Date: Thu, 13 Sep 2018 22:15:20 -0400 Subject: 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 --- api/src/gfapi.aliases | 15 +- api/src/gfapi.map | 10 - api/src/glfs-fops.c | 221 +++------------------ api/src/glfs-resolve.c | 2 +- api/src/glfs.h | 19 +- libglusterfs/src/generator.py | 7 - libglusterfs/src/syncop.c | 47 +---- libglusterfs/src/syncop.h | 13 +- tests/basic/gfapi/mandatory-lock-optimal.c | 2 +- tests/basic/gfapi/upcall-cache-invalidate.c | 2 +- tests/basic/gfapi/upcall-register-api.c | 2 +- tests/bugs/io-cache/bug-read-hang.c | 2 +- xlators/cluster/afr/src/afr-self-heal-data.c | 6 +- xlators/cluster/dht/src/dht-rebalance.c | 19 +- xlators/experimental/fdl/src/gen_recon.py | 2 +- xlators/experimental/jbr-server/src/jbr.c | 3 +- xlators/features/bit-rot/src/bitd/bit-rot.c | 2 +- xlators/features/cloudsync/src/cloudsync.c | 3 +- .../features/snapview-server/src/snapview-server.c | 14 +- xlators/mount/fuse/src/fuse-bridge.c | 2 +- xlators/storage/posix/src/posix-entry-ops.c | 4 +- 21 files changed, 90 insertions(+), 307 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 @@ -862,28 +849,9 @@ 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 @@ -1270,29 +1216,9 @@ 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 diff --git a/libglusterfs/src/generator.py b/libglusterfs/src/generator.py index c17d450502d..026dfb6c75b 100755 --- a/libglusterfs/src/generator.py +++ b/libglusterfs/src/generator.py @@ -123,8 +123,6 @@ ops['fstat'] = ( ops['fsync'] = ( ('fop-arg', 'fd', 'fd_t *'), ('fop-arg', 'flags', 'int32_t'), - ('extra', 'preop', 'struct iatt', '&preop'), - ('extra', 'postop', 'struct iatt', '&postop'), ('fop-arg', 'xdata', 'dict_t *'), ('cbk-arg', 'prebuf', 'struct iatt *'), ('cbk-arg', 'postbuf', 'struct iatt *'), @@ -144,8 +142,6 @@ ops['writev'] = ( ('fop-arg', 'off', 'off_t', 'offset'), ('fop-arg', 'flags', 'uint32_t', 'flags'), ('fop-arg', 'iobref', 'struct iobref *'), - ('extra', 'preop', 'struct iatt', '&preop'), - ('extra', 'postop', 'struct iatt', '&postop'), ('fop-arg', 'xdata', 'dict_t *', 'xdata'), ('cbk-arg', 'prebuf', 'struct iatt *'), ('cbk-arg', 'postbuf', 'struct iatt *'), @@ -158,7 +154,6 @@ ops['readv'] = ( ('fop-arg', 'size', 'size_t'), ('fop-arg', 'offset', 'off_t'), ('fop-arg', 'flags', 'uint32_t'), - ('extra', 'iatt', 'struct iatt', '&iatt'), ('fop-arg', 'xdata', 'dict_t *'), ('cbk-arg', 'vector', 'struct iovec *'), ('cbk-arg', 'count', 'int32_t'), @@ -303,8 +298,6 @@ ops['access'] = ( ops['ftruncate'] = ( ('fop-arg', 'fd', 'fd_t *', 'fd'), ('fop-arg', 'offset', 'off_t', 'offset'), - ('extra', 'preop', 'struct iatt', '&preop'), - ('extra', 'postop', 'struct iatt', '&postop'), ('fop-arg', 'xdata', 'dict_t *', 'xdata'), ('cbk-arg', 'prebuf', 'struct iatt *'), ('cbk-arg', 'postbuf', 'struct iatt *'), diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index ec646425d74..2b8a0a68b00 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -1909,7 +1909,6 @@ syncop_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, args->iobref = iobref_ref(iobref); args->vector = iov_dup(vector, count); args->count = count; - args->iatt1 = *stbuf; } __wake(args); @@ -1920,7 +1919,7 @@ syncop_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int syncop_readv(xlator_t *subvol, fd_t *fd, size_t size, off_t off, uint32_t flags, struct iovec **vector, int *count, struct iobref **iobref, - struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out) + dict_t *xdata_in, dict_t **xdata_out) { struct syncargs args = { 0, @@ -1934,9 +1933,6 @@ syncop_readv(xlator_t *subvol, fd_t *fd, size_t size, off_t off, uint32_t flags, else if (args.xdata) dict_unref(args.xdata); - if (iatt) - *iatt = args.iatt1; - if (args.op_ret < 0) goto out; @@ -1974,11 +1970,6 @@ syncop_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret >= 0) { - args->iatt1 = *prebuf; - args->iatt2 = *postbuf; - } - __wake(args); return 0; @@ -1987,8 +1978,7 @@ syncop_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, int syncop_writev(xlator_t *subvol, fd_t *fd, const struct iovec *vector, int32_t count, off_t offset, struct iobref *iobref, - uint32_t flags, struct iatt *preiatt, struct iatt *postiatt, - dict_t *xdata_in, dict_t **xdata_out) + uint32_t flags, dict_t *xdata_in, dict_t **xdata_out) { struct syncargs args = { 0, @@ -1997,11 +1987,6 @@ syncop_writev(xlator_t *subvol, fd_t *fd, const struct iovec *vector, SYNCOP(subvol, (&args), syncop_writev_cbk, subvol->fops->writev, fd, (struct iovec *)vector, count, offset, flags, iobref, xdata_in); - if (preiatt) - *preiatt = args.iatt1; - if (postiatt) - *postiatt = args.iatt2; - if (xdata_out) *xdata_out = args.xdata; else if (args.xdata) @@ -2330,19 +2315,14 @@ syncop_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret >= 0) { - args->iatt1 = *prebuf; - args->iatt2 = *postbuf; - } - __wake(args); return 0; } int -syncop_ftruncate(xlator_t *subvol, fd_t *fd, off_t offset, struct iatt *preiatt, - struct iatt *postiatt, dict_t *xdata_in, dict_t **xdata_out) +syncop_ftruncate(xlator_t *subvol, fd_t *fd, off_t offset, dict_t *xdata_in, + dict_t **xdata_out) { struct syncargs args = { 0, @@ -2351,11 +2331,6 @@ syncop_ftruncate(xlator_t *subvol, fd_t *fd, off_t offset, struct iatt *preiatt, SYNCOP(subvol, (&args), syncop_ftruncate_cbk, subvol->fops->ftruncate, fd, offset, xdata_in); - if (preiatt) - *preiatt = args.iatt1; - if (postiatt) - *postiatt = args.iatt2; - if (xdata_out) *xdata_out = args.xdata; else if (args.xdata) @@ -2401,19 +2376,14 @@ syncop_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret >= 0) { - args->iatt1 = *prebuf; - args->iatt2 = *postbuf; - } - __wake(args); return 0; } int -syncop_fsync(xlator_t *subvol, fd_t *fd, int dataonly, struct iatt *preiatt, - struct iatt *postiatt, dict_t *xdata_in, dict_t **xdata_out) +syncop_fsync(xlator_t *subvol, fd_t *fd, int dataonly, dict_t *xdata_in, + dict_t **xdata_out) { struct syncargs args = { 0, @@ -2422,11 +2392,6 @@ syncop_fsync(xlator_t *subvol, fd_t *fd, int dataonly, struct iatt *preiatt, SYNCOP(subvol, (&args), syncop_fsync_cbk, subvol->fops->fsync, fd, dataonly, xdata_in); - if (preiatt) - *preiatt = args.iatt1; - if (postiatt) - *postiatt = args.iatt2; - if (xdata_out) *xdata_out = args.xdata; else if (args.xdata) diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index d07aed3d53b..88668125d5a 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -488,18 +488,17 @@ syncop_write(xlator_t *subvol, fd_t *fd, const char *buf, int size, int syncop_writev(xlator_t *subvol, fd_t *fd, const struct iovec *vector, int32_t count, off_t offset, struct iobref *iobref, - uint32_t flags, struct iatt *preiatt, struct iatt *postiatt, - dict_t *xdata_in, dict_t **xdata_out); + uint32_t flags, dict_t *xdata_in, dict_t **xdata_out); int syncop_readv(xlator_t *subvol, fd_t *fd, size_t size, off_t off, uint32_t flags, /* out */ struct iovec **vector, int *count, struct iobref **iobref, - struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out); + dict_t *xdata_in, dict_t **xdata_out); int -syncop_ftruncate(xlator_t *subvol, fd_t *fd, off_t offset, struct iatt *preiatt, - struct iatt *postiatt, dict_t *xdata_in, dict_t **xdata_out); +syncop_ftruncate(xlator_t *subvol, fd_t *fd, off_t offset, dict_t *xdata_in, + dict_t **xdata_out); int syncop_truncate(xlator_t *subvol, loc_t *loc, off_t offset, dict_t *xdata_in, @@ -514,8 +513,8 @@ syncop_rmdir(xlator_t *subvol, loc_t *loc, int flags, dict_t *xdata_in, dict_t **xdata_out); int -syncop_fsync(xlator_t *subvol, fd_t *fd, int dataonly, struct iatt *preiatt, - struct iatt *postiatt, dict_t *xdata_in, dict_t **xdata_out); +syncop_fsync(xlator_t *subvol, fd_t *fd, int dataonly, dict_t *xdata_in, + dict_t **xdata_out); int syncop_flush(xlator_t *subvol, fd_t *fd, dict_t *xdata_in, dict_t **xdata_out); diff --git a/tests/basic/gfapi/mandatory-lock-optimal.c b/tests/basic/gfapi/mandatory-lock-optimal.c index 34fef8d0b80..ceffe523f45 100644 --- a/tests/basic/gfapi/mandatory-lock-optimal.c +++ b/tests/basic/gfapi/mandatory-lock-optimal.c @@ -388,7 +388,7 @@ run_test_7(int i) if (!fd2) LOG_ERR("glfs_open", errno); - ret = glfs_ftruncate(fd2, 4, NULL, NULL); + ret = glfs_ftruncate(fd2, 4); if (ret == 0 || errno != EAGAIN) LOG_ERR("glfs_ftruncate", errno); diff --git a/tests/basic/gfapi/upcall-cache-invalidate.c b/tests/basic/gfapi/upcall-cache-invalidate.c index 078286a8956..ed871a0b421 100644 --- a/tests/basic/gfapi/upcall-cache-invalidate.c +++ b/tests/basic/gfapi/upcall-cache-invalidate.c @@ -136,7 +136,7 @@ main(int argc, char *argv[]) LOG_ERR("glfs_lseek", ret); memset(readbuf, 0, sizeof(readbuf)); - ret = glfs_pread(fd_tmp2, readbuf, 4, 0, 0, NULL); + ret = glfs_pread(fd_tmp2, readbuf, 4, 0, 0); if (ret <= 0) { ret = -1; diff --git a/tests/basic/gfapi/upcall-register-api.c b/tests/basic/gfapi/upcall-register-api.c index 78594dbb108..5127cea5b3f 100644 --- a/tests/basic/gfapi/upcall-register-api.c +++ b/tests/basic/gfapi/upcall-register-api.c @@ -120,7 +120,7 @@ perform_io(glfs_t *fs, glfs_t *fs2, int cnt) LOG_ERR("glfs_lseek", ret); memset(readbuf, 0, sizeof(readbuf)); - ret = glfs_pread(fd_tmp2, readbuf, 4, 0, 0, NULL); + ret = glfs_pread(fd_tmp2, readbuf, 4, 0, 0); if (ret <= 0) { ret = -1; diff --git a/tests/bugs/io-cache/bug-read-hang.c b/tests/bugs/io-cache/bug-read-hang.c index e1fae97e7e8..982c475f7e7 100644 --- a/tests/bugs/io-cache/bug-read-hang.c +++ b/tests/bugs/io-cache/bug-read-hang.c @@ -103,7 +103,7 @@ main(int argc, char *argv[]) buf = (char *)malloc(5); - ret = glfs_pread(fd, buf, 5, 0, 0, NULL); + ret = glfs_pread(fd, buf, 5, 0, 0); if (ret < 0) { fprintf(stderr, "Read(%s): %d (%s)\n", "test", ret, strerror(errno)); return ret; diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index a477fae8039..f1b9eddf21c 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -134,7 +134,7 @@ __afr_is_sink_zero_filled(xlator_t *this, fd_t *fd, size_t size, off_t offset, priv = this->private; ret = syncop_readv(priv->children[sink], fd, size, offset, 0, &iovec, - &count, &iobref, NULL, NULL, NULL); + &count, &iobref, NULL, NULL); if (ret < 0) goto out; ret = iov_0filled(iovec, count); @@ -164,7 +164,7 @@ __afr_selfheal_data_read_write(call_frame_t *frame, xlator_t *this, fd_t *fd, priv = this->private; ret = syncop_readv(priv->children[source], fd, size, offset, 0, &iovec, - &count, &iobref, NULL, NULL, NULL); + &count, &iobref, NULL, NULL); if (ret <= 0) return ret; @@ -212,7 +212,7 @@ __afr_selfheal_data_read_write(call_frame_t *frame, xlator_t *this, fd_t *fd, } ret = syncop_writev(priv->children[i], fd, iovec, count, offset, iobref, - 0, NULL, NULL, NULL, NULL); + 0, NULL, NULL); if (ret != iov_length(iovec, count)) { /* write() failed on this sink. unset the corresponding member in sinks[] (which is healed_sinks[] in the diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 7a2539dc5f5..a00200f0ca3 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -835,7 +835,7 @@ __dht_rebalance_create_dst_file(xlator_t *this, xlator_t *to, xlator_t *from, /* fallocate does not release the space * in some cases */ - ret2 = syncop_ftruncate(to, fd, 0, NULL, NULL, NULL, NULL); + ret2 = syncop_ftruncate(to, fd, 0, NULL, NULL); if (ret2 < 0) { gf_msg(this->name, GF_LOG_WARNING, -ret2, DHT_MSG_MIGRATE_FILE_FAILED, @@ -849,8 +849,7 @@ __dht_rebalance_create_dst_file(xlator_t *this, xlator_t *to, xlator_t *from, } if (!conf->use_fallocate) { - ret = syncop_ftruncate(to, fd, stbuf->ia_size, NULL, NULL, NULL, - NULL); + ret = syncop_ftruncate(to, fd, stbuf->ia_size, NULL, NULL); if (ret < 0) { *fop_errno = -ret; gf_msg(this->name, GF_LOG_WARNING, -ret, @@ -1118,7 +1117,7 @@ __dht_rebalance_migrate_data(xlator_t *this, gf_defrag_info_t *defrag, : (ia_size - total)); ret = syncop_readv(from, src, read_size, offset, 0, &vector, &count, - &iobref, NULL, NULL, NULL); + &iobref, NULL, NULL); if (!ret || (ret < 0)) { *fop_errno = -ret; break; @@ -1158,8 +1157,8 @@ __dht_rebalance_migrate_data(xlator_t *this, gf_defrag_info_t *defrag, } } - ret = syncop_writev(to, dst, vector, count, offset, iobref, 0, NULL, - NULL, xdata, NULL); + ret = syncop_writev(to, dst, vector, count, offset, iobref, 0, + xdata, NULL); if (ret < 0) { *fop_errno = -ret; } @@ -1758,7 +1757,7 @@ dht_migrate_file(xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to, goto out; } - ret = syncop_ftruncate(to, dst_fd, 0, NULL, NULL, NULL, NULL); + ret = syncop_ftruncate(to, dst_fd, 0, NULL, NULL); if (ret) { gf_log(this->name, GF_LOG_WARNING, "%s: failed to perform truncate on %s (%s)", loc->path, @@ -1883,7 +1882,7 @@ dht_migrate_file(xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to, /* TODO: Sync the locks */ - ret = syncop_fsync(to, dst_fd, 0, NULL, NULL, NULL, NULL); + ret = syncop_fsync(to, dst_fd, 0, NULL, NULL); if (ret) { gf_log(this->name, GF_LOG_WARNING, "%s: failed to fsync on %s (%s)", loc->path, to->name, strerror(-ret)); @@ -2170,7 +2169,7 @@ dht_migrate_file(xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to, /* Free up the data blocks on the source node, as the whole file is migrated */ - ret = syncop_ftruncate(from, src_fd, 0, NULL, NULL, NULL, NULL); + ret = syncop_ftruncate(from, src_fd, 0, NULL, NULL); if (ret) { gf_log(this->name, GF_LOG_WARNING, "%s: failed to perform truncate on %s (%s)", loc->path, @@ -2292,7 +2291,7 @@ out: /* reset the destination back to 0 */ if (clean_dst) { - lk_ret = syncop_ftruncate(to, dst_fd, 0, NULL, NULL, NULL, NULL); + lk_ret = syncop_ftruncate(to, dst_fd, 0, NULL, NULL); if (lk_ret) { gf_msg(this->name, GF_LOG_ERROR, -lk_ret, DHT_MSG_MIGRATE_FILE_FAILED, diff --git a/xlators/experimental/fdl/src/gen_recon.py b/xlators/experimental/fdl/src/gen_recon.py index 0766f61320a..4b695d2e770 100755 --- a/xlators/experimental/fdl/src/gen_recon.py +++ b/xlators/experimental/fdl/src/gen_recon.py @@ -142,7 +142,7 @@ def get_special_subs (name, args, fop_type): # is not stored in or read from the journal. There are other ways to # do that, but this is the only place we need anything similar and we # already have to treat it as a special case so this is simplest. - s_args_str = 'fd, &vector, 1, off, iobref, flags, &preop, &postop, xdata' + s_args_str = 'fd, &vector, 1, off, iobref, flags, xdata' elif name == 'symlink': # Swap 'linkpath' and 'loc'. s_args_str = '&loc, linkpath, &iatt, xdata' diff --git a/xlators/experimental/jbr-server/src/jbr.c b/xlators/experimental/jbr-server/src/jbr.c index 49d7eb467f7..0d42740e504 100644 --- a/xlators/experimental/jbr-server/src/jbr.c +++ b/xlators/experimental/jbr-server/src/jbr.c @@ -902,8 +902,7 @@ jbr_flush_thread(void *ctx) list_for_each_entry_safe(fd_ctx, fd_tmp, &dirty_fds, fd_list) { - ret = syncop_fsync(FIRST_CHILD(this), fd_ctx->fd, 0, NULL, NULL, - NULL, NULL); + ret = syncop_fsync(FIRST_CHILD(this), fd_ctx->fd, 0, NULL, NULL); if (ret) { gf_msg(this->name, GF_LOG_WARNING, 0, J_MSG_SYS_CALL_FAILURE, "failed to fsync %p (%d)", fd_ctx->fd, -ret); diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c index 75fa0490c90..40932268c9b 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot.c @@ -296,7 +296,7 @@ br_object_read_block_and_sign(xlator_t *this, fd_t *fd, br_child_t *child, tbf = priv->tbf; ret = syncop_readv(child->xl, fd, size, offset, 0, &iovec, &count, &iobref, - NULL, NULL, NULL); + NULL, NULL); if (ret < 0) { gf_msg(this->name, GF_LOG_ERROR, errno, BRB_MSG_READV_FAILED, diff --git a/xlators/features/cloudsync/src/cloudsync.c b/xlators/features/cloudsync/src/cloudsync.c index 00437aaf80c..cb2cefa4d01 100644 --- a/xlators/features/cloudsync/src/cloudsync.c +++ b/xlators/features/cloudsync/src/cloudsync.c @@ -915,8 +915,7 @@ cs_download_task(void *arg) local->remotepath); /*using dlfd as it is anonymous and have RDWR flag*/ - ret = syncop_ftruncate(FIRST_CHILD(this), local->dlfd, 0, NULL, NULL, - NULL, NULL); + ret = syncop_ftruncate(FIRST_CHILD(this), local->dlfd, 0, NULL, NULL); if (ret) { gf_msg(this->name, GF_LOG_ERROR, 0, -ret, "ftruncate failed"); } else { diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c index b00a1222026..266a02c8c60 100644 --- a/xlators/features/snapview-server/src/snapview-server.c +++ b/xlators/features/snapview-server/src/snapview-server.c @@ -2255,7 +2255,7 @@ svs_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, goto out; } - ret = glfs_pread(glfd, iobuf->ptr, size, offset, 0, &fstatbuf); + ret = glfs_pread(glfd, iobuf->ptr, size, offset, 0); if (ret < 0) { op_ret = -1; op_errno = errno; @@ -2270,6 +2270,18 @@ svs_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, iobref = iobref_new(); iobref_add(iobref, iobuf); + + ret = glfs_fstat(glfd, &fstatbuf); + if (ret) { + op_ret = -1; + op_errno = errno; + gf_log(this->name, GF_LOG_ERROR, + "glfs_fstat failed after " + "readv on %s", + uuid_utoa(fd->inode->gfid)); + goto out; + } + iatt_from_stat(&stbuf, &fstatbuf); gf_uuid_copy(stbuf.ia_gfid, fd->inode->gfid); svs_fill_ino_from_gfid(&stbuf); diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index e4e64dd4a96..5e208f36175 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -4620,7 +4620,7 @@ fuse_migrate_fd(xlator_t *this, fd_t *basefd, xlator_t *old_subvol, if (IA_ISDIR(oldfd->inode->ia_type)) ret = syncop_fsyncdir(old_subvol, oldfd, 0, NULL, NULL); else - ret = syncop_fsync(old_subvol, oldfd, 0, NULL, NULL, NULL, NULL); + ret = syncop_fsync(old_subvol, oldfd, 0, NULL, NULL); if (ret < 0) { gf_log("glusterfs-fuse", GF_LOG_WARNING, diff --git a/xlators/storage/posix/src/posix-entry-ops.c b/xlators/storage/posix/src/posix-entry-ops.c index 1888de7db9b..0e998b20f9f 100644 --- a/xlators/storage/posix/src/posix-entry-ops.c +++ b/xlators/storage/posix/src/posix-entry-ops.c @@ -2293,8 +2293,8 @@ posix_put(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, goto out; } - op_ret = syncop_writev(this, fd, vector, count, offset, iobref, flags, NULL, - NULL, xdata, NULL); + op_ret = syncop_writev(this, fd, vector, count, offset, iobref, flags, + xdata, NULL); if (op_ret < 0) { op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, errno, P_MSG_WRITE_FAILED, -- cgit