From 0af81cecbd1dab19835395a844437cbae806e825 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 10 Sep 2020 15:33:04 +0530 Subject: [PATCH 01/24] glusterfs.h: add gf_return_t type Change-Id: Iaa236ce1dbce4365e43897101d867098109ce347 Signed-off-by: Amar Tumballi --- libglusterfs/src/glusterfs/glusterfs.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libglusterfs/src/glusterfs/glusterfs.h b/libglusterfs/src/glusterfs/glusterfs.h index e6425618b7..e67fd0cd6c 100644 --- a/libglusterfs/src/glusterfs/glusterfs.h +++ b/libglusterfs/src/glusterfs/glusterfs.h @@ -43,8 +43,11 @@ #define GF_YES 1 #define GF_NO 0 -#define IS_ERROR(ret) ((ret) < 0) -#define IS_SUCCESS(ret) ((ret) >= 0) +typedef struct _gf_return { + int32_t op_ret; +} gf_return_t; +#define IS_ERROR(ret) ((ret.op_ret) < 0) +#define IS_SUCCESS(ret) ((ret.op_ret) >= 0) #ifndef O_LARGEFILE /* savannah bug #20053, patch for compiling on darwin */ @@ -425,7 +428,7 @@ static const char *const FOP_PRI_STRINGS[] = {"HIGH", "NORMAL", "LOW", "LEAST"}; static inline const char * fop_pri_to_string(gf_fop_pri_t pri) { - if (IS_ERROR(pri)) + if (pri < 0) return "UNSPEC"; if (pri >= GF_FOP_PRI_MAX) From 19c4faf167cbc491543a9b74ba44604296ac57c1 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 10 Sep 2020 15:30:33 +0530 Subject: [PATCH 02/24] across: bulk change to change the return value to 'gf_return_t' ``` git grep -l -e 'int32_t[ ]*op_ret' | xargs sed -i -e 's/[u]*int32_t\([ ]*\)op_ret/gf_return_t\1op_ret/g' git grep -l -e 'int[ ]*op_ret' | xargs sed -i -e 's/int\([ ]*\)op_ret/gf_return_t\1op_ret/g' DRY_RUN=1 ./rfc.sh # to run the clang-format on all changed files git commit ``` This patch is not compilable by itself, need to be merged along with other following fixes. Made as a single patch to avoid human check. Change-Id: Ib5e25f1d3fa88077de74a3606d79c61c134f82cf Signed-off-by: Amar Tumballi --- api/src/glfs-fops.c | 24 +- cli/src/cli-rpc-ops.c | 5 +- cli/src/cli-xml-output.c | 61 ++-- cli/src/cli.h | 58 ++-- doc/developer-guide/coding-standard.md | 2 +- extras/create_new_xlator/new-xlator.c.tmpl | 2 +- glusterfsd/src/glusterfsd-mgmt.c | 8 +- heal/src/glfs-heal.c | 8 +- libglusterfs/src/call-stub.c | 185 ++++++------ libglusterfs/src/cluster-syncop.c | 98 +++---- libglusterfs/src/default-args.c | 147 +++++----- libglusterfs/src/gen-defaults.py | 4 +- libglusterfs/src/glusterfs/call-stub.h | 183 ++++++------ libglusterfs/src/glusterfs/cluster-syncop.h | 2 +- libglusterfs/src/glusterfs/default-args.h | 147 +++++----- libglusterfs/src/glusterfs/defaults.h | 264 +++++++++--------- libglusterfs/src/glusterfs/stack.h | 4 +- libglusterfs/src/glusterfs/syncop.h | 8 +- libglusterfs/src/glusterfs/xlator.h | 110 ++++---- libglusterfs/src/inode.c | 2 +- libglusterfs/src/syncop.c | 120 ++++---- rpc/xdr/src/changelog-xdr.x | 4 +- rpc/xdr/src/cli1-xdr.x | 12 +- rpc/xdr/src/glusterd1-xdr.x | 32 +-- rpc/xdr/src/glusterfs3-xdr.x | 92 +++--- rpc/xdr/src/glusterfs4-xdr.x | 46 +-- rpc/xdr/src/portmap-xdr.x | 8 +- rpc/xdr/src/rpc-common-xdr.x | 4 +- xlators/cluster/afr/src/afr-common.c | 80 +++--- xlators/cluster/afr/src/afr-dir-read.c | 6 +- xlators/cluster/afr/src/afr-dir-write.c | 29 +- xlators/cluster/afr/src/afr-inode-read.c | 59 ++-- xlators/cluster/afr/src/afr-inode-write.c | 44 +-- xlators/cluster/afr/src/afr-lk-common.c | 8 +- xlators/cluster/afr/src/afr-open.c | 10 +- .../cluster/afr/src/afr-self-heal-common.c | 9 +- xlators/cluster/afr/src/afr-self-heal-data.c | 7 +- xlators/cluster/afr/src/afr-self-heal.h | 6 +- xlators/cluster/afr/src/afr-self-heald.c | 2 +- xlators/cluster/afr/src/afr-transaction.c | 7 +- xlators/cluster/afr/src/afr.h | 12 +- xlators/cluster/dht/src/dht-common.c | 261 +++++++++-------- xlators/cluster/dht/src/dht-common.h | 119 ++++---- xlators/cluster/dht/src/dht-diskusage.c | 5 +- xlators/cluster/dht/src/dht-helper.c | 10 +- xlators/cluster/dht/src/dht-inode-read.c | 62 ++-- xlators/cluster/dht/src/dht-inode-write.c | 42 +-- xlators/cluster/dht/src/dht-layout.c | 2 +- xlators/cluster/dht/src/dht-linkfile.c | 8 +- xlators/cluster/dht/src/dht-lock.c | 22 +- xlators/cluster/dht/src/dht-lock.h | 4 +- xlators/cluster/dht/src/dht-rebalance.c | 3 +- xlators/cluster/dht/src/dht-rename.c | 57 ++-- xlators/cluster/dht/src/dht-selfheal.c | 33 ++- xlators/cluster/dht/src/nufa.c | 12 +- xlators/cluster/dht/src/switch.c | 10 +- xlators/cluster/ec/src/ec-common.c | 16 +- xlators/cluster/ec/src/ec-common.h | 2 +- xlators/cluster/ec/src/ec-data.c | 3 +- xlators/cluster/ec/src/ec-data.h | 3 +- xlators/cluster/ec/src/ec-dir-read.c | 6 +- xlators/cluster/ec/src/ec-dir-write.c | 60 ++-- xlators/cluster/ec/src/ec-generic.c | 30 +- xlators/cluster/ec/src/ec-heal.c | 14 +- xlators/cluster/ec/src/ec-heald.c | 2 +- xlators/cluster/ec/src/ec-inode-read.c | 41 +-- xlators/cluster/ec/src/ec-inode-write.c | 41 +-- xlators/cluster/ec/src/ec-locks.c | 16 +- xlators/cluster/ec/src/ec-types.h | 2 +- xlators/cluster/ec/src/ec.c | 2 +- xlators/debug/io-stats/src/io-stats.c | 114 ++++---- xlators/debug/trace/src/trace.c | 90 +++--- xlators/features/arbiter/src/arbiter.c | 14 +- xlators/features/barrier/src/barrier.c | 50 ++-- .../bit-rot/src/stub/bit-rot-stub-helpers.c | 4 +- .../features/bit-rot/src/stub/bit-rot-stub.c | 80 +++--- xlators/features/changelog/src/changelog.c | 53 ++-- .../features/cloudsync/src/cloudsync-common.h | 2 +- .../cloudsync/src/cloudsync-fops-c.py | 4 +- .../src/cloudsyncs3/src/libcloudsyncs3.c | 6 +- .../src/cloudsyncs3/src/libcloudsyncs3.h | 6 +- .../cloudsync-plugins/src/cvlt/src/libcvlt.c | 6 +- .../cloudsync-plugins/src/cvlt/src/libcvlt.h | 2 +- xlators/features/cloudsync/src/cloudsync.c | 48 ++-- xlators/features/cloudsync/src/cloudsync.h | 15 +- xlators/features/compress/src/cdc.c | 9 +- .../features/gfid-access/src/gfid-access.c | 20 +- xlators/features/index/src/index.c | 22 +- xlators/features/leases/src/leases.c | 63 +++-- xlators/features/locks/src/common.c | 6 +- xlators/features/locks/src/common.h | 6 +- xlators/features/locks/src/entrylk.c | 4 +- xlators/features/locks/src/inodelk.c | 4 +- xlators/features/locks/src/posix.c | 191 +++++++------ xlators/features/marker/src/marker.c | 66 ++--- .../features/metadisp/src/metadisp-create.c | 6 +- .../features/metadisp/src/metadisp-fsync.c | 2 +- .../features/metadisp/src/metadisp-lookup.c | 6 +- xlators/features/metadisp/src/metadisp-open.c | 2 +- .../features/metadisp/src/metadisp-setattr.c | 4 +- xlators/features/metadisp/src/metadisp-stat.c | 6 +- .../features/metadisp/src/metadisp-unlink.c | 7 +- xlators/features/namespace/src/namespace.c | 2 +- xlators/features/quiesce/src/quiesce.c | 63 +++-- .../quota/src/quota-enforcer-client.c | 2 +- xlators/features/quota/src/quota.c | 81 +++--- xlators/features/quota/src/quota.h | 4 +- xlators/features/quota/src/quotad.c | 6 +- .../features/read-only/src/read-only-common.c | 4 +- xlators/features/read-only/src/worm.c | 2 +- xlators/features/sdfs/src/sdfs.c | 29 +- xlators/features/sdfs/src/sdfs.h | 2 +- xlators/features/selinux/src/selinux.c | 18 +- xlators/features/shard/src/shard.c | 109 ++++---- xlators/features/shard/src/shard.h | 2 +- .../snapview-client/src/snapview-client.c | 81 +++--- .../snapview-server/src/snapview-server.c | 38 +-- .../features/thin-arbiter/src/thin-arbiter.c | 4 +- xlators/features/trash/src/trash.c | 73 ++--- xlators/features/upcall/src/upcall.c | 140 +++++----- .../features/utime/src/utime-gen-fops-c.py | 2 +- xlators/features/utime/src/utime.c | 8 +- xlators/lib/src/libxlator.c | 8 +- xlators/lib/src/libxlator.h | 12 +- xlators/mgmt/glusterd/src/glusterd-handler.c | 20 +- .../mgmt/glusterd/src/glusterd-handshake.c | 2 +- xlators/mgmt/glusterd/src/glusterd-locks.c | 4 +- xlators/mgmt/glusterd/src/glusterd-mgmt.c | 36 +-- xlators/mgmt/glusterd/src/glusterd-mgmt.h | 10 +- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 2 +- xlators/mgmt/glusterd/src/glusterd-op-sm.h | 8 +- .../glusterd/src/glusterd-replace-brick.c | 2 +- xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 22 +- xlators/mgmt/glusterd/src/glusterd-sm.c | 2 +- .../glusterd/src/glusterd-snapshot-utils.c | 2 +- xlators/mgmt/glusterd/src/glusterd-snapshot.c | 14 +- xlators/mgmt/glusterd/src/glusterd-syncop.c | 16 +- xlators/mgmt/glusterd/src/glusterd-utils.c | 6 +- xlators/mgmt/glusterd/src/glusterd.h | 12 +- xlators/mount/fuse/src/fuse-bridge.c | 73 ++--- xlators/mount/fuse/src/fuse-bridge.h | 2 +- xlators/mount/fuse/src/fuse-resolve.c | 4 +- xlators/nfs/server/src/acl3.c | 12 +- xlators/nfs/server/src/mount3.c | 10 +- xlators/nfs/server/src/nfs-fops.c | 55 ++-- xlators/nfs/server/src/nfs-inodes.c | 30 +- xlators/nfs/server/src/nfs.c | 4 +- xlators/nfs/server/src/nfs3-helpers.c | 8 +- xlators/nfs/server/src/nfs3.c | 84 +++--- xlators/nfs/server/src/nlm4.c | 11 +- xlators/performance/io-cache/src/io-cache.c | 42 +-- xlators/performance/io-cache/src/io-cache.h | 10 +- xlators/performance/io-cache/src/page.c | 15 +- .../performance/io-threads/src/io-threads.c | 2 +- xlators/performance/md-cache/src/md-cache.c | 113 ++++---- xlators/performance/nl-cache/src/nl-cache.c | 42 +-- .../performance/open-behind/src/open-behind.c | 6 +- .../performance/quick-read/src/quick-read.c | 29 +- xlators/performance/read-ahead/src/page.c | 11 +- .../performance/read-ahead/src/read-ahead.c | 46 +-- .../performance/read-ahead/src/read-ahead.h | 4 +- .../readdir-ahead/src/readdir-ahead.c | 28 +- .../write-behind/src/write-behind.c | 26 +- xlators/playground/rot-13/src/rot-13.c | 4 +- .../protocol/client/src/client-handshake.c | 2 +- xlators/protocol/client/src/client-rpc-fops.c | 2 +- .../protocol/client/src/client-rpc-fops_v2.c | 2 +- xlators/protocol/client/src/client.c | 2 +- xlators/protocol/server/src/server-common.c | 4 +- xlators/protocol/server/src/server-common.h | 4 +- .../protocol/server/src/server-handshake.c | 2 +- xlators/protocol/server/src/server-helpers.c | 4 +- xlators/protocol/server/src/server-resolve.c | 8 +- xlators/protocol/server/src/server-rpc-fops.c | 114 ++++---- .../protocol/server/src/server-rpc-fops_v2.c | 122 ++++---- xlators/protocol/server/src/server.h | 2 +- xlators/storage/posix/src/posix-aio.c | 4 +- xlators/storage/posix/src/posix-common.c | 2 +- xlators/storage/posix/src/posix-entry-ops.c | 22 +- xlators/storage/posix/src/posix-helpers.c | 4 +- .../storage/posix/src/posix-inode-fd-ops.c | 74 ++--- xlators/storage/posix/src/posix-metadata.c | 4 +- xlators/system/posix-acl/src/posix-acl.c | 30 +- 183 files changed, 2950 insertions(+), 2702 deletions(-) diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index fc2cfa0430..28d29e7921 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -1172,9 +1172,9 @@ struct glfs_io { }; 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) +glfs_io_async_cbk(gf_return_t op_ret, int op_errno, call_frame_t *frame, + void *cookie, struct iovec *iovec, int count, + struct iatt *prebuf, struct iatt *postbuf) { struct glfs_io *gio = NULL; xlator_t *subvol = NULL; @@ -1248,8 +1248,9 @@ glfs_io_async_cbk(int op_ret, int op_errno, call_frame_t *frame, void *cookie, static int 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) + gf_return_t 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); @@ -1795,7 +1796,7 @@ pub_glfs_from_glfd(glfs_fd_t *); static int glfs_pwritev_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t 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, @@ -2109,7 +2110,7 @@ pub_glfs_fsync(struct glfs_fd *glfd, struct glfs_stat *prestat, static int glfs_fsync_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_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, @@ -2462,8 +2463,9 @@ pub_glfs_truncate(struct glfs *fs, const char *path, off_t length) static int 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) + gf_return_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); @@ -3368,7 +3370,7 @@ pub_glfs_seekdir(struct glfs_fd *fd, long offset) static int glfs_discard_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata) { @@ -3475,7 +3477,7 @@ pub_glfs_discard_async(struct glfs_fd *glfd, off_t offset, size_t len, static int glfs_zerofill_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata) { diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 9b6b0c7fa5..8aea473a7b 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -3024,7 +3024,8 @@ gluster_remove_auxiliary_mount(char *volname) static int gf_cli_print_limit_list_from_dict(cli_local_t *local, char *volname, dict_t *dict, char *default_sl, int count, - int op_ret, int op_errno, char *op_errstr) + gf_return_t op_ret, int op_errno, + char *op_errstr) { int ret = -1; int i = 0; @@ -3400,7 +3401,7 @@ cli_quotad_getlimit(call_frame_t *frame, xlator_t *this, void *data) static void gf_cli_quota_list(cli_local_t *local, char *volname, dict_t *dict, - char *default_sl, int count, int op_ret, int op_errno, + char *default_sl, int count, gf_return_t op_ret, int op_errno, char *op_errstr) { if (!cli_cmd_connected()) diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index 069de75801..d1c2ef9c77 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -105,7 +105,7 @@ cli_end_xml_output(xmlTextWriterPtr writer, xmlDocPtr doc) } int -cli_xml_output_common(xmlTextWriterPtr writer, int op_ret, int op_errno, +cli_xml_output_common(xmlTextWriterPtr writer, gf_return_t op_ret, int op_errno, char *op_errstr) { int ret = -1; @@ -134,7 +134,7 @@ cli_xml_output_common(xmlTextWriterPtr writer, int op_ret, int op_errno, #endif int -cli_xml_output_str(char *op, char *str, int op_ret, int op_errno, +cli_xml_output_str(char *op, char *str, gf_return_t op_ret, int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) @@ -191,7 +191,7 @@ cli_xml_output_data_pair(dict_t *this, char *key, data_t *value, void *data) #endif int -cli_xml_output_dict(char *op, dict_t *dict, int op_ret, int op_errno, +cli_xml_output_dict(char *op, dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) @@ -1307,8 +1307,8 @@ cli_xml_output_vol_status_callpool(xmlTextWriterPtr writer, dict_t *dict, #endif int -cli_xml_output_vol_status_begin(cli_local_t *local, int op_ret, int op_errno, - char *op_errstr) +cli_xml_output_vol_status_begin(cli_local_t *local, gf_return_t op_ret, + int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) int ret = -1; @@ -1757,7 +1757,8 @@ cli_xml_output_vol_top_other(xmlTextWriterPtr writer, dict_t *dict, #endif int -cli_xml_output_vol_top(dict_t *dict, int op_ret, int op_errno, char *op_errstr) +cli_xml_output_vol_top(dict_t *dict, gf_return_t op_ret, int op_errno, + char *op_errstr) { #if (HAVE_LIB_XML) int ret = -1; @@ -2123,7 +2124,7 @@ cli_xml_output_vol_profile_stats(xmlTextWriterPtr writer, dict_t *dict, #endif int -cli_xml_output_vol_profile(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_profile(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) @@ -2247,7 +2248,8 @@ cli_xml_output_vol_profile(dict_t *dict, int op_ret, int op_errno, } int -cli_xml_output_vol_list(dict_t *dict, int op_ret, int op_errno, char *op_errstr) +cli_xml_output_vol_list(dict_t *dict, gf_return_t op_ret, int op_errno, + char *op_errstr) { #if (HAVE_LIB_XML) int ret = -1; @@ -2651,8 +2653,8 @@ cli_xml_output_vol_info(cli_local_t *local, dict_t *dict) } int -cli_xml_output_vol_info_begin(cli_local_t *local, int op_ret, int op_errno, - char *op_errstr) +cli_xml_output_vol_info_begin(cli_local_t *local, gf_return_t op_ret, + int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) int ret = -1; @@ -2734,8 +2736,9 @@ cli_xml_output_vol_quota_limit_list_end(cli_local_t *local) } int -cli_xml_output_vol_quota_limit_list_begin(cli_local_t *local, int op_ret, - int op_errno, char *op_errstr) +cli_xml_output_vol_quota_limit_list_begin(cli_local_t *local, + gf_return_t op_ret, int op_errno, + char *op_errstr) { #if (HAVE_LIB_XML) int ret = -1; @@ -2799,7 +2802,7 @@ cli_xml_output_peer_hostnames(xmlTextWriterPtr writer, dict_t *dict, #endif int -cli_xml_output_peer_status(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_peer_status(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) @@ -3152,8 +3155,8 @@ cli_xml_output_vol_rebalance_status(xmlTextWriterPtr writer, dict_t *dict, #endif int -cli_xml_output_vol_rebalance(gf_cli_defrag_type op, dict_t *dict, int op_ret, - int op_errno, char *op_errstr) +cli_xml_output_vol_rebalance(gf_cli_defrag_type op, dict_t *dict, + gf_return_t op_ret, int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) int ret = -1; @@ -3206,8 +3209,8 @@ cli_xml_output_vol_rebalance(gf_cli_defrag_type op, dict_t *dict, int op_ret, int cli_xml_output_vol_remove_brick(gf_boolean_t status_op, dict_t *dict, - int op_ret, int op_errno, char *op_errstr, - const char *op) + gf_return_t op_ret, int op_errno, + char *op_errstr, const char *op) { #if (HAVE_LIB_XML) int ret = -1; @@ -3254,7 +3257,7 @@ cli_xml_output_vol_remove_brick(gf_boolean_t status_op, dict_t *dict, } int -cli_xml_output_vol_replace_brick(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_replace_brick(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) @@ -3281,7 +3284,7 @@ cli_xml_output_vol_replace_brick(dict_t *dict, int op_ret, int op_errno, } int -cli_xml_output_vol_create(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_create(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) @@ -3342,8 +3345,8 @@ cli_xml_output_vol_create(dict_t *dict, int op_ret, int op_errno, } int -cli_xml_output_generic_volume(char *op, dict_t *dict, int op_ret, int op_errno, - char *op_errstr) +cli_xml_output_generic_volume(char *op, dict_t *dict, gf_return_t op_ret, + int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) int ret = -1; @@ -3740,7 +3743,7 @@ cli_xml_output_vol_gsync_status(dict_t *dict, xmlTextWriterPtr writer) #endif int -cli_xml_output_vol_gsync(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_gsync(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) @@ -5228,8 +5231,8 @@ cli_xml_snapshot_delete(cli_local_t *local, dict_t *dict, gf_cli_rsp *rsp) } int -cli_xml_output_snap_status_begin(cli_local_t *local, int op_ret, int op_errno, - char *op_errstr) +cli_xml_output_snap_status_begin(cli_local_t *local, gf_return_t op_ret, + int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) int ret = -1; @@ -5284,8 +5287,8 @@ cli_xml_output_snap_status_end(cli_local_t *local) } int -cli_xml_output_snap_delete_begin(cli_local_t *local, int op_ret, int op_errno, - char *op_errstr) +cli_xml_output_snap_delete_begin(cli_local_t *local, gf_return_t op_ret, + int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) int ret = -1; @@ -5356,8 +5359,8 @@ cli_xml_output_snap_delete_end(cli_local_t *local) * @return 0 on success and -1 on failure */ int -cli_xml_output_snapshot(int cmd_type, dict_t *dict, int op_ret, int op_errno, - char *op_errstr) +cli_xml_output_snapshot(int cmd_type, dict_t *dict, gf_return_t op_ret, + int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) int ret = -1; @@ -5597,7 +5600,7 @@ cli_xml_snapshot_status_single_snap(cli_local_t *local, dict_t *dict, char *key) } int -cli_xml_output_vol_getopts(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_getopts(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr) { #if (HAVE_LIB_XML) diff --git a/cli/src/cli.h b/cli/src/cli.h index c0d933e8f8..c86013afa3 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -382,23 +382,24 @@ void cli_print_line(int len); int -cli_xml_output_str(char *op, char *str, int op_ret, int op_errno, +cli_xml_output_str(char *op, char *str, gf_return_t op_ret, int op_errno, char *op_errstr); int -cli_xml_output_dict(char *op, dict_t *dict, int op_ret, int op_errno, +cli_xml_output_dict(char *op, dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr); int -cli_xml_output_vol_top(dict_t *dict, int op_ret, int op_errno, char *op_errstr); +cli_xml_output_vol_top(dict_t *dict, gf_return_t op_ret, int op_errno, + char *op_errstr); int -cli_xml_output_vol_profile(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_profile(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr); int -cli_xml_output_vol_status_begin(cli_local_t *local, int op_ret, int op_errno, - char *op_errstr); +cli_xml_output_vol_status_begin(cli_local_t *local, gf_return_t op_ret, + int op_errno, char *op_errstr); int cli_xml_output_vol_status_end(cli_local_t *local); @@ -407,12 +408,12 @@ int cli_xml_output_vol_status(cli_local_t *local, dict_t *dict); int -cli_xml_output_vol_list(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_list(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr); int -cli_xml_output_vol_info_begin(cli_local_t *local, int op_ret, int op_errno, - char *op_errstr); +cli_xml_output_vol_info_begin(cli_local_t *local, gf_return_t op_ret, + int op_errno, char *op_errstr); int cli_xml_output_vol_info_end(cli_local_t *local); @@ -421,8 +422,9 @@ int cli_xml_output_vol_info(cli_local_t *local, dict_t *dict); int -cli_xml_output_vol_quota_limit_list_begin(cli_local_t *local, int op_ret, - int op_errno, char *op_errstr); +cli_xml_output_vol_quota_limit_list_begin(cli_local_t *local, + gf_return_t op_ret, int op_errno, + char *op_errstr); int cli_xml_output_vol_quota_limit_list_end(cli_local_t *local); @@ -441,32 +443,32 @@ cli_quota_object_xml_output(cli_local_t *local, char *path, char *sl_str, char *hl, gf_boolean_t limit_set); int -cli_xml_output_peer_status(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_peer_status(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr); int -cli_xml_output_vol_rebalance(gf_cli_defrag_type op, dict_t *dict, int op_ret, - int op_errno, char *op_errstr); +cli_xml_output_vol_rebalance(gf_cli_defrag_type op, dict_t *dict, + gf_return_t op_ret, int op_errno, char *op_errstr); int cli_xml_output_vol_remove_brick(gf_boolean_t status_op, dict_t *dict, - int op_ret, int op_errno, char *op_errstr, - const char *op); + gf_return_t op_ret, int op_errno, + char *op_errstr, const char *op); int -cli_xml_output_vol_replace_brick(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_replace_brick(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr); int -cli_xml_output_vol_create(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_create(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr); int -cli_xml_output_generic_volume(char *op, dict_t *dict, int op_ret, int op_errno, - char *op_errstr); +cli_xml_output_generic_volume(char *op, dict_t *dict, gf_return_t op_ret, + int op_errno, char *op_errstr); int -cli_xml_output_vol_gsync(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_gsync(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr); int cli_xml_output_vol_status_tasks_detail(cli_local_t *local, dict_t *dict); @@ -481,19 +483,19 @@ int cli_xml_snapshot_end_composite_op(cli_local_t *local); int -cli_xml_output_snap_delete_begin(cli_local_t *local, int op_ret, int op_errno, - char *op_errstr); +cli_xml_output_snap_delete_begin(cli_local_t *local, gf_return_t op_ret, + int op_errno, char *op_errstr); int cli_xml_output_snap_delete_end(cli_local_t *local); int -cli_xml_output_snap_status_begin(cli_local_t *local, int op_ret, int op_errno, - char *op_errstr); +cli_xml_output_snap_status_begin(cli_local_t *local, gf_return_t op_ret, + int op_errno, char *op_errstr); int cli_xml_output_snap_status_end(cli_local_t *local); int -cli_xml_output_snapshot(int cmd_type, dict_t *dict, int op_ret, int op_errno, - char *op_errstr); +cli_xml_output_snapshot(int cmd_type, dict_t *dict, gf_return_t op_ret, + int op_errno, char *op_errstr); int cli_xml_snapshot_status_single_snap(cli_local_t *local, dict_t *dict, char *key); @@ -502,7 +504,7 @@ cli_cmd_snapshot_parse(const char **words, int wordcount, dict_t **options, struct cli_state *state); int -cli_xml_output_vol_getopts(dict_t *dict, int op_ret, int op_errno, +cli_xml_output_vol_getopts(dict_t *dict, gf_return_t op_ret, int op_errno, char *op_errstr); void diff --git a/doc/developer-guide/coding-standard.md b/doc/developer-guide/coding-standard.md index 031c6c0da9..64ac429471 100644 --- a/doc/developer-guide/coding-standard.md +++ b/doc/developer-guide/coding-standard.md @@ -643,7 +643,7 @@ int32_t sample_fop (call_frame_t *frame, xlator_t *this, ...) { char * var1 = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; DIR * dir = NULL; struct posix_fd * pfd = NULL; diff --git a/extras/create_new_xlator/new-xlator.c.tmpl b/extras/create_new_xlator/new-xlator.c.tmpl index fe9735bfcf..69470fa65b 100644 --- a/extras/create_new_xlator/new-xlator.c.tmpl +++ b/extras/create_new_xlator/new-xlator.c.tmpl @@ -1,5 +1,5 @@ #pragma fragment CBK_TEMPLATE -int32_t @FOP_PREFIX@_@NAME@_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, +int32_t @FOP_PREFIX@_@NAME@_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, @UNWIND_PARAMS@) { STACK_UNWIND_STRICT(@NAME@, frame, op_ret, op_errno, @UNWIND_ARGS@); diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index eaf6796e4c..a4fc750a17 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -275,7 +275,7 @@ glusterfs_submit_reply(rpcsvc_request_t *req, void *arg, struct iovec *payload, } int -glusterfs_terminate_response_send(rpcsvc_request_t *req, int op_ret) +glusterfs_terminate_response_send(rpcsvc_request_t *req, gf_return_t op_ret) { gd1_mgmt_brick_op_rsp rsp = { 0, @@ -436,8 +436,8 @@ glusterfs_translator_info_response_send(rpcsvc_request_t *req, int ret, } int -glusterfs_xlator_op_response_send(rpcsvc_request_t *req, int op_ret, char *msg, - dict_t *output) +glusterfs_xlator_op_response_send(rpcsvc_request_t *req, gf_return_t op_ret, + char *msg, dict_t *output) { gd1_mgmt_brick_op_rsp rsp = { 0, @@ -715,7 +715,7 @@ int glusterfs_handle_translator_op(rpcsvc_request_t *req) { int32_t ret = -1; - int32_t op_ret = 0; + gf_return_t op_ret = 0; gd1_mgmt_brick_op_req xlator_req = { 0, }; diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c index bf4b47f876..0b9d8bd601 100644 --- a/heal/src/glfs-heal.c +++ b/heal/src/glfs-heal.c @@ -62,7 +62,7 @@ typedef struct glfs_info { int (*print_heal_op_summary)(int ret, num_entries_t *num_entries); int (*print_heal_status)(char *path, uuid_t gfid, char *status); int (*print_spb_status)(char *path, uuid_t gfid, char *status); - int (*end)(int op_ret, char *op_errstr); + int (*end)(gf_return_t op_ret, char *op_errstr); } glfsh_info_t; glfsh_info_t *glfsh_output = NULL; @@ -88,7 +88,7 @@ glfsh_init() } int -glfsh_end_op_granular_entry_heal(int op_ret, char *op_errstr) +glfsh_end_op_granular_entry_heal(gf_return_t op_ret, char *op_errstr) { /* If error string is available, give it higher precedence.*/ @@ -116,7 +116,7 @@ glfsh_end_op_granular_entry_heal(int op_ret, char *op_errstr) } int -glfsh_end(int op_ret, char *op_errstr) +glfsh_end(gf_return_t op_ret, char *op_errstr) { if (op_errstr) printf("%s\n", op_errstr); @@ -175,7 +175,7 @@ glfsh_xml_init() } int -glfsh_xml_end(int op_ret, char *op_errstr) +glfsh_xml_end(gf_return_t op_ret, char *op_errstr) { int ret = -1; int op_errno = 0; diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c index ee84f08acd..a097c2a0c4 100644 --- a/libglusterfs/src/call-stub.c +++ b/libglusterfs/src/call-stub.c @@ -53,9 +53,9 @@ fop_lookup_stub(call_frame_t *frame, fop_lookup_t fn, loc_t *loc, dict_t *xdata) } call_stub_t * -fop_lookup_cbk_stub(call_frame_t *frame, fop_lookup_cbk_t fn, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - dict_t *xdata, struct iatt *postparent) +fop_lookup_cbk_stub(call_frame_t *frame, fop_lookup_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { call_stub_t *stub = NULL; @@ -86,7 +86,7 @@ fop_stat_stub(call_frame_t *frame, fop_stat_t fn, loc_t *loc, dict_t *xdata) } call_stub_t * -fop_stat_cbk_stub(call_frame_t *frame, fop_stat_cbk_t fn, int32_t op_ret, +fop_stat_cbk_stub(call_frame_t *frame, fop_stat_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -115,7 +115,7 @@ fop_fstat_stub(call_frame_t *frame, fop_fstat_t fn, fd_t *fd, dict_t *xdata) } call_stub_t * -fop_fstat_cbk_stub(call_frame_t *frame, fop_fstat_cbk_t fn, int32_t op_ret, +fop_fstat_cbk_stub(call_frame_t *frame, fop_fstat_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -148,7 +148,7 @@ fop_truncate_stub(call_frame_t *frame, fop_truncate_t fn, loc_t *loc, off_t off, call_stub_t * fop_truncate_cbk_stub(call_frame_t *frame, fop_truncate_cbk_t fn, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -181,8 +181,8 @@ fop_ftruncate_stub(call_frame_t *frame, fop_ftruncate_t fn, fd_t *fd, off_t off, call_stub_t * fop_ftruncate_cbk_stub(call_frame_t *frame, fop_ftruncate_cbk_t fn, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, - struct iatt *postbuf, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -215,8 +215,8 @@ fop_access_stub(call_frame_t *frame, fop_access_t fn, loc_t *loc, int32_t mask, } call_stub_t * -fop_access_cbk_stub(call_frame_t *frame, fop_access_cbk_t fn, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +fop_access_cbk_stub(call_frame_t *frame, fop_access_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -248,7 +248,7 @@ fop_readlink_stub(call_frame_t *frame, fop_readlink_t fn, loc_t *loc, call_stub_t * fop_readlink_cbk_stub(call_frame_t *frame, fop_readlink_cbk_t fn, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *stbuf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -281,7 +281,7 @@ fop_mknod_stub(call_frame_t *frame, fop_mknod_t fn, loc_t *loc, mode_t mode, } call_stub_t * -fop_mknod_cbk_stub(call_frame_t *frame, fop_mknod_cbk_t fn, int32_t op_ret, +fop_mknod_cbk_stub(call_frame_t *frame, fop_mknod_cbk_t fn, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) @@ -316,7 +316,7 @@ fop_mkdir_stub(call_frame_t *frame, fop_mkdir_t fn, loc_t *loc, mode_t mode, } call_stub_t * -fop_mkdir_cbk_stub(call_frame_t *frame, fop_mkdir_cbk_t fn, int32_t op_ret, +fop_mkdir_cbk_stub(call_frame_t *frame, fop_mkdir_cbk_t fn, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) @@ -352,9 +352,10 @@ fop_unlink_stub(call_frame_t *frame, fop_unlink_t fn, loc_t *loc, int xflag, } call_stub_t * -fop_unlink_cbk_stub(call_frame_t *frame, fop_unlink_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) +fop_unlink_cbk_stub(call_frame_t *frame, fop_unlink_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { call_stub_t *stub = NULL; @@ -387,7 +388,7 @@ fop_rmdir_stub(call_frame_t *frame, fop_rmdir_t fn, loc_t *loc, int flags, } call_stub_t * -fop_rmdir_cbk_stub(call_frame_t *frame, fop_rmdir_cbk_t fn, int32_t op_ret, +fop_rmdir_cbk_stub(call_frame_t *frame, fop_rmdir_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -422,10 +423,10 @@ fop_symlink_stub(call_frame_t *frame, fop_symlink_t fn, const char *linkname, } call_stub_t * -fop_symlink_cbk_stub(call_frame_t *frame, fop_symlink_cbk_t fn, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +fop_symlink_cbk_stub(call_frame_t *frame, fop_symlink_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { call_stub_t *stub = NULL; @@ -458,8 +459,8 @@ fop_rename_stub(call_frame_t *frame, fop_rename_t fn, loc_t *oldloc, } call_stub_t * -fop_rename_cbk_stub(call_frame_t *frame, fop_rename_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *buf, +fop_rename_cbk_stub(call_frame_t *frame, fop_rename_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -495,7 +496,7 @@ fop_link_stub(call_frame_t *frame, fop_link_t fn, loc_t *oldloc, loc_t *newloc, } call_stub_t * -fop_link_cbk_stub(call_frame_t *frame, fop_link_cbk_t fn, int32_t op_ret, +fop_link_cbk_stub(call_frame_t *frame, fop_link_cbk_t fn, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) @@ -530,9 +531,9 @@ fop_create_stub(call_frame_t *frame, fop_create_t fn, loc_t *loc, int32_t flags, } call_stub_t * -fop_create_cbk_stub(call_frame_t *frame, fop_create_cbk_t fn, int32_t op_ret, - int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, +fop_create_cbk_stub(call_frame_t *frame, fop_create_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { call_stub_t *stub = NULL; @@ -565,7 +566,7 @@ fop_open_stub(call_frame_t *frame, fop_open_t fn, loc_t *loc, int32_t flags, } call_stub_t * -fop_open_cbk_stub(call_frame_t *frame, fop_open_cbk_t fn, int32_t op_ret, +fop_open_cbk_stub(call_frame_t *frame, fop_open_cbk_t fn, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { call_stub_t *stub = NULL; @@ -595,7 +596,7 @@ fop_readv_stub(call_frame_t *frame, fop_readv_t fn, fd_t *fd, size_t size, } call_stub_t * -fop_readv_cbk_stub(call_frame_t *frame, fop_readv_cbk_t fn, int32_t op_ret, +fop_readv_cbk_stub(call_frame_t *frame, fop_readv_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -631,9 +632,9 @@ fop_writev_stub(call_frame_t *frame, fop_writev_t fn, fd_t *fd, } call_stub_t * -fop_writev_cbk_stub(call_frame_t *frame, fop_writev_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, - dict_t *xdata) +fop_writev_cbk_stub(call_frame_t *frame, fop_writev_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -662,7 +663,7 @@ fop_flush_stub(call_frame_t *frame, fop_flush_t fn, fd_t *fd, dict_t *xdata) } call_stub_t * -fop_flush_cbk_stub(call_frame_t *frame, fop_flush_cbk_t fn, int32_t op_ret, +fop_flush_cbk_stub(call_frame_t *frame, fop_flush_cbk_t fn, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -692,7 +693,7 @@ fop_fsync_stub(call_frame_t *frame, fop_fsync_t fn, fd_t *fd, int32_t datasync, } call_stub_t * -fop_fsync_cbk_stub(call_frame_t *frame, fop_fsync_cbk_t fn, int32_t op_ret, +fop_fsync_cbk_stub(call_frame_t *frame, fop_fsync_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { @@ -726,8 +727,9 @@ fop_opendir_stub(call_frame_t *frame, fop_opendir_t fn, loc_t *loc, fd_t *fd, } call_stub_t * -fop_opendir_cbk_stub(call_frame_t *frame, fop_opendir_cbk_t fn, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +fop_opendir_cbk_stub(call_frame_t *frame, fop_opendir_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { call_stub_t *stub = NULL; @@ -757,7 +759,7 @@ fop_fsyncdir_stub(call_frame_t *frame, fop_fsyncdir_t fn, fd_t *fd, call_stub_t * fop_fsyncdir_cbk_stub(call_frame_t *frame, fop_fsyncdir_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -787,8 +789,9 @@ fop_statfs_stub(call_frame_t *frame, fop_statfs_t fn, loc_t *loc, dict_t *xdata) } call_stub_t * -fop_statfs_cbk_stub(call_frame_t *frame, fop_statfs_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct statvfs *buf, dict_t *xdata) +fop_statfs_cbk_stub(call_frame_t *frame, fop_statfs_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, + dict_t *xdata) { call_stub_t *stub = NULL; @@ -820,7 +823,7 @@ fop_setxattr_stub(call_frame_t *frame, fop_setxattr_t fn, loc_t *loc, call_stub_t * fop_setxattr_cbk_stub(call_frame_t *frame, fop_setxattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -852,7 +855,7 @@ fop_getxattr_stub(call_frame_t *frame, fop_getxattr_t fn, loc_t *loc, call_stub_t * fop_getxattr_cbk_stub(call_frame_t *frame, fop_getxattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { call_stub_t *stub = NULL; @@ -885,7 +888,7 @@ fop_fsetxattr_stub(call_frame_t *frame, fop_fsetxattr_t fn, fd_t *fd, call_stub_t * fop_fsetxattr_cbk_stub(call_frame_t *frame, fop_fsetxattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -917,7 +920,7 @@ fop_fgetxattr_stub(call_frame_t *frame, fop_fgetxattr_t fn, fd_t *fd, call_stub_t * fop_fgetxattr_cbk_stub(call_frame_t *frame, fop_fgetxattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { call_stub_t *stub = NULL; @@ -951,7 +954,7 @@ fop_removexattr_stub(call_frame_t *frame, fop_removexattr_t fn, loc_t *loc, call_stub_t * fop_removexattr_cbk_stub(call_frame_t *frame, fop_removexattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -984,7 +987,7 @@ fop_fremovexattr_stub(call_frame_t *frame, fop_fremovexattr_t fn, fd_t *fd, call_stub_t * fop_fremovexattr_cbk_stub(call_frame_t *frame, fop_fremovexattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1015,7 +1018,7 @@ fop_lk_stub(call_frame_t *frame, fop_lk_t fn, fd_t *fd, int32_t cmd, } call_stub_t * -fop_lk_cbk_stub(call_frame_t *frame, fop_lk_cbk_t fn, int32_t op_ret, +fop_lk_cbk_stub(call_frame_t *frame, fop_lk_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1047,8 +1050,8 @@ fop_inodelk_stub(call_frame_t *frame, fop_inodelk_t fn, const char *volume, } call_stub_t * -fop_inodelk_cbk_stub(call_frame_t *frame, fop_inodelk_cbk_t fn, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +fop_inodelk_cbk_stub(call_frame_t *frame, fop_inodelk_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1080,8 +1083,8 @@ fop_finodelk_stub(call_frame_t *frame, fop_finodelk_t fn, const char *volume, } call_stub_t * -fop_finodelk_cbk_stub(call_frame_t *frame, fop_inodelk_cbk_t fn, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +fop_finodelk_cbk_stub(call_frame_t *frame, fop_inodelk_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1112,8 +1115,8 @@ fop_entrylk_stub(call_frame_t *frame, fop_entrylk_t fn, const char *volume, } call_stub_t * -fop_entrylk_cbk_stub(call_frame_t *frame, fop_entrylk_cbk_t fn, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +fop_entrylk_cbk_stub(call_frame_t *frame, fop_entrylk_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1144,7 +1147,7 @@ fop_fentrylk_stub(call_frame_t *frame, fop_fentrylk_t fn, const char *volume, call_stub_t * fop_fentrylk_cbk_stub(call_frame_t *frame, fop_fentrylk_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1159,8 +1162,8 @@ fop_fentrylk_cbk_stub(call_frame_t *frame, fop_fentrylk_cbk_t fn, call_stub_t * fop_readdirp_cbk_stub(call_frame_t *frame, fop_readdirp_cbk_t fn, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + gf_dirent_t *entries, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1174,8 +1177,9 @@ fop_readdirp_cbk_stub(call_frame_t *frame, fop_readdirp_cbk_t fn, } call_stub_t * -fop_readdir_cbk_stub(call_frame_t *frame, fop_readdir_cbk_t fn, int32_t op_ret, - int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) +fop_readdir_cbk_stub(call_frame_t *frame, fop_readdir_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, + dict_t *xdata) { call_stub_t *stub = NULL; @@ -1237,8 +1241,9 @@ fop_rchecksum_stub(call_frame_t *frame, fop_rchecksum_t fn, fd_t *fd, call_stub_t * fop_rchecksum_cbk_stub(call_frame_t *frame, fop_rchecksum_cbk_t fn, - int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, - uint8_t *strong_checksum, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + uint32_t weak_checksum, uint8_t *strong_checksum, + dict_t *xdata) { call_stub_t *stub = NULL; @@ -1253,8 +1258,9 @@ fop_rchecksum_cbk_stub(call_frame_t *frame, fop_rchecksum_cbk_t fn, } call_stub_t * -fop_xattrop_cbk_stub(call_frame_t *frame, fop_xattrop_cbk_t fn, int32_t op_ret, - int32_t op_errno, dict_t *xattr, dict_t *xdata) +fop_xattrop_cbk_stub(call_frame_t *frame, fop_xattrop_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, + dict_t *xdata) { call_stub_t *stub = NULL; @@ -1269,7 +1275,7 @@ fop_xattrop_cbk_stub(call_frame_t *frame, fop_xattrop_cbk_t fn, int32_t op_ret, call_stub_t * fop_fxattrop_cbk_stub(call_frame_t *frame, fop_fxattrop_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1318,8 +1324,8 @@ fop_fxattrop_stub(call_frame_t *frame, fop_fxattrop_t fn, fd_t *fd, } call_stub_t * -fop_setattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *statpre, +fop_setattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1335,9 +1341,10 @@ fop_setattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, int32_t op_ret, } call_stub_t * -fop_fsetattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *statpre, - struct iatt *statpost, dict_t *xdata) +fop_fsetattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, + struct iatt *statpre, struct iatt *statpost, + dict_t *xdata) { call_stub_t *stub = NULL; @@ -1387,8 +1394,9 @@ fop_fsetattr_stub(call_frame_t *frame, fop_fsetattr_t fn, fd_t *fd, call_stub_t * fop_fallocate_cbk_stub(call_frame_t *frame, fop_fallocate_cbk_t fn, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, - struct iatt *statpost, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *statpre, struct iatt *statpost, + dict_t *xdata) { call_stub_t *stub = NULL; @@ -1421,8 +1429,8 @@ fop_fallocate_stub(call_frame_t *frame, fop_fallocate_t fn, fd_t *fd, } call_stub_t * -fop_discard_cbk_stub(call_frame_t *frame, fop_discard_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *statpre, +fop_discard_cbk_stub(call_frame_t *frame, fop_discard_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1457,8 +1465,9 @@ fop_discard_stub(call_frame_t *frame, fop_discard_t fn, fd_t *fd, off_t offset, call_stub_t * fop_zerofill_cbk_stub(call_frame_t *frame, fop_zerofill_cbk_t fn, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, - struct iatt *statpost, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *statpre, struct iatt *statpost, + dict_t *xdata) { call_stub_t *stub = NULL; @@ -1491,7 +1500,7 @@ fop_zerofill_stub(call_frame_t *frame, fop_zerofill_t fn, fd_t *fd, } call_stub_t * -fop_ipc_cbk_stub(call_frame_t *frame, fop_ipc_cbk_t fn, int32_t op_ret, +fop_ipc_cbk_stub(call_frame_t *frame, fop_ipc_cbk_t fn, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1523,7 +1532,7 @@ fop_ipc_stub(call_frame_t *frame, fop_ipc_t fn, int32_t op, dict_t *xdata) } call_stub_t * -fop_lease_cbk_stub(call_frame_t *frame, fop_lease_cbk_t fn, int32_t op_ret, +fop_lease_cbk_stub(call_frame_t *frame, fop_lease_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct gf_lease *lease, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1556,7 +1565,7 @@ fop_lease_stub(call_frame_t *frame, fop_lease_t fn, loc_t *loc, } call_stub_t * -fop_seek_cbk_stub(call_frame_t *frame, fop_seek_cbk_t fn, int32_t op_ret, +fop_seek_cbk_stub(call_frame_t *frame, fop_seek_cbk_t fn, gf_return_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1590,7 +1599,7 @@ fop_seek_stub(call_frame_t *frame, fop_seek_t fn, fd_t *fd, off_t offset, call_stub_t * fop_getactivelk_cbk_stub(call_frame_t *frame, fop_getactivelk_cbk_t fn, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, lock_migration_info_t *lmi, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1628,7 +1637,7 @@ fop_getactivelk_stub(call_frame_t *frame, fop_getactivelk_t fn, loc_t *loc, call_stub_t * fop_setactivelk_cbk_stub(call_frame_t *frame, fop_setactivelk_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1689,7 +1698,7 @@ fop_copy_file_range_stub(call_frame_t *frame, fop_copy_file_range_t fn, call_stub_t * fop_copy_file_range_cbk_stub(call_frame_t *frame, fop_copy_file_range_cbk_t fn, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata) { @@ -1728,7 +1737,7 @@ fop_put_stub(call_frame_t *frame, fop_put_t fn, loc_t *loc, mode_t mode, } call_stub_t * -fop_put_cbk_stub(call_frame_t *frame, fop_put_cbk_t fn, int32_t op_ret, +fop_put_cbk_stub(call_frame_t *frame, fop_put_cbk_t fn, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1768,7 +1777,7 @@ fop_icreate_stub(call_frame_t *frame, fop_icreate_t fn, loc_t *loc, mode_t mode, } static void -args_icreate_store_cbk(default_args_cbk_t *args, int32_t op_ret, +args_icreate_store_cbk(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata) { @@ -1783,9 +1792,9 @@ args_icreate_store_cbk(default_args_cbk_t *args, int32_t op_ret, } call_stub_t * -fop_icreate_cbk_stub(call_frame_t *frame, fop_icreate_cbk_t fn, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - dict_t *xdata) +fop_icreate_cbk_stub(call_frame_t *frame, fop_icreate_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -1823,7 +1832,7 @@ fop_namelink_stub(call_frame_t *frame, fop_namelink_t fn, loc_t *loc, } static void -args_namelink_store_cbk(default_args_cbk_t *args, int32_t op_ret, +args_namelink_store_cbk(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { @@ -1840,7 +1849,7 @@ args_namelink_store_cbk(default_args_cbk_t *args, int32_t op_ret, call_stub_t * fop_namelink_cbk_stub(call_frame_t *frame, fop_namelink_cbk_t fn, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -2401,7 +2410,7 @@ call_resume(call_stub_t *stub) } void -call_unwind_error(call_stub_t *stub, int op_ret, int op_errno) +call_unwind_error(call_stub_t *stub, gf_return_t op_ret, int op_errno) { xlator_t *old_THIS = NULL; @@ -2422,7 +2431,7 @@ call_unwind_error(call_stub_t *stub, int op_ret, int op_errno) } void -call_unwind_error_keep_stub(call_stub_t *stub, int op_ret, int op_errno) +call_unwind_error_keep_stub(call_stub_t *stub, gf_return_t op_ret, int op_errno) { xlator_t *old_THIS = NULL; diff --git a/libglusterfs/src/cluster-syncop.c b/libglusterfs/src/cluster-syncop.c index 6ee89ddfdc..5356db5c19 100644 --- a/libglusterfs/src/cluster-syncop.c +++ b/libglusterfs/src/cluster-syncop.c @@ -124,7 +124,7 @@ cluster_replies_wipe(default_args_cbk_t *replies, int numsubvols) int32_t cluster_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { FOP_CBK(lookup, frame, cookie, op_ret, op_errno, inode, buf, xdata, @@ -134,7 +134,7 @@ cluster_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { FOP_CBK(stat, frame, cookie, op_ret, op_errno, buf, xdata); @@ -143,7 +143,7 @@ cluster_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { FOP_CBK(truncate, frame, cookie, op_ret, op_errno, prebuf, postbuf, xdata); @@ -152,7 +152,7 @@ cluster_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { FOP_CBK(ftruncate, frame, cookie, op_ret, op_errno, prebuf, postbuf, xdata); @@ -161,7 +161,7 @@ cluster_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(access, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -169,7 +169,7 @@ cluster_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata) { FOP_CBK(readlink, frame, cookie, op_ret, op_errno, path, buf, xdata); @@ -178,7 +178,7 @@ cluster_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -189,7 +189,7 @@ cluster_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -200,7 +200,7 @@ cluster_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { FOP_CBK(unlink, frame, cookie, op_ret, op_errno, preparent, postparent, @@ -210,7 +210,7 @@ cluster_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { FOP_CBK(rmdir, frame, cookie, op_ret, op_errno, preparent, postparent, @@ -220,7 +220,7 @@ cluster_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -231,7 +231,7 @@ cluster_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -243,7 +243,7 @@ cluster_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -254,8 +254,8 @@ cluster_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { FOP_CBK(create, frame, cookie, op_ret, op_errno, fd, inode, buf, preparent, @@ -265,7 +265,7 @@ cluster_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { FOP_CBK(open, frame, cookie, op_ret, op_errno, fd, xdata); return 0; @@ -273,7 +273,7 @@ cluster_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -284,7 +284,7 @@ cluster_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { FOP_CBK(writev, frame, cookie, op_ret, op_errno, prebuf, postbuf, xdata); @@ -293,7 +293,7 @@ cluster_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -304,7 +304,7 @@ cluster_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(flush, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -312,7 +312,7 @@ cluster_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { FOP_CBK(fsync, frame, cookie, op_ret, op_errno, prebuf, postbuf, xdata); @@ -321,7 +321,7 @@ cluster_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { FOP_CBK(fstat, frame, cookie, op_ret, op_errno, buf, xdata); @@ -330,7 +330,8 @@ cluster_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { FOP_CBK(opendir, frame, cookie, op_ret, op_errno, fd, xdata); return 0; @@ -338,7 +339,7 @@ cluster_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(fsyncdir, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -346,7 +347,7 @@ cluster_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { FOP_CBK(statfs, frame, cookie, op_ret, op_errno, buf, xdata); @@ -355,7 +356,7 @@ cluster_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(setxattr, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -363,7 +364,7 @@ cluster_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(fsetxattr, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -371,7 +372,7 @@ cluster_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { FOP_CBK(fgetxattr, frame, cookie, op_ret, op_errno, dict, xdata); @@ -380,7 +381,7 @@ cluster_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { FOP_CBK(getxattr, frame, cookie, op_ret, op_errno, dict, xdata); @@ -389,7 +390,7 @@ cluster_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { FOP_CBK(xattrop, frame, cookie, op_ret, op_errno, dict, xdata); @@ -398,7 +399,7 @@ cluster_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { FOP_CBK(fxattrop, frame, cookie, op_ret, op_errno, dict, xdata); @@ -407,7 +408,7 @@ cluster_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(removexattr, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -415,7 +416,7 @@ cluster_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(fremovexattr, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -423,7 +424,7 @@ cluster_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { FOP_CBK(lk, frame, cookie, op_ret, op_errno, lock, xdata); @@ -432,7 +433,7 @@ cluster_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(inodelk, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -440,7 +441,7 @@ cluster_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(finodelk, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -448,7 +449,7 @@ cluster_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(entrylk, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -456,7 +457,7 @@ cluster_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(fentrylk, frame, cookie, op_ret, op_errno, xdata); return 0; @@ -464,8 +465,9 @@ cluster_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, - uint8_t *strong_checksum, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + uint32_t weak_checksum, uint8_t *strong_checksum, + dict_t *xdata) { FOP_CBK(rchecksum, frame, cookie, op_ret, op_errno, weak_checksum, strong_checksum, xdata); @@ -474,7 +476,7 @@ cluster_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { FOP_CBK(readdir, frame, cookie, op_ret, op_errno, entries, xdata); @@ -483,7 +485,7 @@ cluster_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { FOP_CBK(readdirp, frame, cookie, op_ret, op_errno, entries, xdata); @@ -492,7 +494,7 @@ cluster_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { FOP_CBK(setattr, frame, cookie, op_ret, op_errno, statpre, statpost, xdata); @@ -501,7 +503,7 @@ cluster_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { FOP_CBK(fsetattr, frame, cookie, op_ret, op_errno, statpre, statpost, @@ -511,7 +513,7 @@ cluster_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { FOP_CBK(fallocate, frame, cookie, op_ret, op_errno, pre, post, xdata); @@ -520,7 +522,7 @@ cluster_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { FOP_CBK(discard, frame, cookie, op_ret, op_errno, pre, post, xdata); @@ -529,7 +531,7 @@ cluster_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { FOP_CBK(zerofill, frame, cookie, op_ret, op_errno, pre, post, xdata); @@ -538,7 +540,7 @@ cluster_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { FOP_CBK(ipc, frame, cookie, op_ret, op_errno, xdata); return 0; diff --git a/libglusterfs/src/default-args.c b/libglusterfs/src/default-args.c index a0ba1cfb29..3b3eb6bf20 100644 --- a/libglusterfs/src/default-args.c +++ b/libglusterfs/src/default-args.c @@ -26,7 +26,7 @@ args_lookup_store(default_args_t *args, loc_t *loc, dict_t *xdata) } int -args_lookup_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_lookup_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { @@ -55,8 +55,8 @@ args_stat_store(default_args_t *args, loc_t *loc, dict_t *xdata) } int -args_stat_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct iatt *buf, dict_t *xdata) +args_stat_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct iatt *buf, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -80,8 +80,8 @@ args_fstat_store(default_args_t *args, fd_t *fd, dict_t *xdata) } int -args_fstat_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct iatt *buf, dict_t *xdata) +args_fstat_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct iatt *buf, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -105,7 +105,7 @@ args_truncate_store(default_args_t *args, loc_t *loc, off_t off, dict_t *xdata) } int -args_truncate_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_truncate_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { @@ -135,7 +135,7 @@ args_ftruncate_store(default_args_t *args, fd_t *fd, off_t off, dict_t *xdata) } int -args_ftruncate_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_ftruncate_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { @@ -163,7 +163,7 @@ args_access_store(default_args_t *args, loc_t *loc, int32_t mask, dict_t *xdata) } int -args_access_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_access_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; @@ -187,7 +187,7 @@ args_readlink_store(default_args_t *args, loc_t *loc, size_t size, } int -args_readlink_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_readlink_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *stbuf, dict_t *xdata) { @@ -218,9 +218,10 @@ args_mknod_store(default_args_t *args, loc_t *loc, mode_t mode, dev_t rdev, } int -args_mknod_cbk_store(default_args_cbk_t *args, int op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) +args_mknod_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, struct iatt *buf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -253,9 +254,10 @@ args_mkdir_store(default_args_t *args, loc_t *loc, mode_t mode, mode_t umask, } int -args_mkdir_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) +args_mkdir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, struct iatt *buf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -285,7 +287,7 @@ args_unlink_store(default_args_t *args, loc_t *loc, int xflag, dict_t *xdata) } int -args_unlink_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_unlink_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -312,9 +314,9 @@ args_rmdir_store(default_args_t *args, loc_t *loc, int flags, dict_t *xdata) } int -args_rmdir_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +args_rmdir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -342,7 +344,7 @@ args_symlink_store(default_args_t *args, const char *linkname, loc_t *loc, } int -args_symlink_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_symlink_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) @@ -376,7 +378,7 @@ args_rename_store(default_args_t *args, loc_t *oldloc, loc_t *newloc, } int -args_rename_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_rename_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, @@ -414,9 +416,10 @@ args_link_store(default_args_t *args, loc_t *oldloc, loc_t *newloc, } int -args_link_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) +args_link_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, struct iatt *buf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -450,7 +453,7 @@ args_create_store(default_args_t *args, loc_t *loc, int32_t flags, mode_t mode, } int -args_create_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_create_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) @@ -488,8 +491,8 @@ args_open_store(default_args_t *args, loc_t *loc, int32_t flags, fd_t *fd, } int -args_open_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - fd_t *fd, dict_t *xdata) +args_open_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, fd_t *fd, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -518,9 +521,9 @@ args_readv_store(default_args_t *args, fd_t *fd, size_t size, off_t off, } int -args_readv_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct iovec *vector, int32_t count, struct iatt *stbuf, - struct iobref *iobref, dict_t *xdata) +args_readv_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct iovec *vector, int32_t count, + struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -554,7 +557,7 @@ args_writev_store(default_args_t *args, fd_t *fd, struct iovec *vector, } int -args_writev_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_writev_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { @@ -591,9 +594,10 @@ args_put_store(default_args_t *args, loc_t *loc, mode_t mode, mode_t umask, } int -args_put_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) +args_put_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, struct iatt *buf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -621,8 +625,8 @@ args_flush_store(default_args_t *args, fd_t *fd, dict_t *xdata) } int -args_flush_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - dict_t *xdata) +args_flush_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -645,8 +649,9 @@ args_fsync_store(default_args_t *args, fd_t *fd, int32_t datasync, } int -args_fsync_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) +args_fsync_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -673,7 +678,7 @@ args_opendir_store(default_args_t *args, loc_t *loc, fd_t *fd, dict_t *xdata) } int -args_opendir_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_opendir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { args->op_ret = op_ret; @@ -698,7 +703,7 @@ args_fsyncdir_store(default_args_t *args, fd_t *fd, int32_t datasync, return 0; } int -args_fsyncdir_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fsyncdir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; @@ -719,7 +724,7 @@ args_statfs_store(default_args_t *args, loc_t *loc, dict_t *xdata) } int -args_statfs_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_statfs_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { args->op_ret = op_ret; @@ -747,7 +752,7 @@ args_setxattr_store(default_args_t *args, loc_t *loc, dict_t *dict, } int -args_setxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_setxattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; @@ -772,7 +777,7 @@ args_getxattr_store(default_args_t *args, loc_t *loc, const char *name, } int -args_getxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_getxattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { args->op_ret = op_ret; @@ -800,7 +805,7 @@ args_fsetxattr_store(default_args_t *args, fd_t *fd, dict_t *dict, } int -args_fsetxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fsetxattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; @@ -825,7 +830,7 @@ args_fgetxattr_store(default_args_t *args, fd_t *fd, const char *name, } int -args_fgetxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fgetxattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { args->op_ret = op_ret; @@ -850,7 +855,7 @@ args_removexattr_store(default_args_t *args, loc_t *loc, const char *name, } int -args_removexattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_removexattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; @@ -873,7 +878,7 @@ args_fremovexattr_store(default_args_t *args, fd_t *fd, const char *name, } int -args_fremovexattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fremovexattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; @@ -898,8 +903,8 @@ args_lk_store(default_args_t *args, fd_t *fd, int32_t cmd, } int -args_lk_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct gf_flock *lock, dict_t *xdata) +args_lk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -927,7 +932,7 @@ args_inodelk_store(default_args_t *args, const char *volume, loc_t *loc, } int -args_inodelk_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_inodelk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; @@ -957,7 +962,7 @@ args_finodelk_store(default_args_t *args, const char *volume, fd_t *fd, } int -args_finodelk_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_finodelk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; @@ -990,7 +995,7 @@ args_entrylk_store(default_args_t *args, const char *volume, loc_t *loc, } int -args_entrylk_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_entrylk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; @@ -1022,7 +1027,7 @@ args_fentrylk_store(default_args_t *args, const char *volume, fd_t *fd, } int -args_fentrylk_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fentrylk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; @@ -1046,7 +1051,7 @@ args_readdirp_store(default_args_t *args, fd_t *fd, size_t size, off_t off, } int -args_readdirp_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_readdirp_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { gf_dirent_t *stub_entry = NULL, *entry = NULL; @@ -1090,7 +1095,7 @@ args_readdir_store(default_args_t *args, fd_t *fd, size_t size, off_t off, } int -args_readdir_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_readdir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { gf_dirent_t *stub_entry = NULL, *entry = NULL; @@ -1128,7 +1133,7 @@ args_rchecksum_store(default_args_t *args, fd_t *fd, off_t offset, int32_t len, } int -args_rchecksum_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_rchecksum_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, uint32_t weak_checksum, uint8_t *strong_checksum, dict_t *xdata) { @@ -1160,7 +1165,7 @@ args_xattrop_store(default_args_t *args, loc_t *loc, gf_xattrop_flags_t optype, } int -args_xattrop_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_xattrop_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { args->op_ret = op_ret; @@ -1188,7 +1193,7 @@ args_fxattrop_store(default_args_t *args, fd_t *fd, gf_xattrop_flags_t optype, } int -args_fxattrop_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fxattrop_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { args->op_ret = op_ret; @@ -1218,7 +1223,7 @@ args_setattr_store(default_args_t *args, loc_t *loc, struct iatt *stbuf, } int -args_setattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_setattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { @@ -1251,7 +1256,7 @@ args_fsetattr_store(default_args_t *args, fd_t *fd, struct iatt *stbuf, return 0; } int -args_fsetattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fsetattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { @@ -1284,7 +1289,7 @@ args_fallocate_store(default_args_t *args, fd_t *fd, int32_t mode, off_t offset, } int -args_fallocate_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fallocate_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { @@ -1316,7 +1321,7 @@ args_discard_store(default_args_t *args, fd_t *fd, off_t offset, size_t len, } int -args_discard_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_discard_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { @@ -1348,7 +1353,7 @@ args_zerofill_store(default_args_t *args, fd_t *fd, off_t offset, off_t len, } int -args_zerofill_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_zerofill_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { @@ -1375,8 +1380,8 @@ args_ipc_store(default_args_t *args, int32_t op, dict_t *xdata) } int -args_ipc_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - dict_t *xdata) +args_ipc_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -1402,8 +1407,8 @@ args_seek_store(default_args_t *args, fd_t *fd, off_t offset, } int -args_seek_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - off_t offset, dict_t *xdata) +args_seek_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, off_t offset, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -1415,7 +1420,7 @@ args_seek_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, } int -args_getactivelk_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_getactivelk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, lock_migration_info_t *locklist, dict_t *xdata) { @@ -1509,8 +1514,8 @@ args_lease_store(default_args_t *args, loc_t *loc, struct gf_lease *lease, } void -args_lease_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct gf_lease *lease, dict_t *xdata) +args_lease_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct gf_lease *lease, dict_t *xdata) { args->op_ret = op_ret; args->op_errno = op_errno; @@ -1562,7 +1567,7 @@ args_copy_file_range_store(default_args_t *args, fd_t *fd_in, off64_t off_in, } int -args_copy_file_range_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_copy_file_range_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata) diff --git a/libglusterfs/src/gen-defaults.py b/libglusterfs/src/gen-defaults.py index e31d3a9fe8..df9766bd21 100755 --- a/libglusterfs/src/gen-defaults.py +++ b/libglusterfs/src/gen-defaults.py @@ -16,7 +16,7 @@ CBK_RESUME_TEMPLATE = """ int32_t default_@NAME@_cbk_resume (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, @LONG_ARGS@) + gf_return_t op_ret, int32_t op_errno, @LONG_ARGS@) { STACK_UNWIND_STRICT (@NAME@, frame, op_ret, op_errno, @SHORT_ARGS@); @@ -27,7 +27,7 @@ CBK_TEMPLATE = """ int32_t default_@NAME@_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, @LONG_ARGS@) + gf_return_t op_ret, int32_t op_errno, @LONG_ARGS@) { STACK_UNWIND_STRICT (@NAME@, frame, op_ret, op_errno, @SHORT_ARGS@); diff --git a/libglusterfs/src/glusterfs/call-stub.h b/libglusterfs/src/glusterfs/call-stub.h index 8237ea459b..881194dcb7 100644 --- a/libglusterfs/src/glusterfs/call-stub.h +++ b/libglusterfs/src/glusterfs/call-stub.h @@ -147,18 +147,18 @@ fop_lookup_stub(call_frame_t *frame, fop_lookup_t fn, loc_t *loc, dict_t *xdata); call_stub_t * -fop_lookup_cbk_stub(call_frame_t *frame, fop_lookup_cbk_t fn, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - dict_t *xdata, struct iatt *postparent); +fop_lookup_cbk_stub(call_frame_t *frame, fop_lookup_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent); call_stub_t * fop_stat_stub(call_frame_t *frame, fop_stat_t fn, loc_t *loc, dict_t *xdata); call_stub_t * -fop_stat_cbk_stub(call_frame_t *frame, fop_stat_cbk_t fn, int32_t op_ret, +fop_stat_cbk_stub(call_frame_t *frame, fop_stat_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata); call_stub_t * fop_fstat_stub(call_frame_t *frame, fop_fstat_t fn, fd_t *fd, dict_t *xdata); call_stub_t * -fop_fstat_cbk_stub(call_frame_t *frame, fop_fstat_cbk_t fn, int32_t op_ret, +fop_fstat_cbk_stub(call_frame_t *frame, fop_fstat_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata); call_stub_t * @@ -167,7 +167,7 @@ fop_truncate_stub(call_frame_t *frame, fop_truncate_t fn, loc_t *loc, off_t off, call_stub_t * fop_truncate_cbk_stub(call_frame_t *frame, fop_truncate_cbk_t fn, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); call_stub_t * @@ -176,16 +176,17 @@ fop_ftruncate_stub(call_frame_t *frame, fop_ftruncate_t fn, fd_t *fd, off_t off, call_stub_t * fop_ftruncate_cbk_stub(call_frame_t *frame, fop_ftruncate_cbk_t fn, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, - struct iatt *postbuf, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata); call_stub_t * fop_access_stub(call_frame_t *frame, fop_access_t fn, loc_t *loc, int32_t mask, dict_t *xdata); call_stub_t * -fop_access_cbk_stub(call_frame_t *frame, fop_access_cbk_t fn, int32_t op_ret, - int32_t op_errno, dict_t *xdata); +fop_access_cbk_stub(call_frame_t *frame, fop_access_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * fop_readlink_stub(call_frame_t *frame, fop_readlink_t fn, loc_t *loc, @@ -193,7 +194,7 @@ fop_readlink_stub(call_frame_t *frame, fop_readlink_t fn, loc_t *loc, call_stub_t * fop_readlink_cbk_stub(call_frame_t *frame, fop_readlink_cbk_t fn, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata); call_stub_t * @@ -201,7 +202,7 @@ fop_mknod_stub(call_frame_t *frame, fop_mknod_t fn, loc_t *loc, mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata); call_stub_t * -fop_mknod_cbk_stub(call_frame_t *frame, fop_mknod_cbk_t fn, int32_t op_ret, +fop_mknod_cbk_stub(call_frame_t *frame, fop_mknod_cbk_t fn, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); @@ -211,7 +212,7 @@ fop_mkdir_stub(call_frame_t *frame, fop_mkdir_t fn, loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata); call_stub_t * -fop_mkdir_cbk_stub(call_frame_t *frame, fop_mkdir_cbk_t fn, int32_t op_ret, +fop_mkdir_cbk_stub(call_frame_t *frame, fop_mkdir_cbk_t fn, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); @@ -221,16 +222,17 @@ fop_unlink_stub(call_frame_t *frame, fop_unlink_t fn, loc_t *loc, int xflag, dict_t *xdata); call_stub_t * -fop_unlink_cbk_stub(call_frame_t *frame, fop_unlink_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata); +fop_unlink_cbk_stub(call_frame_t *frame, fop_unlink_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata); call_stub_t * fop_rmdir_stub(call_frame_t *frame, fop_rmdir_t fn, loc_t *loc, int flags, dict_t *xdata); call_stub_t * -fop_rmdir_cbk_stub(call_frame_t *frame, fop_rmdir_cbk_t fn, int32_t op_ret, +fop_rmdir_cbk_stub(call_frame_t *frame, fop_rmdir_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); @@ -239,18 +241,18 @@ fop_symlink_stub(call_frame_t *frame, fop_symlink_t fn, const char *linkname, loc_t *loc, mode_t umask, dict_t *xdata); call_stub_t * -fop_symlink_cbk_stub(call_frame_t *frame, fop_symlink_cbk_t fn, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, - dict_t *xdata); +fop_symlink_cbk_stub(call_frame_t *frame, fop_symlink_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata); call_stub_t * fop_rename_stub(call_frame_t *frame, fop_rename_t fn, loc_t *oldloc, loc_t *newloc, dict_t *xdata); call_stub_t * -fop_rename_cbk_stub(call_frame_t *frame, fop_rename_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *buf, +fop_rename_cbk_stub(call_frame_t *frame, fop_rename_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata); @@ -260,7 +262,7 @@ fop_link_stub(call_frame_t *frame, fop_link_t fn, loc_t *oldloc, loc_t *newloc, dict_t *xdata); call_stub_t * -fop_link_cbk_stub(call_frame_t *frame, fop_link_cbk_t fn, int32_t op_ret, +fop_link_cbk_stub(call_frame_t *frame, fop_link_cbk_t fn, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); @@ -270,9 +272,9 @@ fop_create_stub(call_frame_t *frame, fop_create_t fn, loc_t *loc, int32_t flags, mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata); call_stub_t * -fop_create_cbk_stub(call_frame_t *frame, fop_create_cbk_t fn, int32_t op_ret, - int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, +fop_create_cbk_stub(call_frame_t *frame, fop_create_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); call_stub_t * @@ -280,7 +282,7 @@ fop_open_stub(call_frame_t *frame, fop_open_t fn, loc_t *loc, int32_t flags, fd_t *fd, dict_t *xdata); call_stub_t * -fop_open_cbk_stub(call_frame_t *frame, fop_open_cbk_t fn, int32_t op_ret, +fop_open_cbk_stub(call_frame_t *frame, fop_open_cbk_t fn, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata); call_stub_t * @@ -288,7 +290,7 @@ fop_readv_stub(call_frame_t *frame, fop_readv_t fn, fd_t *fd, size_t size, off_t off, uint32_t flags, dict_t *xdata); call_stub_t * -fop_readv_cbk_stub(call_frame_t *frame, fop_readv_cbk_t fn, int32_t op_ret, +fop_readv_cbk_stub(call_frame_t *frame, fop_readv_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata); @@ -298,15 +300,15 @@ fop_writev_stub(call_frame_t *frame, fop_writev_t fn, fd_t *fd, struct iobref *iobref, dict_t *xdata); call_stub_t * -fop_writev_cbk_stub(call_frame_t *frame, fop_writev_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, - dict_t *xdata); +fop_writev_cbk_stub(call_frame_t *frame, fop_writev_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata); call_stub_t * fop_flush_stub(call_frame_t *frame, fop_flush_t fn, fd_t *fd, dict_t *xdata); call_stub_t * -fop_flush_cbk_stub(call_frame_t *frame, fop_flush_cbk_t fn, int32_t op_ret, +fop_flush_cbk_stub(call_frame_t *frame, fop_flush_cbk_t fn, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * @@ -314,7 +316,7 @@ fop_fsync_stub(call_frame_t *frame, fop_fsync_t fn, fd_t *fd, int32_t datasync, dict_t *xdata); call_stub_t * -fop_fsync_cbk_stub(call_frame_t *frame, fop_fsync_cbk_t fn, int32_t op_ret, +fop_fsync_cbk_stub(call_frame_t *frame, fop_fsync_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); @@ -323,8 +325,9 @@ fop_opendir_stub(call_frame_t *frame, fop_opendir_t fn, loc_t *loc, fd_t *fd, dict_t *xdata); call_stub_t * -fop_opendir_cbk_stub(call_frame_t *frame, fop_opendir_cbk_t fn, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata); +fop_opendir_cbk_stub(call_frame_t *frame, fop_opendir_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata); call_stub_t * fop_fsyncdir_stub(call_frame_t *frame, fop_fsyncdir_t fn, fd_t *fd, @@ -332,15 +335,16 @@ fop_fsyncdir_stub(call_frame_t *frame, fop_fsyncdir_t fn, fd_t *fd, call_stub_t * fop_fsyncdir_cbk_stub(call_frame_t *frame, fop_fsyncdir_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * fop_statfs_stub(call_frame_t *frame, fop_statfs_t fn, loc_t *loc, dict_t *xdata); call_stub_t * -fop_statfs_cbk_stub(call_frame_t *frame, fop_statfs_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct statvfs *buf, dict_t *xdata); +fop_statfs_cbk_stub(call_frame_t *frame, fop_statfs_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, + dict_t *xdata); call_stub_t * fop_setxattr_stub(call_frame_t *frame, fop_setxattr_t fn, loc_t *loc, @@ -348,7 +352,7 @@ fop_setxattr_stub(call_frame_t *frame, fop_setxattr_t fn, loc_t *loc, call_stub_t * fop_setxattr_cbk_stub(call_frame_t *frame, fop_setxattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * fop_getxattr_stub(call_frame_t *frame, fop_getxattr_t fn, loc_t *loc, @@ -356,7 +360,7 @@ fop_getxattr_stub(call_frame_t *frame, fop_getxattr_t fn, loc_t *loc, call_stub_t * fop_getxattr_cbk_stub(call_frame_t *frame, fop_getxattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *value, + gf_return_t op_ret, int32_t op_errno, dict_t *value, dict_t *xdata); call_stub_t * @@ -365,7 +369,7 @@ fop_fsetxattr_stub(call_frame_t *frame, fop_fsetxattr_t fn, fd_t *fd, call_stub_t * fop_fsetxattr_cbk_stub(call_frame_t *frame, fop_fsetxattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * fop_fgetxattr_stub(call_frame_t *frame, fop_fgetxattr_t fn, fd_t *fd, @@ -373,7 +377,7 @@ fop_fgetxattr_stub(call_frame_t *frame, fop_fgetxattr_t fn, fd_t *fd, call_stub_t * fop_fgetxattr_cbk_stub(call_frame_t *frame, fop_fgetxattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *value, + gf_return_t op_ret, int32_t op_errno, dict_t *value, dict_t *xdata); call_stub_t * @@ -382,7 +386,7 @@ fop_removexattr_stub(call_frame_t *frame, fop_removexattr_t fn, loc_t *loc, call_stub_t * fop_removexattr_cbk_stub(call_frame_t *frame, fop_removexattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * fop_fremovexattr_stub(call_frame_t *frame, fop_fremovexattr_t fn, fd_t *fd, @@ -390,14 +394,14 @@ fop_fremovexattr_stub(call_frame_t *frame, fop_fremovexattr_t fn, fd_t *fd, call_stub_t * fop_fremovexattr_cbk_stub(call_frame_t *frame, fop_fremovexattr_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * fop_lk_stub(call_frame_t *frame, fop_lk_t fn, fd_t *fd, int32_t cmd, struct gf_flock *lock, dict_t *xdata); call_stub_t * -fop_lk_cbk_stub(call_frame_t *frame, fop_lk_cbk_t fn, int32_t op_ret, +fop_lk_cbk_stub(call_frame_t *frame, fop_lk_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata); call_stub_t * @@ -419,20 +423,20 @@ fop_fentrylk_stub(call_frame_t *frame, fop_fentrylk_t fn, const char *volume, entrylk_type type, dict_t *xdata); call_stub_t * -fop_inodelk_cbk_stub(call_frame_t *frame, fop_inodelk_cbk_t fn, int32_t op_ret, - int32_t op_errno, dict_t *xdata); +fop_inodelk_cbk_stub(call_frame_t *frame, fop_inodelk_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * -fop_finodelk_cbk_stub(call_frame_t *frame, fop_inodelk_cbk_t fn, int32_t op_ret, - int32_t op_errno, dict_t *xdata); +fop_finodelk_cbk_stub(call_frame_t *frame, fop_inodelk_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * -fop_entrylk_cbk_stub(call_frame_t *frame, fop_entrylk_cbk_t fn, int32_t op_ret, - int32_t op_errno, dict_t *xdata); +fop_entrylk_cbk_stub(call_frame_t *frame, fop_entrylk_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * -fop_fentrylk_cbk_stub(call_frame_t *frame, fop_entrylk_cbk_t fn, int32_t op_ret, - int32_t op_errno, dict_t *xdata); +fop_fentrylk_cbk_stub(call_frame_t *frame, fop_entrylk_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * fop_readdir_stub(call_frame_t *frame, fop_readdir_t fn, fd_t *fd, size_t size, @@ -443,12 +447,14 @@ fop_readdirp_stub(call_frame_t *frame, fop_readdirp_t fn, fd_t *fd, size_t size, off_t off, dict_t *xdata); call_stub_t * -fop_readdirp_cbk_stub(call_frame_t *frame, fop_readdir_cbk_t fn, int32_t op_ret, - int32_t op_errno, gf_dirent_t *entries, dict_t *xdata); +fop_readdirp_cbk_stub(call_frame_t *frame, fop_readdir_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, + gf_dirent_t *entries, dict_t *xdata); call_stub_t * -fop_readdir_cbk_stub(call_frame_t *frame, fop_readdir_cbk_t fn, int32_t op_ret, - int32_t op_errno, gf_dirent_t *entries, dict_t *xdata); +fop_readdir_cbk_stub(call_frame_t *frame, fop_readdir_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, + dict_t *xdata); call_stub_t * fop_rchecksum_stub(call_frame_t *frame, fop_rchecksum_t fn, fd_t *fd, @@ -456,8 +462,9 @@ fop_rchecksum_stub(call_frame_t *frame, fop_rchecksum_t fn, fd_t *fd, call_stub_t * fop_rchecksum_cbk_stub(call_frame_t *frame, fop_rchecksum_cbk_t fn, - int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, - uint8_t *strong_checksum, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + uint32_t weak_checksum, uint8_t *strong_checksum, + dict_t *xdata); call_stub_t * fop_xattrop_stub(call_frame_t *frame, fop_xattrop_t fn, loc_t *loc, @@ -465,7 +472,7 @@ fop_xattrop_stub(call_frame_t *frame, fop_xattrop_t fn, loc_t *loc, call_stub_t * fop_xattrop_stub_cbk_stub(call_frame_t *frame, fop_xattrop_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * fop_fxattrop_stub(call_frame_t *frame, fop_fxattrop_t fn, fd_t *fd, @@ -473,15 +480,15 @@ fop_fxattrop_stub(call_frame_t *frame, fop_fxattrop_t fn, fd_t *fd, call_stub_t * fop_fxattrop_stub_cbk_stub(call_frame_t *frame, fop_xattrop_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * fop_setattr_stub(call_frame_t *frame, fop_setattr_t fn, loc_t *loc, struct iatt *stbuf, int32_t valid, dict_t *xdata); call_stub_t * -fop_setattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *statpre, +fop_setattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); call_stub_t * @@ -489,9 +496,10 @@ fop_fsetattr_stub(call_frame_t *frame, fop_fsetattr_t fn, fd_t *fd, struct iatt *stbuf, int32_t valid, dict_t *xdata); call_stub_t * -fop_fsetattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *statpre, - struct iatt *statpost, dict_t *xdata); +fop_fsetattr_cbk_stub(call_frame_t *frame, fop_setattr_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, + struct iatt *statpre, struct iatt *statpost, + dict_t *xdata); call_stub_t * fop_fallocate_stub(call_frame_t *frame, fop_fallocate_t fn, fd_t *fd, @@ -499,16 +507,17 @@ fop_fallocate_stub(call_frame_t *frame, fop_fallocate_t fn, fd_t *fd, call_stub_t * fop_fallocate_cbk_stub(call_frame_t *frame, fop_fallocate_cbk_t fn, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, - struct iatt *statpost, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct iatt *statpre, struct iatt *statpost, + dict_t *xdata); call_stub_t * fop_discard_stub(call_frame_t *frame, fop_discard_t fn, fd_t *fd, off_t offset, size_t len, dict_t *xdata); call_stub_t * -fop_discard_cbk_stub(call_frame_t *frame, fop_discard_cbk_t fn, int32_t op_ret, - int32_t op_errno, struct iatt *statpre, +fop_discard_cbk_stub(call_frame_t *frame, fop_discard_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); call_stub_t * @@ -517,14 +526,15 @@ fop_zerofill_stub(call_frame_t *frame, fop_zerofill_t fn, fd_t *fd, call_stub_t * fop_zerofill_cbk_stub(call_frame_t *frame, fop_zerofill_cbk_t fn, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, - struct iatt *statpost, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct iatt *statpre, struct iatt *statpost, + dict_t *xdata); call_stub_t * fop_ipc_stub(call_frame_t *frame, fop_ipc_t fn, int32_t op, dict_t *xdata); call_stub_t * -fop_ipc_cbk_stub(call_frame_t *frame, fop_ipc_cbk_t fn, int32_t op_ret, +fop_ipc_cbk_stub(call_frame_t *frame, fop_ipc_cbk_t fn, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * @@ -532,7 +542,7 @@ fop_seek_stub(call_frame_t *frame, fop_seek_t fn, fd_t *fd, off_t offset, gf_seek_what_t what, dict_t *xdata); call_stub_t * -fop_seek_cbk_stub(call_frame_t *frame, fop_seek_cbk_t fn, int32_t op_ret, +fop_seek_cbk_stub(call_frame_t *frame, fop_seek_cbk_t fn, gf_return_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata); call_stub_t * @@ -540,7 +550,7 @@ fop_lease_stub(call_frame_t *frame, fop_lease_t fn, loc_t *loc, struct gf_lease *lease, dict_t *xdata); call_stub_t * -fop_lease_cbk_stub(call_frame_t *frame, fop_lease_cbk_t fn, int32_t op_ret, +fop_lease_cbk_stub(call_frame_t *frame, fop_lease_cbk_t fn, gf_return_t op_ret, int32_t op_errno, struct gf_lease *lease, dict_t *xdata); call_stub_t * @@ -549,7 +559,7 @@ fop_getactivelk_stub(call_frame_t *frame, fop_getactivelk_t fn, loc_t *loc, call_stub_t * fop_getactivelk_cbk_stub(call_frame_t *frame, fop_getactivelk_cbk_t fn, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, lock_migration_info_t *lmi, dict_t *xdata); call_stub_t * @@ -558,7 +568,7 @@ fop_setactivelk_stub(call_frame_t *frame, fop_setactivelk_t fn, loc_t *loc, call_stub_t * fop_setactivelk_cbk_stub(call_frame_t *frame, fop_setactivelk_cbk_t fn, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); call_stub_t * fop_put_stub(call_frame_t *frame, fop_put_t fn, loc_t *loc, mode_t mode, @@ -566,7 +576,7 @@ fop_put_stub(call_frame_t *frame, fop_put_t fn, loc_t *loc, mode_t mode, off_t offset, struct iobref *iobref, dict_t *xattr, dict_t *xdata); call_stub_t * -fop_put_cbk_stub(call_frame_t *frame, fop_put_cbk_t fn, int32_t op_ret, +fop_put_cbk_stub(call_frame_t *frame, fop_put_cbk_t fn, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); @@ -580,13 +590,13 @@ fop_namelink_stub(call_frame_t *frame, fop_namelink_t fn, loc_t *loc, dict_t *xdata); call_stub_t * -fop_icreate_cbk_stub(call_frame_t *frame, fop_icreate_cbk_t fn, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - dict_t *xdata); +fop_icreate_cbk_stub(call_frame_t *frame, fop_icreate_cbk_t fn, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata); call_stub_t * fop_namelink_cbk_stub(call_frame_t *frame, fop_namelink_cbk_t fn, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); call_stub_t * @@ -597,7 +607,7 @@ fop_copy_file_range_stub(call_frame_t *frame, fop_copy_file_range_t fn, call_stub_t * fop_copy_file_range_cbk_stub(call_frame_t *frame, fop_copy_file_range_cbk_t fn, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata); @@ -608,9 +618,10 @@ call_resume_keep_stub(call_stub_t *stub); void call_stub_destroy(call_stub_t *stub); void -call_unwind_error(call_stub_t *stub, int op_ret, int op_errno); +call_unwind_error(call_stub_t *stub, gf_return_t op_ret, int op_errno); void -call_unwind_error_keep_stub(call_stub_t *stub, int op_ret, int op_errno); +call_unwind_error_keep_stub(call_stub_t *stub, gf_return_t op_ret, + int op_errno); /* * Sometimes we might want to call just this, perhaps repeatedly, without diff --git a/libglusterfs/src/glusterfs/cluster-syncop.h b/libglusterfs/src/glusterfs/cluster-syncop.h index d0ad5ed548..1330db0eef 100644 --- a/libglusterfs/src/glusterfs/cluster-syncop.h +++ b/libglusterfs/src/glusterfs/cluster-syncop.h @@ -215,7 +215,7 @@ cluster_fop_success_fill(default_args_cbk_t *replies, int numsubvols, int32_t cluster_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int diff --git a/libglusterfs/src/glusterfs/default-args.h b/libglusterfs/src/glusterfs/default-args.h index ca7526fcab..15983eef55 100644 --- a/libglusterfs/src/glusterfs/default-args.h +++ b/libglusterfs/src/glusterfs/default-args.h @@ -18,224 +18,229 @@ #include "glusterfs/xlator.h" int -args_lookup_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_lookup_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent); int -args_stat_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct iatt *buf, dict_t *xdata); +args_stat_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct iatt *buf, dict_t *xdata); int -args_fstat_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct iatt *buf, dict_t *xdata); +args_fstat_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct iatt *buf, dict_t *xdata); int -args_truncate_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_truncate_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int -args_ftruncate_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_ftruncate_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int -args_access_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_access_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -args_readlink_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_readlink_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *stbuf, dict_t *xdata); int -args_mknod_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata); +args_mknod_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, struct iatt *buf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata); int -args_mkdir_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata); +args_mkdir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, struct iatt *buf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata); int -args_unlink_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_unlink_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int -args_rmdir_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct iatt *preparent, struct iatt *postparent, - dict_t *xdata); +args_rmdir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata); int -args_symlink_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_symlink_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int -args_rename_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_rename_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata); int -args_link_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata); +args_link_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, struct iatt *buf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata); int -args_create_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_create_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int -args_open_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - fd_t *fd, dict_t *xdata); +args_open_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, fd_t *fd, dict_t *xdata); int -args_readv_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct iovec *vector, int32_t count, struct iatt *stbuf, - struct iobref *iobref, dict_t *xdata); +args_readv_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct iovec *vector, int32_t count, + struct iatt *stbuf, struct iobref *iobref, dict_t *xdata); int -args_writev_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_writev_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int -args_put_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata); +args_put_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, struct iatt *buf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata); int -args_flush_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - dict_t *xdata); +args_flush_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, dict_t *xdata); int -args_fsync_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); +args_fsync_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata); int -args_opendir_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_opendir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata); int -args_fsyncdir_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fsyncdir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -args_statfs_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_statfs_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata); int -args_setxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_setxattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -args_getxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_getxattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int -args_fsetxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fsetxattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -args_fgetxattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fgetxattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int -args_removexattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_removexattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -args_fremovexattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fremovexattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -args_lk_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct gf_flock *lock, dict_t *xdata); +args_lk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct gf_flock *lock, dict_t *xdata); int -args_inodelk_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_inodelk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -args_finodelk_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_finodelk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -args_entrylk_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_entrylk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -args_fentrylk_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fentrylk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -args_readdirp_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_readdirp_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata); int -args_readdir_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_readdir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata); int -args_rchecksum_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_rchecksum_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, uint32_t weak_checksum, uint8_t *strong_checksum, dict_t *xdata); int -args_xattrop_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_xattrop_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata); int -args_fxattrop_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fxattrop_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata); int -args_setattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_setattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); int -args_fsetattr_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fsetattr_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); int -args_fallocate_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_fallocate_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); int -args_discard_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_discard_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); int -args_zerofill_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_zerofill_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); int -args_ipc_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - dict_t *xdata); +args_ipc_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, dict_t *xdata); int -args_seek_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - off_t offset, dict_t *xdata); +args_seek_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, off_t offset, dict_t *xdata); void -args_lease_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, - struct gf_lease *lease, dict_t *xdata); +args_lease_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, + int32_t op_errno, struct gf_lease *lease, dict_t *xdata); int -args_copy_file_range_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_copy_file_range_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata); @@ -430,7 +435,7 @@ args_lease_store(default_args_t *args, loc_t *loc, struct gf_lease *lease, dict_t *xdata); int -args_getactivelk_cbk_store(default_args_cbk_t *args, int32_t op_ret, +args_getactivelk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, int32_t op_errno, lock_migration_info_t *locklist, dict_t *xdata); diff --git a/libglusterfs/src/glusterfs/defaults.h b/libglusterfs/src/glusterfs/defaults.h index 5a818eeb91..0435219c23 100644 --- a/libglusterfs/src/glusterfs/defaults.h +++ b/libglusterfs/src/glusterfs/defaults.h @@ -18,8 +18,8 @@ #include "glusterfs/xlator.h" typedef struct { - int op_ret; - int op_errno; + gf_return_t op_ret; + int32_t op_errno; inode_t *inode; struct iatt stat; struct iatt prestat; @@ -566,262 +566,273 @@ default_copy_file_range_resume(call_frame_t *frame, xlator_t *this, fd_t *fd_in, int32_t default_lookup_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent); int32_t default_stat_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata); int32_t default_truncate_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int32_t default_ftruncate_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int32_t default_access_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_readlink_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, - struct iatt *buf, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + const char *path, struct iatt *buf, dict_t *xdata); int32_t default_mknod_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_mkdir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_unlink_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_rmdir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_symlink_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_rename_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, - struct iatt *preoldparent, struct iatt *postoldparent, - struct iatt *prenewparent, struct iatt *postnewparent, - dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct iatt *buf, struct iatt *preoldparent, + struct iatt *postoldparent, struct iatt *prenewparent, + struct iatt *postnewparent, dict_t *xdata); int32_t default_link_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_create_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_open_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata); int32_t default_readv_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, - int32_t count, struct iatt *stbuf, - struct iobref *iobref, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct iovec *vector, int32_t count, + struct iatt *stbuf, struct iobref *iobref, + dict_t *xdata); int32_t default_writev_cbk_resume(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); + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata); int32_t default_flush_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_fsync_cbk_resume(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); + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata); int32_t default_fstat_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata); int32_t default_opendir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata); int32_t default_fsyncdir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + dict_t *xdata); int32_t default_statfs_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, - dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct statvfs *buf, dict_t *xdata); int32_t default_setxattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + dict_t *xdata); int32_t default_fsetxattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + dict_t *xdata); int32_t default_fgetxattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int32_t default_getxattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int32_t default_xattrop_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int32_t default_fxattrop_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int32_t default_removexattr_cbk_resume(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, int32_t op_errno, - dict_t *xdata); + xlator_t *this, gf_return_t op_ret, + int32_t op_errno, dict_t *xdata); int32_t default_fremovexattr_cbk_resume(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_lk_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, - dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct gf_flock *lock, dict_t *xdata); int32_t default_inodelk_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_finodelk_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + dict_t *xdata); int32_t default_entrylk_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_fentrylk_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + dict_t *xdata); int32_t default_rchecksum_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, uint32_t weak_checksum, uint8_t *strong_checksum, dict_t *xdata); int32_t default_readdir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata); int32_t default_readdirp_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata); int32_t default_setattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); int32_t default_fsetattr_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); int32_t default_fallocate_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, - struct iatt *post, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct iatt *pre, struct iatt *post, + dict_t *xdata); int32_t default_discard_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, - struct iatt *post, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct iatt *pre, struct iatt *post, dict_t *xdata); int32_t default_zerofill_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, - struct iatt *post, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct iatt *pre, struct iatt *post, dict_t *xdata); int32_t default_ipc_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_seek_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, off_t offset, + gf_return_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata); int32_t default_getspec_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, char *spec_data); + gf_return_t op_ret, int32_t op_errno, + char *spec_data); int32_t default_lease_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct gf_lease *lease, dict_t *xdata); int32_t default_getactivelk_cbk_resume(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, int32_t op_errno, + xlator_t *this, gf_return_t op_ret, + int32_t op_errno, lock_migration_info_t *locklist, dict_t *xdata); int32_t default_setactivelk_cbk_resume(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, int32_t op_errno, - dict_t *xdata); + xlator_t *this, gf_return_t op_ret, + int32_t op_errno, dict_t *xdata); int32_t default_put_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); @@ -835,7 +846,7 @@ default_namelink_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t default_copy_file_range_cbk_resume(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata); @@ -843,264 +854,267 @@ default_copy_file_range_cbk_resume(call_frame_t *frame, void *cookie, /* _CBK */ int32_t default_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent); int32_t default_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata); int32_t default_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int32_t default_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int32_t default_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata); int32_t default_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata); int32_t default_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata); int32_t default_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata); int32_t default_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int32_t default_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int32_t default_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata); int32_t default_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata); int32_t default_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata); int32_t default_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int32_t default_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int32_t default_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int32_t default_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int32_t default_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata); int32_t default_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, - uint8_t *strong_checksum, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + uint32_t weak_checksum, uint8_t *strong_checksum, + dict_t *xdata); int32_t default_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata); int32_t default_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata); int32_t default_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); int32_t default_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata); int32_t default_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata); int32_t default_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata); int32_t default_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata); int32_t default_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, off_t offset, + dict_t *xdata); int32_t default_getspec_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, char *spec_data); + gf_return_t op_ret, int32_t op_errno, char *spec_data); int32_t default_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_lease *lease, + gf_return_t op_ret, int32_t op_errno, struct gf_lease *lease, dict_t *xdata); int32_t default_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, lock_migration_info_t *locklist, dict_t *xdata); int32_t default_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t default_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t default_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata); int32_t default_namelink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int32_t default_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata); diff --git a/libglusterfs/src/glusterfs/stack.h b/libglusterfs/src/glusterfs/stack.h index 536a330d38..9ac19f166d 100644 --- a/libglusterfs/src/glusterfs/stack.h +++ b/libglusterfs/src/glusterfs/stack.h @@ -42,8 +42,8 @@ typedef struct call_pool call_pool_t; (stack->client ? stack->client->client_uid : "-") typedef int32_t (*ret_fn_t)(call_frame_t *frame, call_frame_t *prev_frame, - xlator_t *this, int32_t op_ret, int32_t op_errno, - ...); + xlator_t *this, gf_return_t op_ret, + int32_t op_errno, ...); void gf_frame_latency_update(call_frame_t *frame); diff --git a/libglusterfs/src/glusterfs/syncop.h b/libglusterfs/src/glusterfs/syncop.h index 4e9241a32f..d5a7fd3bc5 100644 --- a/libglusterfs/src/glusterfs/syncop.h +++ b/libglusterfs/src/glusterfs/syncop.h @@ -170,7 +170,7 @@ struct syncbarrier { typedef struct syncbarrier syncbarrier_t; struct syncargs { - int op_ret; + gf_return_t op_ret; int op_errno; /* @@ -677,7 +677,7 @@ syncop_getactivelk(xlator_t *subvol, loc_t *loc, int syncop_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int syncop_setactivelk(xlator_t *subvol, loc_t *loc, @@ -692,7 +692,7 @@ syncop_put(xlator_t *subvol, loc_t *loc, mode_t mode, mode_t umask, int syncop_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int syncop_icreate(xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *xdata_out); @@ -711,7 +711,7 @@ syncop_copy_file_range(xlator_t *subvol, fd_t *fd_in, off64_t off_in, int syncop_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *stbuf, + gf_return_t op_ret, int op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata); diff --git a/libglusterfs/src/glusterfs/xlator.h b/libglusterfs/src/glusterfs/xlator.h index 4fd3abdaef..03c00e041a 100644 --- a/libglusterfs/src/glusterfs/xlator.h +++ b/libglusterfs/src/glusterfs/xlator.h @@ -79,11 +79,11 @@ struct _loc { }; typedef int32_t (*fop_getspec_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, char *spec_data); typedef int32_t (*fop_rchecksum_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, uint32_t weak_checksum, uint8_t *strong_checksum, dict_t *xdata); @@ -95,70 +95,70 @@ typedef int32_t (*fop_rchecksum_t)(call_frame_t *frame, xlator_t *this, dict_t *xdata); typedef int32_t (*fop_lookup_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent); typedef int32_t (*fop_stat_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata); typedef int32_t (*fop_fstat_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata); typedef int32_t (*fop_truncate_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); typedef int32_t (*fop_ftruncate_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); typedef int32_t (*fop_access_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_readlink_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata); typedef int32_t (*fop_mknod_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); typedef int32_t (*fop_mkdir_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); typedef int32_t (*fop_unlink_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); typedef int32_t (*fop_rmdir_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); typedef int32_t (*fop_symlink_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); typedef int32_t (*fop_rename_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, @@ -166,196 +166,196 @@ typedef int32_t (*fop_rename_cbk_t)(call_frame_t *frame, void *cookie, struct iatt *postnewparent, dict_t *xdata); typedef int32_t (*fop_link_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); typedef int32_t (*fop_create_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); typedef int32_t (*fop_open_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata); typedef int32_t (*fop_readv_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata); typedef int32_t (*fop_writev_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); typedef int32_t (*fop_flush_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_fsync_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); typedef int32_t (*fop_opendir_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata); typedef int32_t (*fop_fsyncdir_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_statfs_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata); typedef int32_t (*fop_setxattr_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_getxattr_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); typedef int32_t (*fop_fsetxattr_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_fgetxattr_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); typedef int32_t (*fop_removexattr_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_fremovexattr_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_lk_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct gf_flock *flock, dict_t *xdata); typedef int32_t (*fop_inodelk_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_finodelk_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_entrylk_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_fentrylk_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_readdir_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata); typedef int32_t (*fop_readdirp_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata); typedef int32_t (*fop_xattrop_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata); typedef int32_t (*fop_fxattrop_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata); typedef int32_t (*fop_setattr_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata); typedef int32_t (*fop_fsetattr_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata); typedef int32_t (*fop_fallocate_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata); typedef int32_t (*fop_discard_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata); typedef int32_t (*fop_zerofill_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata); typedef int32_t (*fop_ipc_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_seek_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata); typedef int32_t (*fop_lease_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct gf_lease *lease, dict_t *xdata); typedef int32_t (*fop_compound_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, void *data, dict_t *xdata); typedef int32_t (*fop_getactivelk_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, lock_migration_info_t *locklist, dict_t *xdata); typedef int32_t (*fop_setactivelk_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int32_t (*fop_put_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); typedef int32_t (*fop_icreate_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata); typedef int32_t (*fop_namelink_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); typedef int32_t (*fop_copy_file_range_cbk_t)( - call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, + call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata); diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index dbadf77442..84278183aa 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -2024,7 +2024,7 @@ inode_needs_lookup(inode_t *inode, xlator_t *this) { uint64_t need_lookup = 0; gf_boolean_t ret = _gf_false; - int op_ret = -1; + gf_return_t op_ret = -1; if (!inode || !this) return ret; diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index df20cec559..75eb8060ba 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -1310,9 +1310,9 @@ syncbarrier_wake(struct syncbarrier *barrier) /* FOPS */ int -syncop_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *iatt, - dict_t *xdata, struct iatt *parent) +syncop_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *iatt, dict_t *xdata, struct iatt *parent) { struct syncargs *args = NULL; @@ -1360,7 +1360,7 @@ syncop_lookup(xlator_t *subvol, loc_t *loc, struct iatt *iatt, int32_t syncop_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { struct syncargs *args = NULL; @@ -1430,7 +1430,7 @@ syncop_readdirp(xlator_t *subvol, fd_t *fd, size_t size, off_t off, int32_t syncop_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { struct syncargs *args = NULL; @@ -1500,7 +1500,8 @@ syncop_readdir(xlator_t *subvol, fd_t *fd, size_t size, off_t off, int32_t syncop_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { struct syncargs *args = NULL; @@ -1539,7 +1540,7 @@ syncop_opendir(xlator_t *subvol, loc_t *loc, fd_t *fd, dict_t *xdata_in, int syncop_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -1578,7 +1579,7 @@ syncop_fsyncdir(xlator_t *subvol, fd_t *fd, int datasync, dict_t *xdata_in, int syncop_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -1617,7 +1618,7 @@ syncop_removexattr(xlator_t *subvol, loc_t *loc, const char *name, int syncop_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -1656,7 +1657,7 @@ syncop_fremovexattr(xlator_t *subvol, fd_t *fd, const char *name, int syncop_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -1695,7 +1696,7 @@ syncop_setxattr(xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags, int syncop_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -1734,7 +1735,8 @@ syncop_fsetxattr(xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags, int syncop_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *dict, + dict_t *xdata) { struct syncargs *args = NULL; @@ -1833,7 +1835,7 @@ syncop_fgetxattr(xlator_t *subvol, fd_t *fd, dict_t **dict, const char *key, int syncop_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { @@ -1881,7 +1883,7 @@ syncop_statfs(xlator_t *subvol, loc_t *loc, struct statvfs *buf, int syncop_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *preop, + gf_return_t op_ret, int op_errno, struct iatt *preop, struct iatt *postop, dict_t *xdata) { struct syncargs *args = NULL; @@ -1959,7 +1961,7 @@ syncop_fsetattr(xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid, int32_t syncop_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { struct syncargs *args = NULL; @@ -1998,7 +2000,7 @@ syncop_open(xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd, int32_t syncop_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -2070,9 +2072,9 @@ syncop_readv(xlator_t *subvol, fd_t *fd, size_t size, off_t off, uint32_t flags, } int -syncop_writev_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) +syncop_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { struct syncargs *args = NULL; @@ -2159,8 +2161,8 @@ syncop_close(fd_t *fd) int32_t syncop_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { struct syncargs *args = NULL; @@ -2206,7 +2208,7 @@ syncop_create(xlator_t *subvol, loc_t *loc, int32_t flags, mode_t mode, int32_t syncop_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2255,9 +2257,9 @@ syncop_put(xlator_t *subvol, loc_t *loc, mode_t mode, mode_t umask, } int -syncop_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +syncop_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { struct syncargs *args = NULL; @@ -2295,9 +2297,9 @@ syncop_unlink(xlator_t *subvol, loc_t *loc, dict_t *xdata_in, } int -syncop_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +syncop_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { struct syncargs *args = NULL; @@ -2336,7 +2338,7 @@ syncop_rmdir(xlator_t *subvol, loc_t *loc, int flags, dict_t *xdata_in, int syncop_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2384,7 +2386,7 @@ syncop_link(xlator_t *subvol, loc_t *oldloc, loc_t *newloc, struct iatt *iatt, int syncop_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -2427,7 +2429,7 @@ syncop_rename(xlator_t *subvol, loc_t *oldloc, loc_t *newloc, dict_t *xdata_in, int syncop_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct syncargs *args = NULL; @@ -2498,7 +2500,7 @@ syncop_truncate(xlator_t *subvol, loc_t *loc, off_t offset, dict_t *xdata_in, int syncop_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct syncargs *args = NULL; @@ -2548,7 +2550,7 @@ syncop_fsync(xlator_t *subvol, fd_t *fd, int dataonly, struct iatt *preiatt, int syncop_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -2584,7 +2586,7 @@ syncop_flush(xlator_t *subvol, fd_t *fd, dict_t *xdata_in, dict_t **xdata_out) int syncop_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, dict_t *xdata) { struct syncargs *args = NULL; @@ -2654,7 +2656,7 @@ syncop_stat(xlator_t *subvol, loc_t *loc, struct iatt *stbuf, dict_t *xdata_in, int32_t syncop_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2701,7 +2703,7 @@ syncop_symlink(xlator_t *subvol, loc_t *loc, const char *newpath, int syncop_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, const char *path, + gf_return_t op_ret, int op_errno, const char *path, struct iatt *stbuf, dict_t *xdata) { struct syncargs *args = NULL; @@ -2749,7 +2751,7 @@ syncop_readlink(xlator_t *subvol, loc_t *loc, char **buffer, size_t size, int syncop_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2796,7 +2798,7 @@ syncop_mknod(xlator_t *subvol, loc_t *loc, mode_t mode, dev_t rdev, int syncop_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2843,7 +2845,7 @@ syncop_mkdir(xlator_t *subvol, loc_t *loc, mode_t mode, struct iatt *iatt, int syncop_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -2897,7 +2899,7 @@ syncop_access(xlator_t *subvol, loc_t *loc, int32_t mask, dict_t *xdata_in, int syncop_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct syncargs *args = NULL; @@ -2937,7 +2939,7 @@ syncop_fallocate(xlator_t *subvol, fd_t *fd, int32_t keep_size, off_t offset, int syncop_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct syncargs *args = NULL; @@ -2977,7 +2979,7 @@ syncop_discard(xlator_t *subvol, fd_t *fd, off_t offset, size_t len, int syncop_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct syncargs *args = NULL; @@ -3016,8 +3018,8 @@ syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len, } int -syncop_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xdata) +syncop_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -3061,8 +3063,8 @@ syncop_ipc(xlator_t *subvol, int32_t op, dict_t *xdata_in, dict_t **xdata_out) } int -syncop_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, off_t offset, dict_t *xdata) +syncop_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, off_t offset, dict_t *xdata) { struct syncargs *args = NULL; @@ -3100,8 +3102,9 @@ syncop_seek(xlator_t *subvol, fd_t *fd, off_t offset, gf_seek_what_t what, } int -syncop_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct gf_lease *lease, dict_t *xdata) +syncop_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct gf_lease *lease, + dict_t *xdata) { struct syncargs *args = NULL; @@ -3151,8 +3154,9 @@ syncop_lease(xlator_t *subvol, loc_t *loc, struct gf_lease *lease, } int -syncop_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct gf_flock *flock, dict_t *xdata) +syncop_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct gf_flock *flock, + dict_t *xdata) { struct syncargs *args = NULL; @@ -3195,7 +3199,7 @@ syncop_lk(xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock, int32_t syncop_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -3235,7 +3239,7 @@ syncop_inodelk(xlator_t *subvol, const char *volume, loc_t *loc, int32_t cmd, int32_t syncop_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -3274,7 +3278,7 @@ syncop_entrylk(xlator_t *subvol, const char *volume, loc_t *loc, int32_t syncop_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { struct syncargs *args = NULL; @@ -3351,7 +3355,7 @@ syncop_fxattrop(xlator_t *subvol, fd_t *fd, gf_xattrop_flags_t flags, int32_t syncop_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, lock_migration_info_t *locklist, dict_t *xdata) { struct syncargs *args = NULL; @@ -3428,7 +3432,7 @@ syncop_getactivelk(xlator_t *subvol, loc_t *loc, int syncop_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct syncargs *args = NULL; @@ -3470,7 +3474,7 @@ syncop_setactivelk(xlator_t *subvol, loc_t *loc, int syncop_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata) { struct syncargs *args = NULL; @@ -3492,7 +3496,7 @@ syncop_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int syncop_namelink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct syncargs *args = NULL; @@ -3547,7 +3551,7 @@ syncop_copy_file_range(xlator_t *subvol, fd_t *fd_in, off64_t off_in, int syncop_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *stbuf, + gf_return_t op_ret, int op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata) { diff --git a/rpc/xdr/src/changelog-xdr.x b/rpc/xdr/src/changelog-xdr.x index 5956245d5c..0ef9b8ff93 100644 --- a/rpc/xdr/src/changelog-xdr.x +++ b/rpc/xdr/src/changelog-xdr.x @@ -21,7 +21,7 @@ struct changelog_probe_req { }; struct changelog_probe_rsp { - int op_ret; + gf_return_t op_ret; }; /* XDR: changelog -> libgfchangelog */ @@ -35,7 +35,7 @@ struct changelog_event_req { }; struct changelog_event_rsp { - int op_ret; + gf_return_t op_ret; /* ack'd buffers sequence number */ unsigned hyper seq; diff --git a/rpc/xdr/src/cli1-xdr.x b/rpc/xdr/src/cli1-xdr.x index 777cb0046a..0d59ca52fb 100644 --- a/rpc/xdr/src/cli1-xdr.x +++ b/rpc/xdr/src/cli1-xdr.x @@ -246,7 +246,7 @@ struct gf_cli_req { }; struct gf_cli_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -258,7 +258,7 @@ struct gf1_cli_peer_list_req { }; struct gf1_cli_peer_list_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque friends<>; }; @@ -268,7 +268,7 @@ struct gf1_cli_fsm_log_req { }; struct gf1_cli_fsm_log_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; string op_errstr<>; opaque fsm_log<>; @@ -279,7 +279,7 @@ struct gf1_cli_getwd_req { }; struct gf1_cli_getwd_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; string wd<>; }; @@ -290,7 +290,7 @@ struct gf1_cli_mount_req { }; struct gf1_cli_mount_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; string path<>; }; @@ -301,6 +301,6 @@ struct gf1_cli_umount_req { }; struct gf1_cli_umount_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; }; diff --git a/rpc/xdr/src/glusterd1-xdr.x b/rpc/xdr/src/glusterd1-xdr.x index 02ebec26c0..8388f2531a 100644 --- a/rpc/xdr/src/glusterd1-xdr.x +++ b/rpc/xdr/src/glusterd1-xdr.x @@ -29,7 +29,7 @@ unsigned char uuid[16]; string hostname<>; int port; - int op_ret; + gf_return_t op_ret; int op_errno; string op_errstr<>; } ; @@ -44,7 +44,7 @@ struct gd1_mgmt_friend_req { struct gd1_mgmt_friend_rsp { unsigned char uuid[16]; string hostname<>; - int op_ret; + gf_return_t op_ret; int op_errno; int port; } ; @@ -58,7 +58,7 @@ struct gd1_mgmt_unfriend_req { struct gd1_mgmt_unfriend_rsp { unsigned char uuid[16]; string hostname<>; - int op_ret; + gf_return_t op_ret; int op_errno; int port; } ; @@ -69,7 +69,7 @@ struct gd1_mgmt_cluster_lock_req { struct gd1_mgmt_cluster_lock_rsp { unsigned char uuid[16]; - int op_ret; + gf_return_t op_ret; int op_errno; } ; @@ -79,7 +79,7 @@ struct gd1_mgmt_cluster_unlock_req { struct gd1_mgmt_cluster_unlock_rsp { unsigned char uuid[16]; - int op_ret; + gf_return_t op_ret; int op_errno; } ; @@ -93,7 +93,7 @@ struct gd1_mgmt_stage_op_req { struct gd1_mgmt_stage_op_rsp { unsigned char uuid[16]; int op; - int op_ret; + gf_return_t op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -109,7 +109,7 @@ struct gd1_mgmt_commit_op_req { struct gd1_mgmt_commit_op_rsp { unsigned char uuid[16]; int op; - int op_ret; + gf_return_t op_ret; int op_errno; opaque dict<>; string op_errstr<>; @@ -124,7 +124,7 @@ struct gd1_mgmt_friend_update { struct gd1_mgmt_friend_update_rsp { unsigned char uuid[16]; int op; - int op_ret; + gf_return_t op_ret; int op_errno; } ; @@ -136,7 +136,7 @@ struct gd1_mgmt_brick_op_req { } ; struct gd1_mgmt_brick_op_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque output<>; string op_errstr<>; @@ -153,7 +153,7 @@ struct gd1_mgmt_v3_lock_rsp { unsigned char uuid[16]; unsigned char txn_id[16]; opaque dict<>; - int op_ret; + gf_return_t op_ret; int op_errno; } ; @@ -166,7 +166,7 @@ struct gd1_mgmt_v3_pre_val_req { struct gd1_mgmt_v3_pre_val_rsp { unsigned char uuid[16]; int op; - int op_ret; + gf_return_t op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -181,7 +181,7 @@ struct gd1_mgmt_v3_brick_op_req { struct gd1_mgmt_v3_brick_op_rsp { unsigned char uuid[16]; int op; - int op_ret; + gf_return_t op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -196,7 +196,7 @@ struct gd1_mgmt_v3_commit_req { struct gd1_mgmt_v3_commit_rsp { unsigned char uuid[16]; int op; - int op_ret; + gf_return_t op_ret; int op_errno; opaque dict<>; string op_errstr<>; @@ -205,14 +205,14 @@ struct gd1_mgmt_v3_commit_rsp { struct gd1_mgmt_v3_post_val_req { unsigned char uuid[16]; int op; - int op_ret; + gf_return_t op_ret; opaque dict<>; } ; struct gd1_mgmt_v3_post_val_rsp { unsigned char uuid[16]; int op; - int op_ret; + gf_return_t op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -229,6 +229,6 @@ struct gd1_mgmt_v3_unlock_rsp { unsigned char uuid[16]; unsigned char txn_id[16]; opaque dict<>; - int op_ret; + gf_return_t op_ret; int op_errno; } ; diff --git a/rpc/xdr/src/glusterfs3-xdr.x b/rpc/xdr/src/glusterfs3-xdr.x index 1c99099a72..9a70b4f48e 100644 --- a/rpc/xdr/src/glusterfs3-xdr.x +++ b/rpc/xdr/src/glusterfs3-xdr.x @@ -87,7 +87,7 @@ struct gfs3_stat_req { opaque xdata<>; /* Extra data */ }; struct gfs3_stat_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt stat; opaque xdata<>; /* Extra data */ @@ -100,7 +100,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_readlink_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt buf; string path<>; /* NULL terminated */ @@ -117,7 +117,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_mknod_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt stat; gf_iatt preparent; @@ -134,7 +134,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_mkdir_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt stat; gf_iatt preparent; @@ -150,7 +150,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_unlink_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt preparent; gf_iatt postparent; @@ -165,7 +165,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_rmdir_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt preparent; gf_iatt postparent; @@ -181,7 +181,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_symlink_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt stat; gf_iatt preparent; @@ -198,7 +198,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_rename_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt stat; gf_iatt preoldparent; @@ -216,7 +216,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_link_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt stat; gf_iatt preparent; @@ -230,7 +230,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_truncate_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt prestat; gf_iatt poststat; @@ -244,7 +244,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_open_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; quad_t fd; opaque xdata<>; /* Extra data */ @@ -260,7 +260,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_read_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt stat; unsigned int size; @@ -275,7 +275,7 @@ struct gfs3_lookup_req { opaque xdata<>; /* Extra data */ }; struct gfs3_lookup_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt stat; gf_iatt postparent; @@ -293,7 +293,7 @@ struct gfs3_lookup_req { opaque xdata<>; /* Extra data */ }; struct gfs3_write_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt prestat; gf_iatt poststat; @@ -306,7 +306,7 @@ struct gfs3_lookup_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_statfs_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_statfs statfs; opaque xdata<>; /* Extra data */ @@ -321,7 +321,7 @@ struct gfs3_lookup_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_lk_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_proto_flock flock; opaque xdata<>; /* Extra data */ @@ -334,7 +334,7 @@ struct gfs3_lease_req { } ; struct gfs3_lease_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_proto_lease lease; opaque xdata<>; /* Extra data */ @@ -381,7 +381,7 @@ struct gfs3_finodelk_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_fsync_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt prestat; gf_iatt poststat; @@ -416,7 +416,7 @@ struct gfs3_finodelk_req { } ; struct gfs3_xattrop_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque dict<>; opaque xdata<>; /* Extra data */ @@ -432,7 +432,7 @@ struct gfs3_finodelk_req { } ; struct gfs3_fxattrop_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque dict<>; opaque xdata<>; /* Extra data */ @@ -446,7 +446,7 @@ struct gfs3_finodelk_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_getxattr_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque dict<>; opaque xdata<>; /* Extra data */ @@ -461,7 +461,7 @@ struct gfs3_finodelk_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_fgetxattr_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque dict<>; opaque xdata<>; /* Extra data */ @@ -488,7 +488,7 @@ struct gfs3_finodelk_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_opendir_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; quad_t fd; opaque xdata<>; /* Extra data */ @@ -535,7 +535,7 @@ struct gfs3_create_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_create_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt stat; u_quad_t fd; @@ -553,7 +553,7 @@ struct gfs3_ftruncate_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_ftruncate_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt prestat; gf_iatt poststat; @@ -567,7 +567,7 @@ struct gfs3_fstat_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_fstat_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt stat; opaque xdata<>; /* Extra data */ @@ -604,7 +604,7 @@ struct gfs3_fstat_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_setattr_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt statpre; gf_iatt statpost; @@ -618,7 +618,7 @@ struct gfs3_fstat_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_fsetattr_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt statpre; gf_iatt statpost; @@ -635,7 +635,7 @@ struct gfs3_fstat_req { } ; struct gfs3_fallocate_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt statpre; gf_iatt statpost; @@ -651,7 +651,7 @@ struct gfs3_fstat_req { } ; struct gfs3_discard_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt statpre; gf_iatt statpost; @@ -667,7 +667,7 @@ struct gfs3_fstat_req { } ; struct gfs3_zerofill_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gf_iatt statpre; gf_iatt statpost; @@ -682,7 +682,7 @@ struct gfs3_fstat_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_rchecksum_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; unsigned int weak_checksum; opaque strong_checksum<>; @@ -696,7 +696,7 @@ struct gfs3_ipc_req { }; struct gfs3_ipc_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque xdata<>; }; @@ -711,7 +711,7 @@ struct gfs3_seek_req { }; struct gfs3_seek_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; u_quad_t offset; opaque xdata<>; @@ -722,7 +722,7 @@ struct gfs3_seek_rsp { opaque dict<>; } ; struct gf_setvolume_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque dict<>; } ; @@ -734,7 +734,7 @@ struct gfs3_seek_rsp { opaque xdata<>; /* Extra data */ } ; struct gf_getspec_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; string spec<>; opaque xdata<>; /* Extra data */ @@ -744,7 +744,7 @@ struct gfs3_seek_rsp { opaque dict<>; /* Extra data */ } ; struct gf_get_volume_info_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; string op_errstr<>; opaque dict<>; /* Extra data */ @@ -755,7 +755,7 @@ struct gfs3_seek_rsp { } ; struct gf_mgmt_hndsk_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque hndsk<>; } ; @@ -770,7 +770,7 @@ struct gfs3_seek_rsp { opaque xdata<>; /* Extra data */ } ; struct gf_notify_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; unsigned int flags; string buf<>; @@ -800,7 +800,7 @@ struct gfs3_dirlist { struct gfs3_readdir_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfs3_dirlist *reply; opaque xdata<>; /* Extra data */ @@ -818,14 +818,14 @@ struct gfs3_dirplist { }; struct gfs3_readdirp_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfs3_dirplist *reply; opaque xdata<>; /* Extra data */ }; struct gf_set_lk_ver_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; int lk_ver; }; @@ -841,7 +841,7 @@ struct gf_event_notify_req { }; struct gf_event_notify_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque dict<>; }; @@ -852,7 +852,7 @@ struct gf_getsnap_name_uuid_req { }; struct gf_getsnap_name_uuid_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -866,7 +866,7 @@ struct gfs3_locklist { }; struct gfs3_getactivelk_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfs3_locklist *reply; opaque xdata<>; @@ -878,7 +878,7 @@ struct gfs3_getactivelk_req { }; struct gfs3_setactivelk_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque xdata<>; }; diff --git a/rpc/xdr/src/glusterfs4-xdr.x b/rpc/xdr/src/glusterfs4-xdr.x index d3b1d0dfaf..4c3f9a1e7a 100644 --- a/rpc/xdr/src/glusterfs4-xdr.x +++ b/rpc/xdr/src/glusterfs4-xdr.x @@ -112,20 +112,20 @@ struct gfx_dict { /* FOPS */ struct gfx_common_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ }; struct gfx_common_iatt_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; gfx_iattx stat; }; struct gfx_common_2iatt_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; gfx_iattx prestat; @@ -133,7 +133,7 @@ struct gfx_common_2iatt_rsp { }; struct gfx_common_3iatt_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_iattx stat; @@ -200,7 +200,7 @@ struct gfx_readlink_req { }; struct gfx_readlink_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_iattx buf; @@ -256,7 +256,7 @@ struct gfx_rename_req { }; struct gfx_rename_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_iattx stat; @@ -287,7 +287,7 @@ struct gfx_rename_rsp { }; struct gfx_open_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ quad_t fd; @@ -308,7 +308,7 @@ struct gfx_opendir_req { gfx_dict xdata; /* Extra data */ }; struct gfx_read_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_iattx stat; unsigned int size; @@ -338,7 +338,7 @@ struct gfx_lookup_req { gfx_dict xdata; /* Extra data */ } ; struct gfx_statfs_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gf_statfs statfs; @@ -353,7 +353,7 @@ struct gfx_lookup_req { gfx_dict xdata; /* Extra data */ } ; struct gfx_lk_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gf_proto_flock flock; @@ -366,7 +366,7 @@ struct gfx_lease_req { } ; struct gfx_lease_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gf_proto_lease lease; @@ -440,7 +440,7 @@ struct gfx_finodelk_req { } ; struct gfx_common_dict_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_dict dict; @@ -527,7 +527,7 @@ struct gfx_create_req { gfx_dict xdata; /* Extra data */ } ; struct gfx_create_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_iattx stat; @@ -605,7 +605,7 @@ struct gfx_zerofill_req { } ; struct gfx_rchecksum_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ unsigned int flags; @@ -629,7 +629,7 @@ struct gfx_seek_req { }; struct gfx_seek_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; u_quad_t offset; @@ -653,7 +653,7 @@ struct gfx_seek_rsp { }; struct gfx_setvolume_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict dict; } ; @@ -665,7 +665,7 @@ struct gfx_seek_rsp { gfx_dict xdata; /* Extra data */ } ; struct gfx_getspec_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; string spec<>; gfx_dict xdata; /* Extra data */ @@ -678,7 +678,7 @@ struct gfx_seek_rsp { gfx_dict xdata; /* Extra data */ } ; struct gfx_notify_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; unsigned int flags; string buf<>; @@ -708,7 +708,7 @@ struct gfx_dirlist { struct gfx_readdir_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_dirlist *reply; @@ -726,14 +726,14 @@ struct gfx_dirplist { }; struct gfx_readdirp_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_dirplist *reply; }; struct gfx_set_lk_ver_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; int lk_ver; @@ -755,14 +755,14 @@ struct gfx_getsnap_name_uuid_req { }; struct gfx_getsnap_name_uuid_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict dict; string op_errstr<>; }; struct gfx_getactivelk_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; gfx_dict xdata; gfs3_locklist *reply; diff --git a/rpc/xdr/src/portmap-xdr.x b/rpc/xdr/src/portmap-xdr.x index 23515572b9..978db2a8d6 100644 --- a/rpc/xdr/src/portmap-xdr.x +++ b/rpc/xdr/src/portmap-xdr.x @@ -18,7 +18,7 @@ struct pmap_port_by_brick_req { }; struct pmap_port_by_brick_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; int status; int port; @@ -30,7 +30,7 @@ struct pmap_brick_by_port_req { }; struct pmap_brick_by_port_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; int status; string brick<>; @@ -44,7 +44,7 @@ struct pmap_signin_req { }; struct pmap_signin_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; }; @@ -55,6 +55,6 @@ struct pmap_signout_req { }; struct pmap_signout_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; }; diff --git a/rpc/xdr/src/rpc-common-xdr.x b/rpc/xdr/src/rpc-common-xdr.x index baf8b4313c..cc34f48d83 100644 --- a/rpc/xdr/src/rpc-common-xdr.x +++ b/rpc/xdr/src/rpc-common-xdr.x @@ -53,14 +53,14 @@ struct gf_prog_detail { struct gf_dump_rsp { u_quad_t gfs_id; - int op_ret; + gf_return_t op_ret; int op_errno; struct gf_prog_detail *prog; }; struct gf_common_rsp { - int op_ret; + gf_return_t op_ret; int op_errno; opaque xdata<>; /* Extra data */ } ; diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 4c8fa31b67..3574c3d911 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -71,7 +71,7 @@ afr_discover_done(call_frame_t *frame, xlator_t *this); int afr_dom_lock_acquire_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { afr_local_t *local = frame->local; afr_private_t *priv = this->private; @@ -157,7 +157,7 @@ afr_dom_lock_acquire(call_frame_t *frame) int afr_dom_lock_release_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { afr_local_t *local = frame->local; afr_private_t *priv = this->private; @@ -331,7 +331,7 @@ afr_remove_lock_from_saved_locks(afr_local_t *local, xlator_t *this) int afr_lock_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { afr_local_t *local = frame->local; @@ -350,8 +350,9 @@ afr_lock_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int -afr_getlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct gf_flock *lock, dict_t *xdata) +afr_getlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, + dict_t *xdata) { afr_local_t *local = frame->local; int i = (long)cookie; @@ -1872,7 +1873,7 @@ afr_inode_refresh_done(call_frame_t *frame, xlator_t *this, int error) void afr_inode_refresh_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *buf, + gf_return_t op_ret, int op_errno, struct iatt *buf, dict_t *xdata, struct iatt *par) { afr_local_t *local = NULL; @@ -1914,7 +1915,7 @@ afr_inode_refresh_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int afr_inode_refresh_subvol_with_lookup_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, + xlator_t *this, gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *par) @@ -1952,7 +1953,7 @@ afr_inode_refresh_subvol_with_lookup(call_frame_t *frame, xlator_t *this, int i, int afr_inode_refresh_subvol_with_fstat_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { @@ -3125,7 +3126,7 @@ afr_final_errno(afr_local_t *local, afr_private_t *priv) static int32_t afr_local_discovery_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { int ret = 0; @@ -3538,9 +3539,9 @@ afr_lookup_entry_heal(call_frame_t *frame, xlator_t *this) } int -afr_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, - struct iatt *postparent) +afr_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { afr_local_t *local = NULL; int call_count = -1; @@ -3735,9 +3736,9 @@ afr_discover_done(call_frame_t *frame, xlator_t *this) } int -afr_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, - struct iatt *postparent) +afr_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { afr_local_t *local = NULL; int call_count = -1; @@ -4166,8 +4167,8 @@ __afr_fd_ctx_set(xlator_t *this, fd_t *fd) /* {{{ flush */ int -afr_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +afr_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { afr_local_t *local = NULL; int call_count = -1; @@ -4307,7 +4308,7 @@ afr_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) int afr_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { afr_local_t *local = NULL; int call_count = -1; @@ -4377,7 +4378,7 @@ static int afr_serialized_lock_wind(call_frame_t *frame, xlator_t *this); static gf_boolean_t -afr_is_conflicting_lock_present(int32_t op_ret, int32_t op_errno) +afr_is_conflicting_lock_present(gf_return_t op_ret, int32_t op_errno) { if (op_ret == -1 && op_errno == EAGAIN) return _gf_true; @@ -4385,7 +4386,7 @@ afr_is_conflicting_lock_present(int32_t op_ret, int32_t op_errno) } static void -afr_fop_lock_unwind(call_frame_t *frame, glusterfs_fop_t op, int32_t op_ret, +afr_fop_lock_unwind(call_frame_t *frame, glusterfs_fop_t op, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { switch (op) { @@ -4514,7 +4515,7 @@ afr_fop_lock_proceed(call_frame_t *frame) static int32_t afr_unlock_partial_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { afr_local_t *local = NULL; @@ -4663,7 +4664,7 @@ afr_fop_lock_done(call_frame_t *frame, xlator_t *this) static int afr_common_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { afr_local_t *local = NULL; int child_index = (long)cookie; @@ -4687,7 +4688,7 @@ afr_common_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int32_t afr_serialized_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { afr_local_t *local = NULL; @@ -4737,7 +4738,7 @@ afr_serialized_lock_wind(call_frame_t *frame, xlator_t *this) static int32_t afr_parallel_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { int call_count = 0; @@ -4941,8 +4942,9 @@ afr_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, } int -afr_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct statvfs *statvfs, dict_t *xdata) +afr_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct statvfs *statvfs, + dict_t *xdata) { afr_local_t *local = NULL; int call_count = 0; @@ -5034,7 +5036,7 @@ afr_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t afr_lk_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { afr_local_t *local = NULL; @@ -5102,8 +5104,9 @@ afr_lk_unlock(call_frame_t *frame, xlator_t *this) } int32_t -afr_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct gf_flock *lock, dict_t *xdata) +afr_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, + dict_t *xdata) { afr_local_t *local = NULL; afr_private_t *priv = NULL; @@ -5163,7 +5166,7 @@ afr_lk_transaction_cbk(int ret, call_frame_t *frame, void *opaque) int afr_lk_txn_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { afr_local_t *local = NULL; @@ -5184,8 +5187,8 @@ afr_lk_txn_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int afr_lk_txn_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct gf_flock *lock, dict_t *xdata) { afr_local_t *local = frame->local; afr_private_t *priv = this->private; @@ -5338,8 +5341,8 @@ afr_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, int32_t afr_lease_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_lease *lease, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct gf_lease *lease, dict_t *xdata) { afr_local_t *local = NULL; int call_count = -1; @@ -5393,8 +5396,9 @@ afr_lease_unlock(call_frame_t *frame, xlator_t *this) } int32_t -afr_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct gf_lease *lease, dict_t *xdata) +afr_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct gf_lease *lease, + dict_t *xdata) { afr_local_t *local = NULL; afr_private_t *priv = NULL; @@ -5482,8 +5486,8 @@ afr_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, } int -afr_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +afr_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { afr_local_t *local = NULL; int child_index = (long)cookie; diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c index f69013f3e0..46a3285a59 100644 --- a/xlators/cluster/afr/src/afr-dir-read.c +++ b/xlators/cluster/afr/src/afr-dir-read.c @@ -27,7 +27,7 @@ int32_t afr_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { afr_local_t *local = NULL; int call_count = -1; @@ -207,8 +207,8 @@ afr_readdir_transform_entries(gf_dirent_t *subvol_entries, int subvol, int32_t afr_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *subvol_entries, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + gf_dirent_t *subvol_entries, dict_t *xdata) { afr_local_t *local = NULL; gf_dirent_t entries; diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c index b7cceb7915..5a560eeef4 100644 --- a/xlators/cluster/afr/src/afr-dir-write.c +++ b/xlators/cluster/afr/src/afr-dir-write.c @@ -169,7 +169,7 @@ __afr_dir_write_finalize(call_frame_t *frame, xlator_t *this) static void __afr_dir_write_fill(call_frame_t *frame, xlator_t *this, int child_index, - int op_ret, int op_errno, struct iatt *poststat, + gf_return_t op_ret, int op_errno, struct iatt *poststat, struct iatt *preparent, struct iatt *postparent, struct iatt *preparent2, struct iatt *postparent2, dict_t *xdata) @@ -211,7 +211,7 @@ __afr_dir_write_fill(call_frame_t *frame, xlator_t *this, int child_index, static int __afr_dir_write_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *buf, + gf_return_t op_ret, int op_errno, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, struct iatt *preparent2, struct iatt *postparent2, dict_t *xdata) @@ -253,8 +253,8 @@ __afr_dir_write_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int afr_mark_new_entry_changelog_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, int op_errno, - dict_t *xattr, dict_t *xdata) + xlator_t *this, gf_return_t op_ret, + int op_errno, dict_t *xattr, dict_t *xdata) { int call_count = 0; @@ -406,8 +406,8 @@ afr_create_unwind(call_frame_t *frame, xlator_t *this) int afr_create_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { return __afr_dir_write_cbk(frame, cookie, this, op_ret, op_errno, buf, @@ -522,7 +522,7 @@ afr_mknod_unwind(call_frame_t *frame, xlator_t *this) int afr_mknod_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -630,7 +630,7 @@ afr_mkdir_unwind(call_frame_t *frame, xlator_t *this) int afr_mkdir_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -744,7 +744,7 @@ afr_link_unwind(call_frame_t *frame, xlator_t *this) int afr_link_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -851,7 +851,7 @@ afr_symlink_unwind(call_frame_t *frame, xlator_t *this) int afr_symlink_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -960,7 +960,7 @@ afr_rename_unwind(call_frame_t *frame, xlator_t *this) int afr_rename_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -1077,8 +1077,9 @@ afr_unlink_unwind(call_frame_t *frame, xlator_t *this) int afr_unlink_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { return __afr_dir_write_cbk(frame, cookie, this, op_ret, op_errno, NULL, preparent, postparent, NULL, NULL, xdata); @@ -1180,7 +1181,7 @@ afr_rmdir_unwind(call_frame_t *frame, xlator_t *this) int afr_rmdir_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { return __afr_dir_write_cbk(frame, cookie, this, op_ret, op_errno, NULL, diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index c5521704de..9217c1f2bf 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -114,8 +114,8 @@ afr_handle_quota_size(call_frame_t *frame, xlator_t *this) /* {{{ access */ int -afr_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xdata) +afr_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xdata) { afr_local_t *local = NULL; @@ -187,8 +187,9 @@ afr_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, /* {{{ stat */ int -afr_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +afr_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { afr_local_t *local = NULL; @@ -256,8 +257,9 @@ afr_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) /* {{{ fstat */ int -afr_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +afr_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { afr_local_t *local = NULL; @@ -329,7 +331,7 @@ afr_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) int afr_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *buf, + gf_return_t op_ret, int32_t op_errno, const char *buf, struct iatt *sbuf, dict_t *xdata) { afr_local_t *local = NULL; @@ -459,7 +461,8 @@ afr_getxattr_ignorable_errnos(int32_t op_errno) } int afr_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { afr_local_t *local = NULL; @@ -504,8 +507,8 @@ afr_getxattr_wind(call_frame_t *frame, xlator_t *this, int subvol) } int32_t -afr_getxattr_unwind(call_frame_t *frame, int op_ret, int op_errno, dict_t *dict, - dict_t *xdata) +afr_getxattr_unwind(call_frame_t *frame, gf_return_t op_ret, int op_errno, + dict_t *dict, dict_t *xdata) { AFR_STACK_UNWIND(getxattr, frame, op_ret, op_errno, dict, xdata); @@ -514,7 +517,7 @@ afr_getxattr_unwind(call_frame_t *frame, int op_ret, int op_errno, dict_t *dict, int32_t afr_fgetxattr_clrlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { afr_local_t *local = NULL; @@ -601,7 +604,7 @@ afr_fgetxattr_clrlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t afr_getxattr_clrlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { afr_local_t *local = NULL; @@ -693,7 +696,7 @@ afr_getxattr_clrlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t afr_getxattr_node_uuid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { afr_private_t *priv = NULL; @@ -741,7 +744,7 @@ afr_getxattr_node_uuid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t afr_getxattr_list_node_uuids_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { afr_local_t *local = NULL; @@ -838,7 +841,7 @@ afr_getxattr_list_node_uuids_cbk(call_frame_t *frame, void *cookie, int32_t afr_getxattr_quota_size_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { int idx = (long)cookie; @@ -868,7 +871,7 @@ afr_getxattr_quota_size_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t afr_getxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { int call_cnt = 0, len = 0; @@ -973,7 +976,7 @@ afr_getxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t afr_fgetxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { int call_cnt = 0, len = 0; @@ -1078,7 +1081,7 @@ afr_fgetxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t afr_fgetxattr_pathinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { afr_local_t *local = NULL; @@ -1202,7 +1205,7 @@ afr_fgetxattr_pathinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t afr_getxattr_pathinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { afr_local_t *local = NULL; @@ -1337,8 +1340,8 @@ afr_aggregate_stime_xattr(dict_t *this, char *key, data_t *value, void *data) int32_t afr_common_getxattr_stime_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + dict_t *dict, dict_t *xdata) { afr_local_t *local = NULL; int32_t callcnt = 0; @@ -1616,7 +1619,8 @@ afr_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, int32_t afr_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { afr_local_t *local = NULL; @@ -1743,9 +1747,10 @@ afr_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, /* {{{ readv */ int -afr_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iovec *vector, int32_t count, - struct iatt *buf, struct iobref *iobref, dict_t *xdata) +afr_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, + int32_t count, struct iatt *buf, struct iobref *iobref, + dict_t *xdata) { afr_local_t *local = NULL; @@ -1822,8 +1827,8 @@ afr_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, /* {{{ seek */ int -afr_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, off_t offset, dict_t *xdata) +afr_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) { afr_local_t *local = NULL; diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c index 1d6e4f3570..05966e5e4b 100644 --- a/xlators/cluster/afr/src/afr-inode-write.c +++ b/xlators/cluster/afr/src/afr-inode-write.c @@ -123,7 +123,7 @@ __afr_inode_write_finalize(call_frame_t *frame, xlator_t *this) static void __afr_inode_write_fill(call_frame_t *frame, xlator_t *this, int child_index, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xattr, dict_t *xdata) { afr_local_t *local = NULL; @@ -159,7 +159,7 @@ __afr_inode_write_fill(call_frame_t *frame, xlator_t *this, int child_index, static int __afr_inode_write_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xattr, dict_t *xdata) { afr_local_t *local = NULL; @@ -270,7 +270,7 @@ afr_writev_handle_short_writes(call_frame_t *frame, xlator_t *this) void afr_inode_write_fill(call_frame_t *frame, xlator_t *this, int child_index, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { int ret = 0; @@ -345,7 +345,7 @@ afr_process_post_writev(call_frame_t *frame, xlator_t *this) int afr_writev_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { call_frame_t *fop_frame = NULL; @@ -579,7 +579,7 @@ afr_truncate_unwind(call_frame_t *frame, xlator_t *this) int afr_truncate_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { afr_local_t *local = NULL; @@ -692,8 +692,8 @@ afr_ftruncate_unwind(call_frame_t *frame, xlator_t *this) int afr_ftruncate_wind_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { afr_local_t *local = NULL; @@ -807,7 +807,7 @@ afr_setattr_unwind(call_frame_t *frame, xlator_t *this) int afr_setattr_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *preop, + gf_return_t op_ret, int op_errno, struct iatt *preop, struct iatt *postop, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, preop, @@ -909,7 +909,7 @@ afr_fsetattr_unwind(call_frame_t *frame, xlator_t *this) int afr_fsetattr_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preop, + gf_return_t op_ret, int32_t op_errno, struct iatt *preop, struct iatt *postop, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, preop, @@ -1013,7 +1013,7 @@ afr_setxattr_unwind(call_frame_t *frame, xlator_t *this) int afr_setxattr_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, NULL, NULL, NULL, xdata); @@ -1038,8 +1038,8 @@ afr_setxattr_wind(call_frame_t *frame, xlator_t *this, int subvol) int afr_emptyb_set_pending_changelog_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, int op_errno, - dict_t *xattr, dict_t *xdata) + xlator_t *this, gf_return_t op_ret, + int op_errno, dict_t *xattr, dict_t *xdata) { afr_local_t *local = NULL; @@ -1648,7 +1648,7 @@ afr_fsetxattr_unwind(call_frame_t *frame, xlator_t *this) int afr_fsetxattr_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, NULL, NULL, NULL, xdata); @@ -1756,7 +1756,7 @@ afr_removexattr_unwind(call_frame_t *frame, xlator_t *this) int afr_removexattr_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, NULL, NULL, NULL, xdata); @@ -1858,7 +1858,7 @@ afr_fremovexattr_unwind(call_frame_t *frame, xlator_t *this) int afr_fremovexattr_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, NULL, NULL, NULL, xdata); @@ -1961,8 +1961,8 @@ afr_fallocate_unwind(call_frame_t *frame, xlator_t *this) int afr_fallocate_wind_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, prebuf, postbuf, NULL, xdata); @@ -2071,7 +2071,7 @@ afr_discard_unwind(call_frame_t *frame, xlator_t *this) int afr_discard_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, prebuf, @@ -2178,7 +2178,7 @@ afr_zerofill_unwind(call_frame_t *frame, xlator_t *this) int afr_zerofill_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, prebuf, @@ -2267,7 +2267,7 @@ afr_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t afr_xattrop_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, NULL, @@ -2361,7 +2361,7 @@ afr_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t afr_fxattrop_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, NULL, @@ -2475,7 +2475,7 @@ afr_fsync_unwind(call_frame_t *frame, xlator_t *this) int afr_fsync_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, prebuf, diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c index bc8eabe0f4..237d9920e9 100644 --- a/xlators/cluster/afr/src/afr-lk-common.c +++ b/xlators/cluster/afr/src/afr-lk-common.c @@ -270,7 +270,7 @@ afr_log_locks_failure(call_frame_t *frame, char *where, char *what, static int32_t afr_unlock_common_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { afr_local_t *local = NULL; afr_private_t *priv = NULL; @@ -420,8 +420,8 @@ afr_unlock_now(call_frame_t *frame, xlator_t *this) } static int32_t -afr_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +afr_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { afr_internal_lock_t *int_lock = NULL; afr_local_t *local = NULL; @@ -617,7 +617,7 @@ afr_blocking_lock(call_frame_t *frame, xlator_t *this) static int32_t afr_nb_internal_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { afr_internal_lock_t *int_lock = NULL; afr_local_t *local = NULL; diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c index 64856042b6..7170c505cc 100644 --- a/xlators/cluster/afr/src/afr-open.c +++ b/xlators/cluster/afr/src/afr-open.c @@ -41,8 +41,8 @@ afr_is_fd_fixable(fd_t *fd) int afr_open_ftruncate_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { afr_local_t *local = frame->local; @@ -52,8 +52,8 @@ afr_open_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int -afr_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +afr_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { afr_local_t *local = NULL; int call_count = -1; @@ -197,7 +197,7 @@ afr_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int afr_openfd_fix_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { afr_local_t *local = NULL; diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index f35c41df27..4e828d7699 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -407,7 +407,8 @@ afr_gfid_split_brain_source(xlator_t *this, struct afr_reply *replies, int afr_selfheal_post_op_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xattr, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xattr, + dict_t *xdata) { afr_local_t *local = NULL; @@ -476,7 +477,7 @@ afr_check_stale_error(struct afr_reply *replies, afr_private_t *priv) int afr_sh_generic_fop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *pre, + gf_return_t op_ret, int op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { int i = (long)cookie; @@ -1746,7 +1747,7 @@ afr_log_selfheal(uuid_t gfid, xlator_t *this, int ret, char *type, int source, int afr_selfheal_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *parbuf) { afr_local_t *local = NULL; @@ -1931,7 +1932,7 @@ afr_success_count(struct afr_reply *replies, unsigned int count) int afr_selfheal_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { afr_local_t *local = NULL; int i = 0; diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 37bcc2b3f9..19696b8ce2 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -17,8 +17,9 @@ #define HAS_HOLES(i) ((i->ia_blocks * 512) < (i->ia_size)) static int -__checksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, uint32_t weak, uint8_t *strong, dict_t *xdata) +__checksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, uint32_t weak, uint8_t *strong, + dict_t *xdata) { afr_local_t *local = NULL; struct afr_reply *replies = NULL; @@ -773,7 +774,7 @@ __afr_selfheal_data(call_frame_t *frame, xlator_t *this, fd_t *fd, int afr_selfheal_data_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { afr_local_t *local = NULL; diff --git a/xlators/cluster/afr/src/afr-self-heal.h b/xlators/cluster/afr/src/afr-self-heal.h index 7a038fa7fe..a0859774dc 100644 --- a/xlators/cluster/afr/src/afr-self-heal.h +++ b/xlators/cluster/afr/src/afr-self-heal.h @@ -209,7 +209,7 @@ afr_selfheal_extract_xattr(xlator_t *this, struct afr_reply *replies, int afr_sh_generic_fop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *pre, + gf_return_t op_ret, int op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata); int @@ -242,7 +242,7 @@ afr_inode_find(xlator_t *this, uuid_t gfid); int afr_selfheal_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *parbuf); void afr_reply_copy(struct afr_reply *dst, struct afr_reply *src); @@ -334,7 +334,7 @@ afr_selfheal_do(call_frame_t *frame, xlator_t *this, uuid_t gfid); int afr_selfheal_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata); + gf_return_t op_ret, int op_errno, dict_t *xdata); int afr_locked_fill(call_frame_t *frame, xlator_t *this, unsigned char *locked_on); diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c index f2e08908c2..2fe202bfcf 100644 --- a/xlators/cluster/afr/src/afr-self-heald.c +++ b/xlators/cluster/afr/src/afr-self-heald.c @@ -1371,7 +1371,7 @@ afr_xl_op(xlator_t *this, dict_t *input, dict_t *output) char key[64]; int keylen = 0; int this_name_len = 0; - int op_ret = 0; + gf_return_t op_ret = 0; uint64_t cnt = 0; #define AFR_SET_DICT_AND_LOG(name, output, key, keylen, dict_str, \ diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index a51f79b1f4..85ff45324c 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -1641,8 +1641,9 @@ afr_changelog_pre_op_update(call_frame_t *frame, xlator_t *this) } int -afr_changelog_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xattr, dict_t *xdata) +afr_changelog_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xattr, + dict_t *xdata) { afr_local_t *local = NULL; int call_count = -1; @@ -2425,7 +2426,7 @@ afr_fd_has_witnessed_unstable_write(xlator_t *this, inode_t *inode) int afr_changelog_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *pre, + gf_return_t op_ret, int op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { afr_private_t *priv = NULL; diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 2e60708acc..375ad2e6e0 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -368,7 +368,7 @@ typedef struct { struct afr_reply { int valid; - int32_t op_ret; + gf_return_t op_ret; dict_t *xattr; /*For xattrop*/ dict_t *xdata; struct iatt poststat; @@ -472,7 +472,7 @@ typedef struct _afr_local { uint32_t open_fd_count; int32_t num_inodelks; - int32_t op_ret; + gf_return_t op_ret; int32_t op_errno; int dirty[AFR_NUM_CHANGE_LOGS]; @@ -651,12 +651,12 @@ typedef struct _afr_local { struct { uint32_t *checksum; int success_count; - int32_t op_ret; + gf_return_t op_ret; int32_t op_errno; } opendir; struct { - int32_t op_ret; + gf_return_t op_ret; int32_t op_errno; size_t size; off_t offset; @@ -675,7 +675,7 @@ typedef struct _afr_local { struct iovec *vector; struct iobref *iobref; off_t offset; - int32_t op_ret; + gf_return_t op_ret; int32_t count; uint32_t flags; } writev; @@ -1313,7 +1313,7 @@ afr_handle_inconsistent_fop(call_frame_t *frame, int32_t *op_ret, void afr_inode_write_fill(call_frame_t *frame, xlator_t *this, int child_index, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); void afr_process_post_writev(call_frame_t *frame, xlator_t *this); diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index d874415699..45625a469e 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -25,7 +25,7 @@ static int dht_rmdir_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, dict_t *xdata); static int @@ -39,7 +39,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this); static int dht_common_mark_mdsxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata); + gf_return_t op_ret, int op_errno, dict_t *xdata); static int dht_rmdir_unlock(call_frame_t *frame, xlator_t *this); @@ -48,7 +48,8 @@ static const char *dht_dbg_vxattrs[] = {DHT_DBG_HASHED_SUBVOL_PATTERN, NULL}; /* Check the xdata to make sure EBADF has been set by client xlator */ int32_t -dht_check_remote_fd_failed_error(dht_local_t *local, int op_ret, int op_errno) +dht_check_remote_fd_failed_error(dht_local_t *local, gf_return_t op_ret, + int op_errno) { if (op_ret == -1 && (op_errno == EBADF || op_errno == EBADFD) && !(local->fd_checked)) { @@ -452,7 +453,7 @@ dht_inode_ctx_mdsvol_get(inode_t *inode, xlator_t *this, xlator_t **mdsvol) static int dht_lookup_selfheal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { dht_local_t *local = NULL; dht_layout_t *layout = NULL; @@ -683,7 +684,7 @@ dht_discover_complete(xlator_t *this, call_frame_t *discover_frame) static int dht_common_mark_mdsxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = cookie; @@ -971,9 +972,9 @@ dht_dict_get_array(dict_t *dict, char *key, int32_t value[], int32_t size, } static int -dht_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, - dict_t *xattr, struct iatt *postparent) +dht_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -1350,8 +1351,8 @@ is_permission_different(ia_prot_t *prot1, ia_prot_t *prot2) int dht_lookup_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, - dict_t *xattr, struct iatt *postparent) + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { dht_local_t *local = NULL; dht_conf_t *conf = NULL; @@ -1635,8 +1636,8 @@ dht_lookup_directory(call_frame_t *frame, xlator_t *this, loc_t *loc) int dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, - dict_t *xattr, struct iatt *postparent) + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -1982,9 +1983,10 @@ dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_lookup_linkfile_create_cbk(call_frame_t *frame, void *cooie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *stbuf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *stbuf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { dht_local_t *local = NULL; xlator_t *cached_subvol = NULL; @@ -2048,7 +2050,7 @@ dht_lookup_linkfile_create_cbk(call_frame_t *frame, void *cooie, xlator_t *this, static int dht_lookup_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *preparent, + gf_return_t op_ret, int op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { int this_call_cnt = 0; @@ -2074,8 +2076,8 @@ dht_lookup_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_lookup_unlink_of_false_linkto_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, int op_errno, - struct iatt *preparent, + xlator_t *this, gf_return_t op_ret, + int op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { int this_call_cnt = 0; @@ -2126,8 +2128,8 @@ dht_lookup_unlink_of_false_linkto_cbk(call_frame_t *frame, void *cookie, static int dht_lookup_unlink_stale_linkto_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, int op_errno, - struct iatt *preparent, + xlator_t *this, gf_return_t op_ret, + int op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { dht_local_t *local = NULL; @@ -2190,8 +2192,9 @@ dht_fill_dict_to_avoid_unlink_of_migrating_file(dict_t *dict) static int32_t dht_linkfile_create_lookup_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, dict_t *xdata, + xlator_t *this, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { dht_local_t *local = NULL; @@ -2264,7 +2267,7 @@ dht_linkfile_create_lookup_cbk(call_frame_t *frame, void *cookie, static int32_t dht_call_lookup_linkfile_create(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; @@ -2664,7 +2667,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) static int dht_lookup_everywhere_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) { @@ -2898,7 +2901,7 @@ dht_lookup_everywhere(call_frame_t *frame, xlator_t *this, loc_t *loc) int dht_lookup_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { @@ -3049,9 +3052,9 @@ dht_should_lookup_everywhere(xlator_t *this, dht_conf_t *conf, loc_t *loc) } int -dht_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, - struct iatt *postparent) +dht_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { char is_linkfile = 0; char is_dir = 0; @@ -3590,8 +3593,9 @@ dht_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) static int dht_unlink_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -3623,9 +3627,9 @@ dht_unlink_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } static int -dht_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +dht_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -3688,7 +3692,7 @@ dht_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, static int dht_common_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { DHT_STACK_UNWIND(setxattr, frame, op_ret, op_errno, xdata); return 0; @@ -3696,7 +3700,7 @@ dht_common_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_fix_layout_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; dht_layout_t *layout = NULL; @@ -3714,8 +3718,8 @@ dht_fix_layout_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } static int -dht_err_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xdata) +dht_err_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -3787,7 +3791,7 @@ dht_dict_set_array(dict_t *dict, char *key, int32_t value[], int32_t size) static int dht_common_mds_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { dht_local_t *local = NULL; @@ -3830,7 +3834,7 @@ dht_common_mds_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ static int dht_setxattr_non_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -3943,7 +3947,7 @@ dht_setxattr_non_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_setxattr_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { dht_local_t *local = NULL; dht_conf_t *conf = NULL; @@ -4030,7 +4034,8 @@ dht_setxattr_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_xattrop_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *dict, + dict_t *xdata) { dht_local_t *local = NULL; call_frame_t *prev = NULL; @@ -4248,7 +4253,7 @@ dht_vgetxattr_fill_and_set(dht_local_t *local, dict_t **dict, xlator_t *this, static int dht_find_local_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xattr, + gf_return_t op_ret, int op_errno, dict_t *xattr, dict_t *xdata) { dht_local_t *local = NULL; @@ -4405,7 +4410,8 @@ dht_find_local_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_vgetxattr_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xattr, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xattr, + dict_t *xdata) { int ret = 0; dht_local_t *local = NULL; @@ -4470,8 +4476,9 @@ dht_vgetxattr_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } static int -dht_vgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xattr, dict_t *xdata) +dht_vgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xattr, + dict_t *xdata) { dht_local_t *local = NULL; int ret = 0; @@ -4517,7 +4524,7 @@ dht_vgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, static int dht_linkinfo_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xattr, + gf_return_t op_ret, int op_errno, dict_t *xattr, dict_t *xdata) { int ret = 0; @@ -4539,7 +4546,8 @@ dht_linkinfo_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_mds_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xattr, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xattr, + dict_t *xdata) { dht_local_t *local = NULL; dht_conf_t *conf = NULL; @@ -4572,8 +4580,8 @@ dht_mds_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int -dht_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xattr, dict_t *xdata) +dht_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xattr, dict_t *xdata) { int this_call_cnt = 0; dht_local_t *local = NULL; @@ -4657,8 +4665,8 @@ dht_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, } static int32_t -dht_getxattr_unwind(call_frame_t *frame, int op_ret, int op_errno, dict_t *dict, - dict_t *xdata) +dht_getxattr_unwind(call_frame_t *frame, gf_return_t op_ret, int op_errno, + dict_t *dict, dict_t *xdata) { DHT_STACK_UNWIND(getxattr, frame, op_ret, op_errno, dict, xdata); return 0; @@ -4666,8 +4674,8 @@ dht_getxattr_unwind(call_frame_t *frame, int op_ret, int op_errno, dict_t *dict, static int dht_getxattr_get_real_filename_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, int op_errno, - dict_t *xattr, dict_t *xdata) + xlator_t *this, gf_return_t op_ret, + int op_errno, dict_t *xattr, dict_t *xdata) { int this_call_cnt = 0; dht_local_t *local = NULL; @@ -5349,7 +5357,7 @@ dht_setxattr2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) int dht_file_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { int ret = -1; dht_local_t *local = NULL; @@ -5694,7 +5702,7 @@ dht_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xattr, static int dht_checking_pathinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xattr, + gf_return_t op_ret, int op_errno, dict_t *xattr, dict_t *xdata) { int i = -1; @@ -5733,7 +5741,7 @@ dht_checking_pathinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_nuke_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { STACK_UNWIND_STRICT(setxattr, frame, op_ret, op_errno, NULL); @@ -6073,7 +6081,7 @@ dht_removexattr2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) int dht_file_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { int ret = -1; dht_local_t *local = NULL; @@ -6310,8 +6318,8 @@ dht_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *key, } int -dht_fd_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, fd_t *fd, dict_t *xdata) +dht_fd_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, fd_t *fd, dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -6365,8 +6373,9 @@ dht_normalize_stats(struct statvfs *buf, unsigned long bsize, } static int -dht_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct statvfs *statvfs, dict_t *xdata) +dht_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct statvfs *statvfs, + dict_t *xdata) { gf_boolean_t event = _gf_false; qdstatfs_action_t action = qdstatfs_action_OFF; @@ -6665,8 +6674,9 @@ dht_populate_inode_for_dentry(xlator_t *this, xlator_t *subvol, * entries */ static int -dht_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, gf_dirent_t *orig_entries, dict_t *xdata) +dht_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, gf_dirent_t *orig_entries, + dict_t *xdata) { dht_local_t *local = NULL; gf_dirent_t entries; @@ -6956,8 +6966,9 @@ dht_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, } static int -dht_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, gf_dirent_t *orig_entries, dict_t *xdata) +dht_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, gf_dirent_t *orig_entries, + dict_t *xdata) { dht_local_t *local = NULL; gf_dirent_t entries; @@ -7203,8 +7214,8 @@ dht_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } static int -dht_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xdata) +dht_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -7267,9 +7278,10 @@ dht_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, } int -dht_newfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +dht_newfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { xlator_t *prev = NULL; int ret = -1; @@ -7334,9 +7346,10 @@ dht_newfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, static int dht_mknod_linkfile_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *stbuf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *stbuf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { dht_local_t *local = NULL; xlator_t *cached_subvol = NULL; @@ -7481,14 +7494,14 @@ dht_mknod_do(call_frame_t *frame) static int32_t dht_mknod_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { DHT_STACK_DESTROY(frame); return 0; } static int32_t -dht_mknod_finish(call_frame_t *frame, xlator_t *this, int op_ret, +dht_mknod_finish(call_frame_t *frame, xlator_t *this, gf_return_t op_ret, int invoke_cbk) { dht_local_t *local = NULL, *lock_local = NULL; @@ -7541,7 +7554,7 @@ dht_mknod_finish(call_frame_t *frame, xlator_t *this, int op_ret, static int32_t dht_mknod_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; @@ -7709,7 +7722,7 @@ dht_handle_parent_layout_change(xlator_t *this, call_stub_t *stub) static int32_t dht_call_mkdir_stub(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; call_stub_t *stub = NULL; @@ -8093,9 +8106,10 @@ dht_remove_stale_linkto(void *data) } static int -dht_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +dht_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { dht_local_t *local = NULL; int ret = -1; @@ -8266,7 +8280,7 @@ dht_link2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) static int dht_link_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -8360,9 +8374,10 @@ dht_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } int -dht_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, fd_t *fd, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +dht_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, fd_t *fd, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { xlator_t *prev = NULL; int ret = -1; @@ -8499,10 +8514,10 @@ dht_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, static int dht_create_linkfile_create_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) + xlator_t *this, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *cached_subvol = NULL; @@ -8710,14 +8725,14 @@ dht_create_do(call_frame_t *frame) static int32_t dht_create_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { DHT_STACK_DESTROY(frame); return 0; } static int32_t -dht_create_finish(call_frame_t *frame, xlator_t *this, int op_ret, +dht_create_finish(call_frame_t *frame, xlator_t *this, gf_return_t op_ret, int invoke_cbk) { dht_local_t *local = NULL, *lock_local = NULL; @@ -8770,7 +8785,7 @@ dht_create_finish(call_frame_t *frame, xlator_t *this, int op_ret, static int32_t dht_create_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; @@ -9055,7 +9070,7 @@ dht_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, static int dht_mkdir_selfheal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; dht_layout_t *layout = NULL; @@ -9088,9 +9103,10 @@ dht_mkdir_selfheal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } static int -dht_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +dht_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -9157,7 +9173,7 @@ dht_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, static int dht_mkdir_hashed_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); @@ -9286,7 +9302,7 @@ dht_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, static int dht_mkdir_hashed_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -9568,7 +9584,7 @@ dht_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, static int dht_rmdir_selfheal_cbk(call_frame_t *heal_frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { dht_local_t *local = NULL; dht_local_t *heal_local = NULL; @@ -9590,8 +9606,9 @@ dht_rmdir_selfheal_cbk(call_frame_t *heal_frame, void *cookie, xlator_t *this, static int dht_rmdir_hashed_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { dht_local_t *local = NULL; dht_local_t *heal_local = NULL; @@ -9693,7 +9710,7 @@ dht_rmdir_hashed_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_rmdir_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { DHT_STACK_DESTROY(frame); return 0; @@ -9748,9 +9765,9 @@ dht_rmdir_unlock(call_frame_t *frame, xlator_t *this) } static int -dht_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +dht_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -9884,7 +9901,7 @@ dht_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, static int dht_rmdir_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; dht_conf_t *conf = NULL; @@ -10045,8 +10062,9 @@ dht_rmdir_readdirp_do(call_frame_t *readdirp_frame, xlator_t *this) static int dht_rmdir_linkfile_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -10089,7 +10107,7 @@ dht_rmdir_linkfile_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_rmdir_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, struct iatt *parent) { dht_local_t *local = NULL; @@ -10144,7 +10162,7 @@ dht_rmdir_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_rmdir_cached_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, struct iatt *parent) { @@ -10385,7 +10403,7 @@ dht_rmdir_is_subvol_empty(call_frame_t *frame, xlator_t *this, static int dht_rmdir_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, dict_t *xdata) { dht_local_t *local = NULL; @@ -10435,7 +10453,7 @@ dht_rmdir_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_rmdir_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int op_errno, fd_t *fd, dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = -1; @@ -10628,7 +10646,7 @@ dht_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, static int dht_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { DHT_STACK_UNWIND(entrylk, frame, op_ret, op_errno, xdata); @@ -10688,7 +10706,7 @@ dht_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc, static int dht_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { DHT_STACK_UNWIND(fentrylk, frame, op_ret, op_errno, NULL); @@ -10734,8 +10752,8 @@ dht_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, } static int32_t -dht_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +dht_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -11310,9 +11328,10 @@ dht_release(xlator_t *this, fd_t *fd) } static int -dht_pt_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +dht_pt_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { dht_local_t *local = NULL; @@ -11389,7 +11408,8 @@ dht_pt_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, static int dht_pt_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xattr, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xattr, + dict_t *xdata) { dht_conf_t *conf = NULL; @@ -11418,7 +11438,8 @@ dht_pt_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, static int dht_pt_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xattr, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xattr, + dict_t *xdata) { dht_conf_t *conf = NULL; diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index 07bbe20499..df5997aecb 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -56,13 +56,13 @@ #define REBAL_NODEUUID_MINE 0x01 typedef int (*dht_selfheal_dir_cbk_t)(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); typedef int (*dht_defrag_cbk_fn_t)(xlator_t *this, xlator_t *dst_node, call_frame_t *frame, int ret); typedef int (*dht_refresh_layout_unlock)(call_frame_t *frame, xlator_t *this, - int op_ret, int invoke_cbk); + gf_return_t op_ret, int invoke_cbk); typedef int (*dht_refresh_layout_done_handle)(call_frame_t *frame); @@ -202,7 +202,7 @@ typedef struct { dht_reaction_type_t reaction; /* whether locking failed on _any_ of the "locks" above */ - int op_ret; + gf_return_t op_ret; int op_errno; } dht_ilock_wrap_t; @@ -214,7 +214,7 @@ typedef struct { dht_reaction_type_t reaction; /* whether locking failed on _any_ of the "locks" above */ - int op_ret; + gf_return_t op_ret; int op_errno; } dht_elock_wrap_t; @@ -259,7 +259,7 @@ struct dht_local { loc_t loc; loc_t loc2; int call_cnt; - int op_ret; + gf_return_t op_ret; int op_errno; int layout_mismatch; /* Use stbuf as the postbuf, when we require both @@ -892,7 +892,7 @@ int dht_layouts_init(xlator_t *this, dht_conf_t *conf); int dht_layout_merge(xlator_t *this, dht_layout_t *layout, xlator_t *subvol, - int op_ret, int op_errno, dict_t *xattr); + gf_return_t op_ret, int op_errno, dict_t *xattr); int dht_disk_layout_extract(xlator_t *this, dht_layout_t *layout, int pos, @@ -984,7 +984,7 @@ int dht_rename_cleanup(call_frame_t *frame); int dht_rename_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); @@ -1197,41 +1197,44 @@ dht_notify(xlator_t *this, int32_t event, void *data, ...); /* definitions for nufa/switch */ int dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, - dict_t *xattr, struct iatt *postparent); + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, dict_t *xattr, struct iatt *postparent); int dht_lookup_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, - dict_t *xattr, struct iatt *postparent); + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, dict_t *xattr, struct iatt *postparent); int dht_lookup_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, struct iatt *postparent); int -dht_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, - struct iatt *postparent); +dht_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, dict_t *xattr, struct iatt *postparent); int -dht_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, fd_t *fd, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata); +dht_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, fd_t *fd, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata); int -dht_newfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata); +dht_newfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata); int dht_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int -dht_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xattr, dict_t *xdata); +dht_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xattr, + dict_t *xdata); int dht_common_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int gf_defrag_status_get(dht_conf_t *conf, dict_t *dict); @@ -1308,7 +1311,7 @@ int dht_heal_full_path(void *data); int -dht_heal_full_path_done(int op_ret, call_frame_t *frame, void *data); +dht_heal_full_path_done(gf_return_t op_ret, call_frame_t *frame, void *data); int dht_layout_missing_dirs(dht_layout_t *layout); @@ -1347,7 +1350,7 @@ dht_get_lock_subvolume(xlator_t *this, struct gf_flock *lock, dht_local_t *local); int -dht_lk_inode_unref(call_frame_t *frame, int32_t op_ret); +dht_lk_inode_unref(call_frame_t *frame, gf_return_t op_ret); int dht_fd_ctx_set(xlator_t *this, fd_t *fd, xlator_t *subvol); @@ -1358,60 +1361,61 @@ dht_check_and_open_fd_on_subvol(xlator_t *this, call_frame_t *frame); /* FD fop callbacks */ int -dht_writev_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); +dht_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata); int -dht_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xdata); +dht_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xdata); int dht_file_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int -dht_zerofill_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); +dht_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata); int -dht_discard_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); +dht_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata); int -dht_fallocate_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); +dht_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata); int -dht_truncate_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); +dht_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata); int -dht_fsync_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); +dht_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata); int -dht_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iovec *vector, int count, struct iatt *stbuf, - struct iobref *iobref, dict_t *xdata); +dht_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iovec *vector, int count, + struct iatt *stbuf, struct iobref *iobref, dict_t *xdata); int -dht_file_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *stbuf, dict_t *xdata); +dht_file_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *stbuf, + dict_t *xdata); int dht_file_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata); + gf_return_t op_ret, int op_errno, dict_t *xdata); int dht_file_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata); + gf_return_t op_ret, int op_errno, dict_t *xdata); /* All custom xattr heal functions */ int @@ -1466,11 +1470,12 @@ dht_pt_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata); int32_t -dht_check_remote_fd_failed_error(dht_local_t *local, int op_ret, int op_errno); +dht_check_remote_fd_failed_error(dht_local_t *local, gf_return_t op_ret, + int op_errno); int dht_common_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata); int32_t diff --git a/xlators/cluster/dht/src/dht-diskusage.c b/xlators/cluster/dht/src/dht-diskusage.c index c0588828fd..992fcadfd6 100644 --- a/xlators/cluster/dht/src/dht-diskusage.c +++ b/xlators/cluster/dht/src/dht-diskusage.c @@ -16,8 +16,9 @@ #include int -dht_du_info_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct statvfs *statvfs, dict_t *xdata) +dht_du_info_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct statvfs *statvfs, + dict_t *xdata) { dht_conf_t *conf = NULL; xlator_t *prev = NULL; diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 3f2fe43d5f..a2d6884bf5 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -1238,7 +1238,8 @@ dht_init_subvolumes(xlator_t *this, dht_conf_t *conf) */ static int -dht_migration_complete_check_done(int op_ret, call_frame_t *frame, void *data) +dht_migration_complete_check_done(gf_return_t op_ret, call_frame_t *frame, + void *data) { dht_local_t *local = NULL; xlator_t *subvol = NULL; @@ -1516,7 +1517,7 @@ dht_rebalance_complete_check(xlator_t *this, call_frame_t *frame) 1 : File is being migrated but not by this DHT layer. */ static int -dht_inprogress_check_done(int op_ret, call_frame_t *frame, void *data) +dht_inprogress_check_done(gf_return_t op_ret, call_frame_t *frame, void *data) { dht_local_t *local = NULL; xlator_t *dst_subvol = NULL, *src_subvol = NULL; @@ -2077,7 +2078,8 @@ dht_heal_full_path(void *data) } int -dht_heal_full_path_done(int op_ret, call_frame_t *heal_frame, void *data) +dht_heal_full_path_done(gf_return_t op_ret, call_frame_t *heal_frame, + void *data) { call_frame_t *main_frame = NULL; dht_local_t *local = NULL; @@ -2202,7 +2204,7 @@ dht_get_lock_subvolume(xlator_t *this, struct gf_flock *lock, } int -dht_lk_inode_unref(call_frame_t *frame, int32_t op_ret) +dht_lk_inode_unref(call_frame_t *frame, gf_return_t op_ret) { int ret = -1; dht_local_t *local = NULL; diff --git a/xlators/cluster/dht/src/dht-inode-read.c b/xlators/cluster/dht/src/dht-inode-read.c index dbb8070b0d..cb5a129ada 100644 --- a/xlators/cluster/dht/src/dht-inode-read.c +++ b/xlators/cluster/dht/src/dht-inode-read.c @@ -29,8 +29,8 @@ dht_common_xattrop2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret); static int -dht_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, fd_t *fd, dict_t *xdata) +dht_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, fd_t *fd, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -144,8 +144,9 @@ dht_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, fd_t *fd, } int -dht_file_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *stbuf, dict_t *xdata) +dht_file_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *stbuf, + dict_t *xdata) { xlator_t *subvol1 = 0; xlator_t *subvol2 = 0; @@ -259,8 +260,9 @@ dht_attr2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) } static int -dht_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *stbuf, dict_t *xdata) +dht_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *stbuf, + dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -411,9 +413,9 @@ dht_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) } int -dht_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iovec *vector, int count, struct iatt *stbuf, - struct iobref *iobref, dict_t *xdata) +dht_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iovec *vector, int count, + struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { dht_local_t *local = NULL; int ret = 0; @@ -559,8 +561,8 @@ dht_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t off, } static int -dht_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xdata) +dht_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xdata) { int ret = -1; dht_local_t *local = NULL; @@ -689,8 +691,8 @@ dht_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, } int -dht_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xdata) +dht_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *subvol = 0; @@ -804,9 +806,9 @@ dht_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) } int -dht_fsync_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) +dht_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -960,8 +962,9 @@ dht_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, indicate that lock migration happened on the fd, so we can consider it as phase 2 of migration */ static int -dht_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct gf_flock *flock, dict_t *xdata) +dht_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct gf_flock *flock, + dict_t *xdata) { dht_local_t *local = NULL; int ret = -1; @@ -1088,8 +1091,9 @@ dht_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int cmd, } static int -dht_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct gf_lease *lease, dict_t *xdata) +dht_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct gf_lease *lease, + dict_t *xdata) { DHT_STACK_UNWIND(lease, frame, op_ret, op_errno, lease, xdata); @@ -1130,9 +1134,9 @@ dht_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, /* Symlinks are currently not migrated, so no need for any check here */ static int -dht_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, const char *path, struct iatt *stbuf, - dict_t *xdata) +dht_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, const char *path, + struct iatt *stbuf, dict_t *xdata) { dht_local_t *local = NULL; @@ -1217,7 +1221,7 @@ dht_read_iatt_from_xdata(dict_t *xdata, struct iatt *stbuf) int dht_common_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { dht_local_t *local = NULL; @@ -1366,7 +1370,8 @@ dht_common_xattrop2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, static int dht_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { DHT_STACK_UNWIND(xattrop, frame, op_ret, op_errno, dict, xdata); return 0; @@ -1454,7 +1459,8 @@ dht_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, static int dht_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { DHT_STACK_UNWIND(fxattrop, frame, op_ret, op_errno, dict, xdata); return 0; @@ -1527,7 +1533,7 @@ dht_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, static int dht_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_lk_inode_unref(frame, op_ret); @@ -1578,7 +1584,7 @@ dht_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc, int dht_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c index eda2491e0f..4c7aaa56b4 100644 --- a/xlators/cluster/dht/src/dht-inode-write.c +++ b/xlators/cluster/dht/src/dht-inode-write.c @@ -24,9 +24,9 @@ static int dht_zerofill2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret); int -dht_writev_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) +dht_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -236,9 +236,9 @@ dht_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, } int -dht_truncate_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) +dht_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -465,9 +465,9 @@ dht_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } int -dht_fallocate_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) +dht_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -643,9 +643,9 @@ dht_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, } int -dht_discard_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) +dht_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -816,9 +816,9 @@ dht_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } int -dht_zerofill_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) +dht_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -993,7 +993,7 @@ dht_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, /* handle cases of migration here for 'setattr()' calls */ int dht_file_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { dht_local_t *local = NULL; @@ -1098,9 +1098,9 @@ dht_setattr2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) /* Keep the existing code same for all the cases other than regular file */ int -dht_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *statpre, struct iatt *statpost, - dict_t *xdata) +dht_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *statpre, + struct iatt *statpost, dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -1141,7 +1141,7 @@ dht_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, /* Keep the existing code same for all the cases other than regular file */ int dht_non_mds_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *statpre, + gf_return_t op_ret, int op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { dht_local_t *local = NULL; @@ -1179,7 +1179,7 @@ dht_non_mds_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int dht_mds_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *statpre, + gf_return_t op_ret, int op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index fda904c92c..0da274ad2d 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -306,7 +306,7 @@ dht_disk_layout_merge(xlator_t *this, dht_layout_t *layout, int pos, int dht_layout_merge(xlator_t *this, dht_layout_t *layout, xlator_t *subvol, - int op_ret, int op_errno, dict_t *xattr) + gf_return_t op_ret, int op_errno, dict_t *xattr) { int i = 0; int ret = -1; diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c index 89ec6cca56..88c7af83f7 100644 --- a/xlators/cluster/dht/src/dht-linkfile.c +++ b/xlators/cluster/dht/src/dht-linkfile.c @@ -13,7 +13,7 @@ static int dht_linkfile_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { @@ -45,7 +45,7 @@ dht_linkfile_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int dht_linkfile_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -167,7 +167,7 @@ dht_linkfile_create(call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk, int dht_linkfile_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -252,7 +252,7 @@ dht_linkfile_subvol(xlator_t *this, inode_t *inode, struct iatt *stbuf, static int dht_linkfile_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *statpre, + gf_return_t op_ret, int op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { dht_local_t *local = NULL; diff --git a/xlators/cluster/dht/src/dht-lock.c b/xlators/cluster/dht/src/dht-lock.c index 638821ccee..b1f9eebfb4 100644 --- a/xlators/cluster/dht/src/dht-lock.c +++ b/xlators/cluster/dht/src/dht-lock.c @@ -304,7 +304,7 @@ dht_entrylk_done(call_frame_t *lock_frame) static int32_t dht_unlock_entrylk_done(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; char gfid[GF_UUID_BUF_SIZE] = {0}; @@ -325,7 +325,7 @@ dht_unlock_entrylk_done(call_frame_t *frame, void *cookie, xlator_t *this, static int32_t dht_unlock_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; int lk_index = 0, call_cnt = 0; @@ -486,7 +486,7 @@ dht_unlock_entrylk_wrapper(call_frame_t *frame, dht_elock_wrap_t *entrylk) static int dht_entrylk_cleanup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_entrylk_done(frame); return 0; @@ -517,7 +517,7 @@ dht_entrylk_cleanup(call_frame_t *lock_frame) static int32_t dht_blocking_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { int lk_index = 0; int i = 0; @@ -683,7 +683,7 @@ dht_inodelk_done(call_frame_t *lock_frame) static int32_t dht_unlock_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; int lk_index = 0, call_cnt = 0; @@ -714,7 +714,7 @@ dht_unlock_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int32_t dht_unlock_inodelk_done(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; char gfid[GF_UUID_BUF_SIZE] = {0}; @@ -869,7 +869,7 @@ dht_unlock_inodelk_wrapper(call_frame_t *frame, dht_ilock_wrap_t *inodelk) static int dht_inodelk_cleanup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_inodelk_done(frame); return 0; @@ -900,7 +900,7 @@ dht_inodelk_cleanup(call_frame_t *lock_frame) static int32_t dht_nonblocking_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; int lk_index = 0, call_cnt = 0; @@ -1000,7 +1000,7 @@ dht_nonblocking_inodelk(call_frame_t *frame, dht_lock_t **lk_array, static int32_t dht_blocking_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { int lk_index = 0; int i = 0; @@ -1185,7 +1185,7 @@ dht_unlock_namespace(call_frame_t *frame, dht_dir_transaction_t *lock) static int32_t dht_protect_namespace_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; @@ -1199,7 +1199,7 @@ dht_protect_namespace_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t dht_blocking_entrylk_after_inodelk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; diff --git a/xlators/cluster/dht/src/dht-lock.h b/xlators/cluster/dht/src/dht-lock.h index 6485c03fb6..6723c4509a 100644 --- a/xlators/cluster/dht/src/dht-lock.h +++ b/xlators/cluster/dht/src/dht-lock.h @@ -73,12 +73,12 @@ dht_blocking_inodelk(call_frame_t *frame, dht_lock_t **lk_array, int lk_count, int32_t dht_blocking_entrylk_after_inodelk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int32_t dht_blocking_entrylk_after_inodelk_rename(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata); void diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 358e1c6d53..8844d4cd65 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -2357,7 +2357,8 @@ rebalance_task(void *data) } static int -rebalance_task_completion(int op_ret, call_frame_t *sync_frame, void *data) +rebalance_task_completion(gf_return_t op_ret, call_frame_t *sync_frame, + void *data) { int32_t op_errno = EINVAL; diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c index d9dbf50492..fb0060747e 100644 --- a/xlators/cluster/dht/src/dht-rename.c +++ b/xlators/cluster/dht/src/dht-rename.c @@ -19,11 +19,11 @@ int dht_rename_unlock(call_frame_t *frame, xlator_t *this); int32_t dht_rename_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int dht_rename_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; @@ -57,7 +57,7 @@ static void dht_rename_dir_unlock_dst(call_frame_t *frame, xlator_t *this) { dht_local_t *local = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; char src_gfid[GF_UUID_BUF_SIZE] = {0}; char dst_gfid[GF_UUID_BUF_SIZE] = {0}; @@ -106,7 +106,7 @@ dht_rename_dir_unlock(call_frame_t *frame, xlator_t *this) } int dht_rename_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -196,10 +196,10 @@ dht_rename_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int dht_rename_hashed_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, - struct iatt *preoldparent, struct iatt *postoldparent, - struct iatt *prenewparent, struct iatt *postnewparent, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *stbuf, struct iatt *preoldparent, + struct iatt *postoldparent, struct iatt *prenewparent, + struct iatt *postnewparent, dict_t *xdata) { dht_conf_t *conf = NULL; dht_local_t *local = NULL; @@ -284,7 +284,7 @@ dht_rename_dir_do(call_frame_t *frame, xlator_t *this) int dht_rename_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, dict_t *xdata) { dht_local_t *local = NULL; @@ -312,7 +312,8 @@ dht_rename_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int dht_rename_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int op_errno, fd_t *fd, + dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = -1; @@ -348,7 +349,7 @@ dht_rename_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int dht_rename_dir_lock2_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; char src_gfid[GF_UUID_BUF_SIZE] = {0}; @@ -407,7 +408,7 @@ dht_rename_dir_lock2_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int dht_rename_dir_lock1_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; char src_gfid[GF_UUID_BUF_SIZE] = {0}; @@ -474,7 +475,7 @@ static int dht_order_rename_lock(call_frame_t *frame, loc_t **loc, xlator_t **subvol) { int ret = 0; - int op_ret = 0; + gf_return_t op_ret = 0; dht_local_t *local = NULL; char *src = NULL; char *dst = NULL; @@ -700,7 +701,7 @@ int dht_rename_unlock(call_frame_t *frame, xlator_t *this) { dht_local_t *local = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; char src_gfid[GF_UUID_BUF_SIZE] = {0}; char dst_gfid[GF_UUID_BUF_SIZE] = {0}; dht_ilock_wrap_t inodelk_wrapper = { @@ -760,8 +761,9 @@ dht_rename_done(call_frame_t *frame, xlator_t *this) int dht_rename_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { dht_local_t *local = NULL; xlator_t *prev = NULL; @@ -1005,9 +1007,10 @@ dht_rename_unlink(call_frame_t *frame, xlator_t *this) int dht_rename_links_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *stbuf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *stbuf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { xlator_t *prev = NULL; dht_local_t *local = NULL; @@ -1035,7 +1038,7 @@ dht_rename_links_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int dht_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -1199,7 +1202,7 @@ dht_do_rename(call_frame_t *frame) int dht_rename_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1233,7 +1236,7 @@ dht_rename_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int dht_rename_linkto_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1287,7 +1290,7 @@ dht_rename_linkto_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int dht_rename_unlink_links_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1422,7 +1425,7 @@ dht_rename_create_links(call_frame_t *frame) int dht_rename_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { @@ -1561,7 +1564,7 @@ dht_rename_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int dht_rename_file_lock1_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; char src_gfid[GF_UUID_BUF_SIZE] = {0}; @@ -1618,7 +1621,7 @@ dht_rename_file_lock1_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t dht_rename_file_protect_namespace(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; @@ -1679,7 +1682,7 @@ dht_rename_file_protect_namespace(call_frame_t *frame, void *cookie, int32_t dht_rename_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; char src_gfid[GF_UUID_BUF_SIZE] = {0}; diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index 1b6571cd43..3529eaf2bf 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -65,7 +65,7 @@ dht_overlap_calc(dht_layout_t *old, int o, dht_layout_t *new, int n) int dht_selfheal_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { DHT_STACK_DESTROY(frame); return 0; @@ -170,7 +170,7 @@ dht_refresh_layout_done(call_frame_t *frame) int dht_refresh_layout_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { @@ -309,7 +309,8 @@ dht_refresh_layout(call_frame_t *frame) int32_t dht_selfheal_layout_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + dict_t *xdata) { dht_local_t *local = NULL; @@ -614,7 +615,7 @@ dht_selfheal_layout_lock(call_frame_t *frame, dht_layout_t *layout, static int dht_selfheal_dir_xattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { dht_local_t *local = NULL; xlator_t *subvol = NULL; @@ -940,8 +941,9 @@ dht_selfheal_dir_xattr(call_frame_t *frame, loc_t *loc, dht_layout_t *layout) int dht_selfheal_dir_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *statpre, - struct iatt *statpost, dict_t *xdata) + gf_return_t op_ret, int op_errno, + struct iatt *statpre, struct iatt *statpost, + dict_t *xdata) { dht_local_t *local = NULL; dht_layout_t *layout = NULL; @@ -1030,7 +1032,7 @@ dht_selfheal_dir_setattr(call_frame_t *frame, loc_t *loc, struct iatt *stbuf, static int dht_selfheal_dir_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1159,9 +1161,10 @@ dht_selfheal_dir_mkdir_lookup_done(call_frame_t *frame, xlator_t *this) static int dht_selfheal_dir_mkdir_lookup_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, int op_errno, - inode_t *inode, struct iatt *stbuf, - dict_t *xattr, struct iatt *postparent) + xlator_t *this, gf_return_t op_ret, + int op_errno, inode_t *inode, + struct iatt *stbuf, dict_t *xattr, + struct iatt *postparent) { dht_local_t *local = NULL; int i = 0; @@ -1253,7 +1256,7 @@ dht_selfheal_dir_mkdir_lookup_cbk(call_frame_t *frame, void *cookie, static int dht_selfheal_dir_mkdir_lock_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; @@ -2300,7 +2303,7 @@ dht_dir_attr_heal_done(int ret, call_frame_t *sync_frame, void *data) /* EXIT: dht_update_commit_hash_for_layout */ static int dht_update_commit_hash_for_layout_done(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; @@ -2347,8 +2350,8 @@ dht_update_commit_hash_for_layout_unlock(call_frame_t *frame, xlator_t *this) static int dht_update_commit_hash_for_layout_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, int op_errno, - dict_t *xdata) + xlator_t *this, gf_return_t op_ret, + int op_errno, dict_t *xdata) { dht_local_t *local = NULL; int this_call_cnt = 0; @@ -2374,7 +2377,7 @@ dht_update_commit_hash_for_layout_cbk(call_frame_t *frame, void *cookie, static int dht_update_commit_hash_for_layout_resume(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { dht_local_t *local = NULL; diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c index 59313639c4..a0e6af5823 100644 --- a/xlators/cluster/dht/src/nufa.c +++ b/xlators/cluster/dht/src/nufa.c @@ -16,7 +16,7 @@ extern struct volume_options dht_options[]; int nufa_local_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { @@ -244,10 +244,10 @@ nufa_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) int nufa_create_linkfile_create_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, int op_errno, - inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) + xlator_t *this, gf_return_t op_ret, + int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { dht_local_t *local = NULL; @@ -337,7 +337,7 @@ nufa_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int nufa_mknod_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c index 207d109a02..eaed19eaad 100644 --- a/xlators/cluster/dht/src/switch.c +++ b/xlators/cluster/dht/src/switch.c @@ -97,7 +97,7 @@ get_switch_matching_subvol(const char *path, dht_conf_t *conf, int switch_local_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { @@ -350,9 +350,9 @@ switch_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, int switch_create_linkfile_create_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, int op_errno, - inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, + xlator_t *this, gf_return_t op_ret, + int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { dht_local_t *local = NULL; @@ -442,7 +442,7 @@ switch_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int switch_mknod_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c index b955efd8c2..ddb8d71883 100644 --- a/xlators/cluster/ec/src/ec-common.c +++ b/xlators/cluster/ec/src/ec-common.c @@ -229,8 +229,8 @@ ec_child_next(ec_t *ec, ec_fop_data_t *fop, uint32_t idx) int32_t ec_heal_report(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, uintptr_t mask, uintptr_t good, - uintptr_t bad, uint32_t pending, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, uintptr_t mask, + uintptr_t good, uintptr_t bad, uint32_t pending, dict_t *xdata) { if (op_ret < 0) { gf_msg(this->name, GF_LOG_DEBUG, op_errno, EC_MSG_HEAL_FAIL, @@ -1214,7 +1214,7 @@ ec_set_dirty_flag(ec_lock_link_t *link, ec_inode_t *ctx, uint64_t *dirty) int32_t ec_prepare_update_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { struct list_head list; @@ -1694,7 +1694,7 @@ ec_clear_inode_info(ec_fop_data_t *fop, inode_t *inode) int32_t ec_get_real_size_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { ec_fop_data_t *fop = cookie; @@ -1905,7 +1905,7 @@ ec_lock_acquired(ec_lock_link_t *link) } int32_t -ec_locked(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, +ec_locked(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = cookie; @@ -2248,8 +2248,8 @@ ec_lock_unfreeze(ec_lock_link_t *link) } int32_t -ec_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +ec_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = cookie; ec_lock_link_t *link = fop->data; @@ -2312,7 +2312,7 @@ ec_inode_bad_inc(inode_t *inode, xlator_t *xl) int32_t ec_update_size_version_done(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { ec_fop_data_t *fop = cookie; diff --git a/xlators/cluster/ec/src/ec-common.h b/xlators/cluster/ec/src/ec-common.h index 51493612ac..106cfcce21 100644 --- a/xlators/cluster/ec/src/ec-common.h +++ b/xlators/cluster/ec/src/ec-common.h @@ -214,7 +214,7 @@ ec_get_heal_info(xlator_t *this, loc_t *loc, dict_t **dict); int32_t ec_lock_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); void ec_update_fd_status(fd_t *fd, xlator_t *xl, int child_index, diff --git a/xlators/cluster/ec/src/ec-data.c b/xlators/cluster/ec/src/ec-data.c index 0638883354..13d40b6cfd 100644 --- a/xlators/cluster/ec/src/ec-data.c +++ b/xlators/cluster/ec/src/ec-data.c @@ -15,7 +15,8 @@ ec_cbk_data_t * ec_cbk_data_allocate(call_frame_t *frame, xlator_t *this, ec_fop_data_t *fop, - int32_t id, int32_t idx, int32_t op_ret, int32_t op_errno) + int32_t id, int32_t idx, gf_return_t op_ret, + int32_t op_errno) { ec_cbk_data_t *cbk; ec_t *ec = this->private; diff --git a/xlators/cluster/ec/src/ec-data.h b/xlators/cluster/ec/src/ec-data.h index c8a74ffe1e..6269afa959 100644 --- a/xlators/cluster/ec/src/ec-data.h +++ b/xlators/cluster/ec/src/ec-data.h @@ -15,7 +15,8 @@ ec_cbk_data_t * ec_cbk_data_allocate(call_frame_t *frame, xlator_t *this, ec_fop_data_t *fop, - int32_t id, int32_t idx, int32_t op_ret, int32_t op_errno); + int32_t id, int32_t idx, gf_return_t op_ret, + int32_t op_errno); ec_fop_data_t * ec_fop_data_allocate(call_frame_t *frame, xlator_t *this, int32_t id, uint32_t flags, uintptr_t target, uint32_t fop_flags, diff --git a/xlators/cluster/ec/src/ec-dir-read.c b/xlators/cluster/ec/src/ec-dir-read.c index f71dcfac29..0bea635bc6 100644 --- a/xlators/cluster/ec/src/ec-dir-read.c +++ b/xlators/cluster/ec/src/ec-dir-read.c @@ -38,7 +38,7 @@ ec_combine_opendir(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) int32_t ec_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -330,8 +330,8 @@ ec_adjust_readdirp(ec_t *ec, int32_t idx, gf_dirent_t *entries) int32_t ec_common_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + gf_dirent_t *entries, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; diff --git a/xlators/cluster/ec/src/ec-dir-write.c b/xlators/cluster/ec/src/ec-dir-write.c index 53d27d895c..03e293b1d2 100644 --- a/xlators/cluster/ec/src/ec-dir-write.c +++ b/xlators/cluster/ec/src/ec-dir-write.c @@ -17,10 +17,11 @@ #include "ec-fops.h" int -ec_dir_write_cbk(call_frame_t *frame, xlator_t *this, void *cookie, int op_ret, - int op_errno, struct iatt *poststat, struct iatt *preparent, - struct iatt *postparent, struct iatt *preparent2, - struct iatt *postparent2, dict_t *xdata) +ec_dir_write_cbk(call_frame_t *frame, xlator_t *this, void *cookie, + gf_return_t op_ret, int op_errno, struct iatt *poststat, + struct iatt *preparent, struct iatt *postparent, + struct iatt *preparent2, struct iatt *postparent2, + dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -76,9 +77,10 @@ ec_dir_write_cbk(call_frame_t *frame, xlator_t *this, void *cookie, int op_ret, /* FOP: create */ int32_t -ec_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +ec_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { return ec_dir_write_cbk(frame, this, cookie, op_ret, op_errno, buf, preparent, postparent, NULL, NULL, xdata); @@ -325,9 +327,10 @@ ec_create(call_frame_t *frame, xlator_t *this, uintptr_t target, /* FOP: link */ int32_t -ec_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +ec_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { return ec_dir_write_cbk(frame, this, cookie, op_ret, op_errno, buf, preparent, postparent, NULL, NULL, xdata); @@ -490,9 +493,10 @@ ec_link(call_frame_t *frame, xlator_t *this, uintptr_t target, /* FOP: mkdir */ int32_t -ec_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +ec_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { return ec_dir_write_cbk(frame, this, cookie, op_ret, op_errno, buf, preparent, postparent, NULL, NULL, xdata); @@ -667,9 +671,10 @@ ec_mkdir(call_frame_t *frame, xlator_t *this, uintptr_t target, /* FOP: mknod */ int32_t -ec_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +ec_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { return ec_dir_write_cbk(frame, this, cookie, op_ret, op_errno, buf, preparent, postparent, NULL, NULL, xdata); @@ -871,10 +876,11 @@ ec_mknod(call_frame_t *frame, xlator_t *this, uintptr_t target, /* FOP: rename */ int32_t -ec_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, - struct iatt *postoldparent, struct iatt *prenewparent, - struct iatt *postnewparent, dict_t *xdata) +ec_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + struct iatt *preoldparent, struct iatt *postoldparent, + struct iatt *prenewparent, struct iatt *postnewparent, + dict_t *xdata) { return ec_dir_write_cbk(frame, this, cookie, op_ret, op_errno, buf, preoldparent, postoldparent, prenewparent, @@ -1035,9 +1041,9 @@ ec_rename(call_frame_t *frame, xlator_t *this, uintptr_t target, /* FOP: rmdir */ int32_t -ec_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +ec_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { return ec_dir_write_cbk(frame, this, cookie, op_ret, op_errno, NULL, preparent, postparent, NULL, NULL, xdata); @@ -1180,7 +1186,7 @@ ec_rmdir(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1344,9 +1350,9 @@ ec_symlink(call_frame_t *frame, xlator_t *this, uintptr_t target, /* FOP: unlink */ int32_t -ec_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +ec_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { return ec_dir_write_cbk(frame, this, cookie, op_ret, op_errno, NULL, preparent, postparent, NULL, NULL, xdata); diff --git a/xlators/cluster/ec/src/ec-generic.c b/xlators/cluster/ec/src/ec-generic.c index 884deb9366..7f1309a9e8 100644 --- a/xlators/cluster/ec/src/ec-generic.c +++ b/xlators/cluster/ec/src/ec-generic.c @@ -20,8 +20,8 @@ /* FOP: flush */ int32_t -ec_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +ec_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -259,9 +259,9 @@ ec_combine_fsync(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) } int32_t -ec_fsync_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) +ec_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -474,7 +474,7 @@ ec_fsync(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -718,9 +718,9 @@ ec_combine_lookup(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) } int32_t -ec_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, - struct iatt *postparent) +ec_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -954,8 +954,9 @@ ec_combine_statfs(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) } int32_t -ec_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct statvfs *buf, dict_t *xdata) +ec_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, + dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -1149,7 +1150,8 @@ ec_combine_xattrop(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) int32_t ec_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, + dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_lock_link_t *link = NULL; @@ -1460,8 +1462,8 @@ ec_fxattrop(call_frame_t *frame, xlator_t *this, uintptr_t target, /* FOP: IPC */ int32_t -ec_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +ec_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c index 7d991f04aa..73204b3914 100644 --- a/xlators/cluster/ec/src/ec-heal.c +++ b/xlators/cluster/ec/src/ec-heal.c @@ -199,7 +199,7 @@ ec_heal_avoid(ec_fop_data_t *fop) int32_t ec_heal_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = cookie; ec_heal_t *heal = fop->data; @@ -295,7 +295,7 @@ ec_wind_xattrop_parallel(call_frame_t *frame, xlator_t *subvol, int child_index, int32_t ec_heal_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { ec_fop_data_t *fop = cookie; @@ -316,7 +316,7 @@ ec_heal_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t ec_heal_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -476,7 +476,7 @@ ec_adjust_versions(call_frame_t *frame, ec_t *ec, ec_txn_t type, inode_t *inode, int ret = 0; int call_count = 0; dict_t **xattr = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; loc_t loc = {0}; gf_boolean_t erase_dirty = _gf_false; uint64_t *versions_xattr = NULL; @@ -2026,7 +2026,7 @@ ec_heal_block(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_heal_block_done(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, uintptr_t mask, + gf_return_t op_ret, int32_t op_errno, uintptr_t mask, uintptr_t good, uintptr_t bad, uint32_t pending, dict_t *xdata) { @@ -2211,7 +2211,7 @@ __ec_fd_data_adjust_versions(call_frame_t *frame, ec_t *ec, fd_t *fd, dict_t *xattr = NULL; int i = 0; int ret = 0; - int op_ret = 0; + gf_return_t op_ret = 0; int source = -1; gf_boolean_t erase_dirty = _gf_false; @@ -2560,7 +2560,7 @@ ec_heal_do(xlator_t *this, void *data, loc_t *loc, int32_t partial) unsigned char *healed_sinks = NULL; ec_t *ec = NULL; int ret = 0; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; intptr_t mgood = 0; intptr_t mbad = 0; diff --git a/xlators/cluster/ec/src/ec-heald.c b/xlators/cluster/ec/src/ec-heald.c index 679cfe1c83..4792d1fc2e 100644 --- a/xlators/cluster/ec/src/ec-heald.c +++ b/xlators/cluster/ec/src/ec-heald.c @@ -528,7 +528,7 @@ int ec_heal_op(xlator_t *this, dict_t *output, gf_xl_afr_op_t op, int xl_id) { char key[64] = {0}; - int op_ret = 0; + gf_return_t op_ret = 0; ec_t *ec = NULL; int i = 0; GF_UNUSED int ret = 0; diff --git a/xlators/cluster/ec/src/ec-inode-read.c b/xlators/cluster/ec/src/ec-inode-read.c index dad5f4d701..27f9358c9c 100644 --- a/xlators/cluster/ec/src/ec-inode-read.c +++ b/xlators/cluster/ec/src/ec-inode-read.c @@ -19,8 +19,8 @@ /* FOP: access */ int32_t -ec_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +ec_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -201,7 +201,8 @@ ec_combine_getxattr(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) int32_t ec_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -389,7 +390,7 @@ ec_manager_getxattr(ec_fop_data_t *fop, int32_t state) int32_t ec_getxattr_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *xl, - int32_t op_ret, int32_t op_errno, uintptr_t mask, + gf_return_t op_ret, int32_t op_errno, uintptr_t mask, uintptr_t good, uintptr_t bad, uint32_t pending, dict_t *xdata) { @@ -542,7 +543,8 @@ ec_getxattr(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -687,8 +689,8 @@ ec_combine_open(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) } int32_t -ec_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +ec_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -756,7 +758,7 @@ ec_wind_open(ec_t *ec, ec_fop_data_t *fop, int32_t idx) int32_t ec_open_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { ec_fop_data_t *fop = cookie; @@ -970,7 +972,7 @@ ec_combine_readlink(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) int32_t ec_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata) { ec_fop_data_t *fop = NULL; @@ -1262,9 +1264,10 @@ ec_combine_readv(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) } int32_t -ec_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iovec *vector, int32_t count, - struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) +ec_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, + int32_t count, struct iatt *stbuf, struct iobref *iobref, + dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -1503,8 +1506,8 @@ ec_readv(call_frame_t *frame, xlator_t *this, uintptr_t target, /* FOP: seek */ int32_t -ec_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, off_t offset, dict_t *xdata) +ec_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -1722,8 +1725,9 @@ ec_combine_stat(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) } int32_t -ec_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +ec_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -1933,8 +1937,9 @@ ec_stat(call_frame_t *frame, xlator_t *this, uintptr_t target, /* FOP: fstat */ int32_t -ec_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +ec_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c index 9b5fe2a7fd..ea94dc36df 100644 --- a/xlators/cluster/ec/src/ec-inode-write.c +++ b/xlators/cluster/ec/src/ec-inode-write.c @@ -18,7 +18,7 @@ int32_t ec_update_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { ec_fop_data_t *fop = cookie; @@ -109,7 +109,7 @@ ec_update_write(ec_fop_data_t *fop, uintptr_t mask, off_t offset, uint64_t size) int ec_inode_write_cbk(call_frame_t *frame, xlator_t *this, void *cookie, - int op_ret, int op_errno, struct iatt *prestat, + gf_return_t op_ret, int op_errno, struct iatt *prestat, struct iatt *poststat, dict_t *xdata) { ec_fop_data_t *fop = NULL; @@ -157,7 +157,7 @@ ec_inode_write_cbk(call_frame_t *frame, xlator_t *this, void *cookie, int32_t ec_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { return ec_inode_write_cbk(frame, this, cookie, op_ret, op_errno, NULL, NULL, xdata); @@ -174,8 +174,8 @@ ec_wind_removexattr(ec_t *ec, ec_fop_data_t *fop, int32_t idx) } void -ec_xattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +ec_xattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = cookie; switch (fop->id) { @@ -341,7 +341,7 @@ ec_removexattr(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { return ec_inode_write_cbk(frame, this, cookie, op_ret, op_errno, NULL, NULL, xdata); @@ -425,7 +425,7 @@ ec_fremovexattr(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prestat, + gf_return_t op_ret, int32_t op_errno, struct iatt *prestat, struct iatt *poststat, dict_t *xdata) { return ec_inode_write_cbk(frame, this, cookie, op_ret, op_errno, prestat, @@ -605,7 +605,7 @@ ec_setattr(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prestat, + gf_return_t op_ret, int32_t op_errno, struct iatt *prestat, struct iatt *poststat, dict_t *xdata) { return ec_inode_write_cbk(frame, this, cookie, op_ret, op_errno, prestat, @@ -686,7 +686,7 @@ ec_fsetattr(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { return ec_inode_write_cbk(frame, this, cookie, op_ret, op_errno, NULL, NULL, xdata); @@ -769,7 +769,7 @@ ec_setxattr(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -895,7 +895,7 @@ ec_fsetxattr(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { return ec_inode_write_cbk(frame, this, cookie, op_ret, op_errno, prebuf, @@ -1147,7 +1147,7 @@ ec_discard_adjust_offset_size(ec_fop_data_t *fop) int32_t ec_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { return ec_inode_write_cbk(frame, this, cookie, op_ret, op_errno, prebuf, @@ -1344,7 +1344,8 @@ ec_update_truncate_write(ec_fop_data_t *fop, uintptr_t mask) int32_t ec_truncate_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { ec_fop_data_t *fop = cookie; int32_t err; @@ -1381,7 +1382,7 @@ ec_truncate_clean(ec_fop_data_t *fop) int32_t ec_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prestat, + gf_return_t op_ret, int32_t op_errno, struct iatt *prestat, struct iatt *poststat, dict_t *xdata) { return ec_inode_write_cbk(frame, this, cookie, op_ret, op_errno, prestat, @@ -1584,7 +1585,7 @@ ec_truncate(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prestat, + gf_return_t op_ret, int32_t op_errno, struct iatt *prestat, struct iatt *poststat, dict_t *xdata) { return ec_inode_write_cbk(frame, this, cookie, op_ret, op_errno, prestat, @@ -1732,7 +1733,7 @@ ec_add_stripe_in_cache(ec_t *ec, ec_fop_data_t *fop) int32_t ec_writev_merge_tail(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -1765,7 +1766,7 @@ ec_writev_merge_tail(call_frame_t *frame, void *cookie, xlator_t *this, int32_t ec_writev_merge_head(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -2087,9 +2088,9 @@ ec_writev_start(ec_fop_data_t *fop) } int32_t -ec_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *prestat, struct iatt *poststat, - dict_t *xdata) +ec_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *prestat, + struct iatt *poststat, dict_t *xdata) { ec_t *ec = NULL; if (this && this->private) { diff --git a/xlators/cluster/ec/src/ec-locks.c b/xlators/cluster/ec/src/ec-locks.c index 601960d615..03d35805c1 100644 --- a/xlators/cluster/ec/src/ec-locks.c +++ b/xlators/cluster/ec/src/ec-locks.c @@ -122,7 +122,7 @@ ec_lock_check(ec_fop_data_t *fop, uintptr_t *mask) int32_t ec_lock_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { if (op_ret < 0) { gf_msg(this->name, GF_LOG_WARNING, op_errno, EC_MSG_UNLOCK_FAILED, @@ -134,8 +134,8 @@ ec_lock_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, int32_t ec_lock_lk_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *flock, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct gf_flock *flock, dict_t *xdata) { if (op_ret < 0) { gf_msg(this->name, GF_LOG_WARNING, op_errno, EC_MSG_LK_UNLOCK_FAILED, @@ -149,7 +149,7 @@ ec_lock_lk_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, int32_t ec_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -378,7 +378,7 @@ ec_entrylk(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -510,7 +510,7 @@ ec_fentrylk(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t ec_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -757,7 +757,7 @@ ec_inodelk(call_frame_t *frame, xlator_t *this, gf_lkowner_t *owner, int32_t ec_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { ec_fop_data_t *fop = NULL; ec_cbk_data_t *cbk = NULL; @@ -906,7 +906,7 @@ ec_combine_lk(ec_fop_data_t *fop, ec_cbk_data_t *dst, ec_cbk_data_t *src) } int32_t -ec_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, +ec_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct gf_flock *flock, dict_t *xdata) { ec_fop_data_t *fop = NULL; diff --git a/xlators/cluster/ec/src/ec-types.h b/xlators/cluster/ec/src/ec-types.h index 90da328e64..2fff2d43d7 100644 --- a/xlators/cluster/ec/src/ec-types.h +++ b/xlators/cluster/ec/src/ec-types.h @@ -399,7 +399,7 @@ struct _ec_cbk_data { ec_fop_data_t *fop; ec_cbk_data_t *next; /* next answer in the same group */ uint32_t idx; - int32_t op_ret; + gf_return_t op_ret; int32_t op_errno; int32_t count; uintptr_t mask; diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c index bce6a9ca2d..7468888aae 100644 --- a/xlators/cluster/ec/src/ec.c +++ b/xlators/cluster/ec/src/ec.c @@ -1037,7 +1037,7 @@ ec_handle_heal_commands(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { dict_t *dict_rsp = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = ENOMEM; if (!name || strcmp(name, GF_HEAL_INFO)) diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index aa00c446e5..dd7b662d98 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -1912,8 +1912,8 @@ ios_init_iosstat(xlator_t *this, char *path, uuid_t gfid, inode_t *inode) int io_stats_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { struct ios_fd *iosfd = NULL; @@ -1967,7 +1967,7 @@ io_stats_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { struct ios_fd *iosfd = NULL; char *path = NULL; @@ -2031,7 +2031,7 @@ io_stats_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, STAT); @@ -2041,7 +2041,7 @@ io_stats_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *buf, struct iobref *iobref, dict_t *xdata) { @@ -2073,7 +2073,7 @@ io_stats_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct ios_stat *iosstat = NULL; @@ -2099,7 +2099,7 @@ io_stats_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata) { @@ -2112,7 +2112,7 @@ io_stats_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *buf, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *buf, dict_t *xdata) { struct ios_stat *iosstat = NULL; @@ -2135,7 +2135,7 @@ io_stats_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *buf, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *buf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, READDIR); @@ -2145,7 +2145,7 @@ io_stats_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FSYNC); @@ -2155,7 +2155,7 @@ io_stats_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preop, + gf_return_t op_ret, int32_t op_errno, struct iatt *preop, struct iatt *postop, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, SETATTR); @@ -2165,8 +2165,9 @@ io_stats_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { UPDATE_PROFILE_STATS(frame, UNLINK); STACK_UNWIND_STRICT(unlink, frame, op_ret, op_errno, preparent, postparent, @@ -2176,7 +2177,7 @@ io_stats_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -2189,7 +2190,7 @@ io_stats_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *buf, + gf_return_t op_ret, int32_t op_errno, const char *buf, struct iatt *sbuf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, READLINK); @@ -2199,7 +2200,7 @@ io_stats_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { UPDATE_PROFILE_STATS(frame, LOOKUP); @@ -2210,7 +2211,7 @@ io_stats_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2222,7 +2223,7 @@ io_stats_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2234,7 +2235,7 @@ io_stats_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2261,7 +2262,7 @@ io_stats_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2273,7 +2274,7 @@ io_stats_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FLUSH); STACK_UNWIND_STRICT(flush, frame, op_ret, op_errno, xdata); @@ -2282,7 +2283,8 @@ io_stats_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { struct ios_stat *iosstat = NULL; int ret = -1; @@ -2304,7 +2306,7 @@ io_stats_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, RMDIR); @@ -2316,7 +2318,7 @@ io_stats_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, TRUNCATE); @@ -2327,7 +2329,7 @@ io_stats_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, STATFS); @@ -2337,7 +2339,7 @@ io_stats_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, SETXATTR); STACK_UNWIND_STRICT(setxattr, frame, op_ret, op_errno, xdata); @@ -2346,7 +2348,7 @@ io_stats_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, GETXATTR); @@ -2356,7 +2358,7 @@ io_stats_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, REMOVEXATTR); STACK_UNWIND_STRICT(removexattr, frame, op_ret, op_errno, xdata); @@ -2365,7 +2367,7 @@ io_stats_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FSETXATTR); STACK_UNWIND_STRICT(fsetxattr, frame, op_ret, op_errno, xdata); @@ -2374,7 +2376,7 @@ io_stats_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FGETXATTR); @@ -2384,7 +2386,7 @@ io_stats_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FREMOVEXATTR); STACK_UNWIND_STRICT(fremovexattr, frame, op_ret, op_errno, xdata); @@ -2393,7 +2395,7 @@ io_stats_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FSYNCDIR); STACK_UNWIND_STRICT(fsyncdir, frame, op_ret, op_errno, xdata); @@ -2402,7 +2404,7 @@ io_stats_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, ACCESS); STACK_UNWIND_STRICT(access, frame, op_ret, op_errno, xdata); @@ -2411,8 +2413,8 @@ io_stats_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_ftruncate_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FTRUNCATE); STACK_UNWIND_STRICT(ftruncate, frame, op_ret, op_errno, prebuf, postbuf, @@ -2422,7 +2424,7 @@ io_stats_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FSTAT); @@ -2432,8 +2434,8 @@ io_stats_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_fallocate_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FALLOCATE); STACK_UNWIND_STRICT(fallocate, frame, op_ret, op_errno, prebuf, postbuf, @@ -2443,7 +2445,7 @@ io_stats_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, DISCARD); @@ -2454,7 +2456,7 @@ io_stats_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, ZEROFILL); @@ -2465,7 +2467,7 @@ io_stats_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t io_stats_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, IPC); STACK_UNWIND_STRICT(ipc, frame, op_ret, op_errno, xdata); @@ -2474,7 +2476,7 @@ io_stats_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, LK); @@ -2484,7 +2486,7 @@ io_stats_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, ENTRYLK); STACK_UNWIND_STRICT(entrylk, frame, op_ret, op_errno, xdata); @@ -2493,7 +2495,7 @@ io_stats_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FENTRYLK); STACK_UNWIND_STRICT(fentrylk, frame, op_ret, op_errno, xdata); @@ -2502,8 +2504,9 @@ io_stats_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, - uint8_t *strong_checksum, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + uint32_t weak_checksum, uint8_t *strong_checksum, + dict_t *xdata) { UPDATE_PROFILE_STATS(frame, RCHECKSUM); STACK_UNWIND_STRICT(rchecksum, frame, op_ret, op_errno, weak_checksum, @@ -2513,7 +2516,8 @@ io_stats_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, off_t offset, + dict_t *xdata) { UPDATE_PROFILE_STATS(frame, SEEK); STACK_UNWIND_STRICT(seek, frame, op_ret, op_errno, offset, xdata); @@ -2522,7 +2526,7 @@ io_stats_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_lease *lease, + gf_return_t op_ret, int32_t op_errno, struct gf_lease *lease, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, LEASE); @@ -2532,7 +2536,7 @@ io_stats_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, lock_migration_info_t *locklist, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, GETACTIVELK); @@ -2542,7 +2546,7 @@ io_stats_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, SETACTIVELK); STACK_UNWIND_STRICT(setactivelk, frame, op_ret, op_errno, xdata); @@ -2551,7 +2555,7 @@ io_stats_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_compound_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, void *data, + gf_return_t op_ret, int32_t op_errno, void *data, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, COMPOUND); @@ -2561,7 +2565,7 @@ io_stats_compound_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, XATTROP); @@ -2571,7 +2575,7 @@ io_stats_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FXATTROP); @@ -2581,7 +2585,7 @@ io_stats_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, INODELK); STACK_UNWIND_STRICT(inodelk, frame, op_ret, op_errno, xdata); @@ -2628,7 +2632,7 @@ io_stats_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, int io_stats_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { UPDATE_PROFILE_STATS(frame, FINODELK); STACK_UNWIND_STRICT(finodelk, frame, op_ret, op_errno, xdata); diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c index 6ed0ca0034..b1b06ec54d 100644 --- a/xlators/debug/trace/src/trace.c +++ b/xlators/debug/trace/src/trace.c @@ -82,7 +82,7 @@ dump_history_trace(circular_buffer_t *cb, void *data) int trace_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -135,7 +135,7 @@ trace_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -168,7 +168,7 @@ trace_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { char statstr[1024] = { @@ -206,7 +206,7 @@ trace_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *buf, struct iobref *iobref, dict_t *xdata) { @@ -246,7 +246,7 @@ trace_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { char preopstr[1024] = { @@ -291,7 +291,7 @@ trace_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *buf, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *buf, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -319,7 +319,7 @@ trace_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *buf, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *buf, dict_t *xdata) { int count = 0; @@ -365,7 +365,7 @@ trace_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { char preopstr[1024] = { @@ -411,7 +411,7 @@ trace_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { char preopstr[1024] = { @@ -457,7 +457,7 @@ trace_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { char preopstr[1024] = { @@ -501,7 +501,7 @@ trace_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { char preparentstr[1024] = { @@ -549,7 +549,7 @@ trace_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -613,7 +613,7 @@ trace_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *buf, + gf_return_t op_ret, int32_t op_errno, const char *buf, struct iatt *stbuf, dict_t *xdata) { char statstr[1024] = { @@ -654,7 +654,7 @@ trace_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { char statstr[1024] = { @@ -708,7 +708,7 @@ trace_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -758,7 +758,7 @@ trace_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -808,7 +808,7 @@ trace_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -858,7 +858,7 @@ trace_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -911,7 +911,7 @@ trace_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -937,7 +937,7 @@ trace_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -969,7 +969,7 @@ trace_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { char preparentstr[1024] = { @@ -1016,7 +1016,7 @@ trace_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { char preopstr[1024] = { @@ -1062,7 +1062,7 @@ trace_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1112,7 +1112,7 @@ trace_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1138,7 +1138,7 @@ trace_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1168,7 +1168,7 @@ trace_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1194,7 +1194,7 @@ trace_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1224,7 +1224,7 @@ trace_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1251,7 +1251,7 @@ trace_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1277,7 +1277,7 @@ trace_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1305,7 +1305,7 @@ trace_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { char prebufstr[1024] = { @@ -1351,7 +1351,7 @@ trace_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { char statstr[1024] = { @@ -1389,8 +1389,9 @@ trace_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int -trace_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct gf_flock *lock, dict_t *xdata) +trace_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, + dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1431,7 +1432,7 @@ trace_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int trace_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1457,7 +1458,7 @@ trace_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1483,7 +1484,8 @@ trace_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1509,7 +1511,7 @@ trace_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1536,7 +1538,7 @@ trace_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1562,7 +1564,7 @@ trace_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { trace_conf_t *conf = NULL; @@ -1588,8 +1590,9 @@ trace_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int trace_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, - uint8_t *strong_checksum, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + uint32_t weak_checksum, uint8_t *strong_checksum, + dict_t *xdata) { trace_conf_t *conf = NULL; @@ -2343,7 +2346,8 @@ trace_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, static int trace_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, off_t offset, + dict_t *xdata) { trace_conf_t *conf = this->private; diff --git a/xlators/features/arbiter/src/arbiter.c b/xlators/features/arbiter/src/arbiter.c index 83a97e3354..1543e2f27f 100644 --- a/xlators/features/arbiter/src/arbiter.c +++ b/xlators/features/arbiter/src/arbiter.c @@ -59,7 +59,7 @@ arbiter_inode_ctx_get(inode_t *inode, xlator_t *this) int32_t arbiter_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { arbiter_inode_ctx_t *ctx = NULL; @@ -94,7 +94,7 @@ arbiter_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, { arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; ctx = arbiter_inode_ctx_get(loc->inode, this); @@ -116,7 +116,7 @@ arbiter_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, { arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; ctx = arbiter_inode_ctx_get(fd->inode, this); @@ -178,7 +178,7 @@ arbiter_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; dict_t *rsp_xdata = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; ctx = arbiter_inode_ctx_get(fd->inode, this); @@ -203,7 +203,7 @@ arbiter_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, { arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; ctx = arbiter_inode_ctx_get(fd->inode, this); @@ -224,7 +224,7 @@ arbiter_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, { arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; ctx = arbiter_inode_ctx_get(fd->inode, this); @@ -245,7 +245,7 @@ arbiter_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, { arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; ctx = arbiter_inode_ctx_get(fd->inode, this); diff --git a/xlators/features/barrier/src/barrier.c b/xlators/features/barrier/src/barrier.c index 852bbacb99..9463efd2f5 100644 --- a/xlators/features/barrier/src/barrier.c +++ b/xlators/features/barrier/src/barrier.c @@ -41,7 +41,7 @@ barrier_local_free_gfid(call_frame_t *frame) int32_t barrier_truncate_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { @@ -53,7 +53,7 @@ barrier_truncate_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_ftruncate_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { @@ -65,7 +65,7 @@ barrier_ftruncate_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_unlink_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -77,7 +77,7 @@ barrier_unlink_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_rmdir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -89,10 +89,10 @@ barrier_rmdir_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_rename_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, - struct iatt *preoldparent, struct iatt *postoldparent, - struct iatt *prenewparent, struct iatt *postnewparent, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *buf, struct iatt *preoldparent, + struct iatt *postoldparent, struct iatt *prenewparent, + struct iatt *postnewparent, dict_t *xdata) { barrier_local_free_gfid(frame); STACK_UNWIND_STRICT(rename, frame, op_ret, op_errno, buf, preoldparent, @@ -102,8 +102,9 @@ barrier_rename_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_writev_cbk_resume(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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata) { barrier_local_free_gfid(frame); STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, prebuf, postbuf, @@ -113,8 +114,9 @@ barrier_writev_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_fsync_cbk_resume(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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata) { barrier_local_free_gfid(frame); STACK_UNWIND_STRICT(fsync, frame, op_ret, op_errno, prebuf, postbuf, xdata); @@ -123,8 +125,8 @@ barrier_fsync_cbk_resume(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_removexattr_cbk_resume(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, int32_t op_errno, - dict_t *xdata) + xlator_t *this, gf_return_t op_ret, + int32_t op_errno, dict_t *xdata) { barrier_local_free_gfid(frame); STACK_UNWIND_STRICT(removexattr, frame, op_ret, op_errno, xdata); @@ -133,7 +135,7 @@ barrier_removexattr_cbk_resume(call_frame_t *frame, void *cookie, int32_t barrier_fremovexattr_cbk_resume(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { barrier_local_free_gfid(frame); @@ -143,7 +145,7 @@ barrier_fremovexattr_cbk_resume(call_frame_t *frame, void *cookie, int32_t barrier_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { BARRIER_FOP_CBK(writev, out, frame, this, op_ret, op_errno, prebuf, postbuf, @@ -154,7 +156,7 @@ barrier_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { BARRIER_FOP_CBK(fremovexattr, out, frame, this, op_ret, op_errno, xdata); out: @@ -163,7 +165,7 @@ barrier_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { BARRIER_FOP_CBK(removexattr, out, frame, this, op_ret, op_errno, xdata); out: @@ -172,7 +174,7 @@ barrier_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { BARRIER_FOP_CBK(truncate, out, frame, this, op_ret, op_errno, prebuf, @@ -183,7 +185,7 @@ barrier_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { BARRIER_FOP_CBK(ftruncate, out, frame, this, op_ret, op_errno, prebuf, @@ -194,7 +196,7 @@ barrier_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -208,7 +210,7 @@ barrier_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { BARRIER_FOP_CBK(rmdir, out, frame, this, op_ret, op_errno, preparent, @@ -219,7 +221,7 @@ barrier_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { BARRIER_FOP_CBK(unlink, out, frame, this, op_ret, op_errno, preparent, @@ -230,7 +232,7 @@ barrier_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t barrier_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { BARRIER_FOP_CBK(fsync, out, frame, this, op_ret, op_errno, prebuf, postbuf, diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c b/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c index 8ac13a0994..8a22a2521c 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c @@ -352,7 +352,7 @@ br_stub_lookup_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, struct stat lstatbuf = {0}; int ret = 0; int32_t op_errno = EINVAL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; struct iatt stbuf = { 0, }; @@ -561,7 +561,7 @@ br_stub_readdir_wrapper(call_frame_t *frame, xlator_t *this, fd_t *fd, br_stub_fd_t *fctx = NULL; DIR *dir = NULL; int ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int count = 0; gf_dirent_t entries; diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c index 605a5e4c3e..b5954047f8 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c @@ -731,7 +731,7 @@ br_stub_check_bad_object(xlator_t *this, inode_t *inode, int32_t *op_ret, */ int br_stub_fd_incversioning_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { fd_t *fd = NULL; inode_t *inode = NULL; @@ -1058,7 +1058,7 @@ br_stub_handle_object_signature(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { int32_t ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; int fakesuccess = 0; br_stub_private_t *priv = NULL; @@ -1129,7 +1129,7 @@ br_stub_handle_object_signature(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t br_stub_fsetxattr_resume(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { int32_t ret = -1; br_stub_local_t *local = NULL; @@ -1190,7 +1190,7 @@ br_stub_handle_object_reopen(call_frame_t *frame, xlator_t *this, fd_t *fd, uint32_t val) { int32_t ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; call_stub_t *stub = NULL; gf_boolean_t inc_version = _gf_false; @@ -1253,7 +1253,7 @@ br_stub_handle_object_reopen(call_frame_t *frame, xlator_t *this, fd_t *fd, */ int br_stub_fsetxattr_bad_object_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { br_stub_local_t *local = NULL; @@ -1299,7 +1299,7 @@ br_stub_handle_bad_object_key(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int flags, dict_t *xdata) { br_stub_local_t *local = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; if (frame->root->pid != GF_CLIENT_PID_SCRUB) { @@ -1347,7 +1347,7 @@ static int32_t br_stub_handle_internal_xattr(call_frame_t *frame, xlator_t *this, fd_t *fd, char *key) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, 0, BRS_MSG_SET_INTERNAL_XATTR, @@ -1387,7 +1387,7 @@ br_stub_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, uint32_t val = 0; br_isignature_t *sign = NULL; br_stub_private_t *priv = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; priv = this->private; @@ -1470,7 +1470,7 @@ int br_stub_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int flags, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; if (br_stub_internal_xattr(dict)) { @@ -1496,7 +1496,7 @@ int32_t br_stub_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; if (!strcmp(BITROT_OBJECT_BAD_KEY, name) || @@ -1519,7 +1519,7 @@ int32_t br_stub_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; if (!strcmp(BITROT_OBJECT_BAD_KEY, name) || @@ -1547,7 +1547,8 @@ br_stub_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, int br_stub_listxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xattr, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xattr, + dict_t *xdata) { if (op_ret < 0) goto unwind; @@ -1635,7 +1636,8 @@ br_stub_is_object_stale(xlator_t *this, call_frame_t *frame, inode_t *inode, int br_stub_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xattr, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xattr, + dict_t *xdata) { int32_t ret = 0; size_t totallen = 0; @@ -1741,7 +1743,7 @@ br_stub_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static void br_stub_send_stub_init_time(call_frame_t *frame, xlator_t *this) { - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; dict_t *xattr = NULL; br_stub_init_t stub = { @@ -1787,7 +1789,7 @@ br_stub_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, void *cookie = NULL; static uuid_t rootgfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; fop_getxattr_cbk_t cbk = br_stub_getxattr_cbk; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; br_stub_local_t *local = NULL; br_stub_private_t *priv = NULL; @@ -1868,7 +1870,7 @@ br_stub_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, void *cookie = NULL; static uuid_t rootgfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; fop_fgetxattr_cbk_t cbk = br_stub_getxattr_cbk; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; br_stub_local_t *local = NULL; br_stub_private_t *priv = NULL; @@ -1941,7 +1943,7 @@ int32_t br_stub_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; int32_t ret = -1; br_stub_private_t *priv = NULL; @@ -1980,7 +1982,7 @@ br_stub_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, */ int32_t br_stub_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { int32_t ret = 0; @@ -2035,7 +2037,7 @@ br_stub_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, uint32_t flags, struct iobref *iobref, dict_t *xdata) { call_stub_t *stub = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; gf_boolean_t inc_version = _gf_false; gf_boolean_t modified = _gf_false; @@ -2118,7 +2120,7 @@ br_stub_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t br_stub_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { int32_t ret = -1; @@ -2162,7 +2164,7 @@ br_stub_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, { br_stub_local_t *local = NULL; call_stub_t *stub = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; gf_boolean_t inc_version = _gf_false; gf_boolean_t modified = _gf_false; @@ -2231,7 +2233,7 @@ br_stub_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t br_stub_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { int32_t ret = 0; @@ -2289,7 +2291,7 @@ br_stub_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, { br_stub_local_t *local = NULL; call_stub_t *stub = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; gf_boolean_t inc_version = _gf_false; gf_boolean_t modified = _gf_false; @@ -2395,7 +2397,7 @@ br_stub_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int32_t ret = -1; br_stub_inode_ctx_t *ctx = NULL; uint64_t ctx_addr = 0; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; br_stub_private_t *priv = NULL; unsigned long version = BITROT_DEFAULT_CURRENT_VERSION; @@ -2488,7 +2490,7 @@ br_stub_add_fd_to_inode(xlator_t *this, fd_t *fd, br_stub_inode_ctx_t *ctx) int br_stub_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int op_errno, fd_t *fd, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2546,10 +2548,10 @@ br_stub_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } int -br_stub_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +br_stub_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { int32_t ret = -1; unsigned long version = BITROT_DEFAULT_CURRENT_VERSION; @@ -2665,7 +2667,7 @@ br_stub_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, { br_stub_private_t *priv = NULL; br_stub_fd_t *fd_ctx = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; priv = this->private; @@ -2732,7 +2734,7 @@ br_stub_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int br_stub_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, dict_t *dict) { int32_t ret = 0; @@ -2917,8 +2919,8 @@ br_stub_handle_lookup_error(xlator_t *this, inode_t *inode, int32_t op_errno) int br_stub_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, - dict_t *xattr, struct iatt *postparent) + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { int32_t ret = 0; br_stub_private_t *priv = NULL; @@ -3092,7 +3094,7 @@ int br_stub_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { int32_t ret = 0; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; br_stub_private_t *priv = NULL; @@ -3123,7 +3125,7 @@ int br_stub_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { int32_t ret = 0; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; br_stub_private_t *priv = NULL; @@ -3157,7 +3159,7 @@ br_stub_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) int br_stub_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { br_stub_local_t *local = NULL; @@ -3230,7 +3232,7 @@ br_stub_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, dict_t *xdata) { br_stub_local_t *local = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; br_stub_private_t *priv = NULL; @@ -3292,8 +3294,8 @@ br_stub_forget(xlator_t *this, inode_t *inode) /** {{{ */ int32_t -br_stub_noop(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +br_stub_noop(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { STACK_DESTROY(frame->root); return 0; diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c index 6a6e5af859..6ef0efa82a 100644 --- a/xlators/features/changelog/src/changelog.c +++ b/xlators/features/changelog/src/changelog.c @@ -52,8 +52,9 @@ changelog_init(xlator_t *this, changelog_priv_t *priv); int32_t changelog_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { changelog_priv_t *priv = NULL; changelog_local_t *local = NULL; @@ -173,8 +174,9 @@ changelog_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, int32_t changelog_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { changelog_priv_t *priv = NULL; changelog_local_t *local = NULL; @@ -321,7 +323,7 @@ changelog_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, int32_t changelog_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -439,7 +441,7 @@ changelog_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, int32_t changelog_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -549,7 +551,7 @@ changelog_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, int32_t changelog_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -678,7 +680,7 @@ changelog_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int32_t changelog_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -799,7 +801,7 @@ changelog_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, int32_t changelog_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -945,8 +947,8 @@ changelog_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int32_t changelog_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { int32_t ret = 0; @@ -1105,7 +1107,7 @@ changelog_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int32_t changelog_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata) { @@ -1161,7 +1163,7 @@ changelog_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t changelog_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata) { @@ -1230,7 +1232,7 @@ changelog_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t changelog_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { changelog_priv_t *priv = NULL; changelog_local_t *local = NULL; @@ -1281,7 +1283,7 @@ changelog_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t changelog_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { changelog_priv_t *priv = NULL; changelog_local_t *local = NULL; @@ -1334,7 +1336,7 @@ changelog_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t changelog_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { changelog_priv_t *priv = NULL; changelog_local_t *local = NULL; @@ -1447,7 +1449,7 @@ changelog_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t changelog_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { changelog_priv_t *priv = NULL; changelog_local_t *local = NULL; @@ -1499,7 +1501,7 @@ changelog_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int32_t changelog_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { changelog_priv_t *priv = NULL; @@ -1556,7 +1558,7 @@ changelog_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t changelog_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { changelog_priv_t *priv = NULL; @@ -1620,8 +1622,8 @@ changelog_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t changelog_truncate_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { changelog_priv_t *priv = NULL; changelog_local_t *local = NULL; @@ -1668,8 +1670,9 @@ changelog_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t changelog_ftruncate_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata) { changelog_priv_t *priv = NULL; changelog_local_t *local = NULL; @@ -1718,7 +1721,7 @@ changelog_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t changelog_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { changelog_priv_t *priv = NULL; @@ -1774,7 +1777,7 @@ changelog_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, int changelog_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int op_errno, fd_t *fd, dict_t *xdata) { int ret = 0; changelog_priv_t *priv = NULL; diff --git a/xlators/features/cloudsync/src/cloudsync-common.h b/xlators/features/cloudsync/src/cloudsync-common.h index 11d233460a..f5347ead6c 100644 --- a/xlators/features/cloudsync/src/cloudsync-common.h +++ b/xlators/features/cloudsync/src/cloudsync-common.h @@ -37,7 +37,7 @@ typedef struct cs_local { call_stub_t *stub; call_frame_t *main_frame; int op_errno; - int op_ret; + gf_return_t op_ret; fd_t *dlfd; off_t dloffset; struct iatt stbuf; diff --git a/xlators/features/cloudsync/src/cloudsync-fops-c.py b/xlators/features/cloudsync/src/cloudsync-fops-c.py index c27df97ae5..d0172b6b32 100755 --- a/xlators/features/cloudsync/src/cloudsync-fops-c.py +++ b/xlators/features/cloudsync/src/cloudsync-fops-c.py @@ -119,7 +119,7 @@ FD_DATA_MODIFYING_OP_FOP_CBK_TEMPLATE = """ int32_t cs_@NAME@_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, @LONG_ARGS@) { cs_local_t *local = NULL; @@ -242,7 +242,7 @@ LOC_STAT_OP_FOP_CBK_TEMPLATE = """ int32_t cs_@NAME@_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, @LONG_ARGS@) { int ret = 0; diff --git a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c index 23c3599825..7a15428c9b 100644 --- a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c +++ b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c @@ -331,9 +331,9 @@ aws_sign_request(char *const str, char *awssekey) } int -aws_dlwritev_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) +aws_dlwritev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { aws_private_t *priv = NULL; diff --git a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h index 85ae669486..1d5e678baf 100644 --- a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h +++ b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h @@ -28,9 +28,9 @@ int aws_download_s3(call_frame_t *frame, void *config); int -aws_dlwritev_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); +aws_dlwritev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata); void * aws_init(xlator_t *this); diff --git a/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.c b/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.c index 5b7272bb44..b31879f39c 100644 --- a/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.c +++ b/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.c @@ -66,7 +66,7 @@ cvlt_free_resources(archive_t *arch) static int32_t cvlt_extract_store_fops(xlator_t *this, archive_t *arch) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; get_archstore_methods_t get_archstore_methods; /* @@ -566,7 +566,7 @@ cvlt_download(call_frame_t *frame, void *config) cvlt_request_t *req = NULL; archstore_info_t dest_storeinfo; archstore_fileinfo_t dest_fileinfo; - int32_t op_ret, op_errno; + gf_return_t op_ret, op_errno; parch = (archive_t *)config; @@ -687,7 +687,7 @@ cvlt_download(call_frame_t *frame, void *config) int cvlt_read(call_frame_t *frame, void *config) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; archive_t *parch = NULL; cvlt_request_t *req = NULL; diff --git a/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.h b/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.h index c45ac948f6..7fa0cbe630 100644 --- a/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.h +++ b/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.h @@ -41,7 +41,7 @@ struct _cvlt_request { struct iobref *iobref; call_frame_t *frame; cvlt_op_t op_type; - int32_t op_ret; + gf_return_t op_ret; int32_t op_errno; xlator_t *this; sem_t sem; diff --git a/xlators/features/cloudsync/src/cloudsync.c b/xlators/features/cloudsync/src/cloudsync.c index 7f0b9e563b..9f61659ca3 100644 --- a/xlators/features/cloudsync/src/cloudsync.c +++ b/xlators/features/cloudsync/src/cloudsync.c @@ -317,7 +317,7 @@ cs_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int32_t cs_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { cs_local_t *local = NULL; @@ -447,8 +447,9 @@ cs_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, } int32_t -cs_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct statvfs *buf, dict_t *xdata) +cs_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, + dict_t *xdata) { STACK_UNWIND_STRICT(statfs, frame, op_ret, op_errno, buf, xdata); return 0; @@ -464,7 +465,8 @@ cs_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t cs_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { STACK_UNWIND_STRICT(getxattr, frame, op_ret, op_errno, dict, xdata); return 0; @@ -481,7 +483,7 @@ cs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, int32_t cs_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { cs_local_t *local = NULL; @@ -541,7 +543,8 @@ cs_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int32_t cs_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { STACK_UNWIND_STRICT(fgetxattr, frame, op_ret, op_errno, dict, xdata); return 0; @@ -558,7 +561,7 @@ cs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, int32_t cs_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { STACK_UNWIND_STRICT(fsetxattr, frame, op_ret, op_errno, xdata); return 0; @@ -574,9 +577,9 @@ cs_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, } int32_t -cs_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +cs_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { STACK_UNWIND_STRICT(unlink, frame, op_ret, op_errno, preparent, postparent, xdata); @@ -613,8 +616,8 @@ cs_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } int32_t -cs_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +cs_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { int ret = 0; uint64_t val = 0; @@ -666,8 +669,9 @@ cs_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } int32_t -cs_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +cs_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { int ret = 0; uint64_t val = 0; @@ -791,7 +795,7 @@ cs_lock_wipe(call_frame_t *lock_frame) int32_t cs_inodelk_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { cs_lock_wipe(frame); @@ -1155,9 +1159,10 @@ cs_serve_readv(call_frame_t *frame, off_t offset, size_t size, uint32_t flags) } int32_t -cs_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iovec *vector, int32_t count, - struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) +cs_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, + int32_t count, struct iatt *stbuf, struct iobref *iobref, + dict_t *xdata) { cs_local_t *local = NULL; int ret = 0; @@ -1404,8 +1409,9 @@ cs_resume_remote_readv_postprocess(xlator_t *this, call_frame_t *frame, } int -cs_stat_check_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *stbuf, dict_t *xdata) +cs_stat_check_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *stbuf, + dict_t *xdata) { cs_local_t *local = NULL; call_stub_t *stub = NULL; @@ -1585,7 +1591,7 @@ cs_common_cbk(call_frame_t *frame) int cs_blocking_inodelk_cbk(call_frame_t *lock_frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { cs_local_t *main_local = NULL; call_frame_t *main_frame = NULL; diff --git a/xlators/features/cloudsync/src/cloudsync.h b/xlators/features/cloudsync/src/cloudsync.h index d24141978d..5b244b90b5 100644 --- a/xlators/features/cloudsync/src/cloudsync.h +++ b/xlators/features/cloudsync/src/cloudsync.h @@ -53,7 +53,7 @@ cs_resume_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t cs_inodelk_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); size_t cs_write_callback(void *lcurlbuf, size_t size, size_t nitems, void *frame); @@ -66,13 +66,13 @@ cs_is_file_remote(struct iatt *stbuf, dict_t *xattr); int32_t cs_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int cs_build_loc(loc_t *loc, call_frame_t *frame); int cs_blocking_inodelk_cbk(call_frame_t *lock_frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, dict_t *xdata); int cs_read_authinfo(xlator_t *this); @@ -97,16 +97,17 @@ cs_resume_postprocess(xlator_t *this, call_frame_t *frame, inode_t *inode); int32_t cs_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata); int32_t cs_resume_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, dict_t *xattr_req); int32_t -cs_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iovec *vector, int32_t count, - struct iatt *stbuf, struct iobref *iobref, dict_t *xdata); +cs_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, + int32_t count, struct iatt *stbuf, struct iobref *iobref, + dict_t *xdata); int32_t cs_resume_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata); diff --git a/xlators/features/compress/src/cdc.c b/xlators/features/compress/src/cdc.c index b0b51e914e..35d7b6df67 100644 --- a/xlators/features/compress/src/cdc.c +++ b/xlators/features/compress/src/cdc.c @@ -25,9 +25,10 @@ cdc_cleanup_iobref(cdc_info_t *ci) } int32_t -cdc_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iovec *vector, int32_t count, - struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) +cdc_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, + int32_t count, struct iatt *stbuf, struct iobref *iobref, + dict_t *xdata) { int ret = -1; cdc_priv_t *priv = NULL; @@ -98,7 +99,7 @@ cdc_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int32_t cdc_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, prebuf, postbuf, diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index 3fea5672a2..7aee8762d2 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -355,9 +355,9 @@ ga_forget(xlator_t *this, inode_t *inode) } static int -ga_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *stat, dict_t *dict, - struct iatt *postparent) +ga_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *stat, dict_t *dict, struct iatt *postparent) { call_frame_t *orig_frame = NULL; @@ -376,7 +376,7 @@ ga_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, static int ga_newentry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -402,7 +402,7 @@ ga_newentry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int ga_newentry_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stat, dict_t *xdata, struct iatt *postparent) @@ -579,7 +579,7 @@ ga_heal_entry(call_frame_t *frame, xlator_t *this, loc_t *loc, data_t *data, int32_t ga_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { STACK_UNWIND_STRICT(setxattr, frame, op_ret, op_errno, xdata); return 0; @@ -632,7 +632,7 @@ ga_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int32_t ga_virtual_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { int ret = 0; @@ -725,9 +725,9 @@ ga_virtual_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int32_t -ga_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, - struct iatt *postparent) +ga_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { ga_private_t *priv = NULL; diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 4abb2c73ce..47a1a5689d 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -1221,9 +1221,9 @@ index_queue_process(xlator_t *this, inode_t *inode, call_stub_t *new) } static int -xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xattr, dict_t *xdata, dict_match_t match, - dict_t *matchdata) +xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata, + dict_match_t match, dict_t *matchdata) { inode_t *inode = NULL; index_local_t *local = NULL; @@ -1245,7 +1245,7 @@ xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t index_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { index_priv_t *priv = this->private; @@ -1257,7 +1257,7 @@ index_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t index_xattrop64_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { index_priv_t *priv = this->private; @@ -1560,7 +1560,7 @@ index_lookup_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, struct stat lstatbuf = {0}; int ret = 0; int32_t op_errno = EINVAL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; uint64_t val = IA_INVAL; char path[PATH_MAX] = {0}; struct iatt stbuf = { @@ -1718,7 +1718,7 @@ index_readdir_wrapper(call_frame_t *frame, xlator_t *this, fd_t *fd, index_priv_t *priv = NULL; DIR *dir = NULL; int ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int count = 0; gf_dirent_t entries; @@ -1822,7 +1822,7 @@ index_rmdir_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, dict_t *xdata) { int ret = 0; - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; char *subdir = NULL; char index_dir[PATH_MAX] = {0}; @@ -1880,7 +1880,7 @@ index_unlink_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, { index_priv_t *priv = NULL; index_inode_ctx_t *ictx = NULL; - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; int ret = 0; index_xattrop_type_t type = XATTROP_TYPE_UNSET; @@ -2062,7 +2062,7 @@ index_fill_link_count(xlator_t *this, dict_t *xdata) int32_t index_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { xdata = index_fill_link_count(this, xdata); @@ -2118,7 +2118,7 @@ index_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) int32_t index_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { xdata = index_fill_link_count(this, xdata); diff --git a/xlators/features/leases/src/leases.c b/xlators/features/leases/src/leases.c index 04bee50ba3..e374a68953 100644 --- a/xlators/features/leases/src/leases.c +++ b/xlators/features/leases/src/leases.c @@ -17,7 +17,7 @@ int32_t leases_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { STACK_UNWIND_STRICT(open, frame, op_ret, op_errno, fd, xdata); @@ -90,9 +90,9 @@ leases_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } int32_t -leases_writev_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) +leases_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, prebuf, postbuf, xdata); @@ -140,9 +140,10 @@ leases_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, } int32_t -leases_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iovec *vector, int count, - struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) +leases_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iovec *vector, + int count, struct iatt *stbuf, struct iobref *iobref, + dict_t *xdata) { STACK_UNWIND_STRICT(readv, frame, op_ret, op_errno, vector, count, stbuf, iobref, xdata); @@ -188,8 +189,9 @@ leases_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } int32_t -leases_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct gf_flock *lock, dict_t *xdata) +leases_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, + dict_t *xdata) { STACK_UNWIND_STRICT(lk, frame, op_ret, op_errno, lock, xdata); @@ -241,7 +243,7 @@ leases_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, struct gf_lease nullease = { 0, }; - int32_t op_ret = 0; + gf_return_t op_ret = 0; EXIT_IF_LEASES_OFF(this, out); EXIT_IF_INTERNAL_FOP(frame, xdata, out); @@ -269,7 +271,7 @@ leases_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t leases_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { STACK_UNWIND_STRICT(truncate, frame, op_ret, op_errno, prebuf, postbuf, @@ -316,7 +318,7 @@ leases_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, int32_t leases_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *statpre, + gf_return_t op_ret, int op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { STACK_UNWIND_STRICT(setattr, frame, op_ret, op_errno, statpre, statpost, @@ -363,7 +365,7 @@ leases_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t leases_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -413,9 +415,9 @@ leases_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } int32_t -leases_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +leases_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { STACK_UNWIND_STRICT(unlink, frame, op_ret, op_errno, preparent, postparent, xdata); @@ -460,9 +462,10 @@ leases_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, } int32_t -leases_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +leases_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { STACK_UNWIND_STRICT(link, frame, op_ret, op_errno, inode, stbuf, preparent, postparent, xdata); @@ -506,10 +509,10 @@ leases_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } int32_t -leases_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, fd_t *fd, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +leases_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, fd_t *fd, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { STACK_UNWIND_STRICT(create, frame, op_ret, op_errno, fd, inode, stbuf, preparent, postparent, xdata); @@ -558,7 +561,7 @@ leases_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int32_t leases_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { STACK_UNWIND_STRICT(fsync, frame, op_ret, op_errno, prebuf, postbuf, xdata); @@ -602,7 +605,7 @@ leases_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, int32_t leases_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { STACK_UNWIND_STRICT(ftruncate, frame, op_ret, op_errno, prebuf, postbuf, @@ -648,7 +651,7 @@ leases_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t leases_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { STACK_UNWIND_STRICT(fsetattr, frame, op_ret, op_errno, statpre, statpost, @@ -694,7 +697,7 @@ leases_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t leases_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { STACK_UNWIND_STRICT(fallocate, frame, op_ret, op_errno, pre, post, xdata); @@ -742,7 +745,7 @@ leases_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, int32_t leases_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { STACK_UNWIND_STRICT(discard, frame, op_ret, op_errno, pre, post, xdata); @@ -788,7 +791,7 @@ leases_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t leases_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { STACK_UNWIND_STRICT(zerofill, frame, op_ret, op_errno, pre, post, xdata); @@ -834,7 +837,7 @@ leases_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int leases_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { STACK_UNWIND_STRICT(flush, frame, op_ret, op_errno, xdata); diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c index a2c6be93e0..1a98656db2 100644 --- a/xlators/features/locks/src/common.c +++ b/xlators/features/locks/src/common.c @@ -233,7 +233,7 @@ pl_trace_in(xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, int cmd, } void -pl_print_verdict(char *str, int size, int op_ret, int op_errno) +pl_print_verdict(char *str, int size, gf_return_t op_ret, int op_errno) { char *verdict = NULL; @@ -254,7 +254,7 @@ pl_print_verdict(char *str, int size, int op_ret, int op_errno) void pl_trace_out(xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, int cmd, - struct gf_flock *flock, int op_ret, int op_errno, + struct gf_flock *flock, gf_return_t op_ret, int op_errno, const char *domain) { @@ -391,7 +391,7 @@ pl_fetch_mlock_info_from_disk(xlator_t *this, pl_inode_t *pl_inode, { dict_t *xdata_rsp = NULL; int ret = 0; - int op_ret = 0; + gf_return_t op_ret = 0; if (!local) { return -1; diff --git a/xlators/features/locks/src/common.h b/xlators/features/locks/src/common.h index 281223bf3b..205b7f55ba 100644 --- a/xlators/features/locks/src/common.h +++ b/xlators/features/locks/src/common.h @@ -140,7 +140,7 @@ pl_trace_in(xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, int cmd, void pl_trace_out(xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, int cmd, - struct gf_flock *flock, int op_ret, int op_errno, + struct gf_flock *flock, gf_return_t op_ret, int op_errno, const char *domain); void @@ -158,7 +158,7 @@ entrylk_trace_in(xlator_t *this, call_frame_t *frame, const char *volume, void entrylk_trace_out(xlator_t *this, call_frame_t *frame, const char *volume, fd_t *fd, loc_t *loc, const char *basename, entrylk_cmd cmd, - entrylk_type type, int op_ret, int op_errno); + entrylk_type type, gf_return_t op_ret, int op_errno); void entrylk_trace_block(xlator_t *this, call_frame_t *frame, const char *volume, @@ -166,7 +166,7 @@ entrylk_trace_block(xlator_t *this, call_frame_t *frame, const char *volume, entrylk_type type); void -pl_print_verdict(char *str, int size, int op_ret, int op_errno); +pl_print_verdict(char *str, int size, gf_return_t op_ret, int op_errno); void pl_print_lockee(char *str, int size, fd_t *fd, loc_t *loc); diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c index fd772c850d..7a715391dc 100644 --- a/xlators/features/locks/src/entrylk.c +++ b/xlators/features/locks/src/entrylk.c @@ -446,7 +446,7 @@ entrylk_trace_in(xlator_t *this, call_frame_t *frame, const char *domain, void entrylk_trace_out(xlator_t *this, call_frame_t *frame, const char *domain, fd_t *fd, loc_t *loc, const char *basename, entrylk_cmd cmd, - entrylk_type type, int op_ret, int op_errno) + entrylk_type type, gf_return_t op_ret, int op_errno) { posix_locks_private_t *priv = NULL; char pl_locker[256]; @@ -740,7 +740,7 @@ pl_common_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, entrylk_type type, loc_t *loc, fd_t *fd, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int ret = -1; char unwind = 1; diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c index d4e51d6e0a..ef0d7c81a2 100644 --- a/xlators/features/locks/src/inodelk.c +++ b/xlators/features/locks/src/inodelk.c @@ -551,7 +551,7 @@ unwind_granted_inodes(xlator_t *this, pl_inode_t *pl_inode, { pl_inode_lock_t *lock; pl_inode_lock_t *tmp; - int32_t op_ret; + gf_return_t op_ret; int32_t op_errno; list_for_each_entry_safe(lock, tmp, granted, blocked_locks) @@ -975,7 +975,7 @@ pl_common_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, inode_t *inode, int32_t cmd, struct gf_flock *flock, loc_t *loc, fd_t *fd, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int ret = -1; GF_UNUSED int dict_ret = -1; diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index cda02dadc2..99a9606d74 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -638,7 +638,7 @@ pl_check_n_create_fdctx(xlator_t *this, fd_t *fd) int32_t pl_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { pl_track_io_fop_count(frame->local, this, DECREMENT); @@ -674,7 +674,7 @@ pl_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, }; gf_boolean_t enabled = _gf_false; gf_boolean_t can_block = _gf_true; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; int allowed = 1; @@ -764,7 +764,7 @@ pl_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t pl_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { pl_track_io_fop_count(frame->local, this, DECREMENT); @@ -800,7 +800,7 @@ pl_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, }; gf_boolean_t enabled = _gf_false; gf_boolean_t can_block = _gf_true; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; int allowed = 1; @@ -890,7 +890,7 @@ pl_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int pl_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { pl_local_t *local = frame->local; @@ -930,7 +930,7 @@ pl_truncate_cont(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, static int truncate_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { pl_local_t *local = frame->local; @@ -1226,7 +1226,8 @@ __delete_locks_of_owner(pl_inode_t *pl_inode, client_t *client, int32_t pl_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { STACK_UNWIND_STRICT(getxattr, frame, op_ret, op_errno, dict, xdata); return 0; @@ -1245,7 +1246,7 @@ pl_getxattr_clrlk(xlator_t *this, const char *name, inode_t *inode, 0, }; char *brickname = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; *op_errno = EINVAL; @@ -1351,7 +1352,7 @@ pl_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { int32_t op_errno = EINVAL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; dict_t *dict = NULL; if (!name) @@ -1507,7 +1508,7 @@ pl_fgetxattr_handle_lockinfo(xlator_t *this, fd_t *fd, dict_t *dict, int32_t *op_errno) { char *key = NULL, *buf = NULL; - int32_t op_ret = 0; + gf_return_t op_ret = 0; unsigned long fdnum = 0; int32_t len = 0; dict_t *tmp = NULL; @@ -1592,7 +1593,7 @@ int32_t pl_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { - int32_t op_ret = 0, op_errno = 0; + gf_return_t op_ret = 0, op_errno = 0; dict_t *dict = NULL; if (!name) { @@ -1644,7 +1645,7 @@ pl_migrate_locks(call_frame_t *frame, fd_t *newfd, uint64_t oldfd_num, int32_t *op_errno) { posix_lock_t *l = NULL; - int32_t op_ret = 0; + gf_return_t op_ret = 0; uint64_t newfd_num = fd_to_fdnum(newfd); pl_inode_t *pl_inode = pl_inode_get(frame->this, newfd->inode, NULL); @@ -1675,7 +1676,7 @@ int32_t pl_fsetxattr_handle_lockinfo(call_frame_t *frame, fd_t *fd, char *lockinfo_buf, int len, int32_t *op_errno) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; uint64_t oldfd_num = 0; char *key = NULL; @@ -1723,7 +1724,7 @@ pl_fsetxattr_handle_lockinfo(call_frame_t *frame, fd_t *fd, char *lockinfo_buf, int32_t pl_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { pl_local_t *local = NULL; pl_inode_t *pl_inode = NULL; @@ -1761,8 +1762,8 @@ pl_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, char *name = NULL; posix_locks_private_t *priv = this->private; - int32_t op_ret = dict_get_ptr_and_len(dict, GF_XATTR_LOCKINFO_KEY, - &lockinfo_buf, &len); + gf_return_t op_ret = dict_get_ptr_and_len(dict, GF_XATTR_LOCKINFO_KEY, + &lockinfo_buf, &len); if (lockinfo_buf == NULL) { goto usual; } @@ -1791,7 +1792,7 @@ pl_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int32_t pl_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { pl_fdctx_t *fdctx = NULL; @@ -1822,8 +1823,8 @@ pl_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, } int -pl_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +pl_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(flush, xdata, frame, op_ret, op_errno, xdata); @@ -1880,8 +1881,8 @@ pl_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) } int -pl_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +pl_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { pl_fdctx_t *fdctx = NULL; @@ -1905,7 +1906,7 @@ int pl_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, fd_t *fd, dict_t *xdata) { - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; pl_inode_t *pl_inode = NULL; posix_lock_t *l = NULL; @@ -1968,9 +1969,10 @@ pl_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } int -pl_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +pl_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { pl_fdctx_t *fdctx = NULL; @@ -2004,9 +2006,10 @@ pl_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } int -pl_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iovec *vector, int32_t count, - struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) +pl_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, + int32_t count, struct iatt *stbuf, struct iobref *iobref, + dict_t *xdata) { pl_track_io_fop_count(frame->local, this, DECREMENT); @@ -2017,9 +2020,9 @@ pl_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, } int -pl_writev_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) +pl_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { pl_track_io_fop_count(frame->local, this, DECREMENT); @@ -2172,7 +2175,7 @@ pl_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, }; gf_boolean_t enabled = _gf_false; gf_boolean_t can_block = _gf_true; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; int allowed = 1; @@ -2290,7 +2293,7 @@ pl_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, }; gf_boolean_t enabled = _gf_false; gf_boolean_t can_block = _gf_true; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; int allowed = 1; @@ -2565,7 +2568,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, struct gf_flock *flock, dict_t *xdata) { pl_inode_t *pl_inode = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; int can_block = 0; posix_lock_t *reqlock = NULL; @@ -3032,9 +3035,9 @@ pl_check_link_count(dict_t *xdata) } int32_t -pl_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, - struct iatt *postparent) +pl_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { pl_inode_t *pl_inode; @@ -3087,8 +3090,9 @@ pl_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } int32_t -pl_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +pl_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { PL_STACK_UNWIND(fstat, xdata, frame, op_ret, op_errno, buf, xdata); return 0; @@ -3104,8 +3108,9 @@ pl_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) } int -pl_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, gf_dirent_t *entries, dict_t *xdata) +pl_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, + dict_t *xdata) { pl_local_t *local = NULL; gf_dirent_t *entry = NULL; @@ -3205,7 +3210,7 @@ pl_getactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { pl_inode_t *pl_inode = NULL; lock_migration_info_t locks; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; int count = 0; @@ -3528,7 +3533,7 @@ pl_metaunlock(call_frame_t *frame, xlator_t *this, inode_t *inode, dict_t *dict) int32_t pl_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { pl_local_t *local = NULL; pl_inode_t *pl_inode = NULL; @@ -3566,7 +3571,7 @@ int32_t pl_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int flags, dict_t *xdata) { - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = EINVAL; dict_t *xdata_rsp = NULL; char *name = NULL; @@ -4240,10 +4245,11 @@ pl_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, dict_t *xdata); int32_t -pl_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, - struct iatt *postoldparent, struct iatt *prenewparent, - struct iatt *postnewparent, dict_t *xdata) +pl_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + struct iatt *preoldparent, struct iatt *postoldparent, + struct iatt *prenewparent, struct iatt *postnewparent, + dict_t *xdata) { pl_inode_remove_cbk(this, cookie, op_ret < 0 ? op_errno : 0); @@ -4362,7 +4368,7 @@ static int pl_setactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc, lock_migration_info_t *locklist, dict_t *xdata) { - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; int ret = 0; @@ -4385,9 +4391,9 @@ pl_setactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc, } int32_t -pl_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +pl_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { pl_inode_remove_cbk(this, cookie, op_ret < 0 ? op_errno : 0); @@ -4413,9 +4419,10 @@ pl_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, } int32_t -pl_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +pl_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(mkdir, xdata, frame, op_ret, op_errno, inode, buf, preparent, postparent, xdata); @@ -4433,8 +4440,9 @@ pl_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, } int32_t -pl_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +pl_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(stat, xdata, frame, op_ret, op_errno, buf, xdata); @@ -4451,9 +4459,10 @@ pl_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } int32_t -pl_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +pl_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(mknod, xdata, frame, op_ret, op_errno, inode, buf, preparent, postparent, xdata); @@ -4471,9 +4480,9 @@ pl_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, } int32_t -pl_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +pl_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { pl_inode_remove_cbk(this, cookie, op_ret < 0 ? op_errno : 0); @@ -4500,7 +4509,7 @@ pl_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, int32_t pl_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -4520,9 +4529,10 @@ pl_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, } int32_t -pl_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +pl_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { pl_inode_t *pl_inode = (pl_inode_t *)cookie; @@ -4562,9 +4572,9 @@ pl_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } int32_t -pl_fsync_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) +pl_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(fsync, xdata, frame, op_ret, op_errno, prebuf, postbuf, xdata); @@ -4583,7 +4593,7 @@ pl_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, int32_t pl_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(readdir, xdata, frame, op_ret, op_errno, entries, @@ -4603,7 +4613,7 @@ pl_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int32_t pl_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(fsyncdir, xdata, frame, op_ret, op_errno, xdata); return 0; @@ -4620,8 +4630,9 @@ pl_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, } int32_t -pl_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct statvfs *buf, dict_t *xdata) +pl_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, + dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(statfs, xdata, frame, op_ret, op_errno, buf, xdata); @@ -4639,7 +4650,7 @@ pl_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t pl_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { pl_local_t *local = NULL; pl_inode_t *pl_inode = NULL; @@ -4672,7 +4683,7 @@ int pl_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = EINVAL; posix_locks_private_t *priv = this->private; @@ -4694,7 +4705,7 @@ pl_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t pl_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { pl_local_t *local = NULL; pl_inode_t *pl_inode = NULL; @@ -4726,7 +4737,7 @@ int pl_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; posix_locks_private_t *priv = this->private; @@ -4747,7 +4758,7 @@ pl_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, int32_t pl_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, uint32_t weak_cksum, + gf_return_t op_ret, int32_t op_errno, uint32_t weak_cksum, uint8_t *strong_cksum, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(rchecksum, xdata, frame, op_ret, op_errno, @@ -4767,7 +4778,8 @@ pl_rchecksum(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t pl_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(xattrop, xdata, frame, op_ret, op_errno, dict, xdata); @@ -4786,7 +4798,8 @@ pl_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t pl_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(fxattrop, xdata, frame, op_ret, op_errno, dict, xdata); @@ -4805,7 +4818,7 @@ pl_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t pl_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(setattr, xdata, frame, op_ret, op_errno, statpre, @@ -4825,7 +4838,7 @@ pl_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, int32_t pl_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(fsetattr, xdata, frame, op_ret, op_errno, @@ -4845,7 +4858,7 @@ pl_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, int32_t pl_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(fallocate, xdata, frame, op_ret, op_errno, pre, @@ -4866,7 +4879,7 @@ pl_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t keep_size, int32_t pl_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(readlink, xdata, frame, op_ret, op_errno, path, @@ -4885,8 +4898,8 @@ pl_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, } int32_t -pl_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +pl_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(access, xdata, frame, op_ret, op_errno, xdata); return 0; @@ -4903,8 +4916,8 @@ pl_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, } int32_t -pl_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, off_t offset, dict_t *xdata) +pl_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) { PL_STACK_UNWIND_FOR_CLIENT(seek, xdata, frame, op_ret, op_errno, offset, xdata); diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 1375ccc498..6c1e78d6e0 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -430,7 +430,7 @@ marker_filter_gsyncd_xattrs(call_frame_t *frame, xlator_t *this, dict_t *xattrs) int32_t marker_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { int32_t ret = -1; @@ -559,7 +559,8 @@ marker_setxattr_done(call_frame_t *frame) int marker_specific_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + dict_t *xdata) { int32_t ret = 0; int32_t done = 1; @@ -702,7 +703,7 @@ marker_xtime_update_marks(xlator_t *this, marker_local_t *local) int32_t marker_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -789,8 +790,8 @@ marker_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int32_t marker_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { marker_local_t *local = NULL; @@ -877,7 +878,7 @@ marker_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int32_t marker_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { marker_conf_t *priv = NULL; @@ -949,7 +950,7 @@ marker_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t marker_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { marker_conf_t *priv = NULL; @@ -1037,7 +1038,7 @@ marker_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, int32_t marker_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { marker_conf_t *priv = NULL; @@ -1158,7 +1159,7 @@ marker_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, int32_t marker_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1233,7 +1234,7 @@ marker_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, int32_t marker_rename_done(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { marker_local_t *local = NULL, *oplocal = NULL; loc_t newloc = { @@ -1330,7 +1331,7 @@ marker_rename_release_oldp_lock(marker_local_t *local, xlator_t *this) int32_t marker_rename_unwind(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { marker_local_t *local = NULL; marker_local_t *oplocal = NULL; @@ -1387,7 +1388,7 @@ marker_rename_unwind(call_frame_t *frame, void *cookie, xlator_t *this, int32_t marker_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -1503,7 +1504,8 @@ marker_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t marker_do_rename(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { marker_local_t *local = NULL; marker_local_t *oplocal = NULL; @@ -1553,7 +1555,7 @@ marker_do_rename(call_frame_t *frame, void *cookie, xlator_t *this, int32_t marker_get_oldpath_contribution(call_frame_t *lk_frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_frame_t *frame = NULL; @@ -1781,7 +1783,7 @@ marker_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, int32_t marker_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { marker_local_t *local = NULL; @@ -1866,7 +1868,7 @@ marker_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, int32_t marker_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { marker_local_t *local = NULL; @@ -1939,7 +1941,7 @@ marker_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t marker_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2026,7 +2028,7 @@ marker_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, int32_t marker_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2114,7 +2116,7 @@ marker_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int32_t marker_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { marker_local_t *local = NULL; @@ -2184,7 +2186,7 @@ marker_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, int32_t marker_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { marker_local_t *local = NULL; @@ -2251,7 +2253,7 @@ marker_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t marker_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { marker_local_t *local = NULL; @@ -2327,7 +2329,7 @@ call_from_sp_client_to_reset_tmfile(call_frame_t *frame, xlator_t *this, dict_t *dict) { int32_t fd = 0; - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; data_t *data = NULL; marker_conf_t *priv = NULL; @@ -2377,7 +2379,7 @@ call_from_sp_client_to_reset_tmfile(call_frame_t *frame, xlator_t *this, int32_t marker_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { marker_local_t *local = NULL; marker_conf_t *priv = NULL; @@ -2452,7 +2454,7 @@ int quota_xattr_cleaner_cbk(int ret, call_frame_t *frame, void *args) { dict_t *xdata = args; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = 0; op_ret = (ret < 0) ? -1 : 0; @@ -2600,7 +2602,7 @@ marker_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int32_t marker_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { marker_local_t *local = NULL; marker_conf_t *priv = NULL; @@ -2668,7 +2670,7 @@ marker_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int32_t marker_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { marker_local_t *local = NULL; @@ -2734,7 +2736,7 @@ marker_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t marker_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { marker_local_t *local = NULL; @@ -2798,7 +2800,7 @@ marker_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t marker_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { marker_local_t *local = NULL; marker_conf_t *priv = NULL; @@ -2889,7 +2891,7 @@ __has_quota_xattrs(dict_t *xattrs) int32_t marker_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *dict, struct iatt *postparent) { marker_conf_t *priv = NULL; @@ -3018,8 +3020,8 @@ marker_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, int marker_build_ancestry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, gf_dirent_t *entries, - dict_t *xdata) + gf_return_t op_ret, int op_errno, + gf_dirent_t *entries, dict_t *xdata) { gf_dirent_t *entry = NULL; quota_inode_ctx_t *ctx = NULL; @@ -3056,7 +3058,7 @@ marker_build_ancestry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int marker_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, dict_t *xdata) { gf_dirent_t *entry = NULL; diff --git a/xlators/features/metadisp/src/metadisp-create.c b/xlators/features/metadisp/src/metadisp-create.c index f8c9798dd5..dd1460ed24 100644 --- a/xlators/features/metadisp/src/metadisp-create.c +++ b/xlators/features/metadisp/src/metadisp-create.c @@ -10,7 +10,7 @@ int32_t metadisp_create_dentry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) @@ -34,8 +34,8 @@ metadisp_create_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t metadisp_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { METADISP_TRACE("%d %d", op_ret, op_errno); diff --git a/xlators/features/metadisp/src/metadisp-fsync.c b/xlators/features/metadisp/src/metadisp-fsync.c index 2e46fa84ea..1c28a9b49c 100644 --- a/xlators/features/metadisp/src/metadisp-fsync.c +++ b/xlators/features/metadisp/src/metadisp-fsync.c @@ -13,7 +13,7 @@ metadisp_fsync_resume(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t metadisp_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { call_stub_t *stub = NULL; diff --git a/xlators/features/metadisp/src/metadisp-lookup.c b/xlators/features/metadisp/src/metadisp-lookup.c index 27d90c9f74..1854e11d89 100644 --- a/xlators/features/metadisp/src/metadisp-lookup.c +++ b/xlators/features/metadisp/src/metadisp-lookup.c @@ -8,8 +8,8 @@ int32_t metadisp_backend_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *buf, dict_t *xdata, + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { METADISP_TRACE("backend_lookup_cbk"); @@ -45,7 +45,7 @@ metadisp_backend_lookup_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t metadisp_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { METADISP_TRACE("%d %d", op_ret, op_errno); diff --git a/xlators/features/metadisp/src/metadisp-open.c b/xlators/features/metadisp/src/metadisp-open.c index 64814afe63..73a3fe52a5 100644 --- a/xlators/features/metadisp/src/metadisp-open.c +++ b/xlators/features/metadisp/src/metadisp-open.c @@ -3,7 +3,7 @@ int32_t metadisp_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { METADISP_TRACE("got open results %d %d", op_ret, op_errno); diff --git a/xlators/features/metadisp/src/metadisp-setattr.c b/xlators/features/metadisp/src/metadisp-setattr.c index 6991cf644f..42a6499e4a 100644 --- a/xlators/features/metadisp/src/metadisp-setattr.c +++ b/xlators/features/metadisp/src/metadisp-setattr.c @@ -3,7 +3,7 @@ int32_t metadisp_backend_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) @@ -44,7 +44,7 @@ metadisp_backend_setattr_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t metadisp_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { METADISP_TRACE("%d %d", op_ret, op_errno); diff --git a/xlators/features/metadisp/src/metadisp-stat.c b/xlators/features/metadisp/src/metadisp-stat.c index b06d0dbcdd..d70602b920 100644 --- a/xlators/features/metadisp/src/metadisp-stat.c +++ b/xlators/features/metadisp/src/metadisp-stat.c @@ -18,8 +18,8 @@ int32_t metadisp_stat_backend_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *buf, dict_t *xdata) { METADISP_TRACE("got backend stat results %d %d", op_ret, op_errno); if (op_errno == ENOENT) { @@ -48,7 +48,7 @@ metadisp_stat_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t metadisp_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { call_stub_t *stub = NULL; diff --git a/xlators/features/metadisp/src/metadisp-unlink.c b/xlators/features/metadisp/src/metadisp-unlink.c index 1f6a8eb35c..9fdad765e6 100644 --- a/xlators/features/metadisp/src/metadisp-unlink.c +++ b/xlators/features/metadisp/src/metadisp-unlink.c @@ -20,8 +20,9 @@ metadisp_unlink_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t metadisp_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { METADISP_TRACE(". %d %d", op_ret, op_errno); @@ -68,7 +69,7 @@ metadisp_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t metadisp_unlink_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { diff --git a/xlators/features/namespace/src/namespace.c b/xlators/features/namespace/src/namespace.c index 86c5ebee90..eb646eaf7c 100644 --- a/xlators/features/namespace/src/namespace.c +++ b/xlators/features/namespace/src/namespace.c @@ -195,7 +195,7 @@ ns_inode_ctx_get(inode_t *inode, xlator_t *this, ns_info_t *info) * once we've gotten the namespace hash. */ int32_t get_path_resume_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { path_parse_result_t ret = PATH_PARSE_RESULT_NO_PATH; diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c index 0e5eb60a16..be7eda7148 100644 --- a/xlators/features/quiesce/src/quiesce.c +++ b/xlators/features/quiesce/src/quiesce.c @@ -119,7 +119,7 @@ gf_quiesce_populate_failover_hosts(xlator_t *this, quiesce_priv_t *priv, int32_t gf_quiesce_failover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { quiesce_priv_t *priv = NULL; @@ -309,7 +309,7 @@ gf_quiesce_enqueue(xlator_t *this, call_stub_t *stub) int32_t quiesce_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *dict, struct iatt *postparent) { call_stub_t *stub = NULL; @@ -341,7 +341,7 @@ quiesce_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -370,7 +370,7 @@ quiesce_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; quiesce_local_t *local = NULL; @@ -399,7 +399,7 @@ quiesce_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -429,7 +429,7 @@ quiesce_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { call_stub_t *stub = NULL; quiesce_local_t *local = NULL; @@ -458,7 +458,7 @@ quiesce_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -492,7 +492,7 @@ quiesce_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; quiesce_local_t *local = NULL; @@ -520,7 +520,7 @@ quiesce_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -550,7 +550,7 @@ quiesce_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -579,7 +579,8 @@ quiesce_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { call_stub_t *stub = NULL; quiesce_local_t *local = NULL; @@ -608,7 +609,7 @@ quiesce_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_stub_t *stub = NULL; quiesce_local_t *local = NULL; @@ -637,7 +638,7 @@ quiesce_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { call_stub_t *stub = NULL; @@ -667,7 +668,7 @@ quiesce_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { call_stub_t *stub = NULL; @@ -697,7 +698,7 @@ quiesce_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { call_stub_t *stub = NULL; @@ -727,8 +728,9 @@ quiesce_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, - uint8_t *strong_checksum, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + uint32_t weak_checksum, uint8_t *strong_checksum, + dict_t *xdata) { call_stub_t *stub = NULL; quiesce_local_t *local = NULL; @@ -758,7 +760,7 @@ quiesce_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { call_stub_t *stub = NULL; @@ -788,7 +790,7 @@ quiesce_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { call_stub_t *stub = NULL; @@ -820,7 +822,7 @@ quiesce_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { quiesce_priv_t *priv = NULL; @@ -856,7 +858,7 @@ quiesce_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; @@ -890,7 +892,7 @@ quiesce_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_fxattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; @@ -924,7 +926,7 @@ quiesce_fxattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; @@ -957,7 +959,7 @@ quiesce_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; @@ -991,7 +993,7 @@ quiesce_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; @@ -1024,7 +1026,7 @@ quiesce_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; @@ -1057,7 +1059,7 @@ quiesce_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; @@ -1090,7 +1092,7 @@ quiesce_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { quiesce_priv_t *priv = NULL; @@ -1125,7 +1127,7 @@ quiesce_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t quiesce_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { quiesce_priv_t *priv = NULL; @@ -2416,7 +2418,8 @@ quiesce_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, int quiesce_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, off_t offset, + dict_t *xdata) { call_stub_t *stub = NULL; quiesce_local_t *local = NULL; diff --git a/xlators/features/quota/src/quota-enforcer-client.c b/xlators/features/quota/src/quota-enforcer-client.c index 480d64ade2..ff9bcafb69 100644 --- a/xlators/features/quota/src/quota-enforcer-client.c +++ b/xlators/features/quota/src/quota-enforcer-client.c @@ -39,7 +39,7 @@ extern struct rpc_clnt_program quota_enforcer_clnt; int32_t quota_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent); int diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 18df9ae6d1..49a79a371b 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -364,7 +364,7 @@ quota_find_common_ancestor(inode_t *inode1, inode_t *inode2, void check_ancestory_continue(struct list_head *parents, inode_t *inode, - int32_t op_ret, int32_t op_errno, void *data) + gf_return_t op_ret, int32_t op_errno, void *data) { call_frame_t *frame = NULL; quota_local_t *local = NULL; @@ -425,8 +425,8 @@ check_ancestory(call_frame_t *frame, inode_t *inode) } void -check_ancestory_2_cbk(struct list_head *parents, inode_t *inode, int32_t op_ret, - int32_t op_errno, void *data) +check_ancestory_2_cbk(struct list_head *parents, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, void *data) { inode_t *this_inode = NULL; quota_inode_ctx_t *ctx = NULL; @@ -548,7 +548,7 @@ quota_link_count_decrement(call_frame_t *frame) } static void -quota_handle_validate_error(call_frame_t *frame, int32_t op_ret, +quota_handle_validate_error(call_frame_t *frame, gf_return_t op_ret, int32_t op_errno) { quota_local_t *local; @@ -576,7 +576,7 @@ quota_handle_validate_error(call_frame_t *frame, int32_t op_ret, int32_t quota_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { quota_local_t *local = NULL; @@ -715,8 +715,8 @@ quota_add_parents_from_ctx(quota_inode_ctx_t *ctx, struct list_head *list) int32_t quota_build_ancestry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + gf_dirent_t *entries, dict_t *xdata) { inode_t *parent = NULL; inode_t *tmp_parent = NULL; @@ -865,7 +865,7 @@ quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk, quota_local_t *local = NULL; call_frame_t *new_frame = NULL; int op_errno = ENOMEM; - int op_ret = -1; + gf_return_t op_ret = -1; xlator_t *this = NULL; dict_t *xdata_req = NULL; @@ -1014,7 +1014,7 @@ quota_validate(call_frame_t *frame, inode_t *inode, xlator_t *this, void quota_check_limit_continuation(struct list_head *parents, inode_t *inode, - int32_t op_ret, int32_t op_errno, void *data) + gf_return_t op_ret, int32_t op_errno, void *data) { call_frame_t *frame = NULL; xlator_t *this = NULL; @@ -1582,7 +1582,7 @@ should_quota_enforce(xlator_t *this, dict_t *dict, glusterfs_fop_t fop) int32_t quota_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *dict, struct iatt *postparent) { quota_local_t *local = NULL; @@ -1678,7 +1678,7 @@ quota_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) int32_t quota_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { int32_t ret = 0; @@ -1930,7 +1930,7 @@ quota_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t quota_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2034,7 +2034,7 @@ quota_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int32_t quota_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2174,7 +2174,7 @@ quota_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int32_t quota_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { quota_local_t *local = NULL; @@ -2251,7 +2251,7 @@ quota_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, int32_t quota_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2532,7 +2532,7 @@ quota_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, int32_t quota_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -2656,7 +2656,7 @@ quota_rename_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, static int32_t quota_rename_get_size_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { @@ -2857,7 +2857,7 @@ quota_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, int32_t quota_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2993,7 +2993,7 @@ quota_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, int32_t quota_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { quota_local_t *local = NULL; @@ -3072,7 +3072,7 @@ quota_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, int32_t quota_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { quota_local_t *local = NULL; @@ -3235,7 +3235,7 @@ quota_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t quota_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { quota_local_t *local = NULL; @@ -3313,7 +3313,7 @@ quota_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t quota_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { quota_local_t *local = NULL; @@ -3386,7 +3386,7 @@ quota_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) int32_t quota_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata) { quota_local_t *local = NULL; @@ -3463,7 +3463,7 @@ quota_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, int32_t quota_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *buf, struct iobref *iobref, dict_t *xdata) { @@ -3536,7 +3536,7 @@ quota_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int32_t quota_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { quota_local_t *local = NULL; @@ -3607,7 +3607,7 @@ quota_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, int32_t quota_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { quota_local_t *local = NULL; @@ -3688,7 +3688,7 @@ quota_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t quota_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { quota_local_t *local = NULL; @@ -3763,7 +3763,7 @@ quota_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t quota_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -3898,7 +3898,7 @@ quota_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int quota_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; @@ -3938,7 +3938,7 @@ quota_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, { quota_priv_t *priv = NULL; int op_errno = EINVAL; - int op_ret = -1; + gf_return_t op_ret = -1; int64_t hard_lim = -1; int64_t soft_lim = -1; int64_t object_hard_limit = -1; @@ -4001,7 +4001,7 @@ quota_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int quota_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { quota_inode_ctx_t *ctx = NULL; quota_local_t *local = NULL; @@ -4038,7 +4038,7 @@ quota_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int flags, dict_t *xdata) { quota_priv_t *priv = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; quota_local_t *local = NULL; int64_t hard_lim = -1; @@ -4098,7 +4098,7 @@ quota_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int quota_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { QUOTA_STACK_UNWIND(removexattr, frame, op_ret, op_errno, xdata); return 0; @@ -4145,7 +4145,7 @@ quota_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int quota_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { QUOTA_STACK_UNWIND(fremovexattr, frame, op_ret, op_errno, xdata); return 0; @@ -4156,7 +4156,7 @@ quota_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { quota_priv_t *priv = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; priv = this->private; @@ -4187,7 +4187,7 @@ quota_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t quota_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { inode_t *inode = NULL; @@ -4282,7 +4282,7 @@ quota_statfs_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t quota_statfs_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { @@ -4341,7 +4341,8 @@ quota_statfs_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, void quota_get_limit_dir_continuation(struct list_head *parents, inode_t *inode, - int32_t op_ret, int32_t op_errno, void *data) + gf_return_t op_ret, int32_t op_errno, + void *data) { call_frame_t *frame = NULL; xlator_t *this = NULL; @@ -4531,7 +4532,7 @@ quota_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int quota_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, dict_t *xdata) { gf_dirent_t *entry = NULL; @@ -4641,7 +4642,7 @@ quota_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int32_t quota_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { int32_t ret = 0; diff --git a/xlators/features/quota/src/quota.h b/xlators/features/quota/src/quota.h index 0395d78c9e..2d2b98ea7c 100644 --- a/xlators/features/quota/src/quota.h +++ b/xlators/features/quota/src/quota.h @@ -161,7 +161,7 @@ struct quota_inode_ctx { typedef struct quota_inode_ctx quota_inode_ctx_t; typedef void (*quota_ancestry_built_t)(struct list_head *parents, - inode_t *inode, int32_t op_ret, + inode_t *inode, gf_return_t op_ret, int32_t op_errno, void *data); typedef void (*quota_fop_continue_t)(call_frame_t *frame); @@ -175,7 +175,7 @@ struct quota_local { loc_t validate_loc; int64_t delta; int8_t object_delta; - int32_t op_ret; + gf_return_t op_ret; int32_t op_errno; int64_t size; char just_validated; diff --git a/xlators/features/quota/src/quotad.c b/xlators/features/quota/src/quotad.c index 643f25c9c2..9fcc384cb0 100644 --- a/xlators/features/quota/src/quotad.c +++ b/xlators/features/quota/src/quotad.c @@ -43,9 +43,9 @@ mem_acct_init(xlator_t *this) } int32_t -qd_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, - struct iatt *postparent) +qd_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { quotad_aggregator_lookup_cbk_t lookup_cbk = NULL; gfs3_lookup_rsp rsp = { diff --git a/xlators/features/read-only/src/read-only-common.c b/xlators/features/read-only/src/read-only-common.c index 9640e7e3ee..6fb577313c 100644 --- a/xlators/features/read-only/src/read-only-common.c +++ b/xlators/features/read-only/src/read-only-common.c @@ -313,8 +313,8 @@ ro_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } static int32_t -ro_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +ro_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { STACK_UNWIND_STRICT(open, frame, op_ret, op_errno, fd, xdata); return 0; diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c index 1cc5526d5c..41fe0b7507 100644 --- a/xlators/features/read-only/src/worm.c +++ b/xlators/features/read-only/src/worm.c @@ -434,7 +434,7 @@ worm_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, static int32_t worm_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { diff --git a/xlators/features/sdfs/src/sdfs.c b/xlators/features/sdfs/src/sdfs.c index aaf13f0852..10c826416f 100644 --- a/xlators/features/sdfs/src/sdfs.c +++ b/xlators/features/sdfs/src/sdfs.c @@ -209,7 +209,7 @@ sdfs_get_new_frame_readdirp(call_frame_t *frame, fd_t *fd, int sdfs_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { sdfs_local_t *local = NULL; call_stub_t *stub = NULL; @@ -236,7 +236,7 @@ sdfs_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int sdfs_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -329,7 +329,7 @@ sdfs_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int sdfs_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { sdfs_local_t *local = NULL; @@ -417,7 +417,7 @@ sdfs_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, int sdfs_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -510,7 +510,7 @@ sdfs_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int sdfs_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { sdfs_local_t *local = NULL; @@ -598,7 +598,7 @@ sdfs_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, int sdfs_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -689,7 +689,7 @@ sdfs_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, int sdfs_common_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { sdfs_local_t *local = NULL; int this_call_cnt = 0; @@ -731,9 +731,10 @@ sdfs_common_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int -sdfs_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +sdfs_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { sdfs_local_t *local = NULL; sdfs_lock_t *lock = NULL; @@ -932,7 +933,7 @@ sdfs_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, int sdfs_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1023,7 +1024,7 @@ sdfs_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int sdfs_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -1196,7 +1197,7 @@ sdfs_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, int sdfs_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xdata, struct iatt *postparent) { sdfs_local_t *local = NULL; @@ -1304,7 +1305,7 @@ sdfs_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t sdfs_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { sdfs_local_t *local = NULL; diff --git a/xlators/features/sdfs/src/sdfs.h b/xlators/features/sdfs/src/sdfs.h index dded5a2d7f..e84dca6348 100644 --- a/xlators/features/sdfs/src/sdfs.h +++ b/xlators/features/sdfs/src/sdfs.h @@ -32,7 +32,7 @@ struct sdfs_local { loc_t parent_loc; call_stub_t *stub; sdfs_lock_t *lock; - int op_ret; + gf_return_t op_ret; int op_errno; gf_atomic_t call_cnt; }; diff --git a/xlators/features/selinux/src/selinux.c b/xlators/features/selinux/src/selinux.c index 9b1b4b55e1..a378f7ff54 100644 --- a/xlators/features/selinux/src/selinux.c +++ b/xlators/features/selinux/src/selinux.c @@ -17,7 +17,8 @@ static int selinux_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *dict, + dict_t *xdata) { int ret = 0; char *name = cookie; @@ -40,7 +41,7 @@ selinux_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { selinux_priv_t *priv = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; char *xattr_name = (char *)name; @@ -68,7 +69,8 @@ selinux_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, static int selinux_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *dict, + dict_t *xdata) { int ret = 0; char *name = cookie; @@ -92,7 +94,7 @@ selinux_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { selinux_priv_t *priv = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; char *xattr_name = (char *)name; @@ -119,7 +121,7 @@ selinux_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, static int selinux_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { STACK_UNWIND_STRICT(fsetxattr, frame, op_ret, op_errno, xdata); return 0; @@ -130,7 +132,7 @@ selinux_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int flags, dict_t *xdata) { selinux_priv_t *priv = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; int32_t ret = -1; @@ -157,7 +159,7 @@ selinux_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, static int selinux_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { STACK_UNWIND_STRICT(setxattr, frame, op_ret, op_errno, xdata); return 0; @@ -168,7 +170,7 @@ selinux_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int flags, dict_t *xdata) { selinux_priv_t *priv = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; int32_t ret = -1; diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index e5f9306394..1bf2174843 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -782,7 +782,7 @@ __shard_update_shards_inode_list(inode_t *linked_inode, xlator_t *this, int shard_common_failure_unwind(glusterfs_fop_t fop, call_frame_t *frame, - int32_t op_ret, int32_t op_errno) + gf_return_t op_ret, int32_t op_errno) { switch (fop) { case GF_FOP_LOOKUP: @@ -886,7 +886,7 @@ shard_common_failure_unwind(glusterfs_fop_t fop, call_frame_t *frame, int shard_common_inode_write_success_unwind(glusterfs_fop_t fop, - call_frame_t *frame, int32_t op_ret) + call_frame_t *frame, gf_return_t op_ret) { shard_local_t *local = frame->local; @@ -927,7 +927,7 @@ shard_common_inode_write_success_unwind(glusterfs_fop_t fop, int shard_evicted_inode_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { @@ -1109,7 +1109,7 @@ shard_common_resolve_shards(call_frame_t *frame, xlator_t *this, int shard_update_file_size_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { inode_t *inode = NULL; @@ -1279,8 +1279,9 @@ shard_link_internal_dir_inode(shard_local_t *local, inode_t *inode, int shard_refresh_internal_dir_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, dict_t *xdata, + xlator_t *this, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { shard_local_t *local = NULL; @@ -1360,8 +1361,8 @@ shard_refresh_internal_dir(call_frame_t *frame, xlator_t *this, int shard_lookup_internal_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *buf, dict_t *xdata, + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { inode_t *link_inode = NULL; @@ -1571,7 +1572,7 @@ shard_start_background_deletion(xlator_t *this) int shard_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { int ret = -1; @@ -1693,7 +1694,7 @@ shard_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) int shard_set_iattr_invoke_post_handler(call_frame_t *frame, xlator_t *this, - inode_t *inode, int32_t op_ret, + inode_t *inode, gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { @@ -1744,8 +1745,8 @@ shard_set_iattr_invoke_post_handler(call_frame_t *frame, xlator_t *this, int shard_fstat_base_file_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *buf, dict_t *xdata) { shard_local_t *local = frame->local; @@ -1756,7 +1757,7 @@ shard_fstat_base_file_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int shard_lookup_base_file_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { @@ -1866,7 +1867,7 @@ shard_post_stat_handler(call_frame_t *frame, xlator_t *this) int shard_common_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { inode_t *inode = NULL; @@ -2027,7 +2028,7 @@ shard_post_update_size_truncate_handler(call_frame_t *frame, xlator_t *this) int shard_truncate_last_shard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { @@ -2116,7 +2117,7 @@ shard_unlink_block_inode(shard_local_t *local, int shard_block_num); int shard_truncate_htol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2360,8 +2361,9 @@ shard_link_block_inode(shard_local_t *local, int block_num, inode_t *inode, int shard_common_lookup_shards_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct iatt *buf, dict_t *xdata, + xlator_t *this, gf_return_t op_ret, + int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { int call_count = 0; @@ -2864,7 +2866,7 @@ shard_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int shard_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2919,7 +2921,7 @@ shard_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int32_t shard_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -3147,7 +3149,7 @@ shard_unlink_cbk(call_frame_t *frame, xlator_t *this) int shard_unlink_shards_do_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -3788,7 +3790,7 @@ shard_delete_shards(void *opaque) int shard_unlock_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { if (op_ret) gf_msg(this->name, GF_LOG_ERROR, op_errno, SHARD_MSG_FOP_FAILED, @@ -3824,7 +3826,7 @@ shard_unlock_inodelk(call_frame_t *frame, xlator_t *this) int shard_rename_src_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata); @@ -3878,7 +3880,7 @@ shard_unlink_base_file(call_frame_t *frame, xlator_t *this); int shard_set_size_attrs_on_marker_file_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { @@ -3941,8 +3943,8 @@ shard_set_size_attrs_on_marker_file(call_frame_t *frame, xlator_t *this) int shard_lookup_marker_file_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *buf, dict_t *xdata, + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { inode_t *linked_inode = NULL; @@ -3995,7 +3997,7 @@ shard_lookup_marker_file(call_frame_t *frame, xlator_t *this) int shard_create_marker_file_under_remove_me_cbk( - call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, + call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -4106,7 +4108,7 @@ shard_unlock_entrylk(call_frame_t *frame, xlator_t *this); int shard_unlink_base_file_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -4160,7 +4162,7 @@ shard_unlink_base_file(call_frame_t *frame, xlator_t *this) int shard_unlock_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { if (op_ret) gf_msg(this->name, GF_LOG_ERROR, op_errno, SHARD_MSG_FOP_FAILED, @@ -4218,7 +4220,7 @@ shard_post_entrylk_fop_handler(call_frame_t *frame, xlator_t *this) int shard_acquire_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_frame_t *main_frame = NULL; shard_local_t *local = NULL; @@ -4343,7 +4345,7 @@ shard_post_inodelk_fop_handler(call_frame_t *frame, xlator_t *this) int shard_acquire_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { call_frame_t *main_frame = NULL; shard_local_t *local = NULL; @@ -4530,7 +4532,7 @@ shard_post_rename_lookup_handler(call_frame_t *frame, xlator_t *this) int shard_rename_src_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -4700,7 +4702,7 @@ shard_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, int shard_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -4756,7 +4758,7 @@ shard_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int shard_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { /* To-Do: Handle open with O_TRUNC under locks */ SHARD_STACK_UNWIND(open, frame, op_ret, op_errno, fd, xdata); @@ -4774,7 +4776,7 @@ shard_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int shard_readv_do_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -4930,7 +4932,7 @@ shard_readv_do(call_frame_t *frame, xlator_t *this) int shard_common_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -5405,7 +5407,7 @@ shard_get_delta_size_from_inode_ctx(shard_local_t *local, inode_t *inode, int shard_common_inode_write_do_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { @@ -5753,9 +5755,10 @@ shard_common_inode_write_post_lookup_handler(call_frame_t *frame, int shard_mkdir_internal_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *buf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *buf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { inode_t *link_inode = NULL; shard_local_t *local = NULL; @@ -5868,7 +5871,7 @@ shard_mkdir_internal_dir(call_frame_t *frame, xlator_t *this, int shard_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { /* To-Do: Wind flush on all shards of the file */ SHARD_STACK_UNWIND(flush, frame, op_ret, op_errno, xdata); @@ -5924,8 +5927,8 @@ shard_get_timestamps_from_inode_ctx(shard_local_t *local, inode_t *inode, int shard_fsync_shards_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { int call_count = 0; uint64_t fsync_count = 0; @@ -6134,7 +6137,7 @@ shard_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, int shard_readdir_past_dot_shard_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, gf_dirent_t *orig_entries, dict_t *xdata) { @@ -6179,8 +6182,8 @@ shard_readdir_past_dot_shard_cbk(call_frame_t *frame, void *cookie, int32_t shard_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *orig_entries, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + gf_dirent_t *orig_entries, dict_t *xdata) { fd_t *fd = NULL; gf_dirent_t *entry = NULL; @@ -6357,7 +6360,8 @@ shard_modify_and_set_iatt_in_dict(dict_t *xdata, shard_local_t *local, int32_t shard_common_remove_xattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + dict_t *xdata) { int ret = -1; shard_local_t *local = NULL; @@ -6526,7 +6530,7 @@ shard_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t shard_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { if (op_ret < 0) @@ -6564,7 +6568,7 @@ shard_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, int32_t shard_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { if (op_ret < 0) @@ -6602,7 +6606,7 @@ shard_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t shard_common_set_xattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { int ret = -1; shard_local_t *local = NULL; @@ -6788,8 +6792,9 @@ shard_post_setattr_handler(call_frame_t *frame, xlator_t *this) int shard_common_setattr_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata) { shard_local_t *local = NULL; diff --git a/xlators/features/shard/src/shard.h b/xlators/features/shard/src/shard.h index 4fe181b64d..e52a14216f 100644 --- a/xlators/features/shard/src/shard.h +++ b/xlators/features/shard/src/shard.h @@ -252,7 +252,7 @@ typedef int32_t (*shard_post_update_size_fop_handler_t)(call_frame_t *frame, xlator_t *this); typedef struct shard_local { - int op_ret; + gf_return_t op_ret; int op_errno; uint64_t first_block; uint64_t last_block; diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c index 486c5179d5..6c9ebb442f 100644 --- a/xlators/features/snapview-client/src/snapview-client.c +++ b/xlators/features/snapview-client/src/snapview-client.c @@ -283,7 +283,7 @@ gf_svc_get_entry_point(xlator_t *this, char *entry_point, size_t dest_size) static int32_t gf_svc_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { svc_local_t *local = NULL; @@ -377,7 +377,7 @@ gf_svc_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t ret = -1; svc_local_t *local = NULL; xlator_t *subvolume = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; inode_t *parent = NULL; dict_t *new_xdata = NULL; @@ -501,7 +501,7 @@ gf_svc_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) xlator_t *subvolume = NULL; int32_t ret = -1; int inode_type = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; gf_boolean_t wind = _gf_false; svc_private_t *priv = NULL; @@ -564,7 +564,7 @@ gf_svc_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) static int32_t gf_svc_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { /* TODO: FIX ME @@ -600,7 +600,7 @@ gf_svc_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t ret = -1; int inode_type = -1; xlator_t *subvolume = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -629,7 +629,7 @@ gf_svc_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) int32_t ret = -1; int inode_type = -1; xlator_t *subvolume = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -654,7 +654,8 @@ gf_svc_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) static int32_t gf_svc_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { svc_fd_t *svc_fd = NULL; svc_local_t *local = NULL; @@ -725,7 +726,7 @@ gf_svc_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, int32_t ret = -1; int inode_type = -1; xlator_t *subvolume = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; svc_local_t *local = NULL; @@ -769,7 +770,7 @@ gf_svc_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, { int32_t ret = -1; int inode_type = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -814,7 +815,7 @@ gf_svc_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, { int32_t ret = -1; int inode_type = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -861,7 +862,7 @@ gf_svc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t ret = -1; int inode_type = -1; xlator_t *subvolume = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; svc_private_t *priv = NULL; @@ -949,7 +950,7 @@ gf_svc_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, int inode_type = -1; xlator_t *subvolume = NULL; gf_boolean_t wind = _gf_false; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; GF_VALIDATE_OR_GOTO ("svc", this, out); @@ -979,7 +980,7 @@ gf_svc_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, { int32_t ret = -1; int inode_type = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1023,7 +1024,7 @@ gf_svc_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, { int32_t ret = -1; int inode_type = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1067,7 +1068,7 @@ gf_svc_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, { int inode_type = -1; int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1105,7 +1106,7 @@ gf_svc_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, static int32_t gf_svc_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1133,7 +1134,7 @@ gf_svc_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, { int parent_type = -1; int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; char entry_point[NAME_MAX + 1] = { @@ -1181,7 +1182,7 @@ gf_svc_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, static int32_t gf_svc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1209,7 +1210,7 @@ gf_svc_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, { int parent_type = -1; int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; char entry_point[NAME_MAX + 1] = { @@ -1266,7 +1267,7 @@ gf_svc_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, { xlator_t *subvolume = NULL; int inode_type = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; int ret = -1; gf_boolean_t wind = _gf_false; @@ -1305,8 +1306,8 @@ gf_svc_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, static int32_t gf_svc_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *stbuf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { int inode_type = -1; @@ -1334,7 +1335,7 @@ gf_svc_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, { int parent_type = -1; int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; char entry_point[NAME_MAX + 1] = { @@ -1384,7 +1385,7 @@ gf_svc_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, static int32_t gf_svc_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1412,7 +1413,7 @@ gf_svc_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, loc_t *loc, mode_t umask, dict_t *xdata) { int parent_type = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; int ret = -1; gf_boolean_t wind = _gf_false; @@ -1465,7 +1466,7 @@ gf_svc_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, dict_t *xdata) { int inode_type = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; int ret = -1; gf_boolean_t wind = _gf_false; @@ -1509,7 +1510,7 @@ gf_svc_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int inode_type = -1; xlator_t *subvolume = NULL; int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1540,7 +1541,7 @@ gf_svc_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, int inode_type = -1; xlator_t *subvolume = NULL; int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1571,7 +1572,7 @@ gf_svc_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, int ret = -1; int inode_type = -1; xlator_t *subvolume = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1597,7 +1598,7 @@ gf_svc_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, int32_t gf_svc_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { gf_dirent_t *entry = NULL; @@ -1653,7 +1654,7 @@ gf_svc_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, xlator_t *subvolume = NULL; svc_local_t *local = NULL; int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; svc_fd_t *svc_fd = NULL; @@ -1730,7 +1731,7 @@ gf_svc_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, static int32_t gf_svc_readdirp_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { @@ -1896,7 +1897,7 @@ gf_svc_special_dir_revalidate_lookup(call_frame_t *frame, xlator_t *this, static gf_boolean_t gf_svc_readdir_on_special_dir(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { svc_local_t *local = NULL; @@ -2009,7 +2010,7 @@ gf_svc_readdir_on_special_dir(call_frame_t *frame, void *cookie, xlator_t *this, static int32_t gf_svc_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { gf_dirent_t *entry = NULL; @@ -2095,7 +2096,7 @@ gf_svc_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, xlator_t *subvolume = NULL; svc_local_t *local = NULL; int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; svc_fd_t *svc_fd = NULL; @@ -2167,7 +2168,7 @@ gf_svc_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, int src_inode_type = -1; int dst_inode_type = -1; int dst_parent_type = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int32_t ret = -1; gf_boolean_t wind = _gf_false; @@ -2242,7 +2243,7 @@ gf_svc_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, { int src_inode_type = -1; int dst_parent_type = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int32_t ret = -1; gf_boolean_t wind = _gf_false; @@ -2290,7 +2291,7 @@ gf_svc_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, { int ret = -1; int inode_type = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -2333,7 +2334,7 @@ gf_svc_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, { int inode_type = -1; int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -2373,7 +2374,7 @@ gf_svc_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, static int32_t gf_svc_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int ret = -1; int inode_type = -1; diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c index 76cccae591..0436b69a30 100644 --- a/xlators/features/snapview-server/src/snapview-server.c +++ b/xlators/features/snapview-server/src/snapview-server.c @@ -65,7 +65,7 @@ svs_lookup_entry_point(xlator_t *this, loc_t *loc, inode_t *parent, { uuid_t gfid; svs_inode_t *inode_ctx = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; GF_VALIDATE_OR_GOTO("snapview-server", this, out); GF_VALIDATE_OR_GOTO(this->name, loc, out); @@ -147,7 +147,7 @@ int32_t svs_lookup_gfid(xlator_t *this, loc_t *loc, struct iatt *buf, struct iatt *postparent, int32_t *op_errno) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; unsigned char handle_obj[GFAPI_HANDLE_LENGTH] = { 0, }; @@ -239,7 +239,7 @@ svs_lookup_snapshot(xlator_t *this, loc_t *loc, struct iatt *buf, struct iatt *postparent, inode_t *parent, svs_inode_t *parent_ctx, int32_t *op_errno) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; unsigned char handle_obj[GFAPI_HANDLE_LENGTH] = { 0, }; @@ -338,7 +338,7 @@ svs_lookup_entry(xlator_t *this, loc_t *loc, struct iatt *buf, struct iatt *postparent, inode_t *parent, svs_inode_t *parent_ctx, int32_t *op_errno) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; glfs_t *fs = NULL; glfs_object_t *object = NULL; struct stat statbuf = { @@ -474,7 +474,7 @@ svs_revalidate(xlator_t *this, loc_t *loc, inode_t *parent, svs_inode_t *inode_ctx, svs_inode_t *parent_ctx, struct iatt *buf, struct iatt *postparent, int32_t *op_errno) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int ret = -1; char tmp_uuid[64] = { 0, @@ -574,7 +574,7 @@ svs_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) struct iatt buf = { 0, }; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; struct iatt postparent = { 0, @@ -740,7 +740,7 @@ svs_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, dict_t *xdata) { svs_inode_t *inode_ctx = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; svs_fd_t *svs_fd = NULL; glfs_fd_t *glfd = NULL; @@ -892,7 +892,7 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { svs_inode_t *inode_ctx = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; glfs_t *fs = NULL; glfs_object_t *object = NULL; @@ -1033,7 +1033,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { svs_inode_t *inode_ctx = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; char *value = 0; ssize_t size = 0; @@ -1260,7 +1260,7 @@ svs_releasedir(xlator_t *this, fd_t *fd) int32_t svs_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int ret = -1; uint64_t value = 0; @@ -1673,7 +1673,7 @@ svs_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, 0, }; int count = 0; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; svs_inode_t *parent_ctx = NULL; svs_fd_t *svs_fd = NULL; @@ -1774,7 +1774,7 @@ svs_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int count = 0; svs_inode_t *inode_ctx = NULL; int op_errno = EINVAL; - int op_ret = -1; + gf_return_t op_ret = -1; svs_fd_t *svs_fd = NULL; glfs_fd_t *glfd = NULL; @@ -1959,7 +1959,7 @@ svs_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) 0, }; int32_t op_errno = EINVAL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; svs_inode_t *inode_ctx = NULL; glfs_t *fs = NULL; glfs_object_t *object = NULL; @@ -2034,7 +2034,7 @@ svs_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) 0, }; int32_t op_errno = EINVAL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; svs_inode_t *inode_ctx = NULL; struct stat stat = { 0, @@ -2130,7 +2130,7 @@ svs_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) 0, }; int32_t op_errno = EINVAL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; svs_inode_t *inode_ctx = NULL; glfs_t *fs = NULL; glfs_object_t *object = NULL; @@ -2189,7 +2189,7 @@ svs_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, { svs_inode_t *inode_ctx = NULL; svs_fd_t *sfd = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; glfs_fd_t *glfd = NULL; glfs_t *fs = NULL; @@ -2260,7 +2260,7 @@ int32_t svs_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; svs_private_t *priv = NULL; struct iobuf *iobuf = NULL; @@ -2377,7 +2377,7 @@ svs_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, svs_inode_t *inode_ctx = NULL; glfs_t *fs = NULL; glfs_object_t *object = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; char *buf = NULL; struct iatt stbuf = { @@ -2454,7 +2454,7 @@ svs_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, dict_t *xdata) { int ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; glfs_t *fs = NULL; glfs_object_t *object = NULL; diff --git a/xlators/features/thin-arbiter/src/thin-arbiter.c b/xlators/features/thin-arbiter/src/thin-arbiter.c index ce3008636f..fe9fc617c7 100644 --- a/xlators/features/thin-arbiter/src/thin-arbiter.c +++ b/xlators/features/thin-arbiter/src/thin-arbiter.c @@ -92,7 +92,7 @@ ta_release_fop(ta_fop_t *fop) int32_t ta_set_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { TA_STACK_UNWIND(xattrop, frame, op_ret, op_errno, dict, xdata); @@ -130,7 +130,7 @@ ta_verify_on_disk_source(ta_fop_t *fop, dict_t *dict) int32_t ta_get_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { ta_fop_t *fop = NULL; diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index 7d09cba3e9..7c575e4278 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -20,18 +20,19 @@ int32_t trash_truncate_writev_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); + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata); int32_t trash_truncate_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata); int32_t trash_unlink_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata); @@ -296,7 +297,7 @@ wipe_eliminate_path(trash_elim_path **trav) */ int32_t trash_dir_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -415,9 +416,10 @@ rename_trash_directory(xlator_t *this) int32_t trash_internal_op_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *buf, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *buf, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { trash_local_t *local = NULL; local = frame->local; @@ -443,7 +445,7 @@ trash_internal_op_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t trash_dir_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -478,7 +480,7 @@ trash_dir_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_dir_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { data_t *data = NULL; @@ -531,7 +533,7 @@ trash_dir_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_internalop_dir_lookup_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) @@ -617,7 +619,7 @@ trash_internalop_dir_lookup_cbk(call_frame_t *frame, void *cookie, */ int32_t trash_dir_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { trash_private_t *priv = NULL; @@ -801,7 +803,7 @@ create_internalop_directory(xlator_t *this) int32_t trash_common_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -812,7 +814,7 @@ trash_common_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t trash_common_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -824,8 +826,9 @@ trash_common_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t trash_common_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { STACK_UNWIND_STRICT(rmdir, frame, op_ret, op_errno, preparent, postparent, xdata); @@ -837,7 +840,7 @@ trash_common_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_common_unwind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -853,7 +856,7 @@ trash_common_unwind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_unlink_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1037,7 +1040,7 @@ trash_unlink_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_unlink_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -1197,7 +1200,7 @@ trash_unlink_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_common_unwind_buf_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { @@ -1208,7 +1211,7 @@ trash_common_unwind_buf_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t trash_unlink_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { trash_private_t *priv = NULL; @@ -1390,7 +1393,7 @@ trash_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, */ int32_t trash_truncate_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1416,9 +1419,10 @@ trash_truncate_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_truncate_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, - int32_t count, struct iatt *stbuf, - struct iobref *iobuf, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iovec *vector, int32_t count, + struct iatt *stbuf, struct iobref *iobuf, + dict_t *xdata) { trash_local_t *local = NULL; @@ -1448,8 +1452,9 @@ trash_truncate_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_truncate_writev_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata) { trash_local_t *local = NULL; @@ -1489,7 +1494,7 @@ trash_truncate_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_truncate_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { trash_local_t *local = NULL; @@ -1525,7 +1530,7 @@ trash_truncate_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_truncate_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) @@ -1631,7 +1636,7 @@ trash_truncate_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t trash_truncate_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1815,7 +1820,7 @@ trash_truncate_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t trash_truncate_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { trash_private_t *priv = NULL; @@ -2129,7 +2134,7 @@ int32_t trash_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata) { - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; trash_private_t *priv = NULL; @@ -2162,7 +2167,7 @@ int trash_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; trash_private_t *priv = NULL; @@ -2195,7 +2200,7 @@ int32_t trash_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, dict_t *xdata) { - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; trash_private_t *priv = NULL; diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c index 0795f58059..c5dced5f50 100644 --- a/xlators/features/upcall/src/upcall.c +++ b/xlators/features/upcall/src/upcall.c @@ -28,8 +28,8 @@ #include static int32_t -up_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +up_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -80,9 +80,9 @@ up_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } static int32_t -up_writev_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) +up_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -134,9 +134,9 @@ up_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, } static int32_t -up_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iovec *vector, int count, struct iatt *stbuf, - struct iobref *iobref, dict_t *xdata) +up_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iovec *vector, int count, + struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -188,7 +188,7 @@ up_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } static int32_t -up_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, +up_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { client_t *client = NULL; @@ -239,9 +239,9 @@ up_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, } static int32_t -up_truncate_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) +up_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -293,9 +293,9 @@ up_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, } static int32_t -up_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *statpre, struct iatt *statpost, - dict_t *xdata) +up_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *statpre, + struct iatt *statpost, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -361,10 +361,11 @@ up_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, } static int32_t -up_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *stbuf, struct iatt *preoldparent, - struct iatt *postoldparent, struct iatt *prenewparent, - struct iatt *postnewparent, dict_t *xdata) +up_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, + struct iatt *preoldparent, struct iatt *postoldparent, + struct iatt *prenewparent, struct iatt *postnewparent, + dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -430,9 +431,9 @@ up_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } static int32_t -up_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +up_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -488,9 +489,10 @@ up_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, } static int32_t -up_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +up_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -547,9 +549,9 @@ up_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } static int32_t -up_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +up_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -606,9 +608,10 @@ up_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, } static int32_t -up_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +up_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -667,9 +670,10 @@ up_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, } static int32_t -up_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, fd_t *fd, inode_t *inode, struct iatt *stbuf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +up_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, fd_t *fd, inode_t *inode, + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -731,9 +735,9 @@ up_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } static int32_t -up_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, - struct iatt *postparent) +up_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { client_t *client = NULL; uint32_t flags = 0; @@ -784,8 +788,9 @@ up_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) } static int32_t -up_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +up_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -886,8 +891,8 @@ up_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } static int32_t -up_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, dict_t *xdata) +up_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -938,9 +943,9 @@ up_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, } static int32_t -up_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, const char *path, struct iatt *stbuf, - dict_t *xdata) +up_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, const char *path, + struct iatt *stbuf, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -991,9 +996,10 @@ up_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, } static int32_t -up_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +up_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -1053,7 +1059,7 @@ up_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, static int32_t up_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1115,7 +1121,7 @@ up_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, static int32_t up_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -1166,8 +1172,9 @@ up_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, } static int32_t -up_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct statvfs *buf, dict_t *xdata) +up_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, + dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -1218,7 +1225,7 @@ up_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) static int32_t up_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { client_t *client = NULL; @@ -1271,7 +1278,7 @@ up_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, static int32_t up_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { client_t *client = NULL; @@ -1360,7 +1367,7 @@ up_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, static int32_t up_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { client_t *client = NULL; @@ -1414,7 +1421,7 @@ up_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, static int32_t up_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { client_t *client = NULL; @@ -1467,7 +1474,7 @@ up_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, static int32_t up_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { client_t *client = NULL; @@ -1519,8 +1526,8 @@ up_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } static int32_t -up_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, off_t offset, dict_t *xdata) +up_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, off_t offset, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -1572,7 +1579,7 @@ up_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, static int32_t up_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -1646,7 +1653,7 @@ up_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, static int32_t up_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -1720,7 +1727,7 @@ up_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, static int32_t up_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -1803,7 +1810,7 @@ up_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, static int32_t up_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -1886,7 +1893,8 @@ up_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, static int32_t up_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -1935,7 +1943,8 @@ up_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, static int32_t up_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { client_t *client = NULL; uint32_t flags = 0; @@ -2011,7 +2020,8 @@ up_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, */ static int32_t up_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { client_t *client = NULL; upcall_local_t *local = NULL; diff --git a/xlators/features/utime/src/utime-gen-fops-c.py b/xlators/features/utime/src/utime-gen-fops-c.py index 9fb3e1b8b1..48786a3745 100755 --- a/xlators/features/utime/src/utime-gen-fops-c.py +++ b/xlators/features/utime/src/utime-gen-fops-c.py @@ -26,7 +26,7 @@ FOPS_CBK_COMMON_TEMPLATE = """ int32_t gf_utime_@NAME@_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, @LONG_ARGS@) { STACK_UNWIND_STRICT (@NAME@, frame, op_ret, op_errno, @SHORT_ARGS@); diff --git a/xlators/features/utime/src/utime.c b/xlators/features/utime/src/utime.c index 2acc63e6a0..89eb7a6331 100644 --- a/xlators/features/utime/src/utime.c +++ b/xlators/features/utime/src/utime.c @@ -136,8 +136,8 @@ mem_acct_init(xlator_t *this) int32_t gf_utime_set_mdata_setxattr_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int op_ret, int op_errno, - dict_t *xdata) + xlator_t *this, gf_return_t op_ret, + int op_errno, dict_t *xdata) { call_stub_t *stub = frame->local; /* Don't fail lookup if mdata setxattr fails */ @@ -153,8 +153,8 @@ gf_utime_set_mdata_setxattr_cbk(call_frame_t *frame, void *cookie, int32_t gf_utime_set_mdata_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *stbuf, dict_t *xdata, + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *stbuf, dict_t *xdata, struct iatt *postparent) { dict_t *dict = NULL; diff --git a/xlators/lib/src/libxlator.c b/xlators/lib/src/libxlator.c index 8075fa0c29..b5fba149be 100644 --- a/xlators/lib/src/libxlator.c +++ b/xlators/lib/src/libxlator.c @@ -127,7 +127,7 @@ cluster_marker_unwind(call_frame_t *frame, char *key, void *value, size_t size, { xl_marker_local_t *local = frame->local; int ret = 0; - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; gf_boolean_t unref = _gf_false; @@ -172,7 +172,8 @@ cluster_marker_unwind(call_frame_t *frame, char *key, void *value, size_t size, /* Aggregate all the .xtime attrs of the cluster and send the max*/ int32_t cluster_markerxtime_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *dict, + dict_t *xdata) { int32_t callcnt = 0; @@ -231,7 +232,8 @@ cluster_markerxtime_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t cluster_markeruuid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *dict, + dict_t *xdata) { int32_t callcnt = 0; struct volume_mark *volmark = NULL; diff --git a/xlators/lib/src/libxlator.h b/xlators/lib/src/libxlator.h index 81da4060d5..a41c61404c 100644 --- a/xlators/lib/src/libxlator.h +++ b/xlators/lib/src/libxlator.h @@ -27,9 +27,9 @@ #define MARKER_UUID_TYPE 1 #define MARKER_XTIME_TYPE 2 -typedef int32_t (*xlator_specf_unwind_t)(call_frame_t *frame, int op_ret, - int op_errno, dict_t *dict, - dict_t *xdata); +typedef int32_t (*xlator_specf_unwind_t)(call_frame_t *frame, + gf_return_t op_ret, int op_errno, + dict_t *dict, dict_t *xdata); struct volume_mark { uint8_t major; @@ -122,11 +122,13 @@ typedef struct marker_str xl_marker_local_t; int32_t cluster_markerxtime_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict, dict_t *xdata); + gf_return_t op_ret, int op_errno, dict_t *dict, + dict_t *xdata); int32_t cluster_markeruuid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *dict, dict_t *xdata); + gf_return_t op_ret, int op_errno, dict_t *dict, + dict_t *xdata); int cluster_handle_marker_getxattr(call_frame_t *frame, loc_t *loc, diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 1b21c40596..f86eb20611 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -2223,8 +2223,8 @@ glusterd_handle_sync_volume(rpcsvc_request_t *req) } int -glusterd_fsm_log_send_resp(rpcsvc_request_t *req, int op_ret, char *op_errstr, - dict_t *dict) +glusterd_fsm_log_send_resp(rpcsvc_request_t *req, gf_return_t op_ret, + char *op_errstr, dict_t *dict) { int ret = -1; gf1_cli_fsm_log_rsp rsp = {0}; @@ -3861,8 +3861,8 @@ glusterd_xfer_friend_remove_resp(rpcsvc_request_t *req, char *hostname, int glusterd_xfer_friend_add_resp(rpcsvc_request_t *req, char *myhostname, - char *remote_hostname, int port, int32_t op_ret, - int32_t op_errno) + char *remote_hostname, int port, + gf_return_t op_ret, int32_t op_errno) { gd1_mgmt_friend_rsp rsp = { {0}, @@ -3892,8 +3892,8 @@ glusterd_xfer_friend_add_resp(rpcsvc_request_t *req, char *myhostname, } static void -set_probe_error_str(int op_ret, int op_errno, char *op_errstr, char *errstr, - size_t len, char *hostname, int port) +set_probe_error_str(gf_return_t op_ret, int op_errno, char *op_errstr, + char *errstr, size_t len, char *hostname, int port) { if ((op_errstr) && (strcmp(op_errstr, ""))) { snprintf(errstr, len, "%s", op_errstr); @@ -4005,7 +4005,7 @@ set_probe_error_str(int op_ret, int op_errno, char *op_errstr, char *errstr, } int -glusterd_xfer_cli_probe_resp(rpcsvc_request_t *req, int32_t op_ret, +glusterd_xfer_cli_probe_resp(rpcsvc_request_t *req, gf_return_t op_ret, int32_t op_errno, char *op_errstr, char *hostname, int port, dict_t *dict) { @@ -4052,8 +4052,8 @@ glusterd_xfer_cli_probe_resp(rpcsvc_request_t *req, int32_t op_ret, } static void -set_deprobe_error_str(int op_ret, int op_errno, char *op_errstr, char *errstr, - size_t len, char *hostname) +set_deprobe_error_str(gf_return_t op_ret, int op_errno, char *op_errstr, + char *errstr, size_t len, char *hostname) { if ((op_errstr) && (strcmp(op_errstr, ""))) { snprintf(errstr, len, "%s", op_errstr); @@ -4123,7 +4123,7 @@ set_deprobe_error_str(int op_ret, int op_errno, char *op_errstr, char *errstr, } int -glusterd_xfer_cli_deprobe_resp(rpcsvc_request_t *req, int32_t op_ret, +glusterd_xfer_cli_deprobe_resp(rpcsvc_request_t *req, gf_return_t op_ret, int32_t op_errno, char *op_errstr, char *hostname, dict_t *dict) { diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c index d96e35503d..1a2800b8b7 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handshake.c +++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c @@ -907,7 +907,7 @@ int __server_getspec(rpcsvc_request_t *req) { int32_t ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int32_t spec_fd = -1; size_t file_len = 0; diff --git a/xlators/mgmt/glusterd/src/glusterd-locks.c b/xlators/mgmt/glusterd/src/glusterd-locks.c index 11523f2854..a23f0da40b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-locks.c +++ b/xlators/mgmt/glusterd/src/glusterd-locks.c @@ -175,7 +175,7 @@ glusterd_release_multiple_locks_per_entity(dict_t *dict, uuid_t uuid, char name_buf[PATH_MAX] = ""; char *name = NULL; int32_t i = -1; - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t ret = -1; xlator_t *this = NULL; @@ -429,7 +429,7 @@ glusterd_multiple_mgmt_v3_unlock(dict_t *dict, uuid_t uuid) { int32_t i = -1; int32_t ret = -1; - int32_t op_ret = 0; + gf_return_t op_ret = 0; xlator_t *this = NULL; this = THIS; diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-mgmt.c index b2128e10a0..4403109601 100644 --- a/xlators/mgmt/glusterd/src/glusterd-mgmt.c +++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.c @@ -30,9 +30,9 @@ extern struct rpc_clnt_program gd_mgmt_v3_prog; void -gd_mgmt_v3_collate_errors(struct syncargs *args, int op_ret, int op_errno, - char *op_errstr, int op_code, uuid_t peerid, - u_char *uuid) +gd_mgmt_v3_collate_errors(struct syncargs *args, gf_return_t op_ret, + int op_errno, char *op_errstr, int op_code, + uuid_t peerid, u_char *uuid) { char *peer_str = NULL; char err_str[PATH_MAX] = "Please check log file for details."; @@ -405,7 +405,7 @@ gd_mgmt_v3_commit_fn(glusterd_op_t op, dict_t *dict, char **op_errstr, } int32_t -gd_mgmt_v3_post_validate_fn(glusterd_op_t op, int32_t op_ret, dict_t *dict, +gd_mgmt_v3_post_validate_fn(glusterd_op_t op, gf_return_t op_ret, dict_t *dict, char **op_errstr, dict_t *rsp_dict) { int32_t ret = -1; @@ -518,7 +518,7 @@ gd_mgmt_v3_lock_cbk_fn(struct rpc_req *req, struct iovec *iov, int count, {0}, }; call_frame_t *frame = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = -1; xlator_t *this = NULL; uuid_t *peerid = NULL; @@ -812,7 +812,7 @@ gd_mgmt_v3_pre_validate_cbk_fn(struct rpc_req *req, struct iovec *iov, {0}, }; call_frame_t *frame = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = -1; dict_t *rsp_dict = NULL; xlator_t *this = NULL; @@ -1172,7 +1172,7 @@ gd_mgmt_v3_brick_op_cbk_fn(struct rpc_req *req, struct iovec *iov, int count, {0}, }; call_frame_t *frame = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = -1; dict_t *rsp_dict = NULL; xlator_t *this = NULL; @@ -1443,7 +1443,7 @@ gd_mgmt_v3_commit_cbk_fn(struct rpc_req *req, struct iovec *iov, int count, {0}, }; call_frame_t *frame = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = -1; dict_t *rsp_dict = NULL; xlator_t *this = NULL; @@ -1729,7 +1729,7 @@ gd_mgmt_v3_post_validate_cbk_fn(struct rpc_req *req, struct iovec *iov, {0}, }; call_frame_t *frame = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = -1; xlator_t *this = NULL; uuid_t *peerid = NULL; @@ -1789,8 +1789,8 @@ gd_mgmt_v3_post_validate_cbk(struct rpc_req *req, struct iovec *iov, int count, } int -gd_mgmt_v3_post_validate_req(glusterd_op_t op, int32_t op_ret, dict_t *op_ctx, - glusterd_peerinfo_t *peerinfo, +gd_mgmt_v3_post_validate_req(glusterd_op_t op, gf_return_t op_ret, + dict_t *op_ctx, glusterd_peerinfo_t *peerinfo, struct syncargs *args, uuid_t my_uuid, uuid_t recv_uuid) { @@ -1837,8 +1837,8 @@ gd_mgmt_v3_post_validate_req(glusterd_op_t op, int32_t op_ret, dict_t *op_ctx, } int -glusterd_mgmt_v3_post_validate(glusterd_op_t op, int32_t op_ret, dict_t *dict, - dict_t *req_dict, char **op_errstr, +glusterd_mgmt_v3_post_validate(glusterd_op_t op, gf_return_t op_ret, + dict_t *dict, dict_t *req_dict, char **op_errstr, uint32_t txn_generation) { int32_t ret = -1; @@ -1956,7 +1956,7 @@ gd_mgmt_v3_unlock_cbk_fn(struct rpc_req *req, struct iovec *iov, int count, {0}, }; call_frame_t *frame = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = -1; xlator_t *this = NULL; uuid_t *peerid = NULL; @@ -2059,7 +2059,7 @@ gd_mgmt_v3_unlock(glusterd_op_t op, dict_t *op_ctx, int glusterd_mgmt_v3_release_peer_locks(glusterd_op_t op, dict_t *dict, - int32_t op_ret, char **op_errstr, + gf_return_t op_ret, char **op_errstr, gf_boolean_t is_acquired, uint32_t txn_generation) { @@ -2142,7 +2142,7 @@ glusterd_mgmt_v3_initiate_all_phases_with_brickop_phase(rpcsvc_request_t *req, dict_t *dict) { int32_t ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; dict_t *req_dict = NULL; dict_t *tmp_dict = NULL; glusterd_conf_t *conf = NULL; @@ -2308,7 +2308,7 @@ glusterd_mgmt_v3_initiate_all_phases(rpcsvc_request_t *req, glusterd_op_t op, dict_t *dict) { int32_t ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; dict_t *req_dict = NULL; dict_t *tmp_dict = NULL; glusterd_conf_t *conf = NULL; @@ -2531,7 +2531,7 @@ glusterd_mgmt_v3_initiate_snap_phases(rpcsvc_request_t *req, glusterd_op_t op, dict_t *dict) { int32_t ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; dict_t *req_dict = NULL; dict_t *tmp_dict = NULL; glusterd_conf_t *conf = NULL; diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.h b/xlators/mgmt/glusterd/src/glusterd-mgmt.h index 71f793d039..bb6f32624d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-mgmt.h +++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.h @@ -11,9 +11,9 @@ #define _GLUSTERD_MGMT_H_ void -gd_mgmt_v3_collate_errors(struct syncargs *args, int op_ret, int op_errno, - char *op_errstr, int op_code, uuid_t peerid, - u_char *uuid); +gd_mgmt_v3_collate_errors(struct syncargs *args, gf_return_t op_ret, + int op_errno, char *op_errstr, int op_code, + uuid_t peerid, u_char *uuid); int32_t gd_mgmt_v3_pre_validate_fn(glusterd_op_t op, dict_t *dict, char **op_errstr, @@ -28,7 +28,7 @@ gd_mgmt_v3_commit_fn(glusterd_op_t op, dict_t *dict, char **op_errstr, uint32_t *op_errno, dict_t *rsp_dict); int32_t -gd_mgmt_v3_post_validate_fn(glusterd_op_t op, int32_t op_ret, dict_t *dict, +gd_mgmt_v3_post_validate_fn(glusterd_op_t op, gf_return_t op_ret, dict_t *dict, char **op_errstr, dict_t *rsp_dict); int32_t @@ -72,7 +72,7 @@ glusterd_mgmt_v3_commit(glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict, int glusterd_mgmt_v3_release_peer_locks(glusterd_op_t op, dict_t *dict, - int32_t op_ret, char **op_errstr, + gf_return_t op_ret, char **op_errstr, gf_boolean_t is_acquired, uint32_t txn_generation); diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index c537fc33a8..b7490fda43 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -5487,7 +5487,7 @@ glusterd_op_txn_complete(uuid_t *txn_id) int32_t ret = -1; glusterd_conf_t *priv = NULL; int32_t op = -1; - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; rpcsvc_request_t *req = NULL; void *ctx = NULL; diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.h b/xlators/mgmt/glusterd/src/glusterd-op-sm.h index 8a24b16612..eae4447e80 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.h +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.h @@ -93,7 +93,7 @@ struct glusterd_op_info_ { struct cds_list_head op_peers; void *op_ctx; rpcsvc_request_t *req; - int32_t op_ret; + gf_return_t op_ret; int32_t op_errno; char *op_errstr; struct cds_list_head pending_bricks; @@ -128,7 +128,7 @@ struct glusterd_req_ctx_ { typedef struct glusterd_req_ctx_ glusterd_req_ctx_t; typedef struct glusterd_op_brick_rsp_ctx_ { - int op_ret; + gf_return_t op_ret; char *op_errstr; dict_t *rsp_dict; glusterd_req_ctx_t *commit_ctx; @@ -215,7 +215,7 @@ int32_t glusterd_op_set_req(rpcsvc_request_t *req); int32_t -glusterd_op_send_cli_response(glusterd_op_t op, int32_t op_ret, +glusterd_op_send_cli_response(glusterd_op_t op, gf_return_t op_ret, int32_t op_errno, rpcsvc_request_t *req, void *ctx, char *op_errstr); int32_t @@ -297,7 +297,7 @@ int32_t glusterd_generate_txn_id(dict_t *dict, uuid_t **txn_id); void -glusterd_set_opinfo(char *errstr, int32_t op_errno, int32_t op_ret); +glusterd_set_opinfo(char *errstr, int32_t op_errno, gf_return_t op_ret); int glusterd_dict_set_volid(dict_t *dict, char *volname, char **op_errstr); diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c index 43c2f4373e..204c9fa7db 100644 --- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c +++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c @@ -597,7 +597,7 @@ glusterd_mgmt_v3_initiate_replace_brick_cmd_phases(rpcsvc_request_t *req, dict_t *dict) { int32_t ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; uint32_t txn_generation = 0; uint32_t op_errno = 0; char *op_errstr = NULL; diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index 88662e3bba..f8996e44ff 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -37,7 +37,7 @@ extern glusterd_op_info_t opinfo; extern uuid_t global_txn_id; int32_t -glusterd_op_send_cli_response(glusterd_op_t op, int32_t op_ret, +glusterd_op_send_cli_response(glusterd_op_t op, gf_return_t op_ret, int32_t op_errno, rpcsvc_request_t *req, void *op_ctx, char *op_errstr) { @@ -445,7 +445,7 @@ __glusterd_friend_add_cbk(struct rpc_req *req, struct iovec *iov, int count, glusterd_friend_sm_event_t *event = NULL; glusterd_friend_sm_event_type_t event_type = GD_FRIEND_EVENT_NONE; glusterd_peerinfo_t *peerinfo = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; glusterd_probe_ctx_t *ctx = NULL; glusterd_friend_update_ctx_t *ev_ctx = NULL; @@ -556,7 +556,7 @@ __glusterd_friend_remove_cbk(struct rpc_req *req, struct iovec *iov, int count, glusterd_friend_sm_event_t *event = NULL; glusterd_friend_sm_event_type_t event_type = GD_FRIEND_EVENT_NONE; glusterd_peerinfo_t *peerinfo = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; glusterd_probe_ctx_t *ctx = NULL; gf_boolean_t move_sm_now = _gf_true; @@ -707,7 +707,7 @@ __glusterd_cluster_lock_cbk(struct rpc_req *req, struct iovec *iov, int count, {0}, }; int ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; glusterd_op_sm_event_type_t event_type = GD_OP_EVENT_NONE; xlator_t *this = NULL; uuid_t *txn_id = NULL; @@ -807,7 +807,7 @@ glusterd_cluster_lock_cbk(struct rpc_req *req, struct iovec *iov, int count, } void -glusterd_set_opinfo(char *errstr, int32_t op_errno, int32_t op_ret) +glusterd_set_opinfo(char *errstr, int32_t op_errno, gf_return_t op_ret) { opinfo.op_errstr = gf_strdup(errstr); opinfo.op_errno = op_errno; @@ -822,7 +822,7 @@ glusterd_mgmt_v3_lock_peers_cbk_fn(struct rpc_req *req, struct iovec *iov, {0}, }; int ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; glusterd_op_sm_event_type_t event_type = GD_OP_EVENT_NONE; xlator_t *this = NULL; call_frame_t *frame = NULL; @@ -930,7 +930,7 @@ glusterd_mgmt_v3_unlock_peers_cbk_fn(struct rpc_req *req, struct iovec *iov, {0}, }; int ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; glusterd_op_sm_event_type_t event_type = GD_OP_EVENT_NONE; xlator_t *this = NULL; call_frame_t *frame = NULL; @@ -1039,7 +1039,7 @@ __glusterd_cluster_unlock_cbk(struct rpc_req *req, struct iovec *iov, int count, {0}, }; int ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; glusterd_op_sm_event_type_t event_type = GD_OP_EVENT_NONE; xlator_t *this = NULL; uuid_t *txn_id = NULL; @@ -1139,7 +1139,7 @@ __glusterd_stage_op_cbk(struct rpc_req *req, struct iovec *iov, int count, {0}, }; int ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; glusterd_op_sm_event_type_t event_type = GD_OP_EVENT_NONE; glusterd_peerinfo_t *peerinfo = NULL; dict_t *dict = NULL; @@ -1281,7 +1281,7 @@ __glusterd_commit_op_cbk(struct rpc_req *req, struct iovec *iov, int count, {0}, }; int ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; glusterd_op_sm_event_type_t event_type = GD_OP_EVENT_NONE; glusterd_peerinfo_t *peerinfo = NULL; dict_t *dict = NULL; @@ -2115,7 +2115,7 @@ __glusterd_brick_op_cbk(struct rpc_req *req, struct iovec *iov, int count, { gd1_mgmt_brick_op_rsp rsp = {0}; int ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; glusterd_op_sm_event_type_t event_type = GD_OP_EVENT_NONE; call_frame_t *frame = NULL; glusterd_op_brick_rsp_ctx_t *ev_ctx = NULL; diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c index bf2d81b644..bd28ca3dde 100644 --- a/xlators/mgmt/glusterd/src/glusterd-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-sm.c @@ -952,7 +952,7 @@ glusterd_ac_handle_friend_add_req(glusterd_friend_sm_event_t *event, void *ctx) glusterd_friend_sm_event_type_t event_type = GD_FRIEND_EVENT_NONE; glusterd_conf_t *conf = NULL; int status = 0; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; xlator_t *this = NULL; char *hostname = NULL; diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c index 995268b796..8697e6b2f0 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c @@ -68,7 +68,7 @@ glusterd_snapobject_delete(glusterd_snap_t *snap) int glusterd_cleanup_snaps_for_volume(glusterd_volinfo_t *volinfo) { - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t ret = 0; xlator_t *this = NULL; glusterd_volinfo_t *snap_vol = NULL; diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index aeaa8d1521..884db0c807 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -617,7 +617,7 @@ glusterd_snapshot_backup_vol(glusterd_volinfo_t *volinfo) { char pathname[PATH_MAX] = ""; int ret = -1; - int op_ret = 0; + gf_return_t op_ret = 0; char delete_path[PATH_MAX] = ""; char trashdir[PATH_MAX] = ""; glusterd_conf_t *priv = NULL; @@ -8094,7 +8094,7 @@ glusterd_handle_snap_limit(dict_t *dict, dict_t *rsp_dict) } int32_t -glusterd_snapshot_clone_postvalidate(dict_t *dict, int32_t op_ret, +glusterd_snapshot_clone_postvalidate(dict_t *dict, gf_return_t op_ret, char **op_errstr, dict_t *rsp_dict) { xlator_t *this = NULL; @@ -8173,7 +8173,7 @@ glusterd_snapshot_clone_postvalidate(dict_t *dict, int32_t op_ret, } int32_t -glusterd_snapshot_create_postvalidate(dict_t *dict, int32_t op_ret, +glusterd_snapshot_create_postvalidate(dict_t *dict, gf_return_t op_ret, char **op_errstr, dict_t *rsp_dict) { xlator_t *this = NULL; @@ -9010,8 +9010,8 @@ glusterd_snapshot_revert_restore_from_snap(glusterd_snap_t *snap) * @return 0 on success and -1 on failure */ int -glusterd_snapshot_restore_postop(dict_t *dict, int32_t op_ret, char **op_errstr, - dict_t *rsp_dict) +glusterd_snapshot_restore_postop(dict_t *dict, gf_return_t op_ret, + char **op_errstr, dict_t *rsp_dict) { int ret = -1; char *name = NULL; @@ -9137,8 +9137,8 @@ glusterd_snapshot_restore_postop(dict_t *dict, int32_t op_ret, char **op_errstr, } int -glusterd_snapshot_postvalidate(dict_t *dict, int32_t op_ret, char **op_errstr, - dict_t *rsp_dict) +glusterd_snapshot_postvalidate(dict_t *dict, gf_return_t op_ret, + char **op_errstr, dict_t *rsp_dict) { int snap_command = 0; xlator_t *this = NULL; diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index b73d37ad08..4e956de9aa 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -39,7 +39,7 @@ gd_synctask_barrier_wait(struct syncargs *args, int count) } static void -gd_collate_errors(struct syncargs *args, int op_ret, int op_errno, +gd_collate_errors(struct syncargs *args, gf_return_t op_ret, int op_errno, char *op_errstr, int op_code, uuid_t peerid, u_char *uuid) { char err_str[PATH_MAX] = "Please check log file for details."; @@ -336,7 +336,7 @@ gd_syncop_mgmt_v3_lock_cbk_fn(struct rpc_req *req, struct iovec *iov, int count, {0}, }; call_frame_t *frame = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = -1; xlator_t *this = NULL; uuid_t *peerid = NULL; @@ -440,7 +440,7 @@ gd_syncop_mgmt_v3_unlock_cbk_fn(struct rpc_req *req, struct iovec *iov, {0}, }; call_frame_t *frame = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = -1; xlator_t *this = NULL; uuid_t *peerid = NULL; @@ -544,7 +544,7 @@ _gd_syncop_mgmt_lock_cbk(struct rpc_req *req, struct iovec *iov, int count, {0}, }; call_frame_t *frame = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = -1; xlator_t *this = NULL; uuid_t *peerid = NULL; @@ -645,7 +645,7 @@ _gd_syncop_mgmt_unlock_cbk(struct rpc_req *req, struct iovec *iov, int count, {0}, }; call_frame_t *frame = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = -1; xlator_t *this = NULL; uuid_t *peerid = NULL; @@ -746,7 +746,7 @@ _gd_syncop_stage_op_cbk(struct rpc_req *req, struct iovec *iov, int count, xlator_t *this = NULL; dict_t *rsp_dict = NULL; call_frame_t *frame = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = -1; uuid_t *peerid = NULL; @@ -1056,7 +1056,7 @@ _gd_syncop_commit_op_cbk(struct rpc_req *req, struct iovec *iov, int count, xlator_t *this = NULL; dict_t *rsp_dict = NULL; call_frame_t *frame = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = -1; int type = GF_QUOTA_OPTION_TYPE_NONE; uuid_t *peerid = NULL; @@ -1811,7 +1811,7 @@ void gd_sync_task_begin(dict_t *op_ctx, rpcsvc_request_t *req) { int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; dict_t *req_dict = NULL; glusterd_conf_t *conf = NULL; glusterd_op_t op = GD_OP_NONE; diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 1af817513d..ffa2b6a37a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -7020,7 +7020,7 @@ _local_gsyncd_start(dict_t *this, char *key, data_t *value, void *data) char *statefile = NULL; char buf[1024] = "faulty"; int ret = 0; - int op_ret = 0; + gf_return_t op_ret = 0; int ret_status = 0; char uuid_str[64] = ""; glusterd_volinfo_t *volinfo = NULL; @@ -8778,7 +8778,7 @@ glusterd_recreate_volfiles(glusterd_conf_t *conf) { glusterd_volinfo_t *volinfo = NULL; int ret = 0; - int op_ret = 0; + gf_return_t op_ret = 0; GF_ASSERT(conf); @@ -10028,7 +10028,7 @@ glusterd_to_cli(rpcsvc_request_t *req, gf_cli_rsp *arg, struct iovec *payload, { int ret = -1; char *cmd = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; char *op_errstr = NULL; xlator_t *this = NULL; diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index 227e8801f2..71eba86ce9 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -836,8 +836,8 @@ glusterd_probe_begin(rpcsvc_request_t *req, const char *hoststr, int port, int glusterd_xfer_friend_add_resp(rpcsvc_request_t *req, char *myhostname, - char *remote_hostname, int port, int32_t op_ret, - int32_t op_errno); + char *remote_hostname, int port, + gf_return_t op_ret, int32_t op_errno); int glusterd_friend_add(const char *hoststr, int port, @@ -911,7 +911,7 @@ int glusterd_handle_defrag_volume_v2(rpcsvc_request_t *req); int -glusterd_xfer_cli_probe_resp(rpcsvc_request_t *req, int32_t op_ret, +glusterd_xfer_cli_probe_resp(rpcsvc_request_t *req, gf_return_t op_ret, int32_t op_errno, char *op_errstr, char *hostname, int port, dict_t *dict); @@ -1042,7 +1042,7 @@ int glusterd_handle_reset_brick(rpcsvc_request_t *req); int -glusterd_xfer_cli_deprobe_resp(rpcsvc_request_t *req, int32_t op_ret, +glusterd_xfer_cli_deprobe_resp(rpcsvc_request_t *req, gf_return_t op_ret, int32_t op_errno, char *op_errstr, char *hostname, dict_t *dict); @@ -1319,8 +1319,8 @@ int glusterd_snapshot(dict_t *dict, char **op_errstr, uint32_t *op_errno, dict_t *rsp_dict); int -glusterd_snapshot_postvalidate(dict_t *dict, int32_t op_ret, char **op_errstr, - dict_t *rsp_dict); +glusterd_snapshot_postvalidate(dict_t *dict, gf_return_t op_ret, + char **op_errstr, dict_t *rsp_dict); char * glusterd_build_snap_device_path(char *device, char *snapname, int32_t brick_count); diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 1cf55143e2..2f127a9ce0 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -986,7 +986,7 @@ send_fuse_err(xlator_t *this, fuse_in_header_t *finh, int error) static int fuse_entry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata) { fuse_state_t *state = NULL; @@ -1091,7 +1091,7 @@ fuse_entry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int fuse_newentry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1105,7 +1105,7 @@ fuse_newentry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int fuse_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stat, dict_t *dict, struct iatt *postparent) { fuse_state_t *state = NULL; @@ -1265,7 +1265,7 @@ fuse_batch_forget(xlator_t *this, fuse_in_header_t *finh, void *msg, static int fuse_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { fuse_state_t *state; @@ -1319,12 +1319,13 @@ fuse_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int fuse_root_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stat, dict_t *dict, struct iatt *postparent); static int -fuse_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +fuse_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { int32_t ret = 0; fuse_state_t *state; @@ -1413,7 +1414,7 @@ fuse_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, static int fuse_root_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stat, dict_t *dict, struct iatt *postparent) { fuse_attr_cbk(frame, cookie, this, op_ret, op_errno, stat, dict); @@ -1554,8 +1555,8 @@ direct_io_mode(dict_t *xdata) } static int -fuse_fd_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +fuse_fd_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { fuse_state_t *state = NULL; fuse_in_header_t *finh = NULL; @@ -1667,7 +1668,7 @@ fuse_do_truncate(fuse_state_t *state) static int fuse_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { fuse_state_t *state; @@ -1905,7 +1906,7 @@ fuse_setattr(xlator_t *this, fuse_in_header_t *finh, void *msg, static int fuse_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { fuse_state_t *state = NULL; fuse_in_header_t *finh = NULL; @@ -1945,8 +1946,8 @@ fuse_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } static int -fuse_err_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +fuse_err_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { fuse_state_t *state = frame->root->state; fuse_in_header_t *finh = state->finh; @@ -1983,7 +1984,7 @@ fuse_err_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, static int fuse_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { fuse_private_t *priv = this->private; @@ -1998,7 +1999,7 @@ fuse_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int fuse_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { return fuse_err_cbk(frame, cookie, this, op_ret, op_errno, xdata); @@ -2006,7 +2007,7 @@ fuse_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int fuse_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { if (op_ret == -1 && op_errno == ENOTSUP) GF_LOG_OCCASIONALLY(gf_fuse_xattr_enotsup_log, "glusterfs-fuse", @@ -2019,7 +2020,7 @@ fuse_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int fuse_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { fuse_state_t *state = NULL; @@ -2106,7 +2107,7 @@ fuse_access(xlator_t *this, fuse_in_header_t *finh, void *msg, static int fuse_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *linkname, + gf_return_t op_ret, int32_t op_errno, const char *linkname, struct iatt *buf, dict_t *xdata) { fuse_state_t *state = NULL; @@ -2459,7 +2460,7 @@ fuse_symlink(xlator_t *this, fuse_in_header_t *finh, void *msg, int fuse_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -2645,7 +2646,7 @@ fuse_link(xlator_t *this, fuse_in_header_t *finh, void *msg, static int fuse_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2933,7 +2934,7 @@ fuse_open(xlator_t *this, fuse_in_header_t *finh, void *msg, static int fuse_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -3030,7 +3031,7 @@ fuse_readv(xlator_t *this, fuse_in_header_t *finh, void *msg, static int fuse_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *postbuf, dict_t *xdata) { fuse_state_t *state = NULL; @@ -3153,9 +3154,9 @@ fuse_write(xlator_t *this, fuse_in_header_t *finh, void *msg, #if FUSE_KERNEL_MINOR_VERSION >= 28 static int fuse_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, - struct iatt *prebuf_dst, struct iatt *postbuf_dst, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *stbuf, struct iatt *prebuf_dst, + struct iatt *postbuf_dst, dict_t *xdata) { fuse_state_t *state = NULL; fuse_in_header_t *finh = NULL; @@ -3266,7 +3267,8 @@ fuse_copy_file_range(xlator_t *this, fuse_in_header_t *finh, void *msg, #if FUSE_KERNEL_MINOR_VERSION >= 24 && HAVE_SEEK_HOLE static int fuse_lseek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, off_t offset, + dict_t *xdata) { fuse_state_t *state = frame->root->state; fuse_in_header_t *finh = state->finh; @@ -3578,7 +3580,7 @@ d_type_from_stat(struct iatt *buf) static int fuse_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { fuse_state_t *state = NULL; @@ -3694,7 +3696,7 @@ fuse_readdir(xlator_t *this, fuse_in_header_t *finh, void *msg, #if FUSE_KERNEL_MINOR_VERSION >= 20 static int fuse_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { fuse_state_t *state = NULL; @@ -3854,7 +3856,7 @@ fuse_readdirp(xlator_t *this, fuse_in_header_t *finh, void *msg, #ifdef FALLOC_FL_KEEP_SIZE static int fuse_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { return fuse_err_cbk(frame, cookie, this, op_ret, op_errno, xdata); @@ -3964,7 +3966,7 @@ fuse_fsyncdir(xlator_t *this, fuse_in_header_t *finh, void *msg, static int fuse_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { fuse_state_t *state = NULL; @@ -4264,7 +4266,8 @@ fuse_filter_xattr(char *key) static int fuse_xattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { char *value = ""; fuse_state_t *state = NULL; @@ -4644,7 +4647,7 @@ static int gf_fuse_lk_enosys_log; static int fuse_getlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { fuse_state_t *state = NULL; @@ -4730,7 +4733,7 @@ fuse_getlk(xlator_t *this, fuse_in_header_t *finh, void *msg, static int fuse_setlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { uint32_t op = 0; @@ -4792,7 +4795,7 @@ fuse_setlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int fuse_setlk_interrupt_handler_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { fuse_interrupt_state_t intstat = INTERRUPT_NONE; diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h index 4cb94c23ca..31432d357f 100644 --- a/xlators/mount/fuse/src/fuse-bridge.h +++ b/xlators/mount/fuse/src/fuse-bridge.h @@ -418,7 +418,7 @@ typedef struct { inode_t *hint; u_char pargfid[16]; inode_t *parhint; - int op_ret; + gf_return_t op_ret; int op_errno; loc_t resolve_loc; } fuse_resolve_t; diff --git a/xlators/mount/fuse/src/fuse-resolve.c b/xlators/mount/fuse/src/fuse-resolve.c index 6206fd4732..4d9b57c978 100644 --- a/xlators/mount/fuse/src/fuse-resolve.c +++ b/xlators/mount/fuse/src/fuse-resolve.c @@ -40,7 +40,7 @@ fuse_resolve_loc_touchup(fuse_state_t *state) int fuse_resolve_entry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) { fuse_state_t *state = NULL; @@ -105,7 +105,7 @@ fuse_resolve_entry(fuse_state_t *state) int fuse_resolve_gfid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) { fuse_state_t *state = NULL; diff --git a/xlators/nfs/server/src/acl3.c b/xlators/nfs/server/src/acl3.c index 7e3bbf1608..652a5cd1c9 100644 --- a/xlators/nfs/server/src/acl3.c +++ b/xlators/nfs/server/src/acl3.c @@ -257,7 +257,8 @@ acl3_setacl_reply(rpcsvc_request_t *req, setaclreply *reply) */ int acl3_getacl_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; nfs3_call_state_t *cs = NULL; @@ -321,7 +322,7 @@ acl3_getacl_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int acl3_default_getacl_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -389,8 +390,9 @@ acl3_default_getacl_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int -acl3_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +acl3_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; nfs3_call_state_t *cs = NULL; @@ -538,7 +540,7 @@ acl3svc_getacl(rpcsvc_request_t *req) int acl3_setacl_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { nfs3_call_state_t *cs = NULL; cs = frame->local; diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c index a34d9104c1..199baf1a8d 100644 --- a/xlators/nfs/server/src/mount3.c +++ b/xlators/nfs/server/src/mount3.c @@ -739,7 +739,7 @@ __mnt3_get_mount_id(xlator_t *mntxl, uuid_t mountid) int32_t mnt3svc_lookup_mount_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) { @@ -1023,13 +1023,13 @@ setup_next_component(char *path, size_t plen, char *component, size_t clen) int32_t mnt3_resolve_subdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent); int32_t mnt3_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata); /* There are multiple components in the directory export path and each one @@ -1109,7 +1109,7 @@ __mnt3_fresh_lookup(mnt3_resolve_t *mres) int32_t mnt3_resolve_subdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) { @@ -1248,7 +1248,7 @@ mnt3_resolve_subdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t mnt3_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata) { mnt3_resolve_t *mres = NULL; diff --git a/xlators/nfs/server/src/nfs-fops.c b/xlators/nfs/server/src/nfs-fops.c index 4d8540c2c3..5347a87426 100644 --- a/xlators/nfs/server/src/nfs-fops.c +++ b/xlators/nfs/server/src/nfs-fops.c @@ -397,7 +397,7 @@ nfs_gfid_dict(inode_t *inode) int32_t nfs_fop_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) { struct nfs_fop_local *local = NULL; @@ -449,7 +449,7 @@ nfs_fop_lookup(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc, int32_t nfs_fop_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; fop_access_cbk_t progcbk = NULL; @@ -494,7 +494,7 @@ nfs_fop_access(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc, int32_t nfs_fop_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -539,7 +539,7 @@ nfs_fop_stat(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc, int32_t nfs_fop_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -585,7 +585,8 @@ nfs_fop_fstat(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, int32_t nfs_fop_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { struct nfs_fop_local *nfl = NULL; fop_opendir_cbk_t progcbk = NULL; @@ -627,7 +628,7 @@ nfs_fop_opendir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int nfs_fop_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; fop_flush_cbk_t progcbk = NULL; @@ -668,7 +669,7 @@ nfs_fop_flush(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, int32_t nfs_fop_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -714,7 +715,7 @@ nfs_fop_readdirp(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *dirfd, int32_t nfs_fop_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -757,8 +758,8 @@ nfs_fop_statfs(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_fop_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -811,7 +812,7 @@ nfs_fop_create(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_fop_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -856,7 +857,7 @@ nfs_fop_setattr(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_fop_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -907,7 +908,7 @@ nfs_fop_mkdir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_fop_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -958,7 +959,7 @@ nfs_fop_symlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, char *target, int32_t nfs_fop_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -1002,7 +1003,7 @@ nfs_fop_readlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_fop_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1053,7 +1054,7 @@ nfs_fop_mknod(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_fop_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { struct nfs_fop_local *nfl = frame->local; @@ -1098,7 +1099,7 @@ nfs_fop_rmdir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_fop_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { struct nfs_fop_local *nfl = frame->local; @@ -1143,7 +1144,7 @@ nfs_fop_unlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_fop_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1194,7 +1195,7 @@ nfs_fop_link(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc, int32_t nfs_fop_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -1249,7 +1250,7 @@ nfs_fop_rename(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc, int32_t nfs_fop_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; fop_open_cbk_t progcbk = NULL; @@ -1291,7 +1292,7 @@ nfs_fop_open(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc, int32_t nfs_fop_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -1360,7 +1361,7 @@ nfs_fop_write(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, int32_t nfs_fop_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -1404,7 +1405,7 @@ nfs_fop_fsync(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, int32_t nfs_fop_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -1450,7 +1451,7 @@ nfs_fop_read(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, int32_t nfs_fop_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *flock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *flock, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -1502,7 +1503,7 @@ nfs_fop_lk(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, fd_t *fd, int cmd, int32_t nfs_fop_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; @@ -1545,7 +1546,7 @@ nfs_fop_getxattr(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc, int32_t nfs_fop_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; fop_setxattr_cbk_t progcbk = NULL; @@ -1588,7 +1589,7 @@ nfs_fop_setxattr(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc, int32_t nfs_fop_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct nfs_fop_local *nfl = NULL; diff --git a/xlators/nfs/server/src/nfs-inodes.c b/xlators/nfs/server/src/nfs-inodes.c index 6f34ca705b..1adf77aa9a 100644 --- a/xlators/nfs/server/src/nfs-inodes.c +++ b/xlators/nfs/server/src/nfs-inodes.c @@ -52,8 +52,8 @@ nfl_inodes_init(struct nfs_fop_local *nfl, inode_t *inode, inode_t *parent, int32_t nfs_inode_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { struct nfs_fop_local *nfl = frame->local; @@ -122,7 +122,7 @@ nfs_inode_create(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_inode_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -172,7 +172,8 @@ nfs_inode_mkdir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_inode_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { struct nfs_fop_local *nfl = NULL; fop_open_cbk_t progcbk = NULL; @@ -229,7 +230,7 @@ nfs_inode_open(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *loc, int32_t nfs_inode_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -277,7 +278,7 @@ nfs_inode_rename(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc, int32_t nfs_inode_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -328,8 +329,9 @@ nfs_inode_link(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *oldloc, int32_t nfs_inode_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { struct nfs_fop_local *nfl = NULL; fop_unlink_cbk_t progcbk = NULL; @@ -374,8 +376,9 @@ nfs_inode_unlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_inode_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, - struct iatt *postparent, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { struct nfs_fop_local *nfl = NULL; fop_rmdir_cbk_t progcbk = NULL; @@ -421,7 +424,7 @@ nfs_inode_rmdir(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_inode_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -476,7 +479,7 @@ nfs_inode_mknod(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, int32_t nfs_inode_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -529,7 +532,8 @@ nfs_inode_symlink(xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, char *target, int32_t nfs_inode_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { struct nfs_fop_local *nfl = NULL; fop_open_cbk_t progcbk = NULL; diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 39b73f88ac..e20e2855ab 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -469,8 +469,8 @@ nfs_subvolume_set_started(struct nfs_state *nfs, xlator_t *xl) int32_t nfs_start_subvol_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *buf, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) { if (op_ret == -1) { diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c index 897fb42b07..e2cc79be92 100644 --- a/xlators/nfs/server/src/nfs3-helpers.c +++ b/xlators/nfs/server/src/nfs3-helpers.c @@ -251,7 +251,7 @@ nfs3_errno_to_nfsstat3(int errnum) * happens by any means, then set NFS3 status to NFS3ERR_SERVERFAULT. */ nfsstat3 -nfs3_cbk_errno_status(int32_t op_ret, int32_t op_errno) +nfs3_cbk_errno_status(gf_return_t op_ret, int32_t op_errno) { if ((op_ret == -1) && (op_errno == 0)) { return NFS3ERR_SERVERFAULT; @@ -3522,7 +3522,7 @@ nfs3_fh_resolve_inode_done(nfs3_call_state_t *cs, inode_t *inode) int32_t nfs3_fh_resolve_entry_lookup_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) @@ -3570,7 +3570,7 @@ nfs3_fh_resolve_entry_lookup_cbk(call_frame_t *frame, void *cookie, int32_t nfs3_fh_resolve_inode_lookup_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) @@ -3778,7 +3778,7 @@ nfs3_fh_resolve_resume(nfs3_call_state_t *cs) int32_t nfs3_fh_resolve_root_lookup_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index f9042bc3b3..76e15a9df8 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -808,7 +808,7 @@ nfs3_getattr_reply(rpcsvc_request_t *req, nfsstat3 status, struct iatt *buf) int32_t nfs3svc_getattr_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) { @@ -840,7 +840,7 @@ nfs3svc_getattr_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t nfs3svc_getattr_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { nfsstat3 status = NFS3_OK; @@ -1030,7 +1030,7 @@ nfs3_setattr_reply(rpcsvc_request_t *req, nfsstat3 stat, struct iatt *preop, int32_t nfs3svc_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -1064,7 +1064,7 @@ nfs3svc_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t nfs3svc_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preop, + gf_return_t op_ret, int32_t op_errno, struct iatt *preop, struct iatt *postop, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -1116,7 +1116,7 @@ nfs3svc_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t nfs3svc_setattr_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { int ret = -EFAULT; @@ -1329,7 +1329,7 @@ nfs3_fresh_lookup(nfs3_call_state_t *cs) int nfs3svc_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) { struct nfs3_fh newfh = { @@ -1369,8 +1369,8 @@ nfs3svc_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int nfs3svc_lookup_parentdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *buf, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, + inode_t *inode, struct iatt *buf, dict_t *xattr, struct iatt *postparent) { struct nfs3_fh newfh = { @@ -1641,7 +1641,7 @@ nfs3_access_reply(rpcsvc_request_t *req, nfsstat3 status, int32_t accbits, int32_t nfs3svc_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { nfsstat3 status = NFS3_OK; nfs3_call_state_t *cs = NULL; @@ -1795,7 +1795,7 @@ nfs3_readlink_reply(rpcsvc_request_t *req, nfsstat3 stat, char *path, int32_t nfs3svc_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -1961,7 +1961,7 @@ nfs3_read_reply(rpcsvc_request_t *req, nfsstat3 stat, count3 count, int32_t nfs3svc_read_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -2149,8 +2149,9 @@ nfs3_write_reply(rpcsvc_request_t *req, nfsstat3 stat, count3 count, int32_t nfs3svc_write_fsync_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) + gf_return_t op_ret, int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata) { struct nfs3_state *nfs3 = NULL; nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -2206,7 +2207,7 @@ nfs3svc_write_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t nfs3svc_write_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -2439,8 +2440,9 @@ nfs3_create_reply(rpcsvc_request_t *req, nfsstat3 stat, struct nfs3_fh *newfh, int32_t nfs3svc_create_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preop, - struct iatt *postop, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preop, struct iatt *postop, + dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; nfs3_call_state_t *cs = NULL; @@ -2464,8 +2466,8 @@ nfs3svc_create_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t nfs3svc_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *buf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -2567,7 +2569,7 @@ nfs3_create_common(nfs3_call_state_t *cs) int32_t nfs3svc_create_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { int ret = -EFAULT; @@ -2786,8 +2788,9 @@ nfs3_mkdir_reply(rpcsvc_request_t *req, nfsstat3 stat, struct nfs3_fh *fh, int32_t nfs3svc_mkdir_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preop, - struct iatt *postop, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preop, struct iatt *postop, + dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; nfs3_call_state_t *cs = NULL; @@ -2811,7 +2814,7 @@ nfs3svc_mkdir_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t nfs3svc_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2990,7 +2993,7 @@ nfs3_symlink_reply(rpcsvc_request_t *req, nfsstat3 stat, struct nfs3_fh *fh, int32_t nfs3svc_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -3152,8 +3155,9 @@ nfs3_mknod_reply(rpcsvc_request_t *req, nfsstat3 stat, struct nfs3_fh *fh, int32_t nfs3svc_mknod_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preop, - struct iatt *postop, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *preop, struct iatt *postop, + dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; nfs3_call_state_t *cs = NULL; @@ -3176,7 +3180,7 @@ nfs3svc_mknod_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t nfs3svc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -3434,7 +3438,7 @@ nfs3_remove_reply(rpcsvc_request_t *req, nfsstat3 stat, struct iatt *preparent, int32_t nfs3svc_remove_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -3599,7 +3603,7 @@ nfs3_rmdir_reply(rpcsvc_request_t *req, nfsstat3 stat, struct iatt *preparent, int32_t nfs3svc_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -3752,7 +3756,7 @@ nfs3_rename_reply(rpcsvc_request_t *req, nfsstat3 stat, struct iatt *buf, int32_t nfs3svc_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -3959,7 +3963,7 @@ nfs3_link_reply(rpcsvc_request_t *req, nfsstat3 stat, struct iatt *buf, int32_t nfs3svc_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -4172,8 +4176,8 @@ nfs3_readdir_reply(rpcsvc_request_t *req, nfsstat3 stat, struct nfs3_fh *dirfh, int32_t nfs3svc_readdir_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *buf, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; int is_eof = 0; @@ -4223,7 +4227,7 @@ nfs3svc_readdir_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t nfs3svc_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -4331,7 +4335,7 @@ nfs3_readdir_read_resume(void *carg) int32_t nfs3svc_readdir_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { /* @@ -4554,7 +4558,7 @@ nfs3_fsstat_reply(rpcsvc_request_t *req, nfsstat3 stat, struct statvfs *fsbuf, int32_t nfs3_fsstat_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; @@ -4575,8 +4579,8 @@ nfs3_fsstat_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t nfs3_fsstat_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct statvfs *buf, dict_t *xdata) { nfs_user_t nfu = { 0, @@ -4735,7 +4739,7 @@ nfs3_fsinfo_reply(rpcsvc_request_t *req, nfsstat3 status, struct iatt *fsroot) int32_t nfs3svc_fsinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { nfsstat3 status = NFS3ERR_SERVERFAULT; @@ -4877,7 +4881,7 @@ nfs3_pathconf_reply(rpcsvc_request_t *req, nfsstat3 stat, struct iatt *buf) int32_t nfs3svc_pathconf_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) { struct iatt *sbuf = NULL; @@ -5025,7 +5029,7 @@ nfs3_commit_reply(rpcsvc_request_t *req, nfsstat3 stat, uint64_t wverf, int32_t nfs3svc_commit_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { nfsstat3 stat = NFS3ERR_SERVERFAULT; nfs3_call_state_t *cs = NULL; diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c index c909e3bc09..c974d0c6bc 100644 --- a/xlators/nfs/server/src/nlm4.c +++ b/xlators/nfs/server/src/nlm4.c @@ -523,7 +523,8 @@ typedef int (*nlm4_resume_fn_t)(void *cs); int32_t nlm4_file_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { nfs3_call_state_t *cs = frame->local; @@ -779,7 +780,7 @@ nlm4_test_reply(nfs3_call_state_t *cs, nlm4_stats stat, struct gf_flock *flock) int nlm4svc_test_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *flock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *flock, dict_t *xdata) { nlm4_stats stat = nlm4_denied; @@ -1390,7 +1391,7 @@ nlm_search_and_add(fd_t *fd, char *caller_name) int nlm4svc_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *flock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *flock, dict_t *xdata) { nlm4_stats stat = nlm4_denied; @@ -1594,7 +1595,7 @@ nlm4svc_nm_lock(rpcsvc_request_t *req) int nlm4svc_cancel_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *flock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *flock, dict_t *xdata) { nlm4_stats stat = nlm4_denied; @@ -1753,7 +1754,7 @@ nlm4svc_cancel(rpcsvc_request_t *req) int nlm4svc_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *flock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *flock, dict_t *xdata) { nlm4_stats stat = nlm4_denied; diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 9375d29c17..f8e71437ed 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -80,7 +80,8 @@ ioc_get_inode (dict_t *dict, char *name) int ioc_update_pages(call_frame_t *frame, ioc_inode_t *ioc_inode, - struct iovec *vector, int32_t count, int op_ret, off_t offset) + struct iovec *vector, int32_t count, gf_return_t op_ret, + off_t offset) { size_t size = 0; off_t rounded_offset = 0, rounded_end = 0, trav_offset = 0, @@ -195,7 +196,7 @@ ioc_inode_flush(ioc_inode_t *ioc_inode) int32_t ioc_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preop, + gf_return_t op_ret, int32_t op_errno, struct iatt *preop, struct iatt *postop, dict_t *xdata) { STACK_UNWIND_STRICT(setattr, frame, op_ret, op_errno, preop, postop, xdata); @@ -279,7 +280,7 @@ ioc_inode_update(xlator_t *this, inode_t *inode, char *path, struct iatt *iabuf) int32_t ioc_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xdata, struct iatt *postparent) { ioc_local_t *local = NULL; @@ -398,7 +399,7 @@ ioc_invalidate(xlator_t *this, inode_t *inode) */ int32_t ioc_cache_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, dict_t *xdata) { ioc_local_t *local = NULL; @@ -590,8 +591,8 @@ ioc_get_priority(ioc_table_t *table, const char *path) * */ int32_t -ioc_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +ioc_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { uint64_t tmp_ioc_inode = 0; ioc_local_t *local = NULL; @@ -669,7 +670,7 @@ ioc_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, */ int32_t ioc_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -750,9 +751,10 @@ ioc_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int32_t -ioc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +ioc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { ioc_local_t *local = NULL; ioc_table_t *table = NULL; @@ -1217,7 +1219,7 @@ ioc_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, */ int32_t ioc_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { ioc_local_t *local = NULL; @@ -1302,7 +1304,7 @@ ioc_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, */ int32_t ioc_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { STACK_UNWIND_STRICT(truncate, frame, op_ret, op_errno, prebuf, postbuf, @@ -1323,7 +1325,7 @@ ioc_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t ioc_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { STACK_UNWIND_STRICT(ftruncate, frame, op_ret, op_errno, prebuf, postbuf, @@ -1382,8 +1384,9 @@ ioc_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } int32_t -ioc_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct gf_flock *lock, dict_t *xdata) +ioc_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, + dict_t *xdata) { STACK_UNWIND_STRICT(lk, frame, op_ret, op_errno, lock, xdata); return 0; @@ -1418,8 +1421,9 @@ ioc_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, } int -ioc_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, gf_dirent_t *entries, dict_t *xdata) +ioc_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, + dict_t *xdata) { gf_dirent_t *entry = NULL; char *path = NULL; @@ -1459,7 +1463,7 @@ ioc_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, static int32_t ioc_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { STACK_UNWIND_STRICT(discard, frame, op_ret, op_errno, pre, post, xdata); @@ -1484,7 +1488,7 @@ ioc_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, static int32_t ioc_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { STACK_UNWIND_STRICT(zerofill, frame, op_ret, op_errno, pre, post, xdata); diff --git a/xlators/performance/io-cache/src/io-cache.h b/xlators/performance/io-cache/src/io-cache.h index 14923c75ed..ad0949b3e2 100644 --- a/xlators/performance/io-cache/src/io-cache.h +++ b/xlators/performance/io-cache/src/io-cache.h @@ -70,7 +70,7 @@ struct ioc_local { loc_t file_loc; off_t offset; size_t size; - int32_t op_ret; + gf_return_t op_ret; int32_t op_errno; struct list_head fill_list; /* list of ioc_fill structures */ off_t pending_offset; /* @@ -178,9 +178,9 @@ ptr_to_str(void *ptr); int32_t ioc_readv_disabled_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, - int32_t count, struct iatt *stbuf, struct iobref *iobref, - dict_t *xdata); + gf_return_t op_ret, int32_t op_errno, + struct iovec *vector, int32_t count, struct iatt *stbuf, + struct iobref *iobref, dict_t *xdata); ioc_page_t * __ioc_page_get(ioc_inode_t *ioc_inode, off_t offset); @@ -202,7 +202,7 @@ void ioc_page_flush(ioc_page_t *page); ioc_waitq_t * -__ioc_page_error(ioc_page_t *page, int32_t op_ret, int32_t op_errno); +__ioc_page_error(ioc_page_t *page, gf_return_t op_ret, int32_t op_errno); void ioc_frame_return(call_frame_t *frame); diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c index 84b1ae6cb2..805560186f 100644 --- a/xlators/performance/io-cache/src/page.c +++ b/xlators/performance/io-cache/src/page.c @@ -399,9 +399,10 @@ ioc_waitq_return(ioc_waitq_t *waitq) } int -ioc_fault_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iovec *vector, int32_t count, - struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) +ioc_fault_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, + int32_t count, struct iatt *stbuf, struct iobref *iobref, + dict_t *xdata) { ioc_local_t *local = NULL; off_t offset = 0; @@ -563,7 +564,7 @@ ioc_page_fault(ioc_inode_t *ioc_inode, call_frame_t *frame, fd_t *fd, call_frame_t *fault_frame = NULL; ioc_local_t *fault_local = NULL; ioc_local_t *local = NULL; - int32_t op_ret = -1, op_errno = -1; + gf_return_t op_ret = -1, op_errno = -1; ioc_waitq_t *waitq = NULL; ioc_page_t *page = NULL; @@ -785,7 +786,7 @@ ioc_frame_unwind(call_frame_t *frame) struct iatt stbuf = { 0, }; - int32_t op_ret = 0, op_errno = 0; + gf_return_t op_ret = 0, op_errno = 0; GF_ASSERT(frame); @@ -957,7 +958,7 @@ __ioc_page_wakeup(ioc_page_t *page, int32_t op_errno) * */ ioc_waitq_t * -__ioc_page_error(ioc_page_t *page, int32_t op_ret, int32_t op_errno) +__ioc_page_error(ioc_page_t *page, gf_return_t op_ret, int32_t op_errno) { ioc_waitq_t *waitq = NULL, *trav = NULL; call_frame_t *frame = NULL; @@ -1006,7 +1007,7 @@ __ioc_page_error(ioc_page_t *page, int32_t op_ret, int32_t op_errno) * */ ioc_waitq_t * -ioc_page_error(ioc_page_t *page, int32_t op_ret, int32_t op_errno) +ioc_page_error(ioc_page_t *page, gf_return_t op_ret, int32_t op_errno) { ioc_waitq_t *waitq = NULL; struct ioc_inode *inode = NULL; diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 3d24cc97f4..ce844ae239 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -609,7 +609,7 @@ iot_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, iot_conf_t *conf = NULL; dict_t *depths = NULL; int i = 0; - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; conf = this->private; diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index a405be51f0..c1a626cdf1 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -1132,7 +1132,7 @@ mdc_prepare_request(xlator_t *this, mdc_local_t *local, dict_t *xdata) int mdc_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { struct mdc_conf *conf = this->private; @@ -1204,7 +1204,7 @@ mdc_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int mdc_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, dict_t *dict, struct iatt *postparent) { mdc_local_t *local = NULL; @@ -1326,8 +1326,9 @@ mdc_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } int -mdc_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +mdc_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { mdc_local_t *local = NULL; @@ -1397,8 +1398,9 @@ mdc_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } int -mdc_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +mdc_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { mdc_local_t *local = NULL; @@ -1464,7 +1466,7 @@ mdc_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) int mdc_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { mdc_local_t *local = NULL; @@ -1508,7 +1510,7 @@ mdc_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, int mdc_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { mdc_local_t *local = NULL; @@ -1552,9 +1554,10 @@ mdc_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } int -mdc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +mdc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { mdc_local_t *local = NULL; @@ -1603,9 +1606,10 @@ mdc_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, } int -mdc_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +mdc_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { mdc_local_t *local = NULL; @@ -1655,7 +1659,7 @@ mdc_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int mdc_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { mdc_local_t *local = NULL; @@ -1713,9 +1717,9 @@ mdc_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t xflag, } int -mdc_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +mdc_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { mdc_local_t *local = NULL; @@ -1769,7 +1773,7 @@ mdc_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, int mdc_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1830,7 +1834,7 @@ mdc_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, int mdc_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -1891,9 +1895,10 @@ mdc_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } int -mdc_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +mdc_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { mdc_local_t *local = NULL; @@ -1944,7 +1949,7 @@ mdc_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, int mdc_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1996,8 +2001,8 @@ mdc_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, } static int -mdc_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +mdc_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { mdc_local_t *local = NULL; @@ -2045,9 +2050,10 @@ mdc_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, fd_t *fd, } int -mdc_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iovec *vector, int32_t count, - struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) +mdc_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, + int32_t count, struct iatt *stbuf, struct iobref *iobref, + dict_t *xdata) { mdc_local_t *local = NULL; @@ -2088,7 +2094,7 @@ mdc_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int mdc_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { mdc_local_t *local = NULL; @@ -2132,7 +2138,7 @@ mdc_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, int mdc_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { mdc_local_t *local = NULL; @@ -2207,7 +2213,7 @@ mdc_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, int mdc_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { mdc_local_t *local = NULL; @@ -2282,9 +2288,9 @@ mdc_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, } int -mdc_fsync_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) +mdc_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { mdc_local_t *local = NULL; @@ -2325,7 +2331,7 @@ mdc_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, int mdc_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { mdc_local_t *local = NULL; struct iatt prestat = { @@ -2384,7 +2390,7 @@ mdc_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr, int mdc_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { mdc_local_t *local = NULL; struct iatt prestat = { @@ -2443,7 +2449,8 @@ mdc_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xattr, int mdc_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, + dict_t *xdata) { mdc_local_t *local = NULL; @@ -2531,7 +2538,7 @@ mdc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, int mdc_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xattr, + gf_return_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) { mdc_local_t *local = NULL; @@ -2619,7 +2626,7 @@ mdc_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *key, int mdc_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { mdc_local_t *local = NULL; struct iatt prestat = { @@ -2718,7 +2725,7 @@ mdc_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int mdc_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { mdc_local_t *local = NULL; struct iatt prestat = { @@ -2818,7 +2825,7 @@ mdc_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mdc_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { mdc_local_t *local = NULL; @@ -2863,8 +2870,9 @@ mdc_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, } int -mdc_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, gf_dirent_t *entries, dict_t *xdata) +mdc_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, + dict_t *xdata) { gf_dirent_t *entry = NULL; mdc_local_t *local = NULL; @@ -2923,8 +2931,9 @@ mdc_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } int -mdc_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, gf_dirent_t *entries, dict_t *xdata) +mdc_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, + dict_t *xdata) { mdc_local_t *local = NULL; @@ -2978,7 +2987,7 @@ mdc_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int mdc_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { mdc_local_t *local = NULL; @@ -3023,7 +3032,7 @@ mdc_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, int mdc_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { mdc_local_t *local = NULL; @@ -3066,7 +3075,7 @@ mdc_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int mdc_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { mdc_local_t *local = NULL; @@ -3109,7 +3118,7 @@ mdc_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t mdc_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *path, + gf_return_t op_ret, int32_t op_errno, const char *path, struct iatt *buf, dict_t *xdata) { mdc_local_t *local = NULL; @@ -3152,7 +3161,7 @@ mdc_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, int32_t mdc_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { mdc_local_t *local = NULL; @@ -3194,7 +3203,7 @@ mdc_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, int32_t mdc_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { mdc_local_t *local = NULL; diff --git a/xlators/performance/nl-cache/src/nl-cache.c b/xlators/performance/nl-cache/src/nl-cache.c index 33a7c47166..a072b8cf25 100644 --- a/xlators/performance/nl-cache/src/nl-cache.c +++ b/xlators/performance/nl-cache/src/nl-cache.c @@ -101,7 +101,7 @@ nlc_dentry_op(call_frame_t *frame, xlator_t *this, gf_boolean_t multilink) static int32_t nlc_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -122,9 +122,10 @@ nlc_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } static int32_t -nlc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +nlc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { NLC_FOP_CBK(mknod, _gf_false, frame, cookie, this, op_ret, op_errno, inode, buf, preparent, postparent, xdata); @@ -142,7 +143,7 @@ nlc_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, static int32_t nlc_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -161,9 +162,10 @@ nlc_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } static int32_t -nlc_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +nlc_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { NLC_FOP_CBK(mkdir, _gf_false, frame, cookie, this, op_ret, op_errno, inode, buf, preparent, postparent, xdata); @@ -181,7 +183,7 @@ nlc_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, static int32_t nlc_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { nlc_local_t *local = NULL; @@ -250,9 +252,9 @@ nlc_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } static int32_t -nlc_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) +nlc_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { NLC_FOP_CBK(rmdir, _gf_false, frame, cookie, this, op_ret, op_errno, preparent, postparent, xdata); @@ -269,7 +271,8 @@ nlc_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, static int32_t nlc_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *dict, + dict_t *xdata) { nlc_conf_t *conf = NULL; @@ -292,7 +295,7 @@ static int32_t nlc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; dict_t *dict = NULL; nlc_local_t *local = NULL; @@ -346,7 +349,7 @@ nlc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, static int32_t nlc_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -365,9 +368,10 @@ nlc_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, } static int32_t -nlc_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +nlc_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { NLC_FOP_CBK(link, _gf_false, frame, cookie, this, op_ret, op_errno, inode, buf, preparent, postparent, xdata); @@ -385,7 +389,7 @@ nlc_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, static int32_t nlc_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { uint32_t link_count = 0; diff --git a/xlators/performance/open-behind/src/open-behind.c b/xlators/performance/open-behind/src/open-behind.c index 600c3b62ff..472998ee23 100644 --- a/xlators/performance/open-behind/src/open-behind.c +++ b/xlators/performance/open-behind/src/open-behind.c @@ -387,8 +387,8 @@ ob_resume_pending(struct list_head *list) } static void -ob_open_completed(xlator_t *xl, ob_inode_t *ob_inode, fd_t *fd, int32_t op_ret, - int32_t op_errno) +ob_open_completed(xlator_t *xl, ob_inode_t *ob_inode, fd_t *fd, + gf_return_t op_ret, int32_t op_errno) { struct list_head list; @@ -417,7 +417,7 @@ ob_open_completed(xlator_t *xl, ob_inode_t *ob_inode, fd_t *fd, int32_t op_ret, } static int32_t -ob_open_cbk(call_frame_t *frame, void *cookie, xlator_t *xl, int32_t op_ret, +ob_open_cbk(call_frame_t *frame, void *cookie, xlator_t *xl, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { ob_inode_t *ob_inode; diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 7fe4b3c3a4..13b239ccce 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -565,9 +565,9 @@ __qr_cache_is_fresh(xlator_t *this, qr_inode_t *qr_inode) } int -qr_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode_ret, struct iatt *buf, - dict_t *xdata, struct iatt *postparent) +qr_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode_ret, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { void *content = NULL; qr_inode_t *qr_inode = NULL; @@ -664,8 +664,9 @@ qr_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } int -qr_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, gf_dirent_t *entries, dict_t *xdata) +qr_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, + dict_t *xdata) { gf_dirent_t *entry = NULL; qr_inode_t *qr_inode = NULL; @@ -715,7 +716,7 @@ qr_readv_cached(call_frame_t *frame, qr_inode_t *qr_inode, size_t size, xlator_t *this = NULL; qr_private_t *priv = NULL; qr_inode_table_t *table = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; struct iobuf *iobuf = NULL; struct iobref *iobref = NULL; struct iovec iov = { @@ -807,9 +808,9 @@ qr_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } int32_t -qr_writev_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) +qr_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { qr_local_t *local = NULL; @@ -841,7 +842,7 @@ qr_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *iov, int32_t qr_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { qr_local_t *local = NULL; @@ -870,7 +871,7 @@ qr_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, int32_t qr_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { qr_local_t *local = NULL; @@ -899,7 +900,7 @@ qr_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t qr_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { qr_local_t *local = NULL; @@ -929,7 +930,7 @@ qr_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int keep_size, int32_t qr_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { qr_local_t *local = NULL; @@ -958,7 +959,7 @@ qr_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t qr_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *pre, + gf_return_t op_ret, int32_t op_errno, struct iatt *pre, struct iatt *post, dict_t *xdata) { qr_local_t *local = NULL; diff --git a/xlators/performance/read-ahead/src/page.c b/xlators/performance/read-ahead/src/page.c index 8a58ad8bb7..736627e6ef 100644 --- a/xlators/performance/read-ahead/src/page.c +++ b/xlators/performance/read-ahead/src/page.c @@ -123,9 +123,10 @@ ra_waitq_return(ra_waitq_t *waitq) } int -ra_fault_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iovec *vector, int32_t count, - struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) +ra_fault_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, + int32_t count, struct iatt *stbuf, struct iobref *iobref, + dict_t *xdata) { ra_local_t *local = NULL; off_t pending_offset = 0; @@ -249,7 +250,7 @@ ra_page_fault(ra_file_t *file, call_frame_t *frame, off_t offset) ra_local_t *fault_local = NULL; ra_page_t *page = NULL; ra_waitq_t *waitq = NULL; - int32_t op_ret = -1, op_errno = -1; + gf_return_t op_ret = -1, op_errno = -1; GF_VALIDATE_OR_GOTO("read-ahead", frame, out); GF_VALIDATE_OR_GOTO(frame->this->name, file, out); @@ -541,7 +542,7 @@ ra_page_purge(ra_page_t *page) * */ ra_waitq_t * -ra_page_error(ra_page_t *page, int32_t op_ret, int32_t op_errno) +ra_page_error(ra_page_t *page, gf_return_t op_ret, int32_t op_errno) { ra_waitq_t *waitq = NULL; ra_waitq_t *trav = NULL; diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index 5246e1317d..c4de1b2ba5 100644 --- a/xlators/performance/read-ahead/src/read-ahead.c +++ b/xlators/performance/read-ahead/src/read-ahead.c @@ -29,8 +29,8 @@ static void read_ahead(call_frame_t *frame, ra_file_t *file); int -ra_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, dict_t *xdata) +ra_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { ra_conf_t *conf = NULL; ra_file_t *file = NULL; @@ -102,9 +102,10 @@ ra_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, } int -ra_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, dict_t *xdata) +ra_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent, + dict_t *xdata) { ra_conf_t *conf = NULL; ra_file_t *file = NULL; @@ -326,7 +327,7 @@ read_ahead(call_frame_t *frame, ra_file_t *file) int ra_need_atime_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -425,9 +426,9 @@ dispatch_requests(call_frame_t *frame, ra_file_t *file) int ra_readv_disabled_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, - int32_t count, struct iatt *stbuf, struct iobref *iobref, - dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iovec *vector, int32_t count, struct iatt *stbuf, + struct iobref *iobref, dict_t *xdata) { GF_ASSERT(frame); @@ -532,8 +533,8 @@ ra_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } int -ra_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, dict_t *xdata) +ra_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { GF_ASSERT(frame); STACK_UNWIND_STRICT(flush, frame, op_ret, op_errno, xdata); @@ -541,9 +542,9 @@ ra_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, } int -ra_fsync_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) +ra_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { GF_ASSERT(frame); STACK_UNWIND_STRICT(fsync, frame, op_ret, op_errno, prebuf, postbuf, xdata); @@ -588,9 +589,9 @@ ra_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, } int -ra_writev_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) +ra_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { ra_file_t *file = NULL; @@ -660,7 +661,7 @@ ra_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, int ra_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { GF_ASSERT(frame); @@ -671,8 +672,9 @@ ra_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int -ra_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf, dict_t *xdata) +ra_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { GF_ASSERT(frame); @@ -911,7 +913,7 @@ ra_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int ra_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { GF_ASSERT(frame); @@ -963,7 +965,7 @@ ra_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int ra_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { GF_ASSERT(frame); diff --git a/xlators/performance/read-ahead/src/read-ahead.h b/xlators/performance/read-ahead/src/read-ahead.h index e9432fb47c..3003942584 100644 --- a/xlators/performance/read-ahead/src/read-ahead.h +++ b/xlators/performance/read-ahead/src/read-ahead.h @@ -44,7 +44,7 @@ struct ra_local { struct ra_fill fill; off_t offset; size_t size; - int32_t op_ret; + gf_return_t op_ret; int32_t op_errno; off_t pending_offset; size_t pending_size; @@ -120,7 +120,7 @@ void ra_page_flush(ra_page_t *page); ra_waitq_t * -ra_page_error(ra_page_t *page, int32_t op_ret, int32_t op_errno); +ra_page_error(ra_page_t *page, gf_return_t op_ret, int32_t op_errno); void ra_page_purge(ra_page_t *page); diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.c b/xlators/performance/readdir-ahead/src/readdir-ahead.c index 4ba7ee7077..0762e195f3 100644 --- a/xlators/performance/readdir-ahead/src/readdir-ahead.c +++ b/xlators/performance/readdir-ahead/src/readdir-ahead.c @@ -480,7 +480,7 @@ rda_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, static int32_t rda_fill_fd_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { gf_dirent_t *dirent = NULL; @@ -714,7 +714,7 @@ rda_fill_fd(call_frame_t *frame, xlator_t *this, fd_t *fd) static int32_t rda_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { if (!op_ret) rda_fill_fd(frame, this, fd); @@ -756,7 +756,7 @@ rda_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, static int32_t rda_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct rda_local *local = NULL; @@ -792,7 +792,7 @@ rda_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, static int32_t rda_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct rda_local *local = NULL; @@ -825,7 +825,7 @@ rda_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t keep_size, static int32_t rda_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct rda_local *local = NULL; @@ -858,7 +858,7 @@ rda_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, static int32_t rda_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct rda_local *local = NULL; @@ -891,7 +891,7 @@ rda_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, static int32_t rda_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct rda_local *local = NULL; @@ -924,7 +924,7 @@ rda_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, static int32_t rda_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { struct rda_local *local = NULL; @@ -957,7 +957,7 @@ rda_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, static int32_t rda_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct rda_local *local = NULL; @@ -984,7 +984,7 @@ rda_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, static int32_t rda_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct rda_local *local = NULL; @@ -1011,7 +1011,7 @@ rda_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, static int32_t rda_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { struct rda_local *local = NULL; @@ -1044,7 +1044,7 @@ rda_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, static int32_t rda_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { struct rda_local *local = NULL; @@ -1077,7 +1077,7 @@ rda_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, static int32_t rda_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct rda_local *local = NULL; @@ -1104,7 +1104,7 @@ rda_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, static int32_t rda_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { struct rda_local *local = NULL; diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 00cfca016e..b88b0e2159 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -148,7 +148,7 @@ typedef struct wb_request { amount by which we shrink the window. */ - int op_ret; + gf_return_t op_ret; int op_errno; int32_t refcount; @@ -1062,7 +1062,7 @@ wb_fulfill_short_write(wb_request_t *head, int size) int wb_fulfill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { wb_inode_t *wb_inode = NULL; @@ -1805,9 +1805,9 @@ wb_set_inode_size(wb_inode_t *wb_inode, struct iatt *postbuf) } int -wb_writev_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) +wb_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf, dict_t *xdata) { wb_request_t *req = NULL; wb_inode_t *wb_inode; @@ -1954,7 +1954,7 @@ wb_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int wb_flush_bg_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { STACK_DESTROY(frame->root); return 0; @@ -1967,7 +1967,7 @@ wb_flush_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) wb_inode_t *wb_inode = NULL; call_frame_t *bg_frame = NULL; int32_t op_errno = 0; - int op_ret = 0; + gf_return_t op_ret = 0; conf = this->private; @@ -2168,7 +2168,7 @@ wb_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) int32_t wb_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { GF_ASSERT(frame->local); @@ -2227,7 +2227,7 @@ wb_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, int32_t wb_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { GF_ASSERT(frame->local); @@ -2425,9 +2425,9 @@ wb_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } int32_t -wb_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, - struct iatt *postparent) +wb_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { if (op_ret == 0) { wb_inode_t *wb_inode = wb_inode_ctx_get(this, inode); @@ -2535,7 +2535,7 @@ wb_mark_readdirp_end(xlator_t *this, inode_t *directory) int32_t wb_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { wb_inode_t *wb_inode = NULL; diff --git a/xlators/playground/rot-13/src/rot-13.c b/xlators/playground/rot-13/src/rot-13.c index 0f45ee3196..28d7e35b13 100644 --- a/xlators/playground/rot-13/src/rot-13.c +++ b/xlators/playground/rot-13/src/rot-13.c @@ -46,7 +46,7 @@ rot13_iovec(struct iovec *vector, int count) int32_t rot13_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -71,7 +71,7 @@ rot13_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int32_t rot13_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, prebuf, postbuf, diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index ea5ef5c180..5a30c934f4 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -697,7 +697,7 @@ client_setvolume_cbk(struct rpc_req *req, struct iovec *iov, int count, 0, }; int ret = 0; - int32_t op_ret = 0; + gf_return_t op_ret = 0; int32_t op_errno = 0; gf_boolean_t auth_fail = _gf_false; glusterfs_ctx_t *ctx = NULL; diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c index f402121c15..f6199f2a17 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -4614,7 +4614,7 @@ client3_3_getxattr(call_frame_t *frame, xlator_t *this, void *data) }; dict_t *dict = NULL; int ret = 0; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int op_errno = ESTALE; int count = 0; clnt_local_t *local = NULL; diff --git a/xlators/protocol/client/src/client-rpc-fops_v2.c b/xlators/protocol/client/src/client-rpc-fops_v2.c index 0d80d4e8ef..9dfcff3e6c 100644 --- a/xlators/protocol/client/src/client-rpc-fops_v2.c +++ b/xlators/protocol/client/src/client-rpc-fops_v2.c @@ -4379,7 +4379,7 @@ client4_0_getxattr(call_frame_t *frame, xlator_t *this, void *data) }; dict_t *dict = NULL; int ret = 0; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int op_errno = ESTALE; clnt_local_t *local = NULL; diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 0f31fea951..58140fa1de 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -1195,7 +1195,7 @@ client_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int32_t flags, dict_t *xdata) { int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = ENOTCONN; int need_unwind = 0; clnt_conf_t *conf = NULL; diff --git a/xlators/protocol/server/src/server-common.c b/xlators/protocol/server/src/server-common.c index cd79cf4d93..4f60942b0f 100644 --- a/xlators/protocol/server/src/server-common.c +++ b/xlators/protocol/server/src/server-common.c @@ -353,7 +353,7 @@ server_post_open(call_frame_t *frame, xlator_t *this, gfs3_open_rsp *rsp, } void -server_post_readv(gfs3_read_rsp *rsp, struct iatt *stbuf, int op_ret) +server_post_readv(gfs3_read_rsp *rsp, struct iatt *stbuf, gf_return_t op_ret) { gf_stat_from_iatt(&rsp->stat, stbuf); rsp->size = op_ret; @@ -716,7 +716,7 @@ server4_post_open(call_frame_t *frame, xlator_t *this, gfx_open_rsp *rsp, } void -server4_post_readv(gfx_read_rsp *rsp, struct iatt *stbuf, int op_ret) +server4_post_readv(gfx_read_rsp *rsp, struct iatt *stbuf, gf_return_t op_ret) { gfx_stat_from_iattx(&rsp->stat, stbuf); rsp->size = op_ret; diff --git a/xlators/protocol/server/src/server-common.h b/xlators/protocol/server/src/server-common.h index 6200415e30..2e81465ecb 100644 --- a/xlators/protocol/server/src/server-common.h +++ b/xlators/protocol/server/src/server-common.h @@ -107,7 +107,7 @@ int server_post_open(call_frame_t *frame, xlator_t *this, gfs3_open_rsp *rsp, fd_t *fd); void -server_post_readv(gfs3_read_rsp *rsp, struct iatt *stbuf, int op_ret); +server_post_readv(gfs3_read_rsp *rsp, struct iatt *stbuf, gf_return_t op_ret); int server_post_opendir(call_frame_t *frame, xlator_t *this, gfs3_opendir_rsp *rsp, @@ -160,7 +160,7 @@ int server4_post_open(call_frame_t *frame, xlator_t *this, gfx_open_rsp *rsp, fd_t *fd); void -server4_post_readv(gfx_read_rsp *rsp, struct iatt *stbuf, int op_ret); +server4_post_readv(gfx_read_rsp *rsp, struct iatt *stbuf, gf_return_t op_ret); int server4_post_create(call_frame_t *frame, gfx_create_rsp *rsp, diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index 85c87c1ab8..aa64bda82d 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -238,7 +238,7 @@ server_setvolume(rpcsvc_request_t *req) char *msg = NULL; xlator_t *this = NULL; int32_t ret = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; uint32_t opversion = 0; rpc_transport_t *xprt = NULL; diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index 6e644912a4..f26548e03a 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -224,7 +224,7 @@ free_state(server_state_t *state) static int server_connection_cleanup_flush_cbk(call_frame_t *frame, void *cookie, - xlator_t *this, int32_t op_ret, + xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { int32_t ret = -1; @@ -783,7 +783,7 @@ server_resolve_is_empty(server_resolve_t *resolve) } void -server_print_reply(call_frame_t *frame, int op_ret, int op_errno) +server_print_reply(call_frame_t *frame, gf_return_t op_ret, int op_errno) { server_conf_t *conf = NULL; server_state_t *state = NULL; diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c index ec768acba4..55b31894f3 100644 --- a/xlators/protocol/server/src/server-resolve.c +++ b/xlators/protocol/server/src/server-resolve.c @@ -41,7 +41,7 @@ resolve_loc_touchup(call_frame_t *frame) int resolve_gfid_entry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { server_state_t *state = NULL; @@ -102,9 +102,9 @@ resolve_gfid_entry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int -resolve_gfid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, - struct iatt *postparent) +resolve_gfid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { server_state_t *state = NULL; server_resolve_t *resolve = NULL; diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c index 4d8b7be5a3..33563a21cb 100644 --- a/xlators/protocol/server/src/server-rpc-fops.c +++ b/xlators/protocol/server/src/server-rpc-fops.c @@ -57,7 +57,7 @@ set_resolve_gfid(client_t *client, uuid_t resolve_gfid, char *on_wire_gfid) /* Callback function section */ int server_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { gfs3_statfs_rsp rsp = { @@ -93,7 +93,7 @@ server_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xdata, struct iatt *postparent) { rpcsvc_request_t *req = NULL; @@ -193,7 +193,7 @@ server_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_lease *lease, + gf_return_t op_ret, int32_t op_errno, struct gf_lease *lease, dict_t *xdata) { gfs3_lease_rsp rsp = { @@ -231,8 +231,9 @@ server_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } int -server_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct gf_flock *lock, dict_t *xdata) +server_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, + dict_t *xdata) { gfs3_lk_rsp rsp = { 0, @@ -272,7 +273,7 @@ server_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int server_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -312,7 +313,7 @@ server_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -352,7 +353,7 @@ server_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -392,7 +393,7 @@ server_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -432,7 +433,7 @@ server_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -470,7 +471,7 @@ server_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { gfs3_rmdir_rsp rsp = { @@ -512,7 +513,7 @@ server_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -555,7 +556,7 @@ server_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -598,7 +599,7 @@ server_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -637,7 +638,7 @@ server_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { gfs3_readdir_rsp rsp = { @@ -690,7 +691,8 @@ server_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { server_state_t *state = NULL; rpcsvc_request_t *req = NULL; @@ -735,7 +737,7 @@ server_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -785,7 +787,7 @@ server_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -830,7 +832,7 @@ server_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { gfs3_getxattr_rsp rsp = { @@ -875,7 +877,7 @@ server_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { gfs3_fgetxattr_rsp rsp = { @@ -940,7 +942,7 @@ _gf_server_log_setxattr_failure(dict_t *d, char *k, data_t *v, void *tmp) int server_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -1010,7 +1012,7 @@ _gf_server_log_fsetxattr_failure(dict_t *d, char *k, data_t *v, void *tmp) int server_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -1059,7 +1061,7 @@ server_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -1112,7 +1114,7 @@ server_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { gfs3_unlink_rsp rsp = { @@ -1168,7 +1170,7 @@ server_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1212,7 +1214,7 @@ server_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1264,7 +1266,7 @@ server_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { gfs3_truncate_rsp rsp = { @@ -1305,7 +1307,7 @@ server_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, dict_t *xdata) { gfs3_fstat_rsp rsp = { @@ -1347,7 +1349,7 @@ server_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { gfs3_ftruncate_rsp rsp = {0}; @@ -1387,7 +1389,7 @@ server_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -1426,7 +1428,7 @@ server_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { gfs3_fsync_rsp rsp = { @@ -1468,7 +1470,7 @@ server_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { gfs3_write_rsp rsp = { @@ -1510,7 +1512,7 @@ server_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -1563,8 +1565,9 @@ server_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, - uint8_t *strong_checksum, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + uint32_t weak_checksum, uint8_t *strong_checksum, + dict_t *xdata) { gfs3_rchecksum_rsp rsp = { 0, @@ -1604,7 +1607,7 @@ server_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { server_state_t *state = NULL; rpcsvc_request_t *req = NULL; @@ -1643,8 +1646,8 @@ server_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *stbuf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { server_state_t *state = NULL; @@ -1703,7 +1706,7 @@ server_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *buf, + gf_return_t op_ret, int32_t op_errno, const char *buf, struct iatt *stbuf, dict_t *xdata) { gfs3_readlink_rsp rsp = { @@ -1745,7 +1748,7 @@ server_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, dict_t *xdata) { gfs3_stat_rsp rsp = { @@ -1784,7 +1787,7 @@ server_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { gfs3_setattr_rsp rsp = { @@ -1825,7 +1828,7 @@ server_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { gfs3_fsetattr_rsp rsp = { @@ -1867,7 +1870,7 @@ server_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { gfs3_xattrop_rsp rsp = { @@ -1912,7 +1915,7 @@ server_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { gfs3_xattrop_rsp rsp = { @@ -1957,7 +1960,7 @@ server_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { gfs3_readdirp_rsp rsp = { @@ -2014,7 +2017,7 @@ server_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { gfs3_fallocate_rsp rsp = { @@ -2056,7 +2059,7 @@ server_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { gfs3_discard_rsp rsp = { @@ -2098,7 +2101,7 @@ server_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { gfs3_zerofill_rsp rsp = { @@ -2141,7 +2144,7 @@ server_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gf_common_rsp rsp = { 0, @@ -2180,7 +2183,8 @@ server_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, off_t offset, + dict_t *xdata) { struct gfs3_seek_rsp rsp = { 0, @@ -2221,7 +2225,7 @@ server_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int server_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfs3_setactivelk_rsp rsp = { 0, @@ -2266,7 +2270,7 @@ int server_rchecksum_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = EINVAL; state = CALL_STATE(frame); @@ -2334,7 +2338,7 @@ int server_rename_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; state = CALL_STATE(frame); @@ -2364,7 +2368,7 @@ int server_link_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; state = CALL_STATE(frame); @@ -3286,7 +3290,7 @@ server_seek_resume(call_frame_t *frame, xlator_t *bound_xl) static int server_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, lock_migration_info_t *locklist, dict_t *xdata) { gfs3_getactivelk_rsp rsp = { diff --git a/xlators/protocol/server/src/server-rpc-fops_v2.c b/xlators/protocol/server/src/server-rpc-fops_v2.c index c267f8f783..abf66b924a 100644 --- a/xlators/protocol/server/src/server-rpc-fops_v2.c +++ b/xlators/protocol/server/src/server-rpc-fops_v2.c @@ -45,7 +45,7 @@ rpc_receive_common(rpcsvc_request_t *req, call_frame_t **fr, /* Callback function section */ int server4_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct statvfs *buf, + gf_return_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) { gfx_statfs_rsp rsp = { @@ -80,7 +80,7 @@ server4_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xdata, struct iatt *postparent) { rpcsvc_request_t *req = NULL; @@ -174,7 +174,7 @@ server4_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_lease *lease, + gf_return_t op_ret, int32_t op_errno, struct gf_lease *lease, dict_t *xdata) { gfx_lease_rsp rsp = { @@ -210,7 +210,7 @@ server4_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct gf_flock *lock, + gf_return_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { gfx_lk_rsp rsp = { @@ -248,7 +248,7 @@ server4_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -285,7 +285,7 @@ server4_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -322,7 +322,7 @@ server4_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -359,7 +359,7 @@ server4_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -396,7 +396,7 @@ server4_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -432,7 +432,7 @@ server4_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { gfx_common_2iatt_rsp rsp = { @@ -473,7 +473,7 @@ server4_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -514,7 +514,7 @@ server4_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -555,7 +555,7 @@ server4_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -591,7 +591,7 @@ server4_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { gfx_readdir_rsp rsp = { @@ -641,7 +641,8 @@ server4_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + dict_t *xdata) { server_state_t *state = NULL; rpcsvc_request_t *req = NULL; @@ -683,7 +684,7 @@ server4_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -725,7 +726,7 @@ server4_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -762,7 +763,7 @@ server4_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { gfx_common_dict_rsp rsp = { @@ -802,7 +803,7 @@ server4_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { gfx_common_dict_rsp rsp = { @@ -842,7 +843,7 @@ server4_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -882,7 +883,7 @@ server4_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -922,7 +923,7 @@ server4_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) @@ -974,7 +975,7 @@ server4_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { gfx_common_2iatt_rsp rsp = { @@ -1022,7 +1023,7 @@ server4_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1064,7 +1065,7 @@ server4_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1114,7 +1115,7 @@ server4_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { gfx_common_2iatt_rsp rsp = { @@ -1152,7 +1153,7 @@ server4_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, dict_t *xdata) { gfx_common_iatt_rsp rsp = { @@ -1191,7 +1192,7 @@ server4_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { gfx_common_2iatt_rsp rsp = {0}; @@ -1228,7 +1229,7 @@ server4_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -1264,7 +1265,7 @@ server4_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { gfx_common_2iatt_rsp rsp = { @@ -1303,7 +1304,7 @@ server4_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { gfx_common_2iatt_rsp rsp = { @@ -1342,7 +1343,7 @@ server4_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iovec *vector, + gf_return_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { @@ -1392,8 +1393,9 @@ server4_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, - uint8_t *strong_checksum, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + uint32_t weak_checksum, uint8_t *strong_checksum, + dict_t *xdata) { gfx_rchecksum_rsp rsp = { 0, @@ -1430,7 +1432,7 @@ server4_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { server_state_t *state = NULL; rpcsvc_request_t *req = NULL; @@ -1468,8 +1470,8 @@ server4_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, - struct iatt *stbuf, struct iatt *preparent, + gf_return_t op_ret, int32_t op_errno, fd_t *fd, + inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { server_state_t *state = NULL; @@ -1526,7 +1528,7 @@ server4_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, const char *buf, + gf_return_t op_ret, int32_t op_errno, const char *buf, struct iatt *stbuf, dict_t *xdata) { gfx_readlink_rsp rsp = { @@ -1565,7 +1567,7 @@ server4_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, dict_t *xdata) { gfx_common_iatt_rsp rsp = { @@ -1603,7 +1605,7 @@ server4_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { gfx_common_2iatt_rsp rsp = { @@ -1642,7 +1644,7 @@ server4_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { gfx_common_2iatt_rsp rsp = { @@ -1681,7 +1683,7 @@ server4_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { gfx_common_dict_rsp rsp = { @@ -1721,7 +1723,7 @@ server4_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict, + gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { gfx_common_dict_rsp rsp = { @@ -1762,7 +1764,7 @@ server4_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { gfx_readdirp_rsp rsp = { @@ -1816,8 +1818,9 @@ server4_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, - struct iatt *statpost, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, + struct iatt *statpre, struct iatt *statpost, + dict_t *xdata) { gfx_common_2iatt_rsp rsp = { 0, @@ -1855,7 +1858,7 @@ server4_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { gfx_common_2iatt_rsp rsp = { @@ -1894,7 +1897,7 @@ server4_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *statpre, + gf_return_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, dict_t *xdata) { gfx_common_2iatt_rsp rsp = { @@ -1934,7 +1937,7 @@ server4_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -1971,7 +1974,8 @@ server4_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, off_t offset, + dict_t *xdata) { struct gfx_seek_rsp rsp = { 0, @@ -2009,7 +2013,7 @@ server4_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static int server4_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *xdata) + gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { gfx_common_rsp rsp = { 0, @@ -2047,7 +2051,7 @@ server4_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_namelink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + gf_return_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { gfx_common_2iatt_rsp rsp = { @@ -2082,7 +2086,7 @@ server4_namelink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xdata) { server_state_t *state = NULL; @@ -2137,7 +2141,7 @@ server4_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, inode_t *inode, + gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -2185,7 +2189,7 @@ server4_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int server4_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, struct iatt *stbuf, struct iatt *prebuf_dst, struct iatt *postbuf_dst, dict_t *xdata) { @@ -2246,7 +2250,7 @@ int server4_rchecksum_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = EINVAL; state = CALL_STATE(frame); @@ -2339,7 +2343,7 @@ int server4_rename_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; state = CALL_STATE(frame); @@ -2369,7 +2373,7 @@ int server4_link_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; state = CALL_STATE(frame); @@ -3291,7 +3295,7 @@ server4_seek_resume(call_frame_t *frame, xlator_t *bound_xl) static int server4_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, + gf_return_t op_ret, int32_t op_errno, lock_migration_info_t *locklist, dict_t *xdata) { gfx_getactivelk_rsp rsp = { diff --git a/xlators/protocol/server/src/server.h b/xlators/protocol/server/src/server.h index 821290b62d..70f38ce5b1 100644 --- a/xlators/protocol/server/src/server.h +++ b/xlators/protocol/server/src/server.h @@ -104,7 +104,7 @@ typedef struct { u_char pargfid[16]; char *path; char *bname; - int op_ret; + gf_return_t op_ret; int op_errno; loc_t resolve_loc; } server_resolve_t; diff --git a/xlators/storage/posix/src/posix-aio.c b/xlators/storage/posix/src/posix-aio.c index d0cb0002bb..e0a5d1bb93 100644 --- a/xlators/storage/posix/src/posix-aio.c +++ b/xlators/storage/posix/src/posix-aio.c @@ -76,7 +76,7 @@ posix_aio_readv_complete(struct posix_aio_cb *paiocb, int res, int res2) 0, }; int _fd = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = 0; struct iovec iov; struct iobref *iobref = NULL; @@ -254,7 +254,7 @@ posix_aio_writev_complete(struct posix_aio_cb *paiocb, int res, int res2) 0, }; int _fd = -1; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = 0; int ret = 0; struct posix_private *priv = NULL; diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c index f10722ec3f..00e0d02f85 100644 --- a/xlators/storage/posix/src/posix-common.c +++ b/xlators/storage/posix/src/posix-common.c @@ -590,7 +590,7 @@ posix_init(xlator_t *this) }; gf_boolean_t tmp_bool = 0; int ret = 0; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = 0; ssize_t size = -1; uuid_t old_uuid = { diff --git a/xlators/storage/posix/src/posix-entry-ops.c b/xlators/storage/posix/src/posix-entry-ops.c index 8cc3ccf8c0..8ab0c1dbb6 100644 --- a/xlators/storage/posix/src/posix-entry-ops.c +++ b/xlators/storage/posix/src/posix-entry-ops.c @@ -158,7 +158,7 @@ posix_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) struct iatt buf = { 0, }; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t entry_ret = 0; int32_t op_errno = 0; dict_t *xattr = NULL; @@ -381,7 +381,7 @@ posix_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, dev_t dev, mode_t umask, dict_t *xdata) { int tmp_fd = 0; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_path = 0; char *par_path = 0; @@ -617,7 +617,7 @@ int posix_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_path = NULL, *gfid_path = NULL; char *par_path = NULL, *xattr_name = NULL; @@ -1120,7 +1120,7 @@ posix_skip_non_linkto_unlink(dict_t *xdata, loc_t *loc, char *key, gf_boolean_t is_dht_linkto_file = _gf_false; int unlink_if_linkto = 0; ssize_t xattr_size = -1; - int op_ret = -1; + gf_return_t op_ret = -1; op_ret = dict_get_int32n(xdata, key, keylen, &unlink_if_linkto); @@ -1181,7 +1181,7 @@ int32_t posix_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_path = NULL; char *par_path = NULL; @@ -1402,7 +1402,7 @@ int posix_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_path = NULL; char *par_path = NULL; @@ -1541,7 +1541,7 @@ int posix_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, loc_t *loc, mode_t umask, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_path = 0; char *par_path = 0; @@ -1700,7 +1700,7 @@ int posix_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_oldpath = NULL; char *real_newpath = NULL; @@ -1995,7 +1995,7 @@ int posix_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_oldpath = 0; char *real_newpath = 0; @@ -2156,7 +2156,7 @@ int posix_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int32_t _fd = -1; int _flags = 0; @@ -2394,7 +2394,7 @@ posix_put(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, mode_t umask, uint32_t flags, struct iovec *vector, int32_t count, off_t offset, struct iobref *iobref, dict_t *xattr, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; fd_t *fd = NULL; char *real_path = NULL; diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 67db332408..0d6df6b2df 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -2305,7 +2305,7 @@ posix_disk_space_check(xlator_t *this) { struct posix_private *priv = NULL; char *subvol_path = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; double size = 0; double percent = 0; struct statvfs buf = {0}; @@ -3570,7 +3570,7 @@ posix_update_iatt_buf(struct iatt *buf, int fd, char *loc, dict_t *xattr_req) gf_boolean_t posix_is_layout_stale(dict_t *xdata, char *par_path, xlator_t *this) { - int op_ret = 0; + gf_return_t op_ret = 0; ssize_t size = 0; char value_buf[4096] = { 0, diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c index 6d54d37e5a..60a4039902 100644 --- a/xlators/storage/posix/src/posix-inode-fd-ops.c +++ b/xlators/storage/posix/src/posix-inode-fd-ops.c @@ -163,7 +163,7 @@ posix_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) struct iatt buf = { 0, }; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; struct posix_private *priv = NULL; char *real_path = NULL; @@ -356,7 +356,7 @@ int posix_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, int32_t valid, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_path = 0; struct iatt statpre = { @@ -569,7 +569,7 @@ int posix_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, int32_t valid, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; struct iatt statpre = { 0, @@ -847,7 +847,7 @@ _posix_do_zerofill(int fd, off_t offset, off_t len, int o_direct) off_t num_vect = 0; off_t num_loop = 1; off_t idx = 0; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t vect_size = VECTOR_SIZE; off_t remain = 0; off_t extra = 0; @@ -1124,7 +1124,7 @@ posix_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, 0, }; struct posix_private *priv = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; dict_t *rsp_xdata = NULL; gf_boolean_t check_space_error = _gf_false; @@ -1283,7 +1283,7 @@ posix_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, dict_t *xdata) { char *real_path = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; DIR *dir = NULL; struct posix_fd *pfd = NULL; @@ -1410,7 +1410,7 @@ posix_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, dict_t *xdata) { char *dest = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; char *real_path = NULL; struct iatt stbuf = { @@ -1456,7 +1456,7 @@ int32_t posix_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_path = 0; struct posix_private *priv = NULL; @@ -1536,7 +1536,7 @@ int32_t posix_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, fd_t *fd, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_path = NULL; int32_t _fd = -1; @@ -1652,7 +1652,7 @@ int posix_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int _fd = -1; struct posix_private *priv = NULL; @@ -1787,7 +1787,7 @@ posix_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int32_t __posix_pwritev(int fd, struct iovec *vector, int count, off_t offset) { - int32_t op_ret = 0; + gf_return_t op_ret = 0; int idx = 0; int retval = 0; off_t internal_off = 0; @@ -1815,7 +1815,7 @@ int32_t __posix_writev(int fd, struct iovec *vector, int count, off_t startoff, int odirect) { - int32_t op_ret = 0; + gf_return_t op_ret = 0; int idx = 0; int max_buf_size = 0; int retval = 0; @@ -1925,7 +1925,7 @@ posix_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, int32_t count, off_t offset, uint32_t flags, struct iobref *iobref, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int _fd = -1; struct posix_private *priv = NULL; @@ -2149,7 +2149,7 @@ posix_copy_file_range(call_frame_t *frame, xlator_t *this, fd_t *fd_in, off64_t off_in, fd_t *fd_out, off64_t off_out, size_t len, uint32_t flags, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int _fd_in = -1; int _fd_out = -1; @@ -2412,7 +2412,7 @@ int32_t posix_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { char *real_path = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; struct statvfs buf = { 0, @@ -2495,7 +2495,7 @@ posix_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t posix_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int ret = -1; struct posix_fd *pfd = NULL; @@ -2578,7 +2578,7 @@ int32_t posix_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int _fd = -1; struct posix_fd *pfd = NULL; @@ -2703,7 +2703,7 @@ int32_t posix_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int flags, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_path = NULL; char *acl_xattr = NULL; @@ -3092,7 +3092,7 @@ posix_xattr_get_real_filename(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, dict_t *dict, dict_t *xdata) { int ret = -1; - int op_ret = -1; + gf_return_t op_ret = -1; const char *fname = NULL; char *real_path = NULL; char *found = NULL; @@ -3197,7 +3197,7 @@ posix_links_in_same_directory(char *dirpath, int count, inode_t *leaf_inode, gf_dirent_t *head, char **path, int type, dict_t *xdata, int32_t *op_errno) { - int op_ret = -1; + gf_return_t op_ret = -1; gf_dirent_t *gf_entry = NULL; xlator_t *this = NULL; struct posix_private *priv = NULL; @@ -3320,7 +3320,7 @@ posix_get_ancestry_non_directory(xlator_t *this, inode_t *leaf_inode, int32_t *op_errno, dict_t *xdata) { size_t remaining_size = 0; - int op_ret = -1, pathlen = -1; + gf_return_t op_ret = -1, pathlen = -1; ssize_t handle_size = 0; uuid_t pgfid = { 0, @@ -3511,7 +3511,7 @@ posix_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { struct posix_private *priv = NULL; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *value = NULL; char *real_path = NULL; @@ -4033,7 +4033,7 @@ int32_t posix_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; struct posix_fd *pfd = NULL; int _fd = -1; @@ -4345,7 +4345,7 @@ int32_t posix_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int flags, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; struct posix_fd *pfd = NULL; int _fd = -1; @@ -4451,7 +4451,7 @@ posix_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int _posix_remove_xattr(dict_t *dict, char *key, data_t *value, void *data) { - int32_t op_ret = 0; + gf_return_t op_ret = 0; xlator_t *this = NULL; posix_xattr_filler_t *filler = NULL; @@ -4511,7 +4511,7 @@ posix_common_removexattr(call_frame_t *frame, loc_t *loc, fd_t *fd, gf_boolean_t disallow = _gf_false; char *real_path = NULL; struct posix_fd *pfd = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; struct iatt preop = { 0, }; @@ -4651,7 +4651,7 @@ int32_t posix_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = EINVAL; dict_t *xdata_rsp = NULL; @@ -4672,7 +4672,7 @@ int32_t posix_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = EINVAL; dict_t *xdata_rsp = NULL; @@ -4693,7 +4693,7 @@ int32_t posix_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int ret = -1; struct posix_fd *pfd = NULL; @@ -4845,7 +4845,7 @@ _posix_handle_xattr_keyvalue_pair(dict_t *d, char *k, data_t *v, void *tmp) { int size = 0; int count = 0; - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; gf_xattrop_flags_t optype = 0; char *array = NULL; @@ -5041,7 +5041,7 @@ int do_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata) { - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; int _fd = -1; char *real_path = NULL; @@ -5157,7 +5157,7 @@ int posix_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; char *real_path = NULL; @@ -5195,7 +5195,7 @@ int32_t posix_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, dict_t *xdata) { - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; int _fd = -1; struct iatt preop = { @@ -5282,7 +5282,7 @@ int32_t posix_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { int _fd = -1; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; struct iatt buf = { 0, @@ -5713,7 +5713,7 @@ posix_do_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, DIR *dir = NULL; int ret = -1; int count = 0; - int32_t op_ret = -1; + gf_return_t op_ret = -1; int32_t op_errno = 0; gf_dirent_t entries; int32_t skip_dirs = 0; @@ -5796,7 +5796,7 @@ posix_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t off, dict_t *dict) { gf_dirent_t entries; - int32_t op_ret = -1, op_errno = 0; + gf_return_t op_ret = -1, op_errno = 0; gf_dirent_t *entry = NULL; if ((dict != NULL) && (dict_get(dict, GET_ANCESTRY_DENTRY_KEY))) { @@ -5828,7 +5828,7 @@ posix_rchecksum(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, char *buf = NULL; int _fd = -1; struct posix_fd *pfd = NULL; - int op_ret = -1; + gf_return_t op_ret = -1; int op_errno = 0; int ret = 0; ssize_t bytes_read = 0; diff --git a/xlators/storage/posix/src/posix-metadata.c b/xlators/storage/posix/src/posix-metadata.c index b1889052f1..b61f4cde53 100644 --- a/xlators/storage/posix/src/posix-metadata.c +++ b/xlators/storage/posix/src/posix-metadata.c @@ -75,7 +75,7 @@ posix_fetch_mdata_xattr(xlator_t *this, const char *real_path_arg, int _fd, inode_t *inode, posix_mdata_t *metadata, int *op_errno) { size_t size = 256; - int op_ret = -1; + gf_return_t op_ret = -1; char *value = NULL; gf_boolean_t fd_based_fop = _gf_false; char gfid_str[64] = {0}; @@ -193,7 +193,7 @@ posix_store_mdata_xattr(xlator_t *this, const char *real_path_arg, int fd, inode_t *inode, posix_mdata_t *metadata) { char *real_path = NULL; - int op_ret = 0; + gf_return_t op_ret = 0; gf_boolean_t fd_based_fop = _gf_false; char *key = GF_XATTR_MDATA_KEY; char gfid_str[64] = {0}; diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c index fc227364b3..8ef735ae76 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -939,8 +939,8 @@ posix_acl_ctx_update(inode_t *inode, xlator_t *this, struct iatt *buf, int posix_acl_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, struct iatt *buf, - dict_t *xattr, struct iatt *postparent) + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *buf, dict_t *xattr, struct iatt *postparent) { struct posix_acl *acl_access = NULL; struct posix_acl *acl_default = NULL; @@ -1061,7 +1061,7 @@ int posix_acl_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, dict_t *xdata) { - int op_ret = 0; + gf_return_t op_ret = 0; int op_errno = 0; int perm = 0; int mode = 0; @@ -1271,9 +1271,9 @@ posix_acl_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, int posix_acl_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { if (op_ret != 0) goto unwind; @@ -1310,9 +1310,9 @@ posix_acl_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int posix_acl_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, struct iatt *buf, - struct iatt *preparent, struct iatt *postparent, - dict_t *xdata) + gf_return_t op_ret, int op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) { if (op_ret != 0) goto unwind; @@ -1350,7 +1350,7 @@ posix_acl_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, int posix_acl_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, fd_t *fd, inode_t *inode, + gf_return_t op_ret, int op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1391,7 +1391,7 @@ posix_acl_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, int posix_acl_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, + gf_return_t op_ret, int op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { @@ -1544,7 +1544,7 @@ posix_acl_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int posix_acl_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, gf_dirent_t *entries, + gf_return_t op_ret, int op_errno, gf_dirent_t *entries, dict_t *xdata) { gf_dirent_t *entry = NULL; @@ -1718,7 +1718,7 @@ setattr_scrutiny(call_frame_t *frame, inode_t *inode, struct iatt *buf, int posix_acl_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { inode_t *inode = NULL; @@ -1761,7 +1761,7 @@ posix_acl_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int posix_acl_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct iatt *prebuf, + gf_return_t op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { inode_t *inode = NULL; @@ -1946,7 +1946,7 @@ handling_other_acl_related_xattr(xlator_t *this, inode_t *inode, dict_t *xattr) } int posix_acl_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, dict_t *xdata) + gf_return_t op_ret, int op_errno, dict_t *xdata) { /* * Update the context of posix_acl_translator, if any of From 87b60de53239438d60886019a8a5504c912671f3 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 10 Sep 2020 16:26:39 +0530 Subject: [PATCH 03/24] Changes to get libglusterfs compiled Change-Id: I5462725f5ba702781305cf2652d68193df74ef66 Signed-off-by: Amar Tumballi --- libglusterfs/src/cluster-syncop.c | 14 +- libglusterfs/src/common-utils.c | 34 ++++ libglusterfs/src/default-args.c | 24 +-- libglusterfs/src/gen-defaults.py | 6 +- libglusterfs/src/globals.c | 18 ++ libglusterfs/src/glusterfs/common-utils.h | 5 + libglusterfs/src/glusterfs/globals.h | 4 + libglusterfs/src/glusterfs/stack.h | 19 +- libglusterfs/src/glusterfs/syncop.h | 2 +- libglusterfs/src/glusterfs/xlator.h | 22 +++ libglusterfs/src/inode.c | 6 +- libglusterfs/src/libglusterfs.sym | 2 + libglusterfs/src/syncop.c | 230 +++++++++++----------- 13 files changed, 237 insertions(+), 149 deletions(-) diff --git a/libglusterfs/src/cluster-syncop.c b/libglusterfs/src/cluster-syncop.c index 5356db5c19..1319ca5260 100644 --- a/libglusterfs/src/cluster-syncop.c +++ b/libglusterfs/src/cluster-syncop.c @@ -98,7 +98,7 @@ cluster_fop_success_fill(default_args_cbk_t *replies, int numsubvols, int count = 0; for (i = 0; i < numsubvols; i++) { - if (replies[i].valid && replies[i].op_ret >= 0) { + if (replies[i].valid && IS_SUCCESS(replies[i].op_ret)) { success[i] = 1; count++; } else { @@ -1079,7 +1079,7 @@ cluster_inodelk(xlator_t **subvols, unsigned char *on, int numsubvols, &loc, F_SETLK, &flock, NULL); for (i = 0; i < numsubvols; i++) { - if (replies[i].op_ret == -1 && replies[i].op_errno == EAGAIN) { + if (IS_ERROR(replies[i].op_ret) && replies[i].op_errno == EAGAIN) { cluster_fop_success_fill(replies, numsubvols, locked_on); cluster_uninodelk(subvols, locked_on, numsubvols, replies, output, frame, this, dom, inode, off, size); @@ -1149,7 +1149,7 @@ cluster_entrylk(xlator_t **subvols, unsigned char *on, int numsubvols, &loc, name, ENTRYLK_LOCK_NB, ENTRYLK_WRLCK, NULL); for (i = 0; i < numsubvols; i++) { - if (replies[i].op_ret == -1 && replies[i].op_errno == EAGAIN) { + if (IS_ERROR(replies[i].op_ret) && replies[i].op_errno == EAGAIN) { cluster_fop_success_fill(replies, numsubvols, locked_on); cluster_unentrylk(subvols, locked_on, numsubvols, replies, output, frame, this, dom, inode, name); @@ -1189,7 +1189,7 @@ cluster_tiebreaker_inodelk(xlator_t **subvols, unsigned char *on, &loc, F_SETLK, &flock, NULL); for (i = 0; i < numsubvols; i++) { - if (replies[i].valid && replies[i].op_ret == 0) { + if (replies[i].valid && IS_SUCCESS(replies[i].op_ret)) { num_success++; continue; } @@ -1197,7 +1197,7 @@ cluster_tiebreaker_inodelk(xlator_t **subvols, unsigned char *on, /* TODO: If earlier subvols fail with an error other * than EAGAIN, we could still have 2 clients competing * for the lock*/ - if (replies[i].op_ret == -1 && replies[i].op_errno == EAGAIN) { + if (IS_ERROR(replies[i].op_ret) && replies[i].op_errno == EAGAIN) { cluster_fop_success_fill(replies, numsubvols, locked_on); cluster_uninodelk(subvols, locked_on, numsubvols, replies, output, frame, this, dom, inode, off, size); @@ -1237,11 +1237,11 @@ cluster_tiebreaker_entrylk(xlator_t **subvols, unsigned char *on, &loc, name, ENTRYLK_LOCK_NB, ENTRYLK_WRLCK, NULL); for (i = 0; i < numsubvols; i++) { - if (replies[i].valid && replies[i].op_ret == 0) { + if (replies[i].valid && IS_SUCCESS(replies[i].op_ret)) { num_success++; continue; } - if (replies[i].op_ret == -1 && replies[i].op_errno == EAGAIN) { + if (IS_ERROR(replies[i].op_ret) && replies[i].op_errno == EAGAIN) { cluster_fop_success_fill(replies, numsubvols, locked_on); cluster_unentrylk(subvols, locked_on, numsubvols, replies, output, frame, this, dom, inode, name); diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 682cbf2805..98cfe9f8eb 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -5463,3 +5463,37 @@ get_xattrs_to_heal() { return xattrs_to_heal; } + +char * +gf_strerror_r(gf_return_t code, char *str, size_t size) +{ + int32_t errorcode = code.op_ret; + int xl_idx = (errorcode & 0x3ff00000) >> 20; /* 4k xlator-index in graph */ + int xl_id = (errorcode & 0xfe000) >> 13; /* 128 xlator IDs */ + int reason = (errorcode & 0x1fff); /* 8k reasons per xlators */ + + /* If errorcode is -1, then most probably no 'SETERROR()' happened on it */ + if (-1 == errorcode) { + snprintf(str, size, "-1"); + goto out; + } + + if (gf_xlator_list[xl_id]) { + snprintf(str, size, "%s: %d %d", gf_xlator_list[xl_id], xl_idx, reason); + } else { + snprintf(str, size, "%d: %d %d", xl_id, xl_idx, reason); + } + +out: + str[size - 1] = '\0'; + return str; +} + +/*Thread safe conversion function*/ +char * +gf_strerror(gf_return_t code) +{ + char *error_buffer = glusterfs_errorcode_buf_get(); + + return gf_strerror_r(code, error_buffer, 1024); +} diff --git a/libglusterfs/src/default-args.c b/libglusterfs/src/default-args.c index 3b3eb6bf20..44690ac845 100644 --- a/libglusterfs/src/default-args.c +++ b/libglusterfs/src/default-args.c @@ -60,7 +60,7 @@ args_stat_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, { args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) args->stat = *buf; if (xdata) args->xdata = dict_ref(xdata); @@ -527,7 +527,7 @@ args_readv_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, { args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { args->vector = iov_dup(vector, count); args->count = count; args->stat = *stbuf; @@ -563,7 +563,7 @@ args_writev_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, { args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret >= 0) + if (IS_SUCCESS(op_ret)) args->poststat = *postbuf; if (prebuf) args->prestat = *prebuf; @@ -601,7 +601,7 @@ args_put_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, { args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret >= 0) + if (IS_SUCCESS(op_ret)) args->stat = *buf; if (inode) args->inode = inode_ref(inode); @@ -729,7 +729,7 @@ args_statfs_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, { args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) args->statvfs = *buf; if (xdata) args->xdata = dict_ref(xdata); @@ -908,7 +908,7 @@ args_lk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, { args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) args->lock = *lock; if (xdata) args->xdata = dict_ref(xdata); @@ -1058,7 +1058,7 @@ args_readdirp_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret > 0) { + if (IS_SUCCESS(op_ret)) { list_for_each_entry(entry, &entries->list, list) { stub_entry = gf_dirent_for_name(entry->d_name); @@ -1102,7 +1102,7 @@ args_readdir_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret > 0) { + if (IS_SUCCESS(op_ret)) { list_for_each_entry(entry, &entries->list, list) { stub_entry = gf_dirent_for_name(entry->d_name); @@ -1139,7 +1139,7 @@ args_rchecksum_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, { args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { args->weak_checksum = weak_checksum; args->strong_checksum = gf_memdup(strong_checksum, SHA256_DIGEST_LENGTH); @@ -1430,7 +1430,7 @@ args_getactivelk_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, args->op_ret = op_ret; args->op_errno = op_errno; /*op_ret needs to carry the number of locks present in the list*/ - if (op_ret > 0) { + if (IS_SUCCESS(op_ret)) { list_for_each_entry(entry, &locklist->list, list) { stub_entry = GF_CALLOC(1, sizeof(*stub_entry), gf_common_mt_char); @@ -1519,7 +1519,7 @@ args_lease_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, { args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) args->lease = *lease; if (xdata) args->xdata = dict_ref(xdata); @@ -1574,7 +1574,7 @@ args_copy_file_range_cbk_store(default_args_cbk_t *args, gf_return_t op_ret, { args->op_ret = op_ret; args->op_errno = op_errno; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { if (postbuf_dst) args->poststat = *postbuf_dst; if (prebuf_dst) diff --git a/libglusterfs/src/gen-defaults.py b/libglusterfs/src/gen-defaults.py index df9766bd21..adf39b8847 100755 --- a/libglusterfs/src/gen-defaults.py +++ b/libglusterfs/src/gen-defaults.py @@ -8,8 +8,10 @@ int32_t default_@NAME@_failure_cbk (call_frame_t *frame, int32_t op_errno) { - STACK_UNWIND_STRICT (@NAME@, frame, -1, op_errno, @ERROR_ARGS@); - return 0; + gf_return_t ret; + ret.op_ret = -1; + STACK_UNWIND_STRICT (@NAME@, frame, ret, op_errno, @ERROR_ARGS@); + return 0; } """ diff --git a/libglusterfs/src/globals.c b/libglusterfs/src/globals.c index ae06f8be38..d57b4706bb 100644 --- a/libglusterfs/src/globals.c +++ b/libglusterfs/src/globals.c @@ -86,6 +86,13 @@ const char *gf_upcall_list[GF_UPCALL_FLAGS_MAXVALUE] = { [GF_UPCALL_LEASE_RECALL] = "LEASE_RECALL", }; +const char *gf_xlator_list[GF_XLATOR_MAXVALUE] = { + [GF_XLATOR_BACKEND] = "backend-filesystem", + [GF_XLATOR_POSIX] = "storage/posix", + [GF_XLATOR_DHT] = "cluster/distribute", + [GF_XLATOR_AFR] = "cluster/replicate", +}; + /* THIS */ /* This global ctx is a bad hack to prevent some of the libgfapi crashes. @@ -107,6 +114,9 @@ static __thread char thread_uuid_buf[GF_UUID_BUF_SIZE] = {}; static __thread char thread_lkowner_buf[GF_LKOWNER_BUF_SIZE] = {}; static __thread char thread_leaseid_buf[GF_LEASE_ID_BUF_SIZE] = {}; +/* TODO: add macro for size */ +static __thread char thread_errorcode_buf[1024] = {}; + int gf_global_mem_acct_enable_get(void) { @@ -301,6 +311,14 @@ glusterfs_leaseid_buf_get() return buf; } +// ERRORCODE_BUFFER + +char * +glusterfs_errorcode_buf_get() +{ + return thread_errorcode_buf; +} + char * glusterfs_leaseid_exist() { diff --git a/libglusterfs/src/glusterfs/common-utils.h b/libglusterfs/src/glusterfs/common-utils.h index f297fdab5c..485e61939c 100644 --- a/libglusterfs/src/glusterfs/common-utils.h +++ b/libglusterfs/src/glusterfs/common-utils.h @@ -1253,4 +1253,9 @@ gf_tsdiff(struct timespec *start, struct timespec *end) (double)(t.tv_nsec - start->tv_nsec); } +char * +gf_strerror_r(gf_return_t code, char *str, size_t size); +char * +gf_strerror(gf_return_t code); + #endif /* _COMMON_UTILS_H */ diff --git a/libglusterfs/src/glusterfs/globals.h b/libglusterfs/src/glusterfs/globals.h index b22eaae6c2..7bcbc1b174 100644 --- a/libglusterfs/src/glusterfs/globals.h +++ b/libglusterfs/src/glusterfs/globals.h @@ -164,6 +164,9 @@ char * glusterfs_leaseid_buf_get(void); char * glusterfs_leaseid_exist(void); +/* errorcode_buf */ +char * +glusterfs_errorcode_buf_get(void); /* init */ int @@ -179,6 +182,7 @@ glusterfs_ctx_tw_put(glusterfs_ctx_t *ctx); extern const char *gf_fop_list[]; extern const char *gf_upcall_list[]; +extern const char *gf_xlator_list[]; /* mem acct enable/disable */ int diff --git a/libglusterfs/src/glusterfs/stack.h b/libglusterfs/src/glusterfs/stack.h index 9ac19f166d..b3637dfbfa 100644 --- a/libglusterfs/src/glusterfs/stack.h +++ b/libglusterfs/src/glusterfs/stack.h @@ -370,7 +370,7 @@ get_the_pt_fop(void *base_fop, int fop_idx) #define STACK_UNWIND STACK_UNWIND_STRICT /* return from function in type-safe way */ -#define STACK_UNWIND_STRICT(fop, frame, op_ret, op_errno, params...) \ +#define STACK_UNWIND_STRICT(fop, frame, op_return, op_errno, params...) \ do { \ fop_##fop##_cbk_t fn = NULL; \ call_frame_t *_parent = NULL; \ @@ -380,27 +380,27 @@ get_the_pt_fop(void *base_fop, int fop_idx) gf_msg("stack", GF_LOG_CRITICAL, 0, LG_MSG_FRAME_ERROR, "!frame"); \ break; \ } \ - if ((op_ret) < 0) { \ + if (IS_ERROR(op_return)) { \ gf_msg_debug("stack-trace", op_errno, \ "stack-address: %p, " \ - "%s returned %d error: %s", \ - frame->root, THIS->name, (int32_t)(op_ret), \ + "%s returned %s error: %s", \ + frame->root, THIS->name, gf_strerror(op_return), \ strerror(op_errno)); \ } else { \ gf_msg_trace("stack-trace", 0, \ "stack-address: %p, " \ "%s returned %d", \ - frame->root, THIS->name, (int32_t)(op_ret)); \ + frame->root, THIS->name, op_return.op_ret); \ } \ fn = (fop_##fop##_cbk_t)frame->ret; \ _parent = frame->parent; \ LOCK(&frame->root->stack_lock); \ { \ _parent->ref_count--; \ - if ((op_ret) < 0 && (op_errno) != frame->root->error) { \ + if (IS_ERROR(op_return) && (op_errno) != frame->root->error) { \ frame->root->err_xl = frame->this; \ frame->root->error = (op_errno); \ - } else if ((op_ret) == 0) { \ + } else if (IS_SUCCESS(op_return)) { \ frame->root->err_xl = NULL; \ frame->root->error = 0; \ } \ @@ -416,11 +416,12 @@ get_the_pt_fop(void *base_fop, int fop_idx) if (_parent->ret == NULL) \ timespec_now(&_parent->end); \ } \ - if (op_ret < 0) { \ + if (IS_ERROR(op_return)) { \ GF_ATOMIC_INC(THIS->stats.total.metrics[frame->op].cbk); \ GF_ATOMIC_INC(THIS->stats.interval.metrics[frame->op].cbk); \ } \ - fn(_parent, frame->cookie, _parent->this, op_ret, op_errno, params); \ + fn(_parent, frame->cookie, _parent->this, op_return, op_errno, \ + params); \ THIS = old_THIS; \ } while (0) diff --git a/libglusterfs/src/glusterfs/syncop.h b/libglusterfs/src/glusterfs/syncop.h index d5a7fd3bc5..9a9dc95e77 100644 --- a/libglusterfs/src/glusterfs/syncop.h +++ b/libglusterfs/src/glusterfs/syncop.h @@ -280,7 +280,7 @@ struct syncopctx { frame = syncop_create_frame(THIS); \ \ if (!frame) { \ - stb->op_ret = -1; \ + stb->op_ret.op_ret = -1; \ stb->op_errno = errno; \ break; \ } \ diff --git a/libglusterfs/src/glusterfs/xlator.h b/libglusterfs/src/glusterfs/xlator.h index 03c00e041a..bdacae3c0c 100644 --- a/libglusterfs/src/glusterfs/xlator.h +++ b/libglusterfs/src/glusterfs/xlator.h @@ -54,6 +54,28 @@ typedef struct _loc loc_t; typedef int32_t (*event_notify_fn_t)(xlator_t *this, int32_t event, void *data, ...); +enum _gf_xlator_list { + GD_XLATOR_NONE = 0, + GF_XLATOR_POSIX = 1, + GF_XLATOR_AFR, + GF_XLATOR_DHT, + GF_XLATOR_EC, + GF_XLATOR_ACL, + GF_XLATOR_SELINUX, + GF_XLATOR_LOCKS, + GF_XLATOR_LEASES, + GF_XLATOR_INDEX, + GF_XLATOR_FUSE, + GF_XLATOR_IOT, + GF_XLATOR_MARKER, + GF_XLATOR_IO_STATS, + GF_XLATOR_SERVER, + GF_XLATOR_BACKEND = 125, + GF_XLATOR_EXTERNAL = 126, + GF_XLATOR_MAXVALUE = 127, +}; +typedef enum _gf_xlator_list gf_xlator_list_t; + #include "glusterfs/list.h" #include "glusterfs/gf-dirent.h" #include "glusterfs/stack.h" diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index 84278183aa..f0a98018d0 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -2024,13 +2024,13 @@ inode_needs_lookup(inode_t *inode, xlator_t *this) { uint64_t need_lookup = 0; gf_boolean_t ret = _gf_false; - gf_return_t op_ret = -1; + gf_return_t op_ret; if (!inode || !this) return ret; - op_ret = inode_ctx_get(inode, this, &need_lookup); - if (op_ret == -1) { + op_ret.op_ret = inode_ctx_get(inode, this, &need_lookup); + if (IS_ERROR(op_ret)) { ret = _gf_true; } else if (need_lookup == LOOKUP_NEEDED) { ret = _gf_true; diff --git a/libglusterfs/src/libglusterfs.sym b/libglusterfs/src/libglusterfs.sym index 5f18cd56cb..ba002db5aa 100644 --- a/libglusterfs/src/libglusterfs.sym +++ b/libglusterfs/src/libglusterfs.sym @@ -697,6 +697,8 @@ gf_store_save_value gf_store_save_items gf_store_unlink_tmppath gf_store_unlock +gf_strerror +gf_strerror_r gf_string2boolean gf_string2bytesize_int64 gf_string2bytesize_uint64 diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 75eb8060ba..fa51fd589d 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -1323,7 +1323,7 @@ syncop_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { args->iatt1 = *iatt; args->iatt2 = *parent; } @@ -1353,9 +1353,9 @@ syncop_lookup(xlator_t *subvol, loc_t *loc, struct iatt *iatt, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -1378,12 +1378,12 @@ syncop_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { list_for_each_entry(entry, &entries->list, list) { tmp = entry_copy(entry); if (!tmp) { - args->op_ret = -1; + args->op_ret.op_ret = -1; args->op_errno = ENOMEM; gf_dirent_free(&(args->entries)); break; @@ -1423,9 +1423,9 @@ syncop_readdirp(xlator_t *subvol, fd_t *fd, size_t size, off_t off, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -1448,12 +1448,12 @@ syncop_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { list_for_each_entry(entry, &entries->list, list) { tmp = entry_copy(entry); if (!tmp) { - args->op_ret = -1; + args->op_ret.op_ret = -1; args->op_errno = ENOMEM; gf_dirent_free(&(args->entries)); break; @@ -1493,9 +1493,9 @@ syncop_readdir(xlator_t *subvol, fd_t *fd, size_t size, off_t off, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -1533,9 +1533,9 @@ syncop_opendir(xlator_t *subvol, loc_t *loc, fd_t *fd, dict_t *xdata_in, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1572,9 +1572,9 @@ syncop_fsyncdir(xlator_t *subvol, fd_t *fd, int datasync, dict_t *xdata_in, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1611,9 +1611,9 @@ syncop_removexattr(xlator_t *subvol, loc_t *loc, const char *name, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1650,9 +1650,9 @@ syncop_fremovexattr(xlator_t *subvol, fd_t *fd, const char *name, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1689,9 +1689,9 @@ syncop_setxattr(xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1728,9 +1728,9 @@ syncop_fsetxattr(xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1747,7 +1747,7 @@ syncop_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret >= 0) + if (IS_SUCCESS(op_ret)) args->xattr = dict_ref(dict); __wake(args); @@ -1776,9 +1776,9 @@ syncop_listxattr(xlator_t *subvol, loc_t *loc, dict_t **dict, dict_t *xdata_in, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1802,9 +1802,9 @@ syncop_getxattr(xlator_t *subvol, loc_t *loc, dict_t **dict, const char *key, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1828,9 +1828,9 @@ syncop_fgetxattr(xlator_t *subvol, fd_t *fd, dict_t **dict, const char *key, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1848,7 +1848,7 @@ syncop_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { args->statvfs_buf = *buf; } @@ -1876,9 +1876,9 @@ syncop_statfs(xlator_t *subvol, loc_t *loc, struct statvfs *buf, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1895,7 +1895,7 @@ syncop_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { args->iatt1 = *preop; args->iatt2 = *postop; } @@ -1927,9 +1927,9 @@ syncop_setattr(xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -1954,9 +1954,9 @@ syncop_fsetattr(xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -1993,9 +1993,9 @@ syncop_open(xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -2015,7 +2015,7 @@ syncop_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (args->op_ret >= 0) { + if (IS_SUCCESS(args->op_ret)) { if (iobref) args->iobref = iobref_ref(iobref); args->vector = iov_dup(vector, count); @@ -2048,7 +2048,7 @@ syncop_readv(xlator_t *subvol, fd_t *fd, size_t size, off_t off, uint32_t flags, if (iatt) *iatt = args.iatt1; - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) goto out; if (vector) @@ -2066,9 +2066,9 @@ syncop_readv(xlator_t *subvol, fd_t *fd, size_t size, off_t off, uint32_t flags, iobref_unref(args.iobref); out: - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2085,7 +2085,7 @@ syncop_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { args->iatt1 = *prebuf; args->iatt2 = *postbuf; } @@ -2118,9 +2118,9 @@ syncop_writev(xlator_t *subvol, fd_t *fd, const struct iovec *vector, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2146,9 +2146,9 @@ syncop_write(xlator_t *subvol, fd_t *fd, const char *buf, int size, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2201,9 +2201,9 @@ syncop_create(xlator_t *subvol, loc_t *loc, int32_t flags, mode_t mode, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -2251,9 +2251,9 @@ syncop_put(xlator_t *subvol, loc_t *loc, mode_t mode, mode_t umask, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2291,9 +2291,9 @@ syncop_unlink(xlator_t *subvol, loc_t *loc, dict_t *xdata_in, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2331,9 +2331,9 @@ syncop_rmdir(xlator_t *subvol, loc_t *loc, int flags, dict_t *xdata_in, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2378,10 +2378,10 @@ syncop_link(xlator_t *subvol, loc_t *oldloc, loc_t *newloc, struct iatt *iatt, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2421,10 +2421,10 @@ syncop_rename(xlator_t *subvol, loc_t *oldloc, loc_t *newloc, dict_t *xdata_in, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2441,7 +2441,7 @@ syncop_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { args->iatt1 = *prebuf; args->iatt2 = *postbuf; } @@ -2472,9 +2472,9 @@ syncop_ftruncate(xlator_t *subvol, fd_t *fd, off_t offset, struct iatt *preiatt, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2493,9 +2493,9 @@ syncop_truncate(xlator_t *subvol, loc_t *loc, off_t offset, dict_t *xdata_in, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2512,7 +2512,7 @@ syncop_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { args->iatt1 = *prebuf; args->iatt2 = *postbuf; } @@ -2543,9 +2543,9 @@ syncop_fsync(xlator_t *subvol, fd_t *fd, int dataonly, struct iatt *preiatt, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2579,9 +2579,9 @@ syncop_flush(xlator_t *subvol, fd_t *fd, dict_t *xdata_in, dict_t **xdata_out) else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2598,7 +2598,7 @@ syncop_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) args->iatt1 = *stbuf; __wake(args); @@ -2625,9 +2625,9 @@ syncop_fstat(xlator_t *subvol, fd_t *fd, struct iatt *stbuf, dict_t *xdata_in, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2649,9 +2649,9 @@ syncop_stat(xlator_t *subvol, loc_t *loc, struct iatt *stbuf, dict_t *xdata_in, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -2696,9 +2696,9 @@ syncop_symlink(xlator_t *subvol, loc_t *loc, const char *newpath, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2715,7 +2715,7 @@ syncop_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if ((op_ret != -1) && path) + if (IS_SUCCESS(op_ret) && path) args->buffer = gf_strdup(path); __wake(args); @@ -2744,9 +2744,9 @@ syncop_readlink(xlator_t *subvol, loc_t *loc, char **buffer, size_t size, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2791,9 +2791,9 @@ syncop_mknod(xlator_t *subvol, loc_t *loc, mode_t mode, dev_t rdev, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2838,9 +2838,9 @@ syncop_mkdir(xlator_t *subvol, loc_t *loc, mode_t mode, struct iatt *iatt, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2892,7 +2892,7 @@ syncop_access(xlator_t *subvol, loc_t *loc, int32_t mask, dict_t *xdata_in, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; return args.op_errno; } @@ -2932,9 +2932,9 @@ syncop_fallocate(xlator_t *subvol, fd_t *fd, int32_t keep_size, off_t offset, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -2972,9 +2972,9 @@ syncop_discard(xlator_t *subvol, fd_t *fd, off_t offset, size_t len, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -3012,9 +3012,9 @@ syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -3057,9 +3057,9 @@ syncop_ipc(xlator_t *subvol, int32_t op, dict_t *xdata_in, dict_t **xdata_out) } } - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -3092,12 +3092,12 @@ syncop_seek(xlator_t *subvol, fd_t *fd, off_t offset, gf_seek_what_t what, SYNCOP(subvol, (&args), syncop_seek_cbk, subvol->fops->seek, fd, offset, what, xdata_in); - if (args.op_ret < 0) { + if (IS_ERROR(args.op_ret)) { return -args.op_errno; } else { if (off) *off = args.offset; - return args.op_ret; + return args.op_ret.op_ret; } } @@ -3148,9 +3148,9 @@ syncop_lease(xlator_t *subvol, loc_t *loc, struct gf_lease *lease, } } - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -3192,9 +3192,9 @@ syncop_lk(xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -3231,10 +3231,10 @@ syncop_inodelk(xlator_t *subvol, const char *volume, loc_t *loc, int32_t cmd, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -3270,10 +3270,10 @@ syncop_entrylk(xlator_t *subvol, const char *volume, loc_t *loc, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -3319,10 +3319,10 @@ syncop_xattrop(xlator_t *subvol, loc_t *loc, gf_xattrop_flags_t flags, else if (args.dict_out) dict_unref(args.dict_out); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -3347,10 +3347,10 @@ syncop_fxattrop(xlator_t *subvol, fd_t *fd, gf_xattrop_flags_t flags, else if (args.dict_out) dict_unref(args.dict_out); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int32_t @@ -3371,7 +3371,7 @@ syncop_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret > 0) { + if (IS_SUCCESS(op_ret)) { list_for_each_entry(tmp, &locklist->list, list) { entry = GF_CALLOC(1, sizeof(lock_migration_info_t), @@ -3424,10 +3424,10 @@ syncop_getactivelk(xlator_t *subvol, loc_t *loc, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -3466,10 +3466,10 @@ syncop_setactivelk(xlator_t *subvol, loc_t *loc, else if (args.xdata) dict_unref(args.xdata); - if (args.op_ret < 0) + if (IS_ERROR(args.op_ret)) return -args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -3546,7 +3546,7 @@ syncop_copy_file_range(xlator_t *subvol, fd_t *fd_in, off64_t off_in, } errno = args.op_errno; - return args.op_ret; + return args.op_ret.op_ret; } int @@ -3564,7 +3564,7 @@ syncop_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) args->xdata = dict_ref(xdata); - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { args->iatt1 = *stbuf; args->iatt2 = *prebuf_dst; args->iatt3 = *postbuf_dst; From 6fe89d7f77b94bdaa8adc9429c0b45686faf25a1 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 10 Sep 2020 23:31:26 +0530 Subject: [PATCH 04/24] all: Replace all -1 as failure UNWIND introduce a global variable 'gf_failure' which can be used for all generic failures. Change-Id: Ica732f464d05b5d2704d061658bc7404e301748b Signed-off-by: Amar Tumballi --- extras/create_new_xlator/new-xlator.c.tmpl | 2 +- libglusterfs/src/globals.c | 2 + libglusterfs/src/glusterfs/globals.h | 1 + libglusterfs/src/glusterfs/glusterfs.h | 1 + xlators/cluster/afr/src/afr-common.c | 28 +-- xlators/cluster/afr/src/afr-dir-read.c | 4 +- xlators/cluster/afr/src/afr-dir-write.c | 16 +- xlators/cluster/afr/src/afr-inode-read.c | 18 +- xlators/cluster/afr/src/afr-inode-write.c | 38 ++-- xlators/cluster/afr/src/afr-open.c | 4 +- xlators/cluster/dht/src/dht-common.c | 128 +++++++------- xlators/cluster/dht/src/dht-helper.c | 30 ++-- xlators/cluster/dht/src/dht-inode-read.c | 50 +++--- xlators/cluster/dht/src/dht-inode-write.c | 28 +-- xlators/cluster/dht/src/dht-rename.c | 4 +- xlators/cluster/dht/src/nufa.c | 8 +- xlators/cluster/dht/src/switch.c | 8 +- xlators/cluster/ec/src/ec.c | 100 +++++------ xlators/debug/error-gen/src/error-gen.c | 164 +++++++++--------- xlators/features/arbiter/src/arbiter.c | 4 +- .../features/bit-rot/src/stub/bit-rot-stub.c | 14 +- xlators/features/changelog/src/changelog.c | 4 +- .../cloudsync/src/cloudsync-fops-c.py | 4 +- xlators/features/cloudsync/src/cloudsync.c | 14 +- xlators/features/compress/src/cdc.c | 2 +- .../features/gfid-access/src/gfid-access.c | 30 ++-- xlators/features/index/src/index.c | 26 +-- xlators/features/leases/src/leases.c | 34 ++-- xlators/features/locks/src/clear.c | 12 +- xlators/features/locks/src/entrylk.c | 2 +- xlators/features/locks/src/inodelk.c | 2 +- xlators/features/locks/src/posix.c | 38 ++-- xlators/features/locks/src/reservelk.c | 4 +- xlators/features/marker/src/marker.c | 52 +++--- xlators/features/metadisp/src/gen-fops.py | 2 +- .../features/metadisp/src/metadisp-create.c | 4 +- .../features/metadisp/src/metadisp-lookup.c | 2 +- xlators/features/metadisp/src/metadisp-open.c | 2 +- .../features/metadisp/src/metadisp-setattr.c | 2 +- xlators/features/metadisp/src/metadisp-stat.c | 6 +- .../features/metadisp/src/metadisp-unlink.c | 2 +- xlators/features/quiesce/src/quiesce.c | 142 +++++++-------- xlators/features/quota/src/quota.c | 86 ++++----- .../features/read-only/src/read-only-common.c | 42 ++--- xlators/features/read-only/src/worm.c | 18 +- xlators/features/sdfs/src/sdfs.c | 40 ++--- xlators/features/shard/src/shard.c | 110 ++++++------ .../features/thin-arbiter/src/thin-arbiter.c | 6 +- xlators/features/trash/src/trash.c | 6 +- xlators/features/upcall/src/upcall.c | 74 ++++---- xlators/features/utime/src/utime.c | 2 +- xlators/meta/src/meta-defaults.c | 10 +- xlators/performance/io-cache/src/io-cache.c | 18 +- xlators/performance/md-cache/src/md-cache.c | 10 +- xlators/performance/nl-cache/src/nl-cache.c | 6 +- .../performance/read-ahead/src/read-ahead.c | 18 +- .../readdir-ahead/src/readdir-ahead.c | 4 +- .../write-behind/src/write-behind.c | 36 ++-- .../protocol/client/src/client-handshake.c | 2 +- xlators/protocol/client/src/client-rpc-fops.c | 96 +++++----- .../protocol/client/src/client-rpc-fops_v2.c | 104 +++++------ xlators/protocol/client/src/client.c | 110 ++++++------ xlators/storage/posix/src/posix-aio.c | 4 +- .../storage/posix/src/posix-inode-fd-ops.c | 72 ++++---- xlators/system/posix-acl/src/posix-acl.c | 80 ++++----- 65 files changed, 999 insertions(+), 993 deletions(-) diff --git a/extras/create_new_xlator/new-xlator.c.tmpl b/extras/create_new_xlator/new-xlator.c.tmpl index 69470fa65b..4ce1f7a469 100644 --- a/extras/create_new_xlator/new-xlator.c.tmpl +++ b/extras/create_new_xlator/new-xlator.c.tmpl @@ -17,7 +17,7 @@ If you are generating the leaf xlators, remove the STACK_WIND and replace the FIRST_CHILD(this)->fops->@NAME@, @WIND_ARGS@); return 0; err: - STACK_UNWIND_STRICT(@NAME@, frame, -1, errno, @ERROR_ARGS@); + STACK_UNWIND_STRICT(@NAME@, frame, gf_failure, errno, @ERROR_ARGS@); return 0; } diff --git a/libglusterfs/src/globals.c b/libglusterfs/src/globals.c index d57b4706bb..69218f34ef 100644 --- a/libglusterfs/src/globals.c +++ b/libglusterfs/src/globals.c @@ -93,6 +93,8 @@ const char *gf_xlator_list[GF_XLATOR_MAXVALUE] = { [GF_XLATOR_AFR] = "cluster/replicate", }; +const gf_return_t gf_failure = { -1 }; + /* THIS */ /* This global ctx is a bad hack to prevent some of the libgfapi crashes. diff --git a/libglusterfs/src/glusterfs/globals.h b/libglusterfs/src/glusterfs/globals.h index 7bcbc1b174..f12fd5a122 100644 --- a/libglusterfs/src/glusterfs/globals.h +++ b/libglusterfs/src/glusterfs/globals.h @@ -142,6 +142,7 @@ glusterfs_this_set(xlator_t *); extern xlator_t global_xlator; extern struct volume_options global_xl_options[]; +extern gf_return_t gf_failure; /* syncopctx */ void * diff --git a/libglusterfs/src/glusterfs/glusterfs.h b/libglusterfs/src/glusterfs/glusterfs.h index e67fd0cd6c..2680824623 100644 --- a/libglusterfs/src/glusterfs/glusterfs.h +++ b/libglusterfs/src/glusterfs/glusterfs.h @@ -46,6 +46,7 @@ typedef struct _gf_return { int32_t op_ret; } gf_return_t; + #define IS_ERROR(ret) ((ret.op_ret) < 0) #define IS_SUCCESS(ret) ((ret.op_ret) >= 0) diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 3574c3d911..21282d9974 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -3424,7 +3424,7 @@ afr_lookup_selfheal_wrap(void *opaque) return 0; unwind: - AFR_STACK_UNWIND(lookup, frame, -1, EIO, NULL, NULL, NULL, NULL); + AFR_STACK_UNWIND(lookup, frame, gf_failure, EIO, NULL, NULL, NULL, NULL); return 0; } @@ -3818,7 +3818,7 @@ afr_discover_do(call_frame_t *frame, xlator_t *this, int err) return 0; out: - AFR_STACK_UNWIND(lookup, frame, -1, local->op_errno, 0, 0, 0, 0); + AFR_STACK_UNWIND(lookup, frame, gf_failure, local->op_errno, 0, 0, 0, 0); return 0; } @@ -3882,7 +3882,7 @@ afr_discover(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) return 0; out: - AFR_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + AFR_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -3924,7 +3924,7 @@ afr_lookup_do(call_frame_t *frame, xlator_t *this, int err) } return 0; out: - AFR_STACK_UNWIND(lookup, frame, -1, local->op_errno, 0, 0, 0, 0); + AFR_STACK_UNWIND(lookup, frame, gf_failure, local->op_errno, 0, 0, 0, 0); return 0; } @@ -4023,7 +4023,7 @@ afr_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) return 0; out: - AFR_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + AFR_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -4302,7 +4302,7 @@ afr_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) return 0; out: - AFR_STACK_UNWIND(flush, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(flush, frame, gf_failure, op_errno, NULL); return 0; } @@ -4367,7 +4367,7 @@ afr_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, return 0; out: - AFR_STACK_UNWIND(fsyncdir, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(fsyncdir, frame, gf_failure, op_errno, NULL); return 0; } @@ -4857,7 +4857,7 @@ afr_handle_inodelk(call_frame_t *frame, xlator_t *this, glusterfs_fop_t fop, goto out; return 0; out: - afr_fop_lock_unwind(frame, fop, -1, op_errno, NULL); + afr_fop_lock_unwind(frame, fop, gf_failure, op_errno, NULL); return 0; } @@ -4917,7 +4917,7 @@ afr_handle_entrylk(call_frame_t *frame, xlator_t *this, glusterfs_fop_t fop, return 0; out: - afr_fop_lock_unwind(frame, fop, -1, op_errno, NULL); + afr_fop_lock_unwind(frame, fop, gf_failure, op_errno, NULL); return 0; } @@ -5029,7 +5029,7 @@ afr_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) return 0; out: - AFR_STACK_UNWIND(statfs, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(statfs, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -5275,7 +5275,7 @@ afr_lk_transaction(void *opaque) AFR_ONLIST(local->cont.lk.locked_nodes, frame, afr_lk_txn_unlock_cbk, lk, local->fd, F_SETLK, &local->cont.lk.user_flock, NULL); err: - AFR_STACK_UNWIND(lk, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(lk, frame, gf_failure, op_errno, NULL, NULL); return -1; } @@ -5334,7 +5334,7 @@ afr_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, return 0; out: - AFR_STACK_UNWIND(lk, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(lk, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -5480,7 +5480,7 @@ afr_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; out: - AFR_STACK_UNWIND(lease, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(lease, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -5599,7 +5599,7 @@ afr_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata) err: if (op_errno == -1) op_errno = errno; - AFR_STACK_UNWIND(ipc, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(ipc, frame, gf_failure, op_errno, NULL); return 0; diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c index 46a3285a59..da84ce6130 100644 --- a/xlators/cluster/afr/src/afr-dir-read.c +++ b/xlators/cluster/afr/src/afr-dir-read.c @@ -117,7 +117,7 @@ afr_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, return 0; out: - AFR_STACK_UNWIND(opendir, frame, -1, op_errno, fd, NULL); + AFR_STACK_UNWIND(opendir, frame, gf_failure, op_errno, fd, NULL); return 0; } @@ -315,7 +315,7 @@ afr_do_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; out: - AFR_STACK_UNWIND(readdir, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(readdir, frame, gf_failure, op_errno, NULL, NULL); return 0; } diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c index 5a560eeef4..78e9d6fab5 100644 --- a/xlators/cluster/afr/src/afr-dir-write.c +++ b/xlators/cluster/afr/src/afr-dir-write.c @@ -492,7 +492,7 @@ afr_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL, + AFR_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -601,7 +601,7 @@ afr_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + AFR_STACK_UNWIND(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -715,7 +715,7 @@ afr_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + AFR_STACK_UNWIND(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -822,7 +822,7 @@ afr_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + AFR_STACK_UNWIND(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -929,7 +929,7 @@ afr_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(symlink, frame, -1, op_errno, NULL, NULL, NULL, NULL, + AFR_STACK_UNWIND(symlink, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1048,7 +1048,7 @@ afr_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL, + AFR_STACK_UNWIND(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1153,7 +1153,7 @@ afr_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(unlink, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(unlink, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1256,7 +1256,7 @@ afr_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(rmdir, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(rmdir, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index 9217c1f2bf..8114a671f7 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -177,7 +177,7 @@ afr_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, return 0; out: - AFR_STACK_UNWIND(access, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(access, frame, gf_failure, op_errno, NULL); return 0; } @@ -247,7 +247,7 @@ afr_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) return 0; out: - AFR_STACK_UNWIND(stat, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(stat, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -320,7 +320,7 @@ afr_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) return 0; out: - AFR_STACK_UNWIND(fstat, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(fstat, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -394,7 +394,7 @@ afr_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, return 0; out: - AFR_STACK_UNWIND(readlink, frame, -1, op_errno, 0, 0, 0); + AFR_STACK_UNWIND(readlink, frame, gf_failure, op_errno, 0, 0, 0); return 0; } @@ -1521,7 +1521,7 @@ afr_handle_heal_xattrs(call_frame_t *frame, xlator_t *this, loc_t *loc, out: if (ret == 1) { - AFR_STACK_UNWIND(getxattr, frame, -1, ENOMEM, NULL, NULL); + AFR_STACK_UNWIND(getxattr, frame, gf_failure, ENOMEM, NULL, NULL); if (data) GF_FREE(data); ret = 0; @@ -1611,7 +1611,7 @@ afr_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, ret = 0; out: if (ret < 0) - AFR_STACK_UNWIND(getxattr, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(getxattr, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1737,7 +1737,7 @@ afr_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, return 0; out: - AFR_STACK_UNWIND(fgetxattr, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(fgetxattr, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1817,7 +1817,7 @@ afr_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; out: - AFR_STACK_UNWIND(readv, frame, -1, op_errno, 0, 0, 0, 0, 0); + AFR_STACK_UNWIND(readv, frame, gf_failure, op_errno, 0, 0, 0, 0, 0); return 0; } @@ -1892,7 +1892,7 @@ afr_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; out: - AFR_STACK_UNWIND(seek, frame, -1, op_errno, 0, NULL); + AFR_STACK_UNWIND(seek, frame, gf_failure, op_errno, 0, NULL); return 0; } diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c index 05966e5e4b..31ae2df2c5 100644 --- a/xlators/cluster/afr/src/afr-inode-write.c +++ b/xlators/cluster/afr/src/afr-inode-write.c @@ -478,7 +478,7 @@ afr_do_writev(call_frame_t *frame, xlator_t *this) if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(writev, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -550,7 +550,7 @@ afr_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, return 0; out: - AFR_STACK_UNWIND(writev, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -664,7 +664,7 @@ afr_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(truncate, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(truncate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -778,7 +778,7 @@ afr_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; out: - AFR_STACK_UNWIND(ftruncate, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(ftruncate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -883,7 +883,7 @@ afr_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *buf, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(setattr, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(setattr, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -988,7 +988,7 @@ afr_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *buf, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(fsetattr, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(fsetattr, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1317,7 +1317,7 @@ afr_split_brain_resolve_do(call_frame_t *frame, xlator_t *this, loc_t *loc, ret = 0; out: if (ret < 0) - AFR_STACK_UNWIND(setxattr, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(setxattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -1447,7 +1447,7 @@ afr_handle_split_brain_commands(xlator_t *this, call_frame_t *frame, loc_t *loc, out: /* key was correct but value was invalid when ret == 1 */ if (ret == 1) { - AFR_STACK_UNWIND(setxattr, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(setxattr, frame, gf_failure, op_errno, NULL); if (data) GF_FREE(data); ret = 0; @@ -1536,7 +1536,7 @@ afr_handle_empty_brick(xlator_t *this, call_frame_t *frame, loc_t *loc, ret = 0; out: if (ret == 1) { - AFR_STACK_UNWIND(setxattr, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(setxattr, frame, gf_failure, op_errno, NULL); ret = 0; } return ret; @@ -1622,7 +1622,7 @@ afr_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(setxattr, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(setxattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -1729,7 +1729,7 @@ afr_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(fsetxattr, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(fsetxattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -1834,7 +1834,7 @@ afr_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(removexattr, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(removexattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -1936,7 +1936,7 @@ afr_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(fremovexattr, frame, -1, op_errno, NULL); + AFR_STACK_UNWIND(fremovexattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -2043,7 +2043,7 @@ afr_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(fallocate, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(fallocate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -2152,7 +2152,7 @@ afr_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(discard, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(discard, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -2259,7 +2259,7 @@ afr_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(zerofill, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(zerofill, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -2355,7 +2355,7 @@ afr_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(xattrop, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(xattrop, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -2450,7 +2450,7 @@ afr_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(fxattrop, frame, -1, op_errno, NULL, NULL); + AFR_STACK_UNWIND(fxattrop, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -2559,7 +2559,7 @@ afr_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, if (transaction_frame) AFR_STACK_DESTROY(transaction_frame); - AFR_STACK_UNWIND(fsync, frame, -1, op_errno, NULL, NULL, NULL); + AFR_STACK_UNWIND(fsync, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c index 7170c505cc..1dcacc1f9e 100644 --- a/xlators/cluster/afr/src/afr-open.c +++ b/xlators/cluster/afr/src/afr-open.c @@ -111,7 +111,7 @@ afr_open_continue(call_frame_t *frame, xlator_t *this, int err) priv = this->private; if (err) { - AFR_STACK_UNWIND(open, frame, -1, err, NULL, NULL); + AFR_STACK_UNWIND(open, frame, gf_failure, err, NULL, NULL); } else { local->call_count = AFR_COUNT(local->child_up, priv->child_count); call_count = local->call_count; @@ -190,7 +190,7 @@ afr_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, return 0; out: - AFR_STACK_UNWIND(open, frame, -1, op_errno, fd, NULL); + AFR_STACK_UNWIND(open, frame, gf_failure, op_errno, fd, NULL); return 0; } diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 45625a469e..f004c74224 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -677,7 +677,7 @@ dht_discover_complete(xlator_t *this, call_frame_t *discover_frame) return 0; out: - DHT_STACK_UNWIND(lookup, main_frame, -1, op_errno, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, main_frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return ret; } @@ -1245,7 +1245,7 @@ dht_do_discover(call_frame_t *frame, xlator_t *this, loc_t *loc) return 0; err: - DHT_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -1629,7 +1629,7 @@ dht_lookup_directory(call_frame_t *frame, xlator_t *this, loc_t *loc) } return 0; unwind: - DHT_STACK_UNWIND(lookup, frame, -1, ENOMEM, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); out: return 0; } @@ -2119,7 +2119,7 @@ dht_lookup_unlink_of_false_linkto_cbk(call_frame_t *frame, void *cookie, "is set for %s", ((path == NULL) ? "null" : path)); } - DHT_STACK_UNWIND(lookup, frame, -1, EIO, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, EIO, NULL, NULL, NULL, NULL); } } @@ -2154,7 +2154,7 @@ dht_lookup_unlink_stale_linkto_cbk(call_frame_t *frame, void *cookie, "op_errno %d for %s", op_ret, op_errno, ((path == NULL) ? "null" : path)); - DHT_STACK_UNWIND(lookup, frame, -1, ENOENT, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, ENOENT, NULL, NULL, NULL, NULL); return 0; } @@ -2374,12 +2374,12 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) "subvolume and directory on another. " "Please fix it manually", local->loc.path, gfid); - DHT_STACK_UNWIND(lookup, frame, -1, EIO, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, EIO, NULL, NULL, NULL, NULL); return 0; } if (local->op_ret && local->gfid_missing) { if (gf_uuid_is_null(local->gfid_req)) { - DHT_STACK_UNWIND(lookup, frame, -1, ENODATA, NULL, NULL, NULL, + DHT_STACK_UNWIND(lookup, frame, gf_failure, ENODATA, NULL, NULL, NULL, NULL); return 0; } @@ -2431,7 +2431,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) * loss because of the above mentioned race. */ - DHT_STACK_UNWIND(lookup, frame, -1, ENOENT, NULL, NULL, NULL, + DHT_STACK_UNWIND(lookup, frame, gf_failure, ENOENT, NULL, NULL, NULL, NULL); } else { local->skip_unlink.handle_valid_link = _gf_false; @@ -2453,7 +2453,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) "unlink on hashed is not skipped %s", local->loc.path); - DHT_STACK_UNWIND(lookup, frame, -1, ENOENT, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, ENOENT, NULL, NULL, NULL, NULL); } return 0; } @@ -2490,7 +2490,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) if (gf_uuid_compare(local->skip_unlink.cached_gfid, local->skip_unlink.hashed_gfid)) { /*GFID different, return error*/ - DHT_STACK_UNWIND(lookup, frame, -1, ESTALE, NULL, NULL, + DHT_STACK_UNWIND(lookup, frame, gf_failure, ESTALE, NULL, NULL, NULL, NULL); return 0; @@ -2545,7 +2545,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) local->xattr_req); if (ret) { - DHT_STACK_UNWIND(lookup, frame, -1, EIO, NULL, NULL, + DHT_STACK_UNWIND(lookup, frame, gf_failure, EIO, NULL, NULL, NULL, NULL); } else { local->call_cnt = 1; @@ -2567,7 +2567,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) if (local->need_lookup_everywhere) { if (gf_uuid_compare(local->gfid, local->inode->gfid)) { /* GFID different, return error */ - DHT_STACK_UNWIND(lookup, frame, -1, ENOENT, NULL, NULL, NULL, + DHT_STACK_UNWIND(lookup, frame, gf_failure, ENOENT, NULL, NULL, NULL, NULL); return 0; } @@ -2894,7 +2894,7 @@ dht_lookup_everywhere(call_frame_t *frame, xlator_t *this, loc_t *loc) return 0; out: - DHT_STACK_UNWIND(lookup, frame, -1, EINVAL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL); err: return -1; } @@ -3374,7 +3374,7 @@ dht_do_fresh_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc) return 0; err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -3487,7 +3487,7 @@ dht_do_revalidate(call_frame_t *frame, xlator_t *this, loc_t *loc) return 0; err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -3587,7 +3587,7 @@ dht_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) return 0; err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -4402,7 +4402,7 @@ dht_find_local_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_FREE(conf->local_nodeuuids[index].elements); conf->local_nodeuuids[index].elements = NULL; - DHT_STACK_UNWIND(getxattr, frame, -1, local->op_errno, NULL, xdata); + DHT_STACK_UNWIND(getxattr, frame, gf_failure, local->op_errno, NULL, xdata); out: GF_FREE(uuid_list_copy); return 0; @@ -4467,7 +4467,7 @@ dht_vgetxattr_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto cleanup; unwind: - DHT_STACK_UNWIND(getxattr, frame, -1, local->op_errno, NULL, NULL); + DHT_STACK_UNWIND(getxattr, frame, gf_failure, local->op_errno, NULL, NULL); cleanup: if (dict) dict_unref(dict); @@ -4514,7 +4514,7 @@ dht_vgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto cleanup; unwind: - DHT_STACK_UNWIND(getxattr, frame, -1, local->op_errno, NULL, NULL); + DHT_STACK_UNWIND(getxattr, frame, gf_failure, local->op_errno, NULL, NULL); cleanup: if (dict) dict_unref(dict); @@ -4575,7 +4575,7 @@ dht_mds_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, xdata); return 0; err: - DHT_STACK_UNWIND(getxattr, frame, -1, EINVAL, NULL, NULL); + DHT_STACK_UNWIND(getxattr, frame, gf_failure, EINVAL, NULL, NULL); return 0; } @@ -4660,7 +4660,7 @@ dht_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } return 0; err: - DHT_STACK_UNWIND(getxattr, frame, -1, EINVAL, NULL, NULL); + DHT_STACK_UNWIND(getxattr, frame, gf_failure, EINVAL, NULL, NULL); return 0; } @@ -5193,7 +5193,7 @@ dht_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(getxattr, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(getxattr, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -5303,7 +5303,7 @@ dht_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *key, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(fgetxattr, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(fgetxattr, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -5695,7 +5695,7 @@ dht_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xattr, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(fsetxattr, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(fsetxattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -5752,14 +5752,14 @@ static int dht_nuke_dir(call_frame_t *frame, xlator_t *this, loc_t *loc, data_t *tmp) { if (!IA_ISDIR(loc->inode->ia_type)) { - DHT_STACK_UNWIND(setxattr, frame, -1, ENOTSUP, NULL); + DHT_STACK_UNWIND(setxattr, frame, gf_failure, ENOTSUP, NULL); return 0; } /* Setxattr didn't need the parent, but rmdir does. */ loc->parent = inode_parent(loc->inode, NULL, NULL); if (!loc->parent) { - DHT_STACK_UNWIND(setxattr, frame, -1, ENOENT, NULL); + DHT_STACK_UNWIND(setxattr, frame, gf_failure, ENOENT, NULL); return 0; } gf_uuid_copy(loc->pargfid, loc->parent->gfid); @@ -6030,7 +6030,7 @@ dht_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(setxattr, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(setxattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -6075,7 +6075,7 @@ dht_removexattr2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; err: - DHT_STACK_UNWIND(removexattr, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(removexattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -6234,7 +6234,7 @@ dht_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(removexattr, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(removexattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -6312,7 +6312,7 @@ dht_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *key, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(fremovexattr, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(fremovexattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -6530,7 +6530,7 @@ dht_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(statfs, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(statfs, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -6611,7 +6611,7 @@ dht_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(opendir, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(opendir, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -7173,7 +7173,7 @@ dht_do_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(readdir, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(readdir, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -7272,7 +7272,7 @@ dht_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(fsyncdir, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(fsyncdir, frame, gf_failure, op_errno, NULL); return 0; } @@ -7388,9 +7388,9 @@ dht_mknod_linkfile_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; err: if (local && local->lock[0].layout.parent_layout.locks) { - local->refresh_layout_unlock(frame, this, -1, 1); + local->refresh_layout_unlock(frame, this, gf_failure, 1); } else { - DHT_STACK_UNWIND(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); } return 0; @@ -7487,7 +7487,7 @@ dht_mknod_do(call_frame_t *frame) local->params); return 0; err: - local->refresh_layout_unlock(frame, this, -1, 1); + local->refresh_layout_unlock(frame, this, gf_failure, 1); return 0; } @@ -7582,9 +7582,9 @@ dht_mknod_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; err: if (local) - dht_mknod_finish(frame, this, -1, 0); + dht_mknod_finish(frame, this, gf_failure, 0); else - DHT_STACK_UNWIND(mknod, frame, -1, EINVAL, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(mknod, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -7970,7 +7970,7 @@ dht_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -8010,7 +8010,7 @@ dht_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -8049,7 +8049,7 @@ dht_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, return 0; err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(unlink, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(unlink, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -8273,7 +8273,7 @@ dht_link2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; err: - DHT_STACK_UNWIND(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -8368,7 +8368,7 @@ dht_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -8555,9 +8555,9 @@ dht_create_linkfile_create_cbk(call_frame_t *frame, void *cookie, return 0; err: if (local && local->lock[0].layout.parent_layout.locks) { - local->refresh_layout_unlock(frame, this, -1, 1); + local->refresh_layout_unlock(frame, this, gf_failure, 1); } else { - DHT_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); } return 0; @@ -8718,7 +8718,7 @@ dht_create_do(call_frame_t *frame) local->fd, local->params); return 0; err: - local->refresh_layout_unlock(frame, this, -1, 1); + local->refresh_layout_unlock(frame, this, gf_failure, 1); return 0; } @@ -8813,9 +8813,9 @@ dht_create_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; err: if (local) - dht_create_finish(frame, this, -1, 0); + dht_create_finish(frame, this, gf_failure, 0); else - DHT_STACK_UNWIND(create, frame, -1, EINVAL, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(create, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -9062,7 +9062,7 @@ dht_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -9125,7 +9125,7 @@ dht_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { if (subvol_filled && (op_ret != -1)) { - ret = dht_layout_merge(this, layout, prev, -1, ENOSPC, NULL); + ret = dht_layout_merge(this, layout, prev, gf_failure, ENOSPC, NULL); } else { if (op_ret == -1 && op_errno == EEXIST) { /* Very likely just a race between mkdir and @@ -9183,7 +9183,7 @@ dht_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, { dht_local_t *local = NULL; dht_conf_t *conf = NULL; - int op_errno = -1, ret = -1; + int op_errno = gf_failure, ret = -1; xlator_t *hashed_subvol = NULL; int32_t *parent_disk_layout = NULL; dht_layout_t *parent_layout = NULL; @@ -9289,7 +9289,7 @@ dht_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, dht_unlock_namespace(frame, &local->lock[0]); op_errno = local ? local->op_errno : op_errno; - DHT_STACK_UNWIND(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); if (parent_disk_layout != NULL) GF_FREE(parent_disk_layout); @@ -9365,7 +9365,7 @@ dht_mkdir_hashed_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_del(local->params, conf->xattr_name); if (dht_is_subvol_filled(this, hashed_subvol)) - ret = dht_layout_merge(this, layout, prev, -1, ENOSPC, NULL); + ret = dht_layout_merge(this, layout, prev, gf_failure, ENOSPC, NULL); else ret = dht_layout_merge(this, layout, prev, op_ret, op_errno, NULL); @@ -9426,7 +9426,7 @@ dht_mkdir_hashed_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_unlock_namespace(frame, &local->lock[0]); } - DHT_STACK_UNWIND(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -9474,7 +9474,7 @@ dht_mkdir_guard_parent_layout_cbk(call_frame_t *frame, xlator_t *this, return 0; err: - DHT_STACK_UNWIND(mkdir, frame, -1, local->op_errno, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(mkdir, frame, gf_failure, local->op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -9577,7 +9577,7 @@ dht_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, err: op_errno = local ? local->op_errno : op_errno; - DHT_STACK_UNWIND(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -9895,7 +9895,7 @@ dht_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; err: - DHT_STACK_UNWIND(rmdir, frame, -1, local->op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(rmdir, frame, gf_failure, local->op_errno, NULL, NULL, NULL); return 0; } @@ -10000,7 +10000,7 @@ dht_rmdir_do(call_frame_t *frame, xlator_t *this) &local->preparent, &local->postparent, NULL); return 0; err: - DHT_STACK_UNWIND(rmdir, frame, -1, EINVAL, NULL, NULL, NULL); + DHT_STACK_UNWIND(rmdir, frame, gf_failure, EINVAL, NULL, NULL, NULL); return 0; } @@ -10639,7 +10639,7 @@ dht_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(rmdir, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(rmdir, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -10699,7 +10699,7 @@ dht_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(entrylk, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(entrylk, frame, gf_failure, op_errno, NULL); return 0; } @@ -10746,7 +10746,7 @@ dht_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(fentrylk, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(fentrylk, frame, gf_failure, op_errno, NULL); return 0; } @@ -10824,7 +10824,7 @@ dht_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata) return 0; err: - DHT_STACK_UNWIND(ipc, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(ipc, frame, gf_failure, op_errno, NULL); return 0; @@ -11401,7 +11401,7 @@ dht_pt_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, err: op_errno = local ? local->op_errno : op_errno; - DHT_STACK_UNWIND(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index a2d6884bf5..a29e279c8b 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -397,64 +397,64 @@ dht_check_and_open_fd_on_subvol_complete(int ret, call_frame_t *frame, switch (fop) { case GF_FOP_WRITE: - DHT_STACK_UNWIND(writev, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); break; case GF_FOP_FLUSH: - DHT_STACK_UNWIND(flush, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(flush, frame, gf_failure, op_errno, NULL); break; case GF_FOP_FSETATTR: - DHT_STACK_UNWIND(fsetattr, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(fsetattr, frame, gf_failure, op_errno, NULL, NULL, NULL); break; case GF_FOP_ZEROFILL: - DHT_STACK_UNWIND(zerofill, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(zerofill, frame, gf_failure, op_errno, NULL, NULL, NULL); break; case GF_FOP_DISCARD: - DHT_STACK_UNWIND(discard, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(discard, frame, gf_failure, op_errno, NULL, NULL, NULL); break; case GF_FOP_FALLOCATE: - DHT_STACK_UNWIND(fallocate, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(fallocate, frame, gf_failure, op_errno, NULL, NULL, NULL); break; case GF_FOP_FTRUNCATE: - DHT_STACK_UNWIND(ftruncate, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(ftruncate, frame, gf_failure, op_errno, NULL, NULL, NULL); break; case GF_FOP_FSYNC: - DHT_STACK_UNWIND(fsync, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(fsync, frame, gf_failure, op_errno, NULL, NULL, NULL); break; case GF_FOP_READ: - DHT_STACK_UNWIND(readv, frame, -1, op_errno, NULL, 0, NULL, NULL, + DHT_STACK_UNWIND(readv, frame, gf_failure, op_errno, NULL, 0, NULL, NULL, NULL); break; case GF_FOP_FSTAT: - DHT_STACK_UNWIND(fstat, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(fstat, frame, gf_failure, op_errno, NULL, NULL); break; case GF_FOP_FSETXATTR: - DHT_STACK_UNWIND(fsetxattr, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(fsetxattr, frame, gf_failure, op_errno, NULL); break; case GF_FOP_FREMOVEXATTR: - DHT_STACK_UNWIND(fremovexattr, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(fremovexattr, frame, gf_failure, op_errno, NULL); break; case GF_FOP_FXATTROP: - DHT_STACK_UNWIND(fxattrop, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(fxattrop, frame, gf_failure, op_errno, NULL, NULL); break; case GF_FOP_FGETXATTR: - DHT_STACK_UNWIND(fgetxattr, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(fgetxattr, frame, gf_failure, op_errno, NULL, NULL); break; case GF_FOP_FINODELK: - DHT_STACK_UNWIND(finodelk, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(finodelk, frame, gf_failure, op_errno, NULL); break; default: diff --git a/xlators/cluster/dht/src/dht-inode-read.c b/xlators/cluster/dht/src/dht-inode-read.c index cb5a129ada..a4ca9abe38 100644 --- a/xlators/cluster/dht/src/dht-inode-read.c +++ b/xlators/cluster/dht/src/dht-inode-read.c @@ -81,7 +81,7 @@ dht_open2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) if (we_are_not_migrating(ret)) { /* This DHT layer is not migrating the file */ - DHT_STACK_UNWIND(open, frame, -1, local->op_errno, NULL, + DHT_STACK_UNWIND(open, frame, gf_failure, local->op_errno, NULL, local->rebalance.xdata); return 0; } @@ -97,7 +97,7 @@ dht_open2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(open, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(open, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -138,7 +138,7 @@ dht_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, fd_t *fd, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(open, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(open, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -255,7 +255,7 @@ dht_attr2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(stat, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(stat, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -351,7 +351,7 @@ dht_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(stat, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(stat, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -407,7 +407,7 @@ dht_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(fstat, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(fstat, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -510,7 +510,7 @@ dht_readv2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(readv, frame, -1, op_errno, NULL, 0, NULL, NULL, NULL); + DHT_STACK_UNWIND(readv, frame, gf_failure, op_errno, NULL, 0, NULL, NULL, NULL); return 0; } @@ -555,7 +555,7 @@ dht_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t off, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(readv, frame, -1, op_errno, NULL, 0, NULL, NULL, NULL); + DHT_STACK_UNWIND(readv, frame, gf_failure, op_errno, NULL, 0, NULL, NULL, NULL); return 0; } @@ -626,7 +626,7 @@ dht_access2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) * can handle this. */ - DHT_STACK_UNWIND(access, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(access, frame, gf_failure, op_errno, NULL); return 0; } @@ -642,7 +642,7 @@ dht_access2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(access, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(access, frame, gf_failure, op_errno, NULL); return 0; } @@ -685,7 +685,7 @@ dht_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(access, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(access, frame, gf_failure, op_errno, NULL); return 0; } @@ -761,7 +761,7 @@ dht_flush2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(flush, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(flush, frame, gf_failure, op_errno, NULL); return 0; } @@ -800,7 +800,7 @@ dht_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(flush, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(flush, frame, gf_failure, op_errno, NULL); return 0; } @@ -917,7 +917,7 @@ dht_fsync2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(fsync, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(fsync, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -953,7 +953,7 @@ dht_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(fsync, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(fsync, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1034,7 +1034,7 @@ dht_lk2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(lk, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(lk, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1085,7 +1085,7 @@ dht_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int cmd, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(lk, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(lk, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1127,7 +1127,7 @@ dht_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(lease, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(lease, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1191,7 +1191,7 @@ dht_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(readlink, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(readlink, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1361,9 +1361,9 @@ dht_common_xattrop2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, * function here */ if (local && (local->fop == GF_FOP_XATTROP)) { - DHT_STACK_UNWIND(xattrop, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(xattrop, frame, gf_failure, op_errno, NULL, NULL); } else { - DHT_STACK_UNWIND(fxattrop, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(fxattrop, frame, gf_failure, op_errno, NULL, NULL); } return 0; } @@ -1452,7 +1452,7 @@ dht_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(xattrop, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(xattrop, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1522,7 +1522,7 @@ dht_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(fxattrop, frame, -1, op_errno, NULL, NULL); + DHT_STACK_UNWIND(fxattrop, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1577,7 +1577,7 @@ dht_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(inodelk, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(inodelk, frame, gf_failure, op_errno, NULL); return 0; } @@ -1658,7 +1658,7 @@ dht_finodelk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(finodelk, frame, -1, op_errno, NULL); + DHT_STACK_UNWIND(finodelk, frame, gf_failure, op_errno, NULL); return 0; } diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c index 4c7aaa56b4..f7bc8ef7e5 100644 --- a/xlators/cluster/dht/src/dht-inode-write.c +++ b/xlators/cluster/dht/src/dht-inode-write.c @@ -179,7 +179,7 @@ dht_writev2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(writev, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -230,7 +230,7 @@ dht_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(writev, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -374,7 +374,7 @@ dht_truncate2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(truncate, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(truncate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -417,7 +417,7 @@ dht_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(truncate, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(truncate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -459,7 +459,7 @@ dht_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(ftruncate, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(ftruncate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -591,7 +591,7 @@ dht_fallocate2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(fallocate, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(fallocate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -637,7 +637,7 @@ dht_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(fallocate, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(fallocate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -766,7 +766,7 @@ dht_discard2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(discard, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(discard, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -810,7 +810,7 @@ dht_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(discard, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(discard, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -941,7 +941,7 @@ dht_zerofill2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) out: - DHT_STACK_UNWIND(zerofill, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(zerofill, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -985,7 +985,7 @@ dht_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(zerofill, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(zerofill, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1092,7 +1092,7 @@ dht_setattr2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; out: - DHT_STACK_UNWIND(setattr, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(setattr, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1332,7 +1332,7 @@ dht_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(setattr, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(setattr, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1400,7 +1400,7 @@ dht_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(fsetattr, frame, -1, op_errno, NULL, NULL, NULL); + DHT_STACK_UNWIND(fsetattr, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c index fb0060747e..6a957ce5fd 100644 --- a/xlators/cluster/dht/src/dht-rename.c +++ b/xlators/cluster/dht/src/dht-rename.c @@ -606,7 +606,7 @@ dht_rename_dir(call_frame_t *frame, xlator_t *this) return 0; err: - DHT_STACK_UNWIND(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1972,7 +1972,7 @@ dht_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c index a0e6af5823..7647f13d43 100644 --- a/xlators/cluster/dht/src/nufa.c +++ b/xlators/cluster/dht/src/nufa.c @@ -238,7 +238,7 @@ nufa_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -264,7 +264,7 @@ nufa_create_linkfile_create_cbk(call_frame_t *frame, void *cookie, return 0; err: - DHT_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -329,7 +329,7 @@ nufa_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -429,7 +429,7 @@ nufa_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c index eaed19eaad..9fdb5e426e 100644 --- a/xlators/cluster/dht/src/switch.c +++ b/xlators/cluster/dht/src/switch.c @@ -344,7 +344,7 @@ switch_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -370,7 +370,7 @@ switch_create_linkfile_create_cbk(call_frame_t *frame, void *cookie, return 0; err: - DHT_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -434,7 +434,7 @@ switch_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL, + DHT_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -531,7 +531,7 @@ switch_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, err: op_errno = (op_errno == -1) ? errno : op_errno; - DHT_STACK_UNWIND(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + DHT_STACK_UNWIND(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c index 7468888aae..0000ab086d 100644 --- a/xlators/cluster/ec/src/ec.c +++ b/xlators/cluster/ec/src/ec.c @@ -919,7 +919,7 @@ int32_t ec_gf_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, dict_t *xdata) { - ec_access(frame, this, -1, EC_MINIMUM_ONE, default_access_cbk, NULL, loc, + ec_access(frame, this, gf_failure, EC_MINIMUM_ONE, default_access_cbk, NULL, loc, mask, xdata); return 0; @@ -929,7 +929,7 @@ int32_t ec_gf_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata) { - ec_create(frame, this, -1, EC_MINIMUM_MIN, default_create_cbk, NULL, loc, + ec_create(frame, this, gf_failure, EC_MINIMUM_MIN, default_create_cbk, NULL, loc, flags, mode, umask, fd, xdata); return 0; @@ -939,7 +939,7 @@ int32_t ec_gf_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, size_t len, dict_t *xdata) { - ec_discard(frame, this, -1, EC_MINIMUM_MIN, default_discard_cbk, NULL, fd, + ec_discard(frame, this, gf_failure, EC_MINIMUM_MIN, default_discard_cbk, NULL, fd, offset, len, xdata); return 0; @@ -954,7 +954,7 @@ ec_gf_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, if (cmd == ENTRYLK_UNLOCK) fop_flags = EC_MINIMUM_ONE; - ec_entrylk(frame, this, -1, fop_flags, default_entrylk_cbk, NULL, volume, + ec_entrylk(frame, this, gf_failure, fop_flags, default_entrylk_cbk, NULL, volume, loc, basename, cmd, type, xdata); return 0; @@ -969,7 +969,7 @@ ec_gf_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, if (cmd == ENTRYLK_UNLOCK) fop_flags = EC_MINIMUM_ONE; - ec_fentrylk(frame, this, -1, fop_flags, default_fentrylk_cbk, NULL, volume, + ec_fentrylk(frame, this, gf_failure, fop_flags, default_fentrylk_cbk, NULL, volume, fd, basename, cmd, type, xdata); return 0; @@ -979,7 +979,7 @@ int32_t ec_gf_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, off_t offset, size_t len, dict_t *xdata) { - ec_fallocate(frame, this, -1, EC_MINIMUM_MIN, default_fallocate_cbk, NULL, + ec_fallocate(frame, this, gf_failure, EC_MINIMUM_MIN, default_fallocate_cbk, NULL, fd, mode, offset, len, xdata); return 0; @@ -988,7 +988,7 @@ ec_gf_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, int32_t ec_gf_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - ec_flush(frame, this, -1, EC_MINIMUM_MIN, default_flush_cbk, NULL, fd, + ec_flush(frame, this, gf_failure, EC_MINIMUM_MIN, default_flush_cbk, NULL, fd, xdata); return 0; @@ -998,7 +998,7 @@ int32_t ec_gf_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, dict_t *xdata) { - ec_fsync(frame, this, -1, EC_MINIMUM_MIN, default_fsync_cbk, NULL, fd, + ec_fsync(frame, this, gf_failure, EC_MINIMUM_MIN, default_fsync_cbk, NULL, fd, datasync, xdata); return 0; @@ -1008,7 +1008,7 @@ int32_t ec_gf_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, dict_t *xdata) { - ec_fsyncdir(frame, this, -1, EC_MINIMUM_MIN, default_fsyncdir_cbk, NULL, fd, + ec_fsyncdir(frame, this, gf_failure, EC_MINIMUM_MIN, default_fsyncdir_cbk, NULL, fd, datasync, xdata); return 0; @@ -1078,13 +1078,13 @@ ec_gf_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, fop_flags = EC_MINIMUM_ALL; } - ec_getxattr(frame, this, -1, fop_flags, default_getxattr_cbk, NULL, loc, + ec_getxattr(frame, this, gf_failure, fop_flags, default_getxattr_cbk, NULL, loc, name, xdata); return 0; out: error = ENODATA; - STACK_UNWIND_STRICT(getxattr, frame, -1, error, NULL, NULL); + STACK_UNWIND_STRICT(getxattr, frame, gf_failure, error, NULL, NULL); return 0; } @@ -1096,12 +1096,12 @@ ec_gf_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, EC_INTERNAL_XATTR_OR_GOTO(name, NULL, error, out); - ec_fgetxattr(frame, this, -1, EC_MINIMUM_ONE, default_fgetxattr_cbk, NULL, + ec_fgetxattr(frame, this, gf_failure, EC_MINIMUM_ONE, default_fgetxattr_cbk, NULL, fd, name, xdata); return 0; out: error = ENODATA; - STACK_UNWIND_STRICT(fgetxattr, frame, -1, error, NULL, NULL); + STACK_UNWIND_STRICT(fgetxattr, frame, gf_failure, error, NULL, NULL); return 0; } @@ -1114,7 +1114,7 @@ ec_gf_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, if (flock->l_type == F_UNLCK) fop_flags = EC_MINIMUM_ONE; - ec_inodelk(frame, this, &frame->root->lk_owner, -1, fop_flags, + ec_inodelk(frame, this, &frame->root->lk_owner, gf_failure, fop_flags, default_inodelk_cbk, NULL, volume, loc, cmd, flock, xdata); return 0; @@ -1128,7 +1128,7 @@ ec_gf_finodelk(call_frame_t *frame, xlator_t *this, const char *volume, if (flock->l_type == F_UNLCK) fop_flags = EC_MINIMUM_ONE; - ec_finodelk(frame, this, &frame->root->lk_owner, -1, fop_flags, + ec_finodelk(frame, this, &frame->root->lk_owner, gf_failure, fop_flags, default_finodelk_cbk, NULL, volume, fd, cmd, flock, xdata); return 0; @@ -1138,7 +1138,7 @@ int32_t ec_gf_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { - ec_link(frame, this, -1, EC_MINIMUM_MIN, default_link_cbk, NULL, oldloc, + ec_link(frame, this, gf_failure, EC_MINIMUM_MIN, default_link_cbk, NULL, oldloc, newloc, xdata); return 0; @@ -1152,7 +1152,7 @@ ec_gf_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, if (flock->l_type == F_UNLCK) fop_flags = EC_MINIMUM_ONE; - ec_lk(frame, this, -1, fop_flags, default_lk_cbk, NULL, fd, cmd, flock, + ec_lk(frame, this, gf_failure, fop_flags, default_lk_cbk, NULL, fd, cmd, flock, xdata); return 0; @@ -1161,7 +1161,7 @@ ec_gf_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, int32_t ec_gf_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { - ec_lookup(frame, this, -1, EC_MINIMUM_MIN, default_lookup_cbk, NULL, loc, + ec_lookup(frame, this, gf_failure, EC_MINIMUM_MIN, default_lookup_cbk, NULL, loc, xdata); return 0; @@ -1171,7 +1171,7 @@ int32_t ec_gf_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata) { - ec_mkdir(frame, this, -1, EC_MINIMUM_MIN, default_mkdir_cbk, NULL, loc, + ec_mkdir(frame, this, gf_failure, EC_MINIMUM_MIN, default_mkdir_cbk, NULL, loc, mode, umask, xdata); return 0; @@ -1181,7 +1181,7 @@ int32_t ec_gf_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata) { - ec_mknod(frame, this, -1, EC_MINIMUM_MIN, default_mknod_cbk, NULL, loc, + ec_mknod(frame, this, gf_failure, EC_MINIMUM_MIN, default_mknod_cbk, NULL, loc, mode, rdev, umask, xdata); return 0; @@ -1191,7 +1191,7 @@ int32_t ec_gf_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, fd_t *fd, dict_t *xdata) { - ec_open(frame, this, -1, EC_MINIMUM_MIN, default_open_cbk, NULL, loc, flags, + ec_open(frame, this, gf_failure, EC_MINIMUM_MIN, default_open_cbk, NULL, loc, flags, fd, xdata); return 0; @@ -1201,7 +1201,7 @@ int32_t ec_gf_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, dict_t *xdata) { - ec_opendir(frame, this, -1, EC_MINIMUM_MIN, default_opendir_cbk, NULL, loc, + ec_opendir(frame, this, gf_failure, EC_MINIMUM_MIN, default_opendir_cbk, NULL, loc, fd, xdata); return 0; @@ -1211,7 +1211,7 @@ int32_t ec_gf_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, dict_t *xdata) { - ec_readdir(frame, this, -1, EC_MINIMUM_ONE, default_readdir_cbk, NULL, fd, + ec_readdir(frame, this, gf_failure, EC_MINIMUM_ONE, default_readdir_cbk, NULL, fd, size, offset, xdata); return 0; @@ -1221,7 +1221,7 @@ int32_t ec_gf_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, dict_t *xdata) { - ec_readdirp(frame, this, -1, EC_MINIMUM_ONE, default_readdirp_cbk, NULL, fd, + ec_readdirp(frame, this, gf_failure, EC_MINIMUM_ONE, default_readdirp_cbk, NULL, fd, size, offset, xdata); return 0; @@ -1231,7 +1231,7 @@ int32_t ec_gf_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, dict_t *xdata) { - ec_readlink(frame, this, -1, EC_MINIMUM_ONE, default_readlink_cbk, NULL, + ec_readlink(frame, this, gf_failure, EC_MINIMUM_ONE, default_readlink_cbk, NULL, loc, size, xdata); return 0; @@ -1241,7 +1241,7 @@ int32_t ec_gf_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata) { - ec_readv(frame, this, -1, EC_MINIMUM_MIN, default_readv_cbk, NULL, fd, size, + ec_readv(frame, this, gf_failure, EC_MINIMUM_MIN, default_readv_cbk, NULL, fd, size, offset, flags, xdata); return 0; @@ -1255,12 +1255,12 @@ ec_gf_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, EC_INTERNAL_XATTR_OR_GOTO(name, xdata, error, out); - ec_removexattr(frame, this, -1, EC_MINIMUM_MIN, default_removexattr_cbk, + ec_removexattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_removexattr_cbk, NULL, loc, name, xdata); return 0; out: - STACK_UNWIND_STRICT(removexattr, frame, -1, error, NULL); + STACK_UNWIND_STRICT(removexattr, frame, gf_failure, error, NULL); return 0; } @@ -1272,12 +1272,12 @@ ec_gf_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, EC_INTERNAL_XATTR_OR_GOTO(name, xdata, error, out); - ec_fremovexattr(frame, this, -1, EC_MINIMUM_MIN, default_fremovexattr_cbk, + ec_fremovexattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_fremovexattr_cbk, NULL, fd, name, xdata); return 0; out: - STACK_UNWIND_STRICT(fremovexattr, frame, -1, error, NULL); + STACK_UNWIND_STRICT(fremovexattr, frame, gf_failure, error, NULL); return 0; } @@ -1285,7 +1285,7 @@ int32_t ec_gf_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { - ec_rename(frame, this, -1, EC_MINIMUM_MIN, default_rename_cbk, NULL, oldloc, + ec_rename(frame, this, gf_failure, EC_MINIMUM_MIN, default_rename_cbk, NULL, oldloc, newloc, xdata); return 0; @@ -1295,7 +1295,7 @@ int32_t ec_gf_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, dict_t *xdata) { - ec_rmdir(frame, this, -1, EC_MINIMUM_MIN, default_rmdir_cbk, NULL, loc, + ec_rmdir(frame, this, gf_failure, EC_MINIMUM_MIN, default_rmdir_cbk, NULL, loc, xflags, xdata); return 0; @@ -1305,7 +1305,7 @@ int32_t ec_gf_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, int32_t valid, dict_t *xdata) { - ec_setattr(frame, this, -1, EC_MINIMUM_MIN, default_setattr_cbk, NULL, loc, + ec_setattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_setattr_cbk, NULL, loc, stbuf, valid, xdata); return 0; @@ -1315,7 +1315,7 @@ int32_t ec_gf_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, int32_t valid, dict_t *xdata) { - ec_fsetattr(frame, this, -1, EC_MINIMUM_MIN, default_fsetattr_cbk, NULL, fd, + ec_fsetattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_fsetattr_cbk, NULL, fd, stbuf, valid, xdata); return 0; @@ -1329,12 +1329,12 @@ ec_gf_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, EC_INTERNAL_XATTR_OR_GOTO("", dict, error, out); - ec_setxattr(frame, this, -1, EC_MINIMUM_MIN, default_setxattr_cbk, NULL, + ec_setxattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_setxattr_cbk, NULL, loc, dict, flags, xdata); return 0; out: - STACK_UNWIND_STRICT(setxattr, frame, -1, error, NULL); + STACK_UNWIND_STRICT(setxattr, frame, gf_failure, error, NULL); return 0; } @@ -1346,19 +1346,19 @@ ec_gf_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, EC_INTERNAL_XATTR_OR_GOTO("", dict, error, out); - ec_fsetxattr(frame, this, -1, EC_MINIMUM_MIN, default_fsetxattr_cbk, NULL, + ec_fsetxattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_fsetxattr_cbk, NULL, fd, dict, flags, xdata); return 0; out: - STACK_UNWIND_STRICT(fsetxattr, frame, -1, error, NULL); + STACK_UNWIND_STRICT(fsetxattr, frame, gf_failure, error, NULL); return 0; } int32_t ec_gf_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { - ec_stat(frame, this, -1, EC_MINIMUM_MIN, default_stat_cbk, NULL, loc, + ec_stat(frame, this, gf_failure, EC_MINIMUM_MIN, default_stat_cbk, NULL, loc, xdata); return 0; @@ -1367,7 +1367,7 @@ ec_gf_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t ec_gf_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - ec_fstat(frame, this, -1, EC_MINIMUM_MIN, default_fstat_cbk, NULL, fd, + ec_fstat(frame, this, gf_failure, EC_MINIMUM_MIN, default_fstat_cbk, NULL, fd, xdata); return 0; @@ -1376,7 +1376,7 @@ ec_gf_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) int32_t ec_gf_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { - ec_statfs(frame, this, -1, EC_MINIMUM_MIN, default_statfs_cbk, NULL, loc, + ec_statfs(frame, this, gf_failure, EC_MINIMUM_MIN, default_statfs_cbk, NULL, loc, xdata); return 0; @@ -1386,7 +1386,7 @@ int32_t ec_gf_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, loc_t *loc, mode_t umask, dict_t *xdata) { - ec_symlink(frame, this, -1, EC_MINIMUM_MIN, default_symlink_cbk, NULL, + ec_symlink(frame, this, gf_failure, EC_MINIMUM_MIN, default_symlink_cbk, NULL, linkname, loc, umask, xdata); return 0; @@ -1396,7 +1396,7 @@ int32_t ec_gf_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, dict_t *xdata) { - ec_truncate(frame, this, -1, EC_MINIMUM_MIN, default_truncate_cbk, NULL, + ec_truncate(frame, this, gf_failure, EC_MINIMUM_MIN, default_truncate_cbk, NULL, loc, offset, xdata); return 0; @@ -1406,7 +1406,7 @@ int32_t ec_gf_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, dict_t *xdata) { - ec_ftruncate(frame, this, -1, EC_MINIMUM_MIN, default_ftruncate_cbk, NULL, + ec_ftruncate(frame, this, gf_failure, EC_MINIMUM_MIN, default_ftruncate_cbk, NULL, fd, offset, xdata); return 0; @@ -1416,7 +1416,7 @@ int32_t ec_gf_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, dict_t *xdata) { - ec_unlink(frame, this, -1, EC_MINIMUM_MIN, default_unlink_cbk, NULL, loc, + ec_unlink(frame, this, gf_failure, EC_MINIMUM_MIN, default_unlink_cbk, NULL, loc, xflags, xdata); return 0; @@ -1427,7 +1427,7 @@ ec_gf_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, int32_t count, off_t offset, uint32_t flags, struct iobref *iobref, dict_t *xdata) { - ec_writev(frame, this, -1, EC_MINIMUM_MIN, default_writev_cbk, NULL, fd, + ec_writev(frame, this, gf_failure, EC_MINIMUM_MIN, default_writev_cbk, NULL, fd, vector, count, offset, flags, iobref, xdata); return 0; @@ -1437,7 +1437,7 @@ int32_t ec_gf_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata) { - ec_xattrop(frame, this, -1, EC_MINIMUM_MIN, default_xattrop_cbk, NULL, loc, + ec_xattrop(frame, this, gf_failure, EC_MINIMUM_MIN, default_xattrop_cbk, NULL, loc, optype, xattr, xdata); return 0; @@ -1447,7 +1447,7 @@ int32_t ec_gf_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata) { - ec_fxattrop(frame, this, -1, EC_MINIMUM_MIN, default_fxattrop_cbk, NULL, fd, + ec_fxattrop(frame, this, gf_failure, EC_MINIMUM_MIN, default_fxattrop_cbk, NULL, fd, optype, xattr, xdata); return 0; @@ -1466,7 +1466,7 @@ int32_t ec_gf_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, gf_seek_what_t what, dict_t *xdata) { - ec_seek(frame, this, -1, EC_MINIMUM_ONE, default_seek_cbk, NULL, fd, offset, + ec_seek(frame, this, gf_failure, EC_MINIMUM_ONE, default_seek_cbk, NULL, fd, offset, what, xdata); return 0; @@ -1475,7 +1475,7 @@ ec_gf_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t ec_gf_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata) { - ec_ipc(frame, this, -1, EC_MINIMUM_MIN, default_ipc_cbk, NULL, op, xdata); + ec_ipc(frame, this, gf_failure, EC_MINIMUM_MIN, default_ipc_cbk, NULL, op, xdata); return 0; } diff --git a/xlators/debug/error-gen/src/error-gen.c b/xlators/debug/error-gen/src/error-gen.c index d45655ef4c..db71114c77 100644 --- a/xlators/debug/error-gen/src/error-gen.c +++ b/xlators/debug/error-gen/src/error-gen.c @@ -293,8 +293,8 @@ error_gen_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) op_errno = error_gen(this, GF_FOP_LOOKUP); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(lookup, frame, -1, op_errno, NULL, NULL, NULL, + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -318,8 +318,8 @@ error_gen_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) op_errno = error_gen(this, GF_FOP_STAT); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(stat, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(stat, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -343,8 +343,8 @@ error_gen_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, op_errno = error_gen(this, GF_FOP_SETATTR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(setattr, frame, -1, op_errno, NULL, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(setattr, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -368,8 +368,8 @@ error_gen_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, op_errno = error_gen(this, GF_FOP_FSETATTR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(fsetattr, frame, -1, op_errno, NULL, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(fsetattr, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -393,8 +393,8 @@ error_gen_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, op_errno = error_gen(this, GF_FOP_TRUNCATE); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(truncate, frame, -1, op_errno, NULL, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -418,8 +418,8 @@ error_gen_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, op_errno = error_gen(this, GF_FOP_FTRUNCATE); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(ftruncate, frame, -1, op_errno, NULL, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(ftruncate, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -443,8 +443,8 @@ error_gen_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, op_errno = error_gen(this, GF_FOP_ACCESS); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(access, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(access, frame, gf_failure, op_errno, xdata); return 0; } @@ -468,8 +468,8 @@ error_gen_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, op_errno = error_gen(this, GF_FOP_READLINK); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(readlink, frame, -1, op_errno, NULL, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(readlink, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -493,8 +493,8 @@ error_gen_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, op_errno = error_gen(this, GF_FOP_MKNOD); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, xdata); return 0; } @@ -519,8 +519,8 @@ error_gen_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, op_errno = error_gen(this, GF_FOP_MKDIR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, xdata); return 0; } @@ -545,8 +545,8 @@ error_gen_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, op_errno = error_gen(this, GF_FOP_UNLINK); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(unlink, frame, -1, op_errno, NULL, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -570,8 +570,8 @@ error_gen_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, op_errno = error_gen(this, GF_FOP_RMDIR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(rmdir, frame, -1, op_errno, NULL, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(rmdir, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -595,8 +595,8 @@ error_gen_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, op_errno = error_gen(this, GF_FOP_SYMLINK); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(symlink, frame, -1, op_errno, NULL, NULL, NULL, + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(symlink, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); /* pre & post parent attr */ return 0; } @@ -621,8 +621,8 @@ error_gen_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, op_errno = error_gen(this, GF_FOP_RENAME); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -647,8 +647,8 @@ error_gen_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, op_errno = error_gen(this, GF_FOP_LINK); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -673,8 +673,8 @@ error_gen_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, op_errno = error_gen(this, GF_FOP_CREATE); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -699,8 +699,8 @@ error_gen_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, op_errno = error_gen(this, GF_FOP_OPEN); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(open, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(open, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -724,8 +724,8 @@ error_gen_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, op_errno = error_gen(this, GF_FOP_READ); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(readv, frame, -1, op_errno, NULL, 0, NULL, NULL, + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(readv, frame, gf_failure, op_errno, NULL, 0, NULL, NULL, xdata); return 0; } @@ -762,8 +762,8 @@ error_gen_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, count = 1; goto wind; } else if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(writev, frame, -1, op_errno, NULL, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(writev, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } wind: @@ -790,8 +790,8 @@ error_gen_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) op_errno = error_gen(this, GF_FOP_FLUSH); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(flush, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(flush, frame, gf_failure, op_errno, xdata); return 0; } @@ -815,8 +815,8 @@ error_gen_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, op_errno = error_gen(this, GF_FOP_FSYNC); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(fsync, frame, -1, op_errno, NULL, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(fsync, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -839,8 +839,8 @@ error_gen_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) op_errno = error_gen(this, GF_FOP_FSTAT); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(fstat, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(fstat, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -864,8 +864,8 @@ error_gen_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, op_errno = error_gen(this, GF_FOP_OPENDIR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(opendir, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(opendir, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -889,8 +889,8 @@ error_gen_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, op_errno = error_gen(this, GF_FOP_FSYNCDIR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(fsyncdir, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(fsyncdir, frame, gf_failure, op_errno, xdata); return 0; } @@ -913,8 +913,8 @@ error_gen_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) op_errno = error_gen(this, GF_FOP_STATFS); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(statfs, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(statfs, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -938,8 +938,8 @@ error_gen_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, op_errno = error_gen(this, GF_FOP_SETXATTR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(setxattr, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(setxattr, frame, gf_failure, op_errno, xdata); return 0; } @@ -963,8 +963,8 @@ error_gen_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, op_errno = error_gen(this, GF_FOP_GETXATTR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(getxattr, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(getxattr, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -988,8 +988,8 @@ error_gen_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, op_errno = error_gen(this, GF_FOP_FSETXATTR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(fsetxattr, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(fsetxattr, frame, gf_failure, op_errno, xdata); return 0; } @@ -1013,8 +1013,8 @@ error_gen_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, op_errno = error_gen(this, GF_FOP_FGETXATTR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(fgetxattr, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(fgetxattr, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -1038,8 +1038,8 @@ error_gen_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, op_errno = error_gen(this, GF_FOP_XATTROP); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(xattrop, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(xattrop, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -1063,8 +1063,8 @@ error_gen_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, op_errno = error_gen(this, GF_FOP_FXATTROP); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(fxattrop, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(fxattrop, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -1088,8 +1088,8 @@ error_gen_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, op_errno = error_gen(this, GF_FOP_REMOVEXATTR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(removexattr, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(removexattr, frame, gf_failure, op_errno, xdata); return 0; } @@ -1113,8 +1113,8 @@ error_gen_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, op_errno = error_gen(this, GF_FOP_FREMOVEXATTR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(fremovexattr, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(fremovexattr, frame, gf_failure, op_errno, xdata); return 0; } @@ -1138,8 +1138,8 @@ error_gen_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, op_errno = error_gen(this, GF_FOP_LK); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(lk, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(lk, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -1163,8 +1163,8 @@ error_gen_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, op_errno = error_gen(this, GF_FOP_INODELK); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(inodelk, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(inodelk, frame, gf_failure, op_errno, xdata); return 0; } @@ -1188,8 +1188,8 @@ error_gen_finodelk(call_frame_t *frame, xlator_t *this, const char *volume, op_errno = error_gen(this, GF_FOP_FINODELK); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(finodelk, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(finodelk, frame, gf_failure, op_errno, xdata); return 0; } @@ -1214,8 +1214,8 @@ error_gen_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, op_errno = error_gen(this, GF_FOP_ENTRYLK); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(entrylk, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(entrylk, frame, gf_failure, op_errno, xdata); return 0; } @@ -1240,8 +1240,8 @@ error_gen_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, op_errno = error_gen(this, GF_FOP_FENTRYLK); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(fentrylk, frame, -1, op_errno, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(fentrylk, frame, gf_failure, op_errno, xdata); return 0; } @@ -1265,8 +1265,8 @@ error_gen_getspec(call_frame_t *frame, xlator_t *this, const char *key, op_errno = error_gen(this, GF_FOP_GETSPEC); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(getspec, frame, -1, op_errno, NULL); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(getspec, frame, gf_failure, op_errno, NULL); return 0; } @@ -1290,8 +1290,8 @@ error_gen_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, op_errno = error_gen(this, GF_FOP_READDIR); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(readdir, frame, -1, op_errno, NULL, xdata); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(readdir, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -1315,8 +1315,8 @@ error_gen_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, op_errno = error_gen(this, GF_FOP_READDIRP); if (op_errno) { - GF_ERROR(this, "unwind(-1, %s)", strerror(op_errno)); - STACK_UNWIND_STRICT(readdirp, frame, -1, op_errno, NULL, NULL); + GF_ERROR(this, "unwind(gf_failure, %s)", strerror(op_errno)); + STACK_UNWIND_STRICT(readdirp, frame, gf_failure, op_errno, NULL, NULL); return 0; } diff --git a/xlators/features/arbiter/src/arbiter.c b/xlators/features/arbiter/src/arbiter.c index 1543e2f27f..65c7f1a7c3 100644 --- a/xlators/features/arbiter/src/arbiter.c +++ b/xlators/features/arbiter/src/arbiter.c @@ -264,7 +264,7 @@ static int32_t arbiter_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata) { - STACK_UNWIND_STRICT(readv, frame, -1, ENOSYS, NULL, 0, NULL, NULL, NULL); + STACK_UNWIND_STRICT(readv, frame, gf_failure, ENOSYS, NULL, 0, NULL, NULL, NULL); return 0; } @@ -272,7 +272,7 @@ static int32_t arbiter_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, gf_seek_what_t what, dict_t *xdata) { - STACK_UNWIND_STRICT(seek, frame, -1, ENOSYS, 0, xdata); + STACK_UNWIND_STRICT(seek, frame, gf_failure, ENOSYS, 0, xdata); return 0; } diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c index b5954047f8..9e33073935 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c @@ -752,7 +752,7 @@ br_stub_fd_incversioning_cbk(call_frame_t *frame, void *cookie, xlator_t *this, done: if (op_ret < 0) { frame->local = NULL; - call_unwind_error(local->fopstub, -1, op_errno); + call_unwind_error(local->fopstub, gf_failure, op_errno); br_stub_cleanup_local(local); br_stub_dealloc_local(local); } else { @@ -874,7 +874,7 @@ br_stub_perform_incversioning(xlator_t *this, call_frame_t *frame, if (ret) { if (local) frame->local = NULL; - call_unwind_error(stub, -1, op_errno); + call_unwind_error(stub, gf_failure, op_errno); if (local) { br_stub_cleanup_local(local); br_stub_dealloc_local(local); @@ -2542,7 +2542,7 @@ br_stub_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, xdata); return 0; unwind: - STACK_UNWIND_STRICT(create, frame, -1, EINVAL, NULL, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -2593,7 +2593,7 @@ br_stub_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, FIRST_CHILD(this)->fops->mknod, loc, mode, dev, umask, xdata); return 0; unwind: - STACK_UNWIND_STRICT(mknod, frame, -1, EINVAL, NULL, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(mknod, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -2721,7 +2721,7 @@ br_stub_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, stub = fop_readdir_stub(frame, br_stub_readdir_wrapper, fd, size, off, xdata); if (!stub) { - STACK_UNWIND_STRICT(readdir, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(readdir, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } br_stub_worker_enqueue(this, stub); @@ -2852,7 +2852,7 @@ br_stub_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, unwind: if (frame->local == (void *)0x1) frame->local = NULL; - STACK_UNWIND_STRICT(readdirp, frame, -1, op_errno, NULL, NULL); + STACK_UNWIND_STRICT(readdirp, frame, gf_failure, op_errno, NULL, NULL); return 0; unref_dict: @@ -3078,7 +3078,7 @@ br_stub_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) unwind: if (frame->local == (void *)0x1) frame->local = NULL; - STACK_UNWIND_STRICT(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); dealloc_dict: if (xref) dict_unref(xdata); diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c index 6ef0efa82a..1f24daa3d8 100644 --- a/xlators/features/changelog/src/changelog.c +++ b/xlators/features/changelog/src/changelog.c @@ -1403,7 +1403,7 @@ changelog_handle_virtual_xattr(call_frame_t *frame, xlator_t *this, loc_t *loc, CHANGELOG_STACK_UNWIND(setxattr, frame, 0, 0, NULL); return; } else { - CHANGELOG_STACK_UNWIND(setxattr, frame, -1, ENOTSUP, NULL); + CHANGELOG_STACK_UNWIND(setxattr, frame, gf_failure, ENOTSUP, NULL); return; } } @@ -2108,7 +2108,7 @@ notify(xlator_t *this, int event, void *data, ...) ret = -1; } UNLOCK(&priv->lock); - /* If ret = -1, then changelog barrier is already + /* If ret = gf_failure, then changelog barrier is already * disabled because of error or timeout. */ if (ret == 0) { diff --git a/xlators/features/cloudsync/src/cloudsync-fops-c.py b/xlators/features/cloudsync/src/cloudsync-fops-c.py index d0172b6b32..6f3f1a283f 100755 --- a/xlators/features/cloudsync/src/cloudsync-fops-c.py +++ b/xlators/features/cloudsync/src/cloudsync-fops-c.py @@ -81,7 +81,7 @@ return 0; err: - CS_STACK_UNWIND (@NAME@, frame, -1, op_errno, @CBK_ERROR_ARGS@); + CS_STACK_UNWIND (@NAME@, frame, gf_failure, op_errno, @CBK_ERROR_ARGS@); return 0; } @@ -233,7 +233,7 @@ return 0; err: - CS_STACK_UNWIND (@NAME@, frame, -1, op_errno, @CBK_ERROR_ARGS@); + CS_STACK_UNWIND (@NAME@, frame, gf_failure, op_errno, @CBK_ERROR_ARGS@); return 0; } diff --git a/xlators/features/cloudsync/src/cloudsync.c b/xlators/features/cloudsync/src/cloudsync.c index 9f61659ca3..7c3ad0b126 100644 --- a/xlators/features/cloudsync/src/cloudsync.c +++ b/xlators/features/cloudsync/src/cloudsync.c @@ -311,7 +311,7 @@ cs_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, FIRST_CHILD(this)->fops->readdirp, fd, size, off, xdata); return 0; err: - STACK_UNWIND_STRICT(readdirp, frame, -1, op_errno, NULL, NULL); + STACK_UNWIND_STRICT(readdirp, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -442,7 +442,7 @@ cs_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, return 0; err: - CS_STACK_UNWIND(truncate, frame, -1, ENOMEM, NULL, NULL, NULL); + CS_STACK_UNWIND(truncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -537,7 +537,7 @@ cs_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, FIRST_CHILD(this)->fops->setxattr, loc, dict, flags, xdata); return 0; err: - CS_STACK_UNWIND(setxattr, frame, -1, errno, NULL); + CS_STACK_UNWIND(setxattr, frame, gf_failure, errno, NULL); return 0; } @@ -611,7 +611,7 @@ cs_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, FIRST_CHILD(this)->fops->unlink, loc, flags, local->xattr_req); return 0; err: - CS_STACK_UNWIND(unlink, frame, -1, errno, NULL, NULL, NULL); + CS_STACK_UNWIND(unlink, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -664,7 +664,7 @@ cs_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, FIRST_CHILD(this)->fops->open, loc, flags, fd, local->xattr_req); return 0; err: - CS_STACK_UNWIND(open, frame, -1, errno, NULL, NULL); + CS_STACK_UNWIND(open, frame, gf_failure, errno, NULL, NULL); return 0; } @@ -729,7 +729,7 @@ cs_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xattr_req) FIRST_CHILD(this)->fops->fstat, fd, local->xattr_req); return 0; err: - CS_STACK_UNWIND(fstat, frame, -1, errno, NULL, NULL); + CS_STACK_UNWIND(fstat, frame, gf_failure, errno, NULL, NULL); return 0; } @@ -1391,7 +1391,7 @@ cs_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - CS_STACK_UNWIND(readv, frame, -1, op_errno, NULL, -1, NULL, NULL, NULL); + CS_STACK_UNWIND(readv, frame, gf_failure, op_errno, NULL, gf_failure, NULL, NULL, NULL); return 0; } diff --git a/xlators/features/compress/src/cdc.c b/xlators/features/compress/src/cdc.c index 35d7b6df67..561d124e41 100644 --- a/xlators/features/compress/src/cdc.c +++ b/xlators/features/compress/src/cdc.c @@ -169,7 +169,7 @@ cdc_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, flags, iobref, xdata); return 0; err: - STACK_UNWIND_STRICT(writev, frame, -1, EINVAL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(writev, frame, gf_failure, EINVAL, NULL, NULL, NULL); return 0; } diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index 7aee8762d2..d021c6874b 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -626,7 +626,7 @@ ga_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, loc_wipe(&ga_loc); return 0; err: - STACK_UNWIND_STRICT(setxattr, frame, -1, op_errno, xdata); + STACK_UNWIND_STRICT(setxattr, frame, gf_failure, op_errno, xdata); return 0; } @@ -906,7 +906,7 @@ ga_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) return 0; err: - STACK_UNWIND_STRICT(lookup, frame, -1, op_errno, loc->inode, + STACK_UNWIND_STRICT(lookup, frame, gf_failure, op_errno, loc->inode, &priv->gfiddir_stbuf, xdata, &priv->root_stbuf); return 0; } @@ -925,7 +925,7 @@ ga_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - STACK_UNWIND_STRICT(mkdir, frame, -1, op_errno, loc->inode, NULL, NULL, + STACK_UNWIND_STRICT(mkdir, frame, gf_failure, op_errno, loc->inode, NULL, NULL, NULL, xdata); return 0; } @@ -943,7 +943,7 @@ ga_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, xdata); return 0; err: - STACK_UNWIND_STRICT(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, xdata); return 0; @@ -961,7 +961,7 @@ ga_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, FIRST_CHILD(this)->fops->symlink, linkname, loc, umask, xdata); return 0; err: - STACK_UNWIND_STRICT(symlink, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(symlink, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, xdata); return 0; @@ -980,7 +980,7 @@ ga_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - STACK_UNWIND_STRICT(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, xdata); return 0; @@ -1008,7 +1008,7 @@ ga_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, loc_wipe(&ga_loc); return 0; err: - STACK_UNWIND_STRICT(rmdir, frame, -1, op_errno, NULL, NULL, xdata); + STACK_UNWIND_STRICT(rmdir, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -1035,7 +1035,7 @@ ga_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t xflag, loc_wipe(&ga_loc); return 0; err: - STACK_UNWIND_STRICT(unlink, frame, -1, op_errno, NULL, NULL, xdata); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -1073,7 +1073,7 @@ ga_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, loc_wipe(&ga_oldloc); return 0; err: - STACK_UNWIND_STRICT(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, xdata); return 0; @@ -1113,7 +1113,7 @@ ga_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - STACK_UNWIND_STRICT(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, xdata); return 0; @@ -1139,7 +1139,7 @@ ga_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, FIRST_CHILD(this)->fops->opendir, loc, fd, xdata); return 0; err: - STACK_UNWIND_STRICT(opendir, frame, -1, op_errno, NULL, xdata); + STACK_UNWIND_STRICT(opendir, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -1166,7 +1166,7 @@ ga_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, return 0; err: - STACK_UNWIND_STRICT(getxattr, frame, -1, op_errno, NULL, xdata); + STACK_UNWIND_STRICT(getxattr, frame, gf_failure, op_errno, NULL, xdata); return 0; } @@ -1199,7 +1199,7 @@ ga_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) return 0; err: - STACK_UNWIND_STRICT(stat, frame, -1, op_errno, NULL, xdata); + STACK_UNWIND_STRICT(stat, frame, gf_failure, op_errno, NULL, xdata); return 0; @@ -1229,7 +1229,7 @@ ga_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, loc_wipe(&ga_loc); return 0; err: - STACK_UNWIND_STRICT(setattr, frame, -1, op_errno, NULL, NULL, xdata); + STACK_UNWIND_STRICT(setattr, frame, gf_failure, op_errno, NULL, NULL, xdata); return 0; } @@ -1256,7 +1256,7 @@ ga_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; err: - STACK_UNWIND_STRICT(removexattr, frame, -1, op_errno, xdata); + STACK_UNWIND_STRICT(removexattr, frame, gf_failure, op_errno, xdata); return 0; } diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 47a1a5689d..2d2ec642bc 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -1017,7 +1017,7 @@ xattrop_index_action(xlator_t *this, index_local_t *local, dict_t *xattr, inode = local->inode; req_xdata = local->xdata; - memset(zfilled, -1, sizeof(zfilled)); + memset(zfilled, gf_failure, sizeof(zfilled)); ret = dict_foreach_match(xattr, match, match_data, _check_key_is_zero_filled, zfilled); _index_action(this, inode, zfilled); @@ -1209,9 +1209,9 @@ index_queue_process(xlator_t *this, inode_t *inode, call_stub_t *new) if (ret && new) { frame = new->frame; if (new->fop == GF_FOP_XATTROP) { - INDEX_STACK_UNWIND(xattrop, frame, -1, ENOMEM, NULL, NULL); + INDEX_STACK_UNWIND(xattrop, frame, gf_failure, ENOMEM, NULL, NULL); } else if (new->fop == GF_FOP_FXATTROP) { - INDEX_STACK_UNWIND(fxattrop, frame, -1, ENOMEM, NULL, NULL); + INDEX_STACK_UNWIND(fxattrop, frame, gf_failure, ENOMEM, NULL, NULL); } call_stub_destroy(new); } else if (stub) { @@ -1287,7 +1287,7 @@ index_xattrop_do(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, // In wind phase bring the gfid into index. This way if the brick crashes // just after posix performs xattrop before _cbk reaches index xlator // we will still have the gfid in index. - memset(zfilled, -1, sizeof(zfilled)); + memset(zfilled, gf_failure, sizeof(zfilled)); /* Foreach xattr, set corresponding index of zfilled to 1 * zfilled[index] = 1 implies the xattr's value is zero filled @@ -1308,7 +1308,7 @@ index_xattrop_do(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, ret = index_entry_action(this, local->inode, xdata, GF_XATTROP_ENTRY_IN_KEY); if (ret < 0) { - x_cbk(frame, NULL, this, -1, -ret, NULL, NULL); + x_cbk(frame, NULL, this, gf_failure, -ret, NULL, NULL); return; } @@ -1359,7 +1359,7 @@ index_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, err: if ((!local) || (!stub)) { - INDEX_STACK_UNWIND(xattrop, frame, -1, ENOMEM, NULL, NULL); + INDEX_STACK_UNWIND(xattrop, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -1394,7 +1394,7 @@ index_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, err: if ((!local) || (!stub)) { - INDEX_STACK_UNWIND(fxattrop, frame, -1, ENOMEM, NULL, xdata); + INDEX_STACK_UNWIND(fxattrop, frame, gf_failure, ENOMEM, NULL, xdata); return 0; } @@ -1510,7 +1510,7 @@ index_getxattr_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, } done: if (ret) - STACK_UNWIND_STRICT(getxattr, frame, -1, -ret, xattr, NULL); + STACK_UNWIND_STRICT(getxattr, frame, gf_failure, -ret, xattr, NULL); else STACK_UNWIND_STRICT(getxattr, frame, 0, 0, xattr, NULL); @@ -1950,7 +1950,7 @@ index_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, stub = fop_getxattr_stub(frame, index_getxattr_wrapper, loc, name, xdata); if (!stub) { - STACK_UNWIND_STRICT(getxattr, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(getxattr, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } worker_enqueue(this, stub); @@ -2097,7 +2097,7 @@ index_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) stub = fop_lookup_stub(frame, index_lookup_wrapper, loc, xattr_req); if (!stub) { - STACK_UNWIND_STRICT(lookup, frame, -1, ENOMEM, loc->inode, NULL, NULL, + STACK_UNWIND_STRICT(lookup, frame, gf_failure, ENOMEM, loc->inode, NULL, NULL, NULL); return 0; } @@ -2174,7 +2174,7 @@ index_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, stub = fop_readdir_stub(frame, index_readdir_wrapper, fd, size, off, xdata); if (!stub) { - STACK_UNWIND_STRICT(readdir, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(readdir, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } worker_enqueue(this, stub); @@ -2196,7 +2196,7 @@ index_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, stub = fop_unlink_stub(frame, index_unlink_wrapper, loc, xflag, xdata); if (!stub) { - STACK_UNWIND_STRICT(unlink, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } worker_enqueue(this, stub); @@ -2218,7 +2218,7 @@ index_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, stub = fop_rmdir_stub(frame, index_rmdir_wrapper, loc, flags, xdata); if (!stub) { - STACK_UNWIND_STRICT(rmdir, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(rmdir, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } worker_enqueue(this, stub); diff --git a/xlators/features/leases/src/leases.c b/xlators/features/leases/src/leases.c index e374a68953..87ec18a883 100644 --- a/xlators/features/leases/src/leases.c +++ b/xlators/features/leases/src/leases.c @@ -85,7 +85,7 @@ leases_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, GF_FREE(fd_ctx); } - STACK_UNWIND_STRICT(open, frame, -1, op_errno, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -135,7 +135,7 @@ leases_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, return 0; err: - STACK_UNWIND_STRICT(writev, frame, -1, errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(writev, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -184,7 +184,7 @@ leases_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - STACK_UNWIND_STRICT(readv, frame, -1, errno, NULL, 0, NULL, NULL, NULL); + STACK_UNWIND_STRICT(readv, frame, gf_failure, errno, NULL, 0, NULL, NULL, NULL); return 0; } @@ -230,7 +230,7 @@ leases_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, return 0; err: - STACK_UNWIND_STRICT(lk, frame, -1, errno, NULL, NULL); + STACK_UNWIND_STRICT(lk, frame, gf_failure, errno, NULL, NULL); return 0; } @@ -312,7 +312,7 @@ leases_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, return 0; err: - STACK_UNWIND_STRICT(truncate, frame, -1, errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -359,7 +359,7 @@ leases_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; err: - STACK_UNWIND_STRICT(setattr, frame, -1, errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(setattr, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -409,7 +409,7 @@ leases_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - STACK_UNWIND_STRICT(rename, frame, -1, errno, NULL, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -457,7 +457,7 @@ leases_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, return 0; err: - STACK_UNWIND_STRICT(unlink, frame, -1, errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -504,7 +504,7 @@ leases_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - STACK_UNWIND_STRICT(link, frame, -1, errno, NULL, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(link, frame, gf_failure, errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -554,7 +554,7 @@ leases_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, return 0; err: - STACK_UNWIND_STRICT(create, frame, -1, errno, NULL, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -599,7 +599,7 @@ leases_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, FIRST_CHILD(this)->fops->fsync, fd, flags, xdata); return 0; err: - STACK_UNWIND_STRICT(fsync, frame, -1, errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsync, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -645,7 +645,7 @@ leases_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; err: - STACK_UNWIND_STRICT(ftruncate, frame, -1, errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(ftruncate, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -691,7 +691,7 @@ leases_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, return 0; err: - STACK_UNWIND_STRICT(fsetattr, frame, -1, errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsetattr, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -739,7 +739,7 @@ leases_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, return 0; err: - STACK_UNWIND_STRICT(fallocate, frame, -1, errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fallocate, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -785,7 +785,7 @@ leases_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; err: - STACK_UNWIND_STRICT(discard, frame, -1, errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(discard, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -831,7 +831,7 @@ leases_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; err: - STACK_UNWIND_STRICT(zerofill, frame, -1, errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(zerofill, frame, gf_failure, errno, NULL, NULL, NULL); return 0; } @@ -897,7 +897,7 @@ leases_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) return 0; err: - STACK_UNWIND_STRICT(create, frame, -1, errno, NULL, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } diff --git a/xlators/features/locks/src/clear.c b/xlators/features/locks/src/clear.c index ab1eac68a5..899b71a3dc 100644 --- a/xlators/features/locks/src/clear.c +++ b/xlators/features/locks/src/clear.c @@ -181,9 +181,9 @@ clrlk_clear_posixlk(xlator_t *this, pl_inode_t *pl_inode, clrlk_args *args, if (plock->blocked) { bcount++; pl_trace_out(this, plock->frame, NULL, NULL, F_SETLKW, - &plock->user_flock, -1, EINTR, NULL); + &plock->user_flock, gf_failure, EINTR, NULL); - STACK_UNWIND_STRICT(lk, plock->frame, -1, EINTR, + STACK_UNWIND_STRICT(lk, plock->frame, gf_failure, EINTR, &plock->user_flock, NULL); } else { @@ -265,8 +265,8 @@ clrlk_clear_inodelk(xlator_t *this, pl_inode_t *pl_inode, pl_dom_list_t *dom, { list_del_init(&ilock->blocked_locks); pl_trace_out(this, ilock->frame, NULL, NULL, F_SETLKW, - &ilock->user_flock, -1, EAGAIN, ilock->volume); - STACK_UNWIND_STRICT(inodelk, ilock->frame, -1, EAGAIN, NULL); + &ilock->user_flock, gf_failure, EAGAIN, ilock->volume); + STACK_UNWIND_STRICT(inodelk, ilock->frame, gf_failure, EAGAIN, NULL); // No need to take lock as the locks are only in one list __pl_inodelk_unref(ilock); } @@ -370,9 +370,9 @@ clrlk_clear_entrylk(xlator_t *this, pl_inode_t *pl_inode, pl_dom_list_t *dom, { list_del_init(&elock->blocked_locks); entrylk_trace_out(this, elock->frame, elock->volume, NULL, NULL, - elock->basename, ENTRYLK_LOCK, elock->type, -1, + elock->basename, ENTRYLK_LOCK, elock->type, gf_failure, EAGAIN); - STACK_UNWIND_STRICT(entrylk, elock->frame, -1, EAGAIN, NULL); + STACK_UNWIND_STRICT(entrylk, elock->frame, gf_failure, EAGAIN, NULL); __pl_entrylk_unref(elock); } diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c index 7a715391dc..2de66f1ee9 100644 --- a/xlators/features/locks/src/entrylk.c +++ b/xlators/features/locks/src/entrylk.c @@ -1074,7 +1074,7 @@ pl_entrylk_client_cleanup(xlator_t *this, pl_ctx_t *ctx) list_del_init(&l->client_list); if (l->frame) - STACK_UNWIND_STRICT(entrylk, l->frame, -1, EAGAIN, NULL); + STACK_UNWIND_STRICT(entrylk, l->frame, gf_failure, EAGAIN, NULL); list_add_tail(&l->client_list, &released); } } diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c index ef0d7c81a2..6f2c9266c3 100644 --- a/xlators/features/locks/src/inodelk.c +++ b/xlators/features/locks/src/inodelk.c @@ -709,7 +709,7 @@ pl_inodelk_client_cleanup(xlator_t *this, pl_ctx_t *ctx) list_del_init(&l->client_list); if (l->frame) - STACK_UNWIND_STRICT(inodelk, l->frame, -1, EAGAIN, NULL); + STACK_UNWIND_STRICT(inodelk, l->frame, gf_failure, EAGAIN, NULL); list_add_tail(&l->client_list, &released); } } diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 99a9606d74..fc85e96a14 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -1097,8 +1097,8 @@ pl_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, gf_log(this ? this->name : "locks", GF_LOG_ERROR, "truncate on %s failed with" " ret: %d, error: %s", - loc->path, -1, strerror(ENOMEM)); - STACK_UNWIND_STRICT(truncate, frame, -1, ENOMEM, NULL, NULL, NULL); + loc->path, gf_failure, strerror(ENOMEM)); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); } return 0; } @@ -1130,8 +1130,8 @@ pl_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, gf_log(this ? this->name : "locks", GF_LOG_ERROR, "ftruncate failed with" " ret: %d, error: %s", - -1, strerror(ENOMEM)); - STACK_UNWIND_STRICT(ftruncate, frame, -1, ENOMEM, NULL, NULL, NULL); + gf_failure, strerror(ENOMEM)); + STACK_UNWIND_STRICT(ftruncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); } return 0; } @@ -1185,7 +1185,7 @@ delete_locks_of_fd(xlator_t *this, pl_inode_t *pl_inode, fd_t *fd) list_for_each_entry_safe(l, tmp, &blocked_list, list) { list_del_init(&l->list); - STACK_UNWIND_STRICT(lk, l->frame, -1, EAGAIN, &l->user_flock, NULL); + STACK_UNWIND_STRICT(lk, l->frame, gf_failure, EAGAIN, &l->user_flock, NULL); __destroy_lock(l); } @@ -1837,7 +1837,7 @@ pl_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) pl_inode_t *pl_inode = pl_inode_get(this, fd->inode, NULL); if (!pl_inode) { gf_log(this->name, GF_LOG_DEBUG, "Could not get inode."); - STACK_UNWIND_STRICT(flush, frame, -1, EBADFD, NULL); + STACK_UNWIND_STRICT(flush, frame, gf_failure, EBADFD, NULL); return 0; } @@ -1845,7 +1845,7 @@ pl_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { if (pl_inode->migrated) { pthread_mutex_unlock(&pl_inode->mutex); - STACK_UNWIND_STRICT(flush, frame, -1, EREMOTE, NULL); + STACK_UNWIND_STRICT(flush, frame, gf_failure, EREMOTE, NULL); return 0; } } @@ -2728,7 +2728,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, if (pl_inode->migrated) { op_errno = EREMOTE; pthread_mutex_unlock(&pl_inode->mutex); - STACK_UNWIND_STRICT(lk, frame, -1, op_errno, flock, xdata); + STACK_UNWIND_STRICT(lk, frame, gf_failure, op_errno, flock, xdata); __destroy_lock(reqlock); goto out; @@ -2891,7 +2891,7 @@ pl_forget(xlator_t *this, inode_t *inode) if (!list_empty(&posixlks_released)) { list_for_each_entry_safe(ext_l, ext_tmp, &posixlks_released, list) { - STACK_UNWIND_STRICT(lk, ext_l->frame, -1, 0, &ext_l->user_flock, + STACK_UNWIND_STRICT(lk, ext_l->frame, gf_failure, 0, &ext_l->user_flock, NULL); __destroy_lock(ext_l); } @@ -2901,7 +2901,7 @@ pl_forget(xlator_t *this, inode_t *inode) list_for_each_entry_safe(ino_l, ino_tmp, &inodelks_released, blocked_locks) { - STACK_UNWIND_STRICT(inodelk, ino_l->frame, -1, 0, NULL); + STACK_UNWIND_STRICT(inodelk, ino_l->frame, gf_failure, 0, NULL); __pl_inodelk_unref(ino_l); } } @@ -2910,7 +2910,7 @@ pl_forget(xlator_t *this, inode_t *inode) list_for_each_entry_safe(entry_l, entry_tmp, &entrylks_released, blocked_locks) { - STACK_UNWIND_STRICT(entrylk, entry_l->frame, -1, 0, NULL); + STACK_UNWIND_STRICT(entrylk, entry_l->frame, gf_failure, 0, NULL); GF_FREE((char *)entry_l->basename); GF_FREE(entry_l->connection_id); GF_FREE(entry_l); @@ -3044,7 +3044,7 @@ pl_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret >= 0) { pl_inode = pl_inode_get(this, inode, NULL); if (pl_inode == NULL) { - PL_STACK_UNWIND(lookup, xdata, frame, -1, ENOMEM, NULL, NULL, NULL, + PL_STACK_UNWIND(lookup, xdata, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); return 0; } @@ -3084,7 +3084,7 @@ pl_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) FIRST_CHILD(this)->fops->lookup, loc, xdata); dict_unref(xdata); } else { - STACK_UNWIND_STRICT(lookup, frame, -1, error, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(lookup, frame, gf_failure, error, NULL, NULL, NULL, NULL); } return 0; } @@ -3522,7 +3522,7 @@ pl_metaunlock(call_frame_t *frame, xlator_t *this, inode_t *inode, dict_t *dict) { list_del_init(&posix_lock->list); - STACK_UNWIND_STRICT(lk, posix_lock->frame, -1, EREMOTE, + STACK_UNWIND_STRICT(lk, posix_lock->frame, gf_failure, EREMOTE, &posix_lock->user_flock, NULL); __destroy_lock(posix_lock); @@ -4036,7 +4036,7 @@ pl_metalk_client_cleanup(xlator_t *this, pl_ctx_t *ctx) { list_del_init(&posix_lock->list); - STACK_UNWIND_STRICT(lk, posix_lock->frame, -1, EREMOTE, + STACK_UNWIND_STRICT(lk, posix_lock->frame, gf_failure, EREMOTE, &posix_lock->user_flock, NULL); __destroy_lock(posix_lock); @@ -4268,7 +4268,7 @@ pl_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, error = PL_INODE_REMOVE(rename, frame, this, oldloc, newloc, pl_rename, pl_rename_cbk, oldloc, newloc, xdata); if (error > 0) { - STACK_UNWIND_STRICT(rename, frame, -1, error, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, error, NULL, NULL, NULL, NULL, NULL, NULL); } @@ -4412,7 +4412,7 @@ pl_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, error = PL_INODE_REMOVE(unlink, frame, this, loc, NULL, pl_unlink, pl_unlink_cbk, loc, xflag, xdata); if (error > 0) { - STACK_UNWIND_STRICT(unlink, frame, -1, error, NULL, NULL, NULL); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, error, NULL, NULL, NULL); } return 0; @@ -4501,7 +4501,7 @@ pl_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, error = PL_INODE_REMOVE(rmdir, frame, this, loc, NULL, pl_rmdir, pl_rmdir_cbk, loc, xflags, xdata); if (error > 0) { - STACK_UNWIND_STRICT(rmdir, frame, -1, error, NULL, NULL, NULL); + STACK_UNWIND_STRICT(rmdir, frame, gf_failure, error, NULL, NULL, NULL); } return 0; @@ -4560,7 +4560,7 @@ pl_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, pl_inode = pl_inode_get(this, oldloc->inode, NULL); if (pl_inode == NULL) { - STACK_UNWIND_STRICT(link, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(link, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); return 0; } diff --git a/xlators/features/locks/src/reservelk.c b/xlators/features/locks/src/reservelk.c index 604691fd88..6bfce016f5 100644 --- a/xlators/features/locks/src/reservelk.c +++ b/xlators/features/locks/src/reservelk.c @@ -316,9 +316,9 @@ grant_blocked_lock_calls(xlator_t *this, pl_inode_t *pl_inode) } else { gf_log(this->name, GF_LOG_DEBUG, "returning EAGAIN"); pl_trace_out(this, lock->frame, fd, NULL, cmd, - &lock->user_flock, -1, EAGAIN, NULL); + &lock->user_flock, gf_failure, EAGAIN, NULL); pl_update_refkeeper(this, fd->inode); - STACK_UNWIND_STRICT(lk, lock->frame, -1, EAGAIN, + STACK_UNWIND_STRICT(lk, lock->frame, gf_failure, EAGAIN, &lock->user_flock, NULL); __destroy_lock(lock); } diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 6c1e78d6e0..5b4f8b5c9d 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -331,7 +331,7 @@ marker_getxattr_stampfile_cbk(call_frame_t *frame, xlator_t *this, dict_t *dict = NULL; if (vol_mark == NULL) { - STACK_UNWIND_STRICT(getxattr, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(getxattr, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -537,7 +537,7 @@ marker_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; out: - MARKER_STACK_UNWIND(getxattr, frame, -1, ENOMEM, NULL, NULL); + MARKER_STACK_UNWIND(getxattr, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -783,7 +783,7 @@ marker_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - MARKER_STACK_UNWIND(mkdir, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL); + MARKER_STACK_UNWIND(mkdir, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -870,7 +870,7 @@ marker_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, xdata); return 0; err: - MARKER_STACK_UNWIND(create, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL, + MARKER_STACK_UNWIND(create, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -943,7 +943,7 @@ marker_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, flags, iobref, xdata); return 0; err: - MARKER_STACK_UNWIND(writev, frame, -1, ENOMEM, NULL, NULL, NULL); + MARKER_STACK_UNWIND(writev, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1031,7 +1031,7 @@ marker_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, FIRST_CHILD(this)->fops->rmdir, loc, flags, xdata); return 0; err: - MARKER_STACK_UNWIND(rmdir, frame, -1, ENOMEM, NULL, NULL, NULL); + MARKER_STACK_UNWIND(rmdir, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1149,7 +1149,7 @@ marker_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, goto out; err: - MARKER_STACK_UNWIND(unlink, frame, -1, ENOMEM, NULL, NULL, NULL); + MARKER_STACK_UNWIND(unlink, frame, gf_failure, ENOMEM, NULL, NULL, NULL); out: if (dict_free) @@ -1227,7 +1227,7 @@ marker_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, FIRST_CHILD(this)->fops->link, oldloc, newloc, xdata); return 0; err: - MARKER_STACK_UNWIND(link, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL); + MARKER_STACK_UNWIND(link, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1259,7 +1259,7 @@ marker_rename_done(call_frame_t *frame, void *cookie, xlator_t *this, if (local->err != 0) goto err; - mq_reduce_parent_size_txn(this, &oplocal->loc, &oplocal->contribution, -1, + mq_reduce_parent_size_txn(this, &oplocal->loc, &oplocal->contribution, gf_failure, NULL); if (local->loc.inode != NULL) { @@ -1367,7 +1367,7 @@ marker_rename_unwind(call_frame_t *frame, void *cookie, xlator_t *this, local->stub = NULL; local->err = 0; } else if (local->err != 0) { - STACK_UNWIND_STRICT(rename, frame, -1, local->err, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, local->err, NULL, NULL, NULL, NULL, NULL, NULL); } else { gf_log(this->name, GF_LOG_CRITICAL, @@ -1774,7 +1774,7 @@ marker_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - MARKER_STACK_UNWIND(rename, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL, + MARKER_STACK_UNWIND(rename, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL, NULL); marker_local_unref(oplocal); @@ -1861,7 +1861,7 @@ marker_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, FIRST_CHILD(this)->fops->truncate, loc, offset, xdata); return 0; err: - MARKER_STACK_UNWIND(truncate, frame, -1, ENOMEM, NULL, NULL, NULL); + MARKER_STACK_UNWIND(truncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1934,7 +1934,7 @@ marker_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, FIRST_CHILD(this)->fops->ftruncate, fd, offset, xdata); return 0; err: - MARKER_STACK_UNWIND(ftruncate, frame, -1, ENOMEM, NULL, NULL, NULL); + MARKER_STACK_UNWIND(ftruncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -2020,7 +2020,7 @@ marker_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, FIRST_CHILD(this)->fops->symlink, linkpath, loc, umask, xdata); return 0; err: - MARKER_STACK_UNWIND(symlink, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, + MARKER_STACK_UNWIND(symlink, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); return 0; @@ -2109,7 +2109,7 @@ marker_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, FIRST_CHILD(this)->fops->mknod, loc, mode, rdev, umask, xdata); return 0; err: - MARKER_STACK_UNWIND(mknod, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL); + MARKER_STACK_UNWIND(mknod, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -2179,7 +2179,7 @@ marker_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, xdata); return 0; err: - MARKER_STACK_UNWIND(fallocate, frame, -1, ENOMEM, NULL, NULL, NULL); + MARKER_STACK_UNWIND(fallocate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -2246,7 +2246,7 @@ marker_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, FIRST_CHILD(this)->fops->discard, fd, offset, len, xdata); return 0; err: - MARKER_STACK_UNWIND(discard, frame, -1, ENOMEM, NULL, NULL, NULL); + MARKER_STACK_UNWIND(discard, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -2313,7 +2313,7 @@ marker_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, FIRST_CHILD(this)->fops->zerofill, fd, offset, len, xdata); return 0; err: - MARKER_STACK_UNWIND(zerofill, frame, -1, ENOMEM, NULL, NULL, NULL); + MARKER_STACK_UNWIND(zerofill, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -2535,7 +2535,7 @@ marker_do_xattr_cleanup(call_frame_t *frame, xlator_t *this, dict_t *xdata, ret = 0; out: if (ret) - MARKER_STACK_UNWIND(setxattr, frame, -1, ENOMEM, xdata); + MARKER_STACK_UNWIND(setxattr, frame, gf_failure, ENOMEM, xdata); return ret; } @@ -2595,7 +2595,7 @@ marker_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, FIRST_CHILD(this)->fops->setxattr, loc, dict, flags, xdata); return 0; err: - MARKER_STACK_UNWIND(setxattr, frame, -1, op_errno, NULL); + MARKER_STACK_UNWIND(setxattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -2663,7 +2663,7 @@ marker_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, FIRST_CHILD(this)->fops->fsetxattr, fd, dict, flags, xdata); return 0; err: - MARKER_STACK_UNWIND(fsetxattr, frame, -1, ENOMEM, NULL); + MARKER_STACK_UNWIND(fsetxattr, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -2729,7 +2729,7 @@ marker_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, FIRST_CHILD(this)->fops->fsetattr, fd, stbuf, valid, xdata); return 0; err: - MARKER_STACK_UNWIND(fsetattr, frame, -1, ENOMEM, NULL, NULL, NULL); + MARKER_STACK_UNWIND(fsetattr, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -2793,7 +2793,7 @@ marker_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, FIRST_CHILD(this)->fops->setattr, loc, stbuf, valid, xdata); return 0; err: - MARKER_STACK_UNWIND(setattr, frame, -1, ENOMEM, NULL, NULL, NULL); + MARKER_STACK_UNWIND(setattr, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -2874,7 +2874,7 @@ marker_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, FIRST_CHILD(this)->fops->removexattr, loc, name, xdata); return 0; err: - MARKER_STACK_UNWIND(removexattr, frame, -1, ENOMEM, NULL); + MARKER_STACK_UNWIND(removexattr, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -3010,7 +3010,7 @@ marker_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; err: - MARKER_STACK_UNWIND(lookup, frame, -1, ENOMEM, NULL, NULL, NULL, NULL); + MARKER_STACK_UNWIND(lookup, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); if (xattr_req) dict_unref(xattr_req); @@ -3168,7 +3168,7 @@ marker_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, dict_unref(dict); return 0; unwind: - MARKER_STACK_UNWIND(readdirp, frame, -1, ENOMEM, NULL, NULL); + MARKER_STACK_UNWIND(readdirp, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } diff --git a/xlators/features/metadisp/src/gen-fops.py b/xlators/features/metadisp/src/gen-fops.py index 8b5e120fde..7123c63471 100644 --- a/xlators/features/metadisp/src/gen-fops.py +++ b/xlators/features/metadisp/src/gen-fops.py @@ -64,7 +64,7 @@ return 0; unwind: - STACK_UNWIND_STRICT(lookup, frame, -1, EINVAL, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(lookup, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL); return 0; } """ diff --git a/xlators/features/metadisp/src/metadisp-create.c b/xlators/features/metadisp/src/metadisp-create.c index dd1460ed24..cfc24b9514 100644 --- a/xlators/features/metadisp/src/metadisp-create.c +++ b/xlators/features/metadisp/src/metadisp-create.c @@ -59,7 +59,7 @@ metadisp_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; unwind: - STACK_UNWIND_STRICT(create, frame, -1, EINVAL, NULL, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -93,7 +93,7 @@ metadisp_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, return 0; unwind: - STACK_UNWIND_STRICT(create, frame, -1, EINVAL, NULL, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL, NULL, NULL); return 0; out: diff --git a/xlators/features/metadisp/src/metadisp-lookup.c b/xlators/features/metadisp/src/metadisp-lookup.c index 1854e11d89..ffdcb13afc 100644 --- a/xlators/features/metadisp/src/metadisp-lookup.c +++ b/xlators/features/metadisp/src/metadisp-lookup.c @@ -39,7 +39,7 @@ metadisp_backend_lookup_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; unwind: - STACK_UNWIND_STRICT(lookup, frame, -1, EINVAL, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(lookup, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL); return 0; } diff --git a/xlators/features/metadisp/src/metadisp-open.c b/xlators/features/metadisp/src/metadisp-open.c index 73a3fe52a5..d009e53297 100644 --- a/xlators/features/metadisp/src/metadisp-open.c +++ b/xlators/features/metadisp/src/metadisp-open.c @@ -65,6 +65,6 @@ metadisp_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, METADATA_CHILD(this)->fops->open, loc, flags, fd, xdata); return 0; unwind: - STACK_UNWIND_STRICT(open, frame, -1, EINVAL, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, EINVAL, NULL, NULL); return 0; } diff --git a/xlators/features/metadisp/src/metadisp-setattr.c b/xlators/features/metadisp/src/metadisp-setattr.c index 42a6499e4a..6478e3f397 100644 --- a/xlators/features/metadisp/src/metadisp-setattr.c +++ b/xlators/features/metadisp/src/metadisp-setattr.c @@ -38,7 +38,7 @@ metadisp_backend_setattr_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; unwind: - STACK_UNWIND_STRICT(setattr, frame, -1, EINVAL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(setattr, frame, gf_failure, EINVAL, NULL, NULL, NULL); return 0; } diff --git a/xlators/features/metadisp/src/metadisp-stat.c b/xlators/features/metadisp/src/metadisp-stat.c index d70602b920..d7139e3c47 100644 --- a/xlators/features/metadisp/src/metadisp-stat.c +++ b/xlators/features/metadisp/src/metadisp-stat.c @@ -23,7 +23,7 @@ metadisp_stat_backend_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { METADISP_TRACE("got backend stat results %d %d", op_ret, op_errno); if (op_errno == ENOENT) { - STACK_UNWIND_STRICT(open, frame, -1, ENODATA, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, ENODATA, NULL, NULL); return 0; } STACK_UNWIND_STRICT(stat, frame, op_ret, op_errno, buf, xdata); @@ -37,7 +37,7 @@ metadisp_stat_resume(call_frame_t *frame, xlator_t *this, loc_t *loc, METADISP_TRACE("winding stat to path %s", loc->path); if (gf_uuid_is_null(loc->gfid)) { METADISP_TRACE("bad object, sending EUCLEAN"); - STACK_UNWIND_STRICT(open, frame, -1, EUCLEAN, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, EUCLEAN, NULL, NULL); return 0; } @@ -119,6 +119,6 @@ metadisp_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) METADATA_CHILD(this)->fops->stat, loc, xdata); return 0; unwind: - STACK_UNWIND_STRICT(stat, frame, -1, EINVAL, NULL, NULL); + STACK_UNWIND_STRICT(stat, frame, gf_failure, EINVAL, NULL, NULL); return 0; } diff --git a/xlators/features/metadisp/src/metadisp-unlink.c b/xlators/features/metadisp/src/metadisp-unlink.c index 9fdad765e6..83980d1ae0 100644 --- a/xlators/features/metadisp/src/metadisp-unlink.c +++ b/xlators/features/metadisp/src/metadisp-unlink.c @@ -156,6 +156,6 @@ metadisp_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, METADATA_CHILD(this)->fops->unlink, loc, xflag, xdata); return 0; unwind: - STACK_UNWIND_STRICT(unlink, frame, -1, EINVAL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, EINVAL, NULL, NULL, NULL); return 0; } diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c index be7eda7148..c506d2e737 100644 --- a/xlators/features/quiesce/src/quiesce.c +++ b/xlators/features/quiesce/src/quiesce.c @@ -322,7 +322,7 @@ quiesce_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_lookup_stub(frame, default_lookup_resume, &local->loc, local->dict); if (!stub) { - STACK_UNWIND_STRICT(lookup, frame, -1, ENOMEM, NULL, NULL, NULL, + STACK_UNWIND_STRICT(lookup, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); goto out; } @@ -353,7 +353,7 @@ quiesce_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* Re-transmit (by putting in the queue) */ stub = fop_stat_stub(frame, default_stat_resume, &local->loc, xdata); if (!stub) { - STACK_UNWIND_STRICT(stat, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(stat, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -382,7 +382,7 @@ quiesce_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_access_stub(frame, default_access_resume, &local->loc, local->flag, xdata); if (!stub) { - STACK_UNWIND_STRICT(access, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(access, frame, gf_failure, ENOMEM, NULL); goto out; } @@ -412,7 +412,7 @@ quiesce_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_readlink_stub(frame, default_readlink_resume, &local->loc, local->size, xdata); if (!stub) { - STACK_UNWIND_STRICT(readlink, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(readlink, frame, gf_failure, ENOMEM, NULL, NULL, NULL); goto out; } @@ -441,7 +441,7 @@ quiesce_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_open_stub(frame, default_open_resume, &local->loc, local->flag, local->fd, xdata); if (!stub) { - STACK_UNWIND_STRICT(open, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -473,7 +473,7 @@ quiesce_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->size, local->offset, local->io_flag, xdata); if (!stub) { - STACK_UNWIND_STRICT(readv, frame, -1, ENOMEM, NULL, 0, NULL, NULL, + STACK_UNWIND_STRICT(readv, frame, gf_failure, ENOMEM, NULL, 0, NULL, NULL, NULL); goto out; } @@ -503,7 +503,7 @@ quiesce_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* Re-transmit (by putting in the queue) */ stub = fop_flush_stub(frame, default_flush_resume, local->fd, xdata); if (!stub) { - STACK_UNWIND_STRICT(flush, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(flush, frame, gf_failure, ENOMEM, NULL); goto out; } @@ -533,7 +533,7 @@ quiesce_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_fsync_stub(frame, default_fsync_resume, local->fd, local->flag, xdata); if (!stub) { - STACK_UNWIND_STRICT(fsync, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsync, frame, gf_failure, ENOMEM, NULL, NULL, NULL); goto out; } @@ -562,7 +562,7 @@ quiesce_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* Re-transmit (by putting in the queue) */ stub = fop_fstat_stub(frame, default_fstat_resume, local->fd, xdata); if (!stub) { - STACK_UNWIND_STRICT(fstat, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(fstat, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -592,7 +592,7 @@ quiesce_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_opendir_stub(frame, default_opendir_resume, &local->loc, local->fd, xdata); if (!stub) { - STACK_UNWIND_STRICT(opendir, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(opendir, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -621,7 +621,7 @@ quiesce_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_fsyncdir_stub(frame, default_fsyncdir_resume, local->fd, local->flag, xdata); if (!stub) { - STACK_UNWIND_STRICT(fsyncdir, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(fsyncdir, frame, gf_failure, ENOMEM, NULL); goto out; } @@ -651,7 +651,7 @@ quiesce_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_statfs_stub(frame, default_statfs_resume, &local->loc, xdata); if (!stub) { - STACK_UNWIND_STRICT(statfs, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(statfs, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -681,7 +681,7 @@ quiesce_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_fgetxattr_stub(frame, default_fgetxattr_resume, local->fd, local->name, xdata); if (!stub) { - STACK_UNWIND_STRICT(fgetxattr, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(fgetxattr, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -711,7 +711,7 @@ quiesce_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_getxattr_stub(frame, default_getxattr_resume, &local->loc, local->name, xdata); if (!stub) { - STACK_UNWIND_STRICT(getxattr, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(getxattr, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -742,7 +742,7 @@ quiesce_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_rchecksum_stub(frame, default_rchecksum_resume, local->fd, local->offset, local->flag, xdata); if (!stub) { - STACK_UNWIND_STRICT(rchecksum, frame, -1, ENOMEM, 0, NULL, NULL); + STACK_UNWIND_STRICT(rchecksum, frame, gf_failure, ENOMEM, 0, NULL, NULL); goto out; } @@ -773,7 +773,7 @@ quiesce_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_readdir_stub(frame, default_readdir_resume, local->fd, local->size, local->offset, xdata); if (!stub) { - STACK_UNWIND_STRICT(readdir, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(readdir, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -803,7 +803,7 @@ quiesce_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_readdirp_stub(frame, default_readdirp_resume, local->fd, local->size, local->offset, local->dict); if (!stub) { - STACK_UNWIND_STRICT(readdirp, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(readdirp, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -840,7 +840,7 @@ quiesce_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->offset, local->io_flags, local->iobref, xdata); if (!stub) { - STACK_UNWIND_STRICT (writev, frame, -1, ENOMEM, + STACK_UNWIND_STRICT (writev, frame, gf_failure, ENOMEM, NULL, NULL, NULL); goto out; } @@ -874,7 +874,7 @@ quiesce_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, &local->loc, local->xattrop_flags, local->dict, xdata); if (!stub) { - STACK_UNWIND_STRICT (xattrop, frame, -1, ENOMEM, + STACK_UNWIND_STRICT (xattrop, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -908,7 +908,7 @@ quiesce_fxattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->fd, local->xattrop_flags, local->dict, xdata); if (!stub) { - STACK_UNWIND_STRICT (fxattrop, frame, -1, ENOMEM, + STACK_UNWIND_STRICT (fxattrop, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -941,7 +941,7 @@ quiesce_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_lk_stub (frame, default_lk_resume, local->fd, local->flag, &local->flock, xdata); if (!stub) { - STACK_UNWIND_STRICT (lk, frame, -1, ENOMEM, + STACK_UNWIND_STRICT (lk, frame, gf_failure, ENOMEM, NULL, NULL); goto out; } @@ -975,7 +975,7 @@ quiesce_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->volname, &local->loc, local->flag, &local->flock, xdata); if (!stub) { - STACK_UNWIND_STRICT (inodelk, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT (inodelk, frame, gf_failure, ENOMEM, NULL); goto out; } @@ -1009,7 +1009,7 @@ quiesce_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->volname, local->fd, local->flag, &local->flock, xdata); if (!stub) { - STACK_UNWIND_STRICT (finodelk, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT (finodelk, frame, gf_failure, ENOMEM, NULL); goto out; } @@ -1042,7 +1042,7 @@ quiesce_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->volname, &local->loc, local->name, local->cmd, local->type, xdata); if (!stub) { - STACK_UNWIND_STRICT (entrylk, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT (entrylk, frame, gf_failure, ENOMEM, NULL); goto out; } @@ -1075,7 +1075,7 @@ quiesce_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->volname, local->fd, local->name, local->cmd, local->type, xdata); if (!stub) { - STACK_UNWIND_STRICT (fentrylk, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT (fentrylk, frame, gf_failure, ENOMEM, NULL); goto out; } @@ -1108,7 +1108,7 @@ quiesce_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_setattr_stub (frame, default_setattr_resume, &local->loc, &local->stbuf, local->flag, xdata); if (!stub) { - STACK_UNWIND_STRICT (setattr, frame, -1, ENOMEM, + STACK_UNWIND_STRICT (setattr, frame, gf_failure, ENOMEM, NULL, NULL, NULL); goto out; } @@ -1144,7 +1144,7 @@ quiesce_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_fsetattr_stub (frame, default_fsetattr_resume, local->fd, &local->stbuf, local->flag, xdata); if (!stub) { - STACK_UNWIND_STRICT (fsetattr, frame, -1, ENOMEM, + STACK_UNWIND_STRICT (fsetattr, frame, gf_failure, ENOMEM, NULL, NULL, NULL); goto out; } @@ -1185,7 +1185,7 @@ quiesce_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, stub = fop_removexattr_stub(frame, default_removexattr_resume, loc, name, xdata); if (!stub) { - STACK_UNWIND_STRICT(removexattr, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(removexattr, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -1212,7 +1212,7 @@ quiesce_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, stub = fop_fremovexattr_stub(frame, default_fremovexattr_resume, fd, name, xdata); if (!stub) { - STACK_UNWIND_STRICT(fremovexattr, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(fremovexattr, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -1239,7 +1239,7 @@ quiesce_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, stub = fop_truncate_stub(frame, default_truncate_resume, loc, offset, xdata); if (!stub) { - STACK_UNWIND_STRICT(truncate, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1266,7 +1266,7 @@ quiesce_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, stub = fop_fsetxattr_stub(frame, default_fsetxattr_resume, fd, dict, flags, xdata); if (!stub) { - STACK_UNWIND_STRICT(fsetxattr, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(fsetxattr, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -1293,7 +1293,7 @@ quiesce_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, stub = fop_setxattr_stub(frame, default_setxattr_resume, loc, dict, flags, xdata); if (!stub) { - STACK_UNWIND_STRICT(setxattr, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(setxattr, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -1323,7 +1323,7 @@ quiesce_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, stub = fop_create_stub(frame, default_create_resume, loc, (flags & ~O_APPEND), mode, umask, fd, xdata); if (!stub) { - STACK_UNWIND_STRICT(create, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1350,7 +1350,7 @@ quiesce_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, stub = fop_link_stub(frame, default_link_resume, oldloc, newloc, xdata); if (!stub) { - STACK_UNWIND_STRICT(link, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(link, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1377,7 +1377,7 @@ quiesce_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, stub = fop_rename_stub(frame, default_rename_resume, oldloc, newloc, xdata); if (!stub) { - STACK_UNWIND_STRICT(rename, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1406,7 +1406,7 @@ quiesce_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, stub = fop_symlink_stub(frame, default_symlink_resume, linkpath, loc, umask, xdata); if (!stub) { - STACK_UNWIND_STRICT(symlink, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(symlink, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1433,7 +1433,7 @@ quiesce_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, stub = fop_rmdir_stub(frame, default_rmdir_resume, loc, flags, xdata); if (!stub) { - STACK_UNWIND_STRICT(rmdir, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(rmdir, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1459,7 +1459,7 @@ quiesce_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, stub = fop_unlink_stub(frame, default_unlink_resume, loc, xflag, xdata); if (!stub) { - STACK_UNWIND_STRICT(unlink, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1485,7 +1485,7 @@ quiesce_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, stub = fop_mkdir_stub(frame, default_mkdir_resume, loc, mode, umask, xdata); if (!stub) { - STACK_UNWIND_STRICT(mkdir, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(mkdir, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1514,7 +1514,7 @@ quiesce_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, stub = fop_mknod_stub(frame, default_mknod_resume, loc, mode, rdev, umask, xdata); if (!stub) { - STACK_UNWIND_STRICT(mknod, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(mknod, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1542,7 +1542,7 @@ quiesce_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, stub = fop_ftruncate_stub(frame, default_ftruncate_resume, fd, offset, xdata); if (!stub) { - STACK_UNWIND_STRICT(ftruncate, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(ftruncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1576,7 +1576,7 @@ quiesce_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, stub = fop_readlink_stub(frame, default_readlink_resume, loc, size, xdata); if (!stub) { - STACK_UNWIND_STRICT(readlink, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(readlink, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1608,7 +1608,7 @@ quiesce_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, stub = fop_access_stub(frame, default_access_resume, loc, mask, xdata); if (!stub) { - STACK_UNWIND_STRICT(access, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(access, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -1642,7 +1642,7 @@ quiesce_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, stub = fop_fgetxattr_stub(frame, default_fgetxattr_resume, fd, name, xdata); if (!stub) { - STACK_UNWIND_STRICT(fgetxattr, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(fgetxattr, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -1672,7 +1672,7 @@ quiesce_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) stub = fop_statfs_stub(frame, default_statfs_resume, loc, xdata); if (!stub) { - STACK_UNWIND_STRICT(statfs, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(statfs, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -1704,7 +1704,7 @@ quiesce_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, stub = fop_fsyncdir_stub(frame, default_fsyncdir_resume, fd, flags, xdata); if (!stub) { - STACK_UNWIND_STRICT(fsyncdir, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(fsyncdir, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -1736,7 +1736,7 @@ quiesce_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, stub = fop_opendir_stub(frame, default_opendir_resume, loc, fd, xdata); if (!stub) { - STACK_UNWIND_STRICT(opendir, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(opendir, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -1766,7 +1766,7 @@ quiesce_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) stub = fop_fstat_stub(frame, default_fstat_resume, fd, xdata); if (!stub) { - STACK_UNWIND_STRICT(fstat, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(fstat, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -1798,7 +1798,7 @@ quiesce_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, stub = fop_fsync_stub(frame, default_fsync_resume, fd, flags, xdata); if (!stub) { - STACK_UNWIND_STRICT(fsync, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsync, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1828,7 +1828,7 @@ quiesce_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) stub = fop_flush_stub(frame, default_flush_resume, fd, xdata); if (!stub) { - STACK_UNWIND_STRICT(flush, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(flush, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -1857,7 +1857,7 @@ quiesce_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, stub = fop_writev_stub(frame, default_writev_resume, fd, vector, count, off, flags, iobref, xdata); if (!stub) { - STACK_UNWIND_STRICT(writev, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(writev, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1893,7 +1893,7 @@ quiesce_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, stub = fop_readv_stub(frame, default_readv_resume, fd, size, offset, flags, xdata); if (!stub) { - STACK_UNWIND_STRICT(readv, frame, -1, ENOMEM, NULL, 0, NULL, NULL, + STACK_UNWIND_STRICT(readv, frame, gf_failure, ENOMEM, NULL, 0, NULL, NULL, NULL); return 0; } @@ -1932,7 +1932,7 @@ quiesce_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, stub = fop_open_stub(frame, default_open_resume, loc, (flags & ~O_APPEND), fd, xdata); if (!stub) { - STACK_UNWIND_STRICT(open, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -1966,7 +1966,7 @@ quiesce_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, stub = fop_getxattr_stub(frame, default_getxattr_resume, loc, name, xdata); if (!stub) { - STACK_UNWIND_STRICT(getxattr, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(getxattr, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -1993,7 +1993,7 @@ quiesce_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, stub = fop_xattrop_stub(frame, default_xattrop_resume, loc, flags, dict, xdata); if (!stub) { - STACK_UNWIND_STRICT(xattrop, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(xattrop, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -2020,7 +2020,7 @@ quiesce_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, stub = fop_fxattrop_stub(frame, default_fxattrop_resume, fd, flags, dict, xdata); if (!stub) { - STACK_UNWIND_STRICT(fxattrop, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(fxattrop, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -2046,7 +2046,7 @@ quiesce_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, stub = fop_lk_stub(frame, default_lk_resume, fd, cmd, lock, xdata); if (!stub) { - STACK_UNWIND_STRICT(lk, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(lk, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -2074,7 +2074,7 @@ quiesce_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, stub = fop_inodelk_stub(frame, default_inodelk_resume, volume, loc, cmd, lock, xdata); if (!stub) { - STACK_UNWIND_STRICT(inodelk, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(inodelk, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -2102,7 +2102,7 @@ quiesce_finodelk(call_frame_t *frame, xlator_t *this, const char *volume, stub = fop_finodelk_stub(frame, default_finodelk_resume, volume, fd, cmd, lock, xdata); if (!stub) { - STACK_UNWIND_STRICT(finodelk, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(finodelk, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -2131,7 +2131,7 @@ quiesce_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, stub = fop_entrylk_stub(frame, default_entrylk_resume, volume, loc, basename, cmd, type, xdata); if (!stub) { - STACK_UNWIND_STRICT(entrylk, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(entrylk, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -2160,7 +2160,7 @@ quiesce_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, stub = fop_fentrylk_stub(frame, default_fentrylk_resume, volume, fd, basename, cmd, type, xdata); if (!stub) { - STACK_UNWIND_STRICT(fentrylk, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(fentrylk, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -2194,7 +2194,7 @@ quiesce_rchecksum(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, stub = fop_rchecksum_stub(frame, default_rchecksum_resume, fd, offset, len, xdata); if (!stub) { - STACK_UNWIND_STRICT(rchecksum, frame, -1, ENOMEM, 0, NULL, NULL); + STACK_UNWIND_STRICT(rchecksum, frame, gf_failure, ENOMEM, 0, NULL, NULL); return 0; } @@ -2228,7 +2228,7 @@ quiesce_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, stub = fop_readdir_stub(frame, default_readdir_resume, fd, size, off, xdata); if (!stub) { - STACK_UNWIND_STRICT(readdir, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(readdir, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -2263,7 +2263,7 @@ quiesce_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, stub = fop_readdirp_stub(frame, default_readdirp_resume, fd, size, off, dict); if (!stub) { - STACK_UNWIND_STRICT(readdirp, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(readdirp, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -2290,7 +2290,7 @@ quiesce_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, stub = fop_setattr_stub(frame, default_setattr_resume, loc, stbuf, valid, xdata); if (!stub) { - STACK_UNWIND_STRICT(setattr, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(setattr, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -2320,7 +2320,7 @@ quiesce_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) stub = fop_stat_stub(frame, default_stat_resume, loc, xdata); if (!stub) { - STACK_UNWIND_STRICT(stat, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(stat, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -2352,7 +2352,7 @@ quiesce_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, stub = fop_lookup_stub(frame, default_lookup_resume, loc, xattr_req); if (!stub) { - STACK_UNWIND_STRICT(lookup, frame, -1, ENOMEM, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(lookup, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); return 0; } @@ -2379,7 +2379,7 @@ quiesce_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, stub = fop_fsetattr_stub(frame, default_fsetattr_resume, fd, stbuf, valid, xdata); if (!stub) { - STACK_UNWIND_STRICT(fsetattr, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsetattr, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -2407,7 +2407,7 @@ quiesce_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, stub = fop_fallocate_stub(frame, default_fallocate_resume, fd, mode, offset, len, xdata); if (!stub) { - STACK_UNWIND_STRICT(fallocate, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fallocate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -2431,7 +2431,7 @@ quiesce_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = fop_seek_stub(frame, default_seek_resume, local->fd, local->offset, local->what, xdata); if (!stub) { - STACK_UNWIND_STRICT(seek, frame, -1, ENOMEM, 0, NULL); + STACK_UNWIND_STRICT(seek, frame, gf_failure, ENOMEM, 0, NULL); goto out; } @@ -2471,7 +2471,7 @@ quiesce_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, stub = fop_seek_stub(frame, default_seek_resume, fd, offset, what, xdata); if (!stub) { - STACK_UNWIND_STRICT(seek, frame, -1, ENOMEM, 0, NULL); + STACK_UNWIND_STRICT(seek, frame, gf_failure, ENOMEM, 0, NULL); return 0; } diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 49a79a371b..8e2fae9736 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -420,7 +420,7 @@ check_ancestory(call_frame_t *frame, inode_t *inode) inode_unref(cur_inode); check_ancestory_continue(NULL, NULL, 0, 0, frame); } else { - check_ancestory_continue(NULL, NULL, -1, ESTALE, frame); + check_ancestory_continue(NULL, NULL, gf_failure, ESTALE, frame); } } @@ -836,7 +836,7 @@ quota_build_ancestry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto cleanup; err: - local->ancestry_cbk(NULL, NULL, -1, op_errno, local->ancestry_data); + local->ancestry_cbk(NULL, NULL, gf_failure, op_errno, local->ancestry_data); cleanup: STACK_DESTROY(frame->root); @@ -930,7 +930,7 @@ quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk, dict_unref(xdata_req); if (op_ret < 0) { - ancestry_cbk(NULL, NULL, -1, op_errno, data); + ancestry_cbk(NULL, NULL, gf_failure, op_errno, data); if (new_frame) { local = new_frame->local; @@ -1044,7 +1044,7 @@ quota_check_limit_continuation(struct list_head *parents, inode_t *inode, op_errno = EIO; } - quota_handle_validate_error(frame, -1, op_errno); + quota_handle_validate_error(frame, gf_failure, op_errno); goto out; } @@ -1225,7 +1225,7 @@ quota_check_size_limit(call_frame_t *frame, quota_inode_ctx_t *ctx, int32_t quota_check_limit(call_frame_t *frame, inode_t *inode, xlator_t *this) { - int32_t ret = -1, op_errno = EINVAL; + int32_t ret = gf_failure, op_errno = EINVAL; inode_t *_inode = NULL, *parent = NULL; quota_inode_ctx_t *ctx = NULL; quota_priv_t *priv = NULL; @@ -1358,7 +1358,7 @@ quota_check_limit(call_frame_t *frame, inode_t *inode, xlator_t *this) return 0; err: - quota_handle_validate_error(frame, -1, op_errno); + quota_handle_validate_error(frame, gf_failure, op_errno); inode_unref(_inode); return 0; @@ -1403,7 +1403,7 @@ do_quota_check_limit(call_frame_t *frame, inode_t *inode, xlator_t *this, /* Caller should decrement link_count, in case parent is * NULL */ - quota_handle_validate_error(frame, -1, ENOMEM); + quota_handle_validate_error(frame, gf_failure, ENOMEM); } if (new_frame) { @@ -1665,7 +1665,7 @@ quota_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) dict_unref(xattr_req); if (ret < 0) { - QUOTA_STACK_UNWIND(lookup, frame, -1, ENOMEM, NULL, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(lookup, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); } return 0; @@ -1803,7 +1803,7 @@ quota_writev_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, return 0; unwind: - QUOTA_STACK_UNWIND(writev, frame, -1, op_errno, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1919,7 +1919,7 @@ quota_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, return 0; unwind: - QUOTA_STACK_UNWIND(writev, frame, -1, op_errno, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; off: @@ -1962,7 +1962,7 @@ quota_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; unwind: - QUOTA_STACK_UNWIND(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, + QUOTA_STACK_UNWIND(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -2020,7 +2020,7 @@ quota_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - QUOTA_STACK_UNWIND(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, + QUOTA_STACK_UNWIND(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -2107,7 +2107,7 @@ quota_create_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; unwind: - QUOTA_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, + QUOTA_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -2161,7 +2161,7 @@ quota_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, quota_check_limit(frame, loc->parent, this); return 0; err: - QUOTA_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, + QUOTA_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -2238,7 +2238,7 @@ quota_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, err: if (ret == -1) { - QUOTA_STACK_UNWIND(unlink, frame, -1, 0, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(unlink, frame, gf_failure, 0, NULL, NULL, NULL); } return 0; @@ -2343,7 +2343,7 @@ quota_link_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, return 0; unwind: - QUOTA_STACK_UNWIND(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -2427,7 +2427,7 @@ quota_link_continue(call_frame_t *frame) return; err: - QUOTA_STACK_UNWIND(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return; wind: @@ -2516,7 +2516,7 @@ quota_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - QUOTA_STACK_UNWIND(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; off: @@ -2649,7 +2649,7 @@ quota_rename_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, return 0; unwind: - QUOTA_STACK_UNWIND(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, + QUOTA_STACK_UNWIND(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -2687,7 +2687,7 @@ quota_rename_get_size_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; out: - quota_handle_validate_error(frame, -1, op_errno); + quota_handle_validate_error(frame, gf_failure, op_errno); return 0; } @@ -2769,7 +2769,7 @@ quota_rename_continue(call_frame_t *frame) return; err: - QUOTA_STACK_UNWIND(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, + QUOTA_STACK_UNWIND(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return; } @@ -2840,7 +2840,7 @@ quota_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - QUOTA_STACK_UNWIND(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, + QUOTA_STACK_UNWIND(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -2928,7 +2928,7 @@ quota_symlink_helper(call_frame_t *frame, xlator_t *this, const char *linkpath, return 0; unwind: - QUOTA_STACK_UNWIND(symlink, frame, -1, op_errno, NULL, NULL, NULL, NULL, + QUOTA_STACK_UNWIND(symlink, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -2980,7 +2980,7 @@ quota_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, return 0; err: - QUOTA_STACK_UNWIND(symlink, frame, -1, op_errno, NULL, NULL, NULL, NULL, + QUOTA_STACK_UNWIND(symlink, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -3061,7 +3061,7 @@ quota_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, return 0; err: - QUOTA_STACK_UNWIND(truncate, frame, -1, ENOMEM, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(truncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; off: @@ -3132,7 +3132,7 @@ quota_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; err: - QUOTA_STACK_UNWIND(ftruncate, frame, -1, ENOMEM, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(ftruncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; @@ -3302,7 +3302,7 @@ quota_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) return 0; unwind: - QUOTA_STACK_UNWIND(stat, frame, -1, ENOMEM, NULL, NULL); + QUOTA_STACK_UNWIND(stat, frame, gf_failure, ENOMEM, NULL, NULL); return 0; off: @@ -3375,7 +3375,7 @@ quota_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) return 0; unwind: - QUOTA_STACK_UNWIND(fstat, frame, -1, ENOMEM, NULL, NULL); + QUOTA_STACK_UNWIND(fstat, frame, gf_failure, ENOMEM, NULL, NULL); return 0; off: @@ -3452,7 +3452,7 @@ quota_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, return 0; unwind: - QUOTA_STACK_UNWIND(readlink, frame, -1, ENOMEM, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(readlink, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; off: @@ -3525,7 +3525,7 @@ quota_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; unwind: - QUOTA_STACK_UNWIND(readv, frame, -1, ENOMEM, NULL, -1, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(readv, frame, gf_failure, ENOMEM, NULL, gf_failure, NULL, NULL, NULL); return 0; off: @@ -3596,7 +3596,7 @@ quota_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, return 0; unwind: - QUOTA_STACK_UNWIND(fsync, frame, -1, ENOMEM, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(fsync, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; off: @@ -3677,7 +3677,7 @@ quota_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; unwind: - QUOTA_STACK_UNWIND(setattr, frame, -1, ENOMEM, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(setattr, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; off: @@ -3752,7 +3752,7 @@ quota_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, return 0; unwind: - QUOTA_STACK_UNWIND(fsetattr, frame, -1, ENOMEM, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(fsetattr, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; off: @@ -3835,7 +3835,7 @@ quota_mknod_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; unwind: - QUOTA_STACK_UNWIND(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, + QUOTA_STACK_UNWIND(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -3887,7 +3887,7 @@ quota_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - QUOTA_STACK_UNWIND(mknod, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(mknod, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); return 0; off: @@ -4134,7 +4134,7 @@ quota_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; err: - QUOTA_STACK_UNWIND(removexattr, frame, -1, op_errno, NULL); + QUOTA_STACK_UNWIND(removexattr, frame, gf_failure, op_errno, NULL); return 0; off: @@ -4275,7 +4275,7 @@ quota_statfs_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, FIRST_CHILD(this)->fops->statfs, loc, xdata); return 0; err: - QUOTA_STACK_UNWIND(statfs, frame, -1, op_errno, NULL, NULL); + QUOTA_STACK_UNWIND(statfs, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -4363,7 +4363,7 @@ quota_get_limit_dir_continuation(struct list_head *parents, inode_t *inode, op_errno = EIO; } - quota_handle_validate_error(frame, -1, op_errno); + quota_handle_validate_error(frame, gf_failure, op_errno); goto out; } @@ -4391,7 +4391,7 @@ quota_statfs_continue(call_frame_t *frame, xlator_t *this, inode_t *inode) ret = quota_validate(frame, local->inode, this, quota_statfs_validate_cbk); if (0 > ret) - quota_handle_validate_error(frame, -1, -ret); + quota_handle_validate_error(frame, gf_failure, -ret); } void @@ -4525,7 +4525,7 @@ quota_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) return 0; err: - QUOTA_STACK_UNWIND(statfs, frame, -1, op_errno, NULL, NULL); + QUOTA_STACK_UNWIND(statfs, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -4626,7 +4626,7 @@ quota_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - STACK_UNWIND_STRICT(readdirp, frame, -1, EINVAL, NULL, NULL); + STACK_UNWIND_STRICT(readdirp, frame, gf_failure, EINVAL, NULL, NULL); if (new_dict) { dict_unref(dict); @@ -4724,7 +4724,7 @@ quota_fallocate_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, return 0; unwind: - QUOTA_STACK_UNWIND(fallocate, frame, -1, op_errno, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(fallocate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -4837,7 +4837,7 @@ quota_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, return 0; unwind: - QUOTA_STACK_UNWIND(fallocate, frame, -1, op_errno, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(fallocate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; off: diff --git a/xlators/features/read-only/src/read-only-common.c b/xlators/features/read-only/src/read-only-common.c index 6fb577313c..83ad6971fd 100644 --- a/xlators/features/read-only/src/read-only-common.c +++ b/xlators/features/read-only/src/read-only-common.c @@ -50,7 +50,7 @@ ro_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, allzero = _gf_true; if (is_readonly_or_worm_enabled(frame, this) && !allzero) - STACK_UNWIND_STRICT(xattrop, frame, -1, EROFS, NULL, xdata); + STACK_UNWIND_STRICT(xattrop, frame, gf_failure, EROFS, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->xattrop, loc, flags, dict, @@ -70,7 +70,7 @@ ro_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, allzero = _gf_true; if (is_readonly_or_worm_enabled(frame, this) && !allzero) - STACK_UNWIND_STRICT(fxattrop, frame, -1, EROFS, NULL, xdata); + STACK_UNWIND_STRICT(fxattrop, frame, gf_failure, EROFS, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fxattrop, fd, flags, dict, @@ -136,7 +136,7 @@ ro_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, int32_t valid, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(setattr, frame, -1, EROFS, NULL, NULL, xdata); + STACK_UNWIND_STRICT(setattr, frame, gf_failure, EROFS, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->setattr, loc, stbuf, valid, @@ -150,7 +150,7 @@ ro_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, int32_t valid, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(fsetattr, frame, -1, EROFS, NULL, NULL, xdata); + STACK_UNWIND_STRICT(fsetattr, frame, gf_failure, EROFS, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fsetattr, fd, stbuf, valid, @@ -164,7 +164,7 @@ ro_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(truncate, frame, -1, EROFS, NULL, NULL, xdata); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, EROFS, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->truncate, loc, offset, xdata); @@ -177,7 +177,7 @@ ro_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(ftruncate, frame, -1, EROFS, NULL, NULL, xdata); + STACK_UNWIND_STRICT(ftruncate, frame, gf_failure, EROFS, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->ftruncate, fd, offset, xdata); @@ -190,7 +190,7 @@ ro_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, off_t offset, size_t len, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(fallocate, frame, -1, EROFS, NULL, NULL, xdata); + STACK_UNWIND_STRICT(fallocate, frame, gf_failure, EROFS, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fallocate, fd, mode, offset, @@ -203,7 +203,7 @@ ro_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(mknod, frame, -1, EROFS, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(mknod, frame, gf_failure, EROFS, NULL, NULL, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), @@ -218,7 +218,7 @@ ro_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(mkdir, frame, -1, EROFS, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(mkdir, frame, gf_failure, EROFS, NULL, NULL, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), @@ -233,7 +233,7 @@ ro_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(unlink, frame, -1, EROFS, NULL, NULL, xdata); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, EROFS, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->unlink, loc, xflag, xdata); @@ -246,7 +246,7 @@ ro_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(rmdir, frame, -1, EROFS, NULL, NULL, xdata); + STACK_UNWIND_STRICT(rmdir, frame, gf_failure, EROFS, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->rmdir, loc, flags, xdata); @@ -259,7 +259,7 @@ ro_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, loc_t *loc, mode_t umask, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(symlink, frame, -1, EROFS, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(symlink, frame, gf_failure, EROFS, NULL, NULL, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), @@ -274,7 +274,7 @@ ro_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(rename, frame, -1, EROFS, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, EROFS, NULL, NULL, NULL, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), @@ -288,7 +288,7 @@ ro_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(link, frame, -1, EROFS, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(link, frame, gf_failure, EROFS, NULL, NULL, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->link, @@ -302,7 +302,7 @@ ro_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(create, frame, -1, EROFS, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, EROFS, NULL, NULL, NULL, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), @@ -327,7 +327,7 @@ ro_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, if (is_readonly_or_worm_enabled(frame, this) && (((flags & O_ACCMODE) == O_WRONLY) || ((flags & O_ACCMODE) == O_RDWR))) { - STACK_UNWIND_STRICT(open, frame, -1, EROFS, NULL, xdata); + STACK_UNWIND_STRICT(open, frame, gf_failure, EROFS, NULL, xdata); return 0; } @@ -341,7 +341,7 @@ ro_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int32_t flags, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(fsetxattr, frame, -1, EROFS, xdata); + STACK_UNWIND_STRICT(fsetxattr, frame, gf_failure, EROFS, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fsetxattr, fd, dict, flags, @@ -355,7 +355,7 @@ ro_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(fsyncdir, frame, -1, EROFS, xdata); + STACK_UNWIND_STRICT(fsyncdir, frame, gf_failure, EROFS, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fsyncdir, fd, flags, xdata); @@ -369,7 +369,7 @@ ro_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(writev, frame, -1, EROFS, NULL, NULL, xdata); + STACK_UNWIND_STRICT(writev, frame, gf_failure, EROFS, NULL, NULL, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->writev, fd, vector, count, off, @@ -383,7 +383,7 @@ ro_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int32_t flags, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(setxattr, frame, -1, EROFS, xdata); + STACK_UNWIND_STRICT(setxattr, frame, gf_failure, EROFS, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->setxattr, loc, dict, flags, @@ -397,7 +397,7 @@ ro_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { if (is_readonly_or_worm_enabled(frame, this)) - STACK_UNWIND_STRICT(removexattr, frame, -1, EROFS, xdata); + STACK_UNWIND_STRICT(removexattr, frame, gf_failure, EROFS, xdata); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->removexattr, loc, name, xdata); diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c index 41fe0b7507..67250aadfc 100644 --- a/xlators/features/read-only/src/worm.c +++ b/xlators/features/read-only/src/worm.c @@ -35,7 +35,7 @@ worm_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, { if (is_readonly_or_worm_enabled(frame, this) && (flags & (O_WRONLY | O_RDWR | O_APPEND | O_TRUNC))) { - STACK_UNWIND_STRICT(open, frame, -1, EROFS, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, EROFS, NULL, NULL); return 0; } @@ -71,7 +71,7 @@ worm_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, if (op_errno) { if (op_errno < 0) op_errno = EROFS; - STACK_UNWIND_STRICT(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); } else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->link, @@ -106,7 +106,7 @@ worm_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, if (op_errno) { if (op_errno < 0) op_errno = EROFS; - STACK_UNWIND_STRICT(unlink, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, op_errno, NULL, NULL, NULL); } else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->unlink, loc, flags, xdata); @@ -153,7 +153,7 @@ worm_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, if (op_errno) { if (op_errno < 0) op_errno = EROFS; - STACK_UNWIND_STRICT(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); } else STACK_WIND_TAIL(frame, FIRST_CHILD(this), @@ -187,7 +187,7 @@ worm_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, if (op_errno) { if (op_errno < 0) op_errno = EROFS; - STACK_UNWIND_STRICT(truncate, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, op_errno, NULL, NULL, NULL); } else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->truncate, loc, offset, xdata); @@ -220,7 +220,7 @@ worm_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, if (op_errno) { if (op_errno < 0) op_errno = EROFS; - STACK_UNWIND_STRICT(ftruncate, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(ftruncate, frame, gf_failure, op_errno, NULL, NULL, NULL); } else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->ftruncate, fd, offset, xdata); @@ -305,7 +305,7 @@ worm_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, out: if (op_errno) - STACK_UNWIND_STRICT(setattr, frame, -1, EROFS, NULL, NULL, NULL); + STACK_UNWIND_STRICT(setattr, frame, gf_failure, EROFS, NULL, NULL, NULL); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->setattr, loc, stbuf, valid, @@ -392,7 +392,7 @@ worm_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, out: if (op_errno) - STACK_UNWIND_STRICT(fsetattr, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsetattr, frame, gf_failure, op_errno, NULL, NULL, NULL); else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fsetattr, fd, stbuf, valid, @@ -424,7 +424,7 @@ worm_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, if (op_errno) { if (op_errno < 0) op_errno = EROFS; - STACK_UNWIND_STRICT(writev, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); } else STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->writev, fd, vector, count, diff --git a/xlators/features/sdfs/src/sdfs.c b/xlators/features/sdfs/src/sdfs.c index 10c826416f..46ff3913a4 100644 --- a/xlators/features/sdfs/src/sdfs.c +++ b/xlators/features/sdfs/src/sdfs.c @@ -280,7 +280,7 @@ sdfs_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - STACK_UNWIND_STRICT(mkdir, local->main_frame, -1, op_errno, NULL, NULL, + STACK_UNWIND_STRICT(mkdir, local->main_frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); local->main_frame = NULL; @@ -318,7 +318,7 @@ sdfs_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - STACK_UNWIND_STRICT(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); if (new_frame) @@ -370,7 +370,7 @@ sdfs_rmdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, return 0; err: - STACK_UNWIND_STRICT(rmdir, local->main_frame, -1, local->op_errno, NULL, + STACK_UNWIND_STRICT(rmdir, local->main_frame, gf_failure, local->op_errno, NULL, NULL, NULL); local->main_frame = NULL; @@ -407,7 +407,7 @@ sdfs_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, return 0; err: - STACK_UNWIND_STRICT(rmdir, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(rmdir, frame, gf_failure, op_errno, NULL, NULL, NULL); if (new_frame) SDFS_STACK_DESTROY(new_frame); @@ -461,7 +461,7 @@ sdfs_create_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; err: - STACK_UNWIND_STRICT(create, local->main_frame, -1, local->op_errno, NULL, + STACK_UNWIND_STRICT(create, local->main_frame, gf_failure, local->op_errno, NULL, NULL, NULL, NULL, NULL, NULL); local->main_frame = NULL; @@ -499,7 +499,7 @@ sdfs_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, return 0; err: - STACK_UNWIND_STRICT(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); if (new_frame) @@ -551,7 +551,7 @@ sdfs_unlink_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, return 0; err: - STACK_UNWIND_STRICT(unlink, local->main_frame, -1, local->op_errno, NULL, + STACK_UNWIND_STRICT(unlink, local->main_frame, gf_failure, local->op_errno, NULL, NULL, NULL); local->main_frame = NULL; @@ -588,7 +588,7 @@ sdfs_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, return 0; err: - STACK_UNWIND_STRICT(unlink, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, op_errno, NULL, NULL, NULL); if (new_frame) SDFS_STACK_DESTROY(new_frame); @@ -640,7 +640,7 @@ sdfs_symlink_helper(call_frame_t *frame, xlator_t *this, const char *linkname, return 0; err: - STACK_UNWIND_STRICT(link, local->main_frame, -1, local->op_errno, NULL, + STACK_UNWIND_STRICT(link, local->main_frame, gf_failure, local->op_errno, NULL, NULL, NULL, NULL, NULL); local->main_frame = NULL; @@ -678,7 +678,7 @@ sdfs_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, return 0; err: - STACK_UNWIND_STRICT(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); if (new_frame) @@ -784,7 +784,7 @@ sdfs_link_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, return 0; err: - STACK_UNWIND_STRICT(link, local->main_frame, -1, local->op_errno, NULL, + STACK_UNWIND_STRICT(link, local->main_frame, gf_failure, local->op_errno, NULL, NULL, NULL, NULL, NULL); local->main_frame = NULL; @@ -922,7 +922,7 @@ sdfs_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - STACK_UNWIND_STRICT(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); if (new_frame) @@ -975,7 +975,7 @@ sdfs_mknod_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - STACK_UNWIND_STRICT(mknod, local->main_frame, -1, local->op_errno, NULL, + STACK_UNWIND_STRICT(mknod, local->main_frame, gf_failure, local->op_errno, NULL, NULL, NULL, NULL, NULL); local->main_frame = NULL; @@ -1013,7 +1013,7 @@ sdfs_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - STACK_UNWIND_STRICT(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); if (new_frame) @@ -1081,7 +1081,7 @@ sdfs_rename_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, return 0; err: - STACK_UNWIND_STRICT(rename, local->main_frame, -1, local->op_errno, NULL, + STACK_UNWIND_STRICT(rename, local->main_frame, gf_failure, local->op_errno, NULL, NULL, NULL, NULL, NULL, NULL); local->main_frame = NULL; @@ -1186,7 +1186,7 @@ sdfs_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - STACK_UNWIND_STRICT(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); if (new_frame) @@ -1246,7 +1246,7 @@ sdfs_lookup_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; err: - STACK_UNWIND_STRICT(lookup, local->main_frame, -1, local->op_errno, NULL, + STACK_UNWIND_STRICT(lookup, local->main_frame, gf_failure, local->op_errno, NULL, NULL, NULL, NULL); local->main_frame = NULL; @@ -1295,7 +1295,7 @@ sdfs_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) return 0; err: - STACK_UNWIND_STRICT(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); if (new_frame) SDFS_STACK_DESTROY(new_frame); @@ -1345,7 +1345,7 @@ sdfs_readdirp_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - STACK_UNWIND_STRICT(readdirp, local->main_frame, -1, local->op_errno, NULL, + STACK_UNWIND_STRICT(readdirp, local->main_frame, gf_failure, local->op_errno, NULL, NULL); local->main_frame = NULL; @@ -1385,7 +1385,7 @@ sdfs_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - STACK_UNWIND_STRICT(readdirp, frame, -1, op_errno, NULL, NULL); + STACK_UNWIND_STRICT(readdirp, frame, gf_failure, op_errno, NULL, NULL); if (new_frame) SDFS_STACK_DESTROY(new_frame); diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 1bf2174843..28f61ea4b9 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -840,7 +840,7 @@ shard_common_failure_unwind(glusterfs_fop_t fop, call_frame_t *frame, NULL); break; case GF_FOP_READ: - SHARD_STACK_UNWIND(readv, frame, op_ret, op_errno, NULL, -1, NULL, + SHARD_STACK_UNWIND(readv, frame, op_ret, op_errno, NULL, gf_failure, NULL, NULL, NULL); break; case GF_FOP_FSYNC: @@ -1688,7 +1688,7 @@ shard_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) FIRST_CHILD(this)->fops->lookup, loc, local->xattr_req); return 0; err: - shard_common_failure_unwind(GF_FOP_LOOKUP, frame, -1, op_errno); + shard_common_failure_unwind(GF_FOP_LOOKUP, frame, gf_failure, op_errno); return 0; } @@ -1952,7 +1952,7 @@ shard_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) FIRST_CHILD(this)->fops->stat, loc, local->xattr_req); return 0; err: - shard_common_failure_unwind(GF_FOP_STAT, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_STAT, frame, gf_failure, ENOMEM); return 0; } @@ -2006,7 +2006,7 @@ shard_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) FIRST_CHILD(this)->fops->fstat, fd, local->xattr_req); return 0; err: - shard_common_failure_unwind(GF_FOP_FSTAT, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_FSTAT, frame, gf_failure, ENOMEM); return 0; } @@ -2212,7 +2212,7 @@ shard_truncate_htol(call_frame_t *frame, xlator_t *this, inode_t *inode) i = 1; xdata_req = dict_new(); if (!xdata_req) { - shard_common_failure_unwind(local->fop, frame, -1, ENOMEM); + shard_common_failure_unwind(local->fop, frame, gf_failure, ENOMEM); return 0; } ret = dict_set_uint64(xdata_req, GF_GET_FILE_BLOCK_COUNT, 8 * 8); @@ -2222,7 +2222,7 @@ shard_truncate_htol(call_frame_t *frame, xlator_t *this, inode_t *inode) GF_GET_FILE_BLOCK_COUNT, uuid_utoa(local->resolver_base_inode->gfid)); dict_unref(xdata_req); - shard_common_failure_unwind(local->fop, frame, -1, ENOMEM); + shard_common_failure_unwind(local->fop, frame, gf_failure, ENOMEM); return 0; } @@ -2234,7 +2234,7 @@ shard_truncate_htol(call_frame_t *frame, xlator_t *this, inode_t *inode) continue; } if (wind_failed) { - shard_truncate_htol_cbk(frame, (void *)(long)cur_block, this, -1, + shard_truncate_htol_cbk(frame, (void *)(long)cur_block, this, gf_failure, ENOMEM, NULL, NULL, NULL); goto next; } @@ -2252,7 +2252,7 @@ shard_truncate_htol(call_frame_t *frame, xlator_t *this, inode_t *inode) local->op_errno = ENOMEM; loc_wipe(&loc); wind_failed = _gf_true; - shard_truncate_htol_cbk(frame, (void *)(long)cur_block, this, -1, + shard_truncate_htol_cbk(frame, (void *)(long)cur_block, this, gf_failure, ENOMEM, NULL, NULL, NULL); goto next; } @@ -2514,7 +2514,7 @@ shard_common_lookup_shards(call_frame_t *frame, xlator_t *this, inode_t *inode, if (wind_failed) { shard_common_lookup_shards_cbk(frame, (void *)(long)shard_idx_iter, - this, -1, ENOMEM, NULL, NULL, NULL, + this, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); goto next; } @@ -2536,7 +2536,7 @@ shard_common_lookup_shards(call_frame_t *frame, xlator_t *this, inode_t *inode, loc_wipe(&loc); wind_failed = _gf_true; shard_common_lookup_shards_cbk(frame, (void *)(long)shard_idx_iter, - this, -1, ENOMEM, NULL, NULL, NULL, + this, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); goto next; } @@ -2552,7 +2552,7 @@ shard_common_lookup_shards(call_frame_t *frame, xlator_t *this, inode_t *inode, wind_failed = _gf_true; loc_wipe(&loc); shard_common_lookup_shards_cbk(frame, (void *)(long)shard_idx_iter, - this, -1, ENOMEM, NULL, NULL, NULL, + this, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); goto next; } @@ -2688,7 +2688,7 @@ shard_truncate_begin(call_frame_t *frame, xlator_t *this) return 0; err: - shard_common_failure_unwind(local->fop, frame, -1, ENOMEM); + shard_common_failure_unwind(local->fop, frame, gf_failure, ENOMEM); return 0; } @@ -2805,7 +2805,7 @@ shard_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, return 0; err: - shard_common_failure_unwind(GF_FOP_TRUNCATE, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_TRUNCATE, frame, gf_failure, ENOMEM); return 0; } @@ -2860,7 +2860,7 @@ shard_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, shard_post_lookup_truncate_handler); return 0; err: - shard_common_failure_unwind(GF_FOP_FTRUNCATE, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_FTRUNCATE, frame, gf_failure, ENOMEM); return 0; } @@ -2915,7 +2915,7 @@ shard_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, FIRST_CHILD(this)->fops->mknod, loc, mode, rdev, umask, xdata); return 0; err: - shard_common_failure_unwind(GF_FOP_MKNOD, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_MKNOD, frame, gf_failure, ENOMEM); return 0; } @@ -3005,7 +3005,7 @@ shard_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, shard_post_lookup_link_handler); return 0; err: - shard_common_failure_unwind(GF_FOP_LINK, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_LINK, frame, gf_failure, ENOMEM); return 0; } @@ -3227,7 +3227,7 @@ shard_unlink_shards_do(call_frame_t *frame, xlator_t *this, inode_t *inode) goto next; if (wind_failed) { - shard_unlink_shards_do_cbk(frame, (void *)(long)cur_block, this, -1, + shard_unlink_shards_do_cbk(frame, (void *)(long)cur_block, this, gf_failure, ENOMEM, NULL, NULL, NULL); goto next; } @@ -3245,7 +3245,7 @@ shard_unlink_shards_do(call_frame_t *frame, xlator_t *this, inode_t *inode) local->op_errno = ENOMEM; loc_wipe(&loc); wind_failed = _gf_true; - shard_unlink_shards_do_cbk(frame, (void *)(long)cur_block, this, -1, + shard_unlink_shards_do_cbk(frame, (void *)(long)cur_block, this, gf_failure, ENOMEM, NULL, NULL, NULL); goto next; } @@ -3937,7 +3937,7 @@ shard_set_size_attrs_on_marker_file(call_frame_t *frame, xlator_t *this) err: if (xdata) dict_unref(xdata); - shard_common_failure_unwind(local->fop, frame, -1, op_errno); + shard_common_failure_unwind(local->fop, frame, gf_failure, op_errno); return 0; } @@ -3991,7 +3991,7 @@ shard_lookup_marker_file(call_frame_t *frame, xlator_t *this) dict_unref(xattr_req); return 0; err: - shard_common_failure_unwind(local->fop, frame, -1, op_errno); + shard_common_failure_unwind(local->fop, frame, gf_failure, op_errno); return 0; } @@ -4035,7 +4035,7 @@ shard_create_marker_file_under_remove_me_cbk( shard_rename_src_base_file(frame, this); return 0; err: - shard_common_failure_unwind(local->fop, frame, -1, local->op_errno); + shard_common_failure_unwind(local->fop, frame, gf_failure, local->op_errno); return 0; } @@ -4098,7 +4098,7 @@ shard_create_marker_file_under_remove_me(call_frame_t *frame, xlator_t *this, err: if (xattr_req) dict_unref(xattr_req); - shard_create_marker_file_under_remove_me_cbk(frame, 0, this, -1, op_errno, + shard_create_marker_file_under_remove_me_cbk(frame, 0, this, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -4282,7 +4282,7 @@ shard_acquire_entrylk(call_frame_t *frame, xlator_t *this, inode_t *inode, int_entrylk->basename, ENTRYLK_LOCK, ENTRYLK_WRLCK, NULL); return 0; err: - shard_common_failure_unwind(local->fop, frame, -1, ENOMEM); + shard_common_failure_unwind(local->fop, frame, gf_failure, ENOMEM); return 0; } @@ -4296,7 +4296,7 @@ shard_post_lookup_base_shard_rm_handler(call_frame_t *frame, xlator_t *this) local = frame->local; if (local->op_ret < 0) { - shard_common_failure_unwind(local->fop, frame, -1, local->op_errno); + shard_common_failure_unwind(local->fop, frame, gf_failure, local->op_errno); return 0; } @@ -4404,7 +4404,7 @@ shard_acquire_inodelk(call_frame_t *frame, xlator_t *this, loc_t *loc) &local->int_inodelk.loc, F_SETLKW, &int_inodelk->flock, NULL); return 0; err: - shard_common_failure_unwind(local->fop, frame, -1, ENOMEM); + shard_common_failure_unwind(local->fop, frame, gf_failure, ENOMEM); return 0; } @@ -4417,7 +4417,7 @@ shard_post_mkdir_rm_handler(call_frame_t *frame, xlator_t *this) local = frame->local; if (local->op_ret < 0) { - shard_common_failure_unwind(local->fop, frame, -1, local->op_errno); + shard_common_failure_unwind(local->fop, frame, gf_failure, local->op_errno); return 0; } if (local->fop == GF_FOP_UNLINK) @@ -4440,7 +4440,7 @@ shard_pre_mkdir_rm_handler(call_frame_t *frame, xlator_t *this) local = frame->local; if (local->op_ret < 0) { - shard_common_failure_unwind(local->fop, frame, -1, local->op_errno); + shard_common_failure_unwind(local->fop, frame, gf_failure, local->op_errno); return 0; } shard_mkdir_internal_dir(frame, this, shard_post_mkdir_rm_handler, @@ -4519,7 +4519,7 @@ shard_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, shard_begin_rm_resolution(frame, this); return 0; err: - shard_common_failure_unwind(GF_FOP_UNLINK, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_UNLINK, frame, gf_failure, ENOMEM); return 0; } @@ -4696,7 +4696,7 @@ shard_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - shard_common_failure_unwind(GF_FOP_RENAME, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_RENAME, frame, gf_failure, ENOMEM); return 0; } @@ -4752,7 +4752,7 @@ shard_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, xdata); return 0; err: - shard_common_failure_unwind(GF_FOP_CREATE, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_CREATE, frame, gf_failure, ENOMEM); return 0; } @@ -4891,7 +4891,7 @@ shard_readv_do(call_frame_t *frame, xlator_t *this) while (cur_block <= last_block) { if (wind_failed) { - shard_readv_do_cbk(frame, (void *)(long)0, this, -1, ENOMEM, NULL, + shard_readv_do_cbk(frame, (void *)(long)0, this, gf_failure, ENOMEM, NULL, 0, NULL, NULL, NULL); goto next; } @@ -4911,7 +4911,7 @@ shard_readv_do(call_frame_t *frame, xlator_t *this) local->op_ret = -1; local->op_errno = ENOMEM; wind_failed = _gf_true; - shard_readv_do_cbk(frame, (void *)(long)anon_fd, this, -1, + shard_readv_do_cbk(frame, (void *)(long)anon_fd, this, gf_failure, ENOMEM, NULL, 0, NULL, NULL, NULL); goto next; } @@ -5030,7 +5030,7 @@ shard_common_resume_mknod(call_frame_t *frame, xlator_t *this, if (wind_failed) { shard_common_mknod_cbk(frame, (void *)(long)shard_idx_iter, this, - -1, ENOMEM, NULL, NULL, NULL, NULL, NULL); + gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); goto next; } @@ -5043,7 +5043,7 @@ shard_common_resume_mknod(call_frame_t *frame, xlator_t *this, local->op_errno = ENOMEM; wind_failed = _gf_true; shard_common_mknod_cbk(frame, (void *)(long)shard_idx_iter, this, - -1, ENOMEM, NULL, NULL, NULL, NULL, NULL); + gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); goto next; } @@ -5062,7 +5062,7 @@ shard_common_resume_mknod(call_frame_t *frame, xlator_t *this, loc_wipe(&loc); dict_unref(xattr_req); shard_common_mknod_cbk(frame, (void *)(long)shard_idx_iter, this, - -1, ENOMEM, NULL, NULL, NULL, NULL, NULL); + gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); goto next; } @@ -5268,7 +5268,7 @@ shard_post_lookup_readv_handler(call_frame_t *frame, xlator_t *this) } return 0; err: - shard_common_failure_unwind(GF_FOP_READ, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_READ, frame, gf_failure, ENOMEM); return 0; } @@ -5328,7 +5328,7 @@ shard_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, shard_post_lookup_readv_handler); return 0; err: - shard_common_failure_unwind(GF_FOP_READ, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_READ, frame, gf_failure, ENOMEM); return 0; } @@ -5543,7 +5543,7 @@ shard_common_inode_write_do(call_frame_t *frame, xlator_t *this) local->op_ret = -1; local->op_errno = ENOMEM; local->call_count = 1; - shard_common_inode_write_do_cbk(frame, (void *)(long)0, this, -1, + shard_common_inode_write_do_cbk(frame, (void *)(long)0, this, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -5553,7 +5553,7 @@ shard_common_inode_write_do(call_frame_t *frame, xlator_t *this) while (cur_block <= last_block) { if (wind_failed) { - shard_common_inode_write_do_cbk(frame, (void *)(long)0, this, -1, + shard_common_inode_write_do_cbk(frame, (void *)(long)0, this, gf_failure, ENOMEM, NULL, NULL, NULL); goto next; } @@ -5574,7 +5574,7 @@ shard_common_inode_write_do(call_frame_t *frame, xlator_t *this) local->op_errno = ENOMEM; wind_failed = _gf_true; shard_common_inode_write_do_cbk(frame, (void *)(long)0, this, - -1, ENOMEM, NULL, NULL, NULL); + gf_failure, ENOMEM, NULL, NULL, NULL); goto next; } } @@ -5589,7 +5589,7 @@ shard_common_inode_write_do(call_frame_t *frame, xlator_t *this) wind_failed = _gf_true; GF_FREE(vec); shard_common_inode_write_do_cbk(frame, (void *)(long)anon_fd, - this, -1, ENOMEM, NULL, NULL, + this, gf_failure, ENOMEM, NULL, NULL, NULL); goto next; } @@ -5724,7 +5724,7 @@ shard_common_inode_write_post_lookup_handler(call_frame_t *frame, local->inode_list = GF_CALLOC(local->num_blocks, sizeof(inode_t *), gf_shard_mt_inode_list); if (!local->inode_list) { - shard_common_failure_unwind(local->fop, frame, -1, ENOMEM); + shard_common_failure_unwind(local->fop, frame, gf_failure, ENOMEM); return 0; } @@ -6059,7 +6059,7 @@ shard_post_lookup_fsync_handler(call_frame_t *frame, xlator_t *this) SHARD_MSG_MEMALLOC_FAILED, "Failed to create " "anon fd to fsync shard"); - shard_fsync_shards_cbk(frame, (void *)(long)anon_fd, this, -1, + shard_fsync_shards_cbk(frame, (void *)(long)anon_fd, this, gf_failure, ENOMEM, NULL, NULL, NULL); continue; } @@ -6072,7 +6072,7 @@ shard_post_lookup_fsync_handler(call_frame_t *frame, xlator_t *this) uuid_utoa(iter->inode->gfid)); local->op_ret = -1; local->op_errno = ENOMEM; - shard_fsync_shards_cbk(frame, (void *)(long)anon_fd, this, -1, + shard_fsync_shards_cbk(frame, (void *)(long)anon_fd, this, gf_failure, ENOMEM, NULL, NULL, NULL); continue; } @@ -6131,7 +6131,7 @@ shard_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, shard_post_lookup_fsync_handler); return 0; err: - shard_common_failure_unwind(GF_FOP_FSYNC, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_FSYNC, frame, gf_failure, ENOMEM); return 0; } @@ -6299,7 +6299,7 @@ shard_readdir_do(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - STACK_UNWIND_STRICT(readdir, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(readdir, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -6506,7 +6506,7 @@ shard_common_remove_xattr(call_frame_t *frame, xlator_t *this, shard_post_lookup_remove_xattr_handler); return 0; err: - shard_common_failure_unwind(fop, frame, -1, op_errno); + shard_common_failure_unwind(fop, frame, gf_failure, op_errno); return 0; } @@ -6562,7 +6562,7 @@ shard_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, FIRST_CHILD(this)->fops->fgetxattr, fd, name, xdata); return 0; out: - shard_common_failure_unwind(GF_FOP_FGETXATTR, frame, -1, op_errno); + shard_common_failure_unwind(GF_FOP_FGETXATTR, frame, gf_failure, op_errno); return 0; } @@ -6600,7 +6600,7 @@ shard_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, FIRST_CHILD(this)->fops->getxattr, loc, name, xdata); return 0; out: - shard_common_failure_unwind(GF_FOP_GETXATTR, frame, -1, op_errno); + shard_common_failure_unwind(GF_FOP_GETXATTR, frame, gf_failure, op_errno); return 0; } @@ -6744,7 +6744,7 @@ shard_common_set_xattr(call_frame_t *frame, xlator_t *this, glusterfs_fop_t fop, shard_post_lookup_set_xattr_handler); return 0; err: - shard_common_failure_unwind(fop, frame, -1, op_errno); + shard_common_failure_unwind(fop, frame, gf_failure, op_errno); return 0; } @@ -6872,7 +6872,7 @@ shard_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, local->xattr_req); return 0; err: - shard_common_failure_unwind(GF_FOP_SETATTR, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_SETATTR, frame, gf_failure, ENOMEM); return 0; } @@ -6928,7 +6928,7 @@ shard_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, local->xattr_req); return 0; err: - shard_common_failure_unwind(GF_FOP_FSETATTR, frame, -1, ENOMEM); + shard_common_failure_unwind(GF_FOP_FSETATTR, frame, gf_failure, ENOMEM); return 0; } @@ -7030,7 +7030,7 @@ shard_common_inode_write_begin(call_frame_t *frame, xlator_t *this, shard_common_inode_write_post_lookup_handler); return 0; out: - shard_common_failure_unwind(fop, frame, -1, ENOMEM); + shard_common_failure_unwind(fop, frame, gf_failure, ENOMEM); return 0; } @@ -7056,7 +7056,7 @@ shard_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, offset, keep_size, len, NULL, xdata); return 0; out: - shard_common_failure_unwind(GF_FOP_FALLOCATE, frame, -1, ENOTSUP); + shard_common_failure_unwind(GF_FOP_FALLOCATE, frame, gf_failure, ENOTSUP); return 0; } @@ -7085,7 +7085,7 @@ shard_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, /* TBD */ gf_msg(this->name, GF_LOG_INFO, ENOTSUP, SHARD_MSG_FOP_NOT_SUPPORTED, "seek called on %s.", uuid_utoa(fd->inode->gfid)); - shard_common_failure_unwind(GF_FOP_SEEK, frame, -1, ENOTSUP); + shard_common_failure_unwind(GF_FOP_SEEK, frame, gf_failure, ENOTSUP); return 0; } diff --git a/xlators/features/thin-arbiter/src/thin-arbiter.c b/xlators/features/thin-arbiter/src/thin-arbiter.c index fe9fc617c7..8220c97a70 100644 --- a/xlators/features/thin-arbiter/src/thin-arbiter.c +++ b/xlators/features/thin-arbiter/src/thin-arbiter.c @@ -160,7 +160,7 @@ ta_get_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, unwind: - TA_STACK_UNWIND(xattrop, frame, -1, op_errno, NULL, NULL); + TA_STACK_UNWIND(xattrop, frame, gf_failure, op_errno, NULL, NULL); return -1; } @@ -226,7 +226,7 @@ ta_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, unwind: - TA_STACK_UNWIND(xattrop, frame, -1, -ret, NULL, NULL); + TA_STACK_UNWIND(xattrop, frame, gf_failure, -ret, NULL, NULL); return 0; } @@ -250,7 +250,7 @@ ta_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, unwind: - TA_STACK_UNWIND(xattrop, frame, -1, -ret, NULL, NULL); + TA_STACK_UNWIND(xattrop, frame, gf_failure, -ret, NULL, NULL); return 0; } diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index 7c575e4278..c14805b0e9 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -1349,7 +1349,7 @@ trash_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, local = mem_get0(this->local_pool); if (!local) { gf_log(this->name, GF_LOG_DEBUG, "out of memory"); - TRASH_STACK_UNWIND(unlink, frame, -1, ENOMEM, NULL, NULL, xdata); + TRASH_STACK_UNWIND(unlink, frame, gf_failure, ENOMEM, NULL, NULL, xdata); ret = ENOMEM; goto out; } @@ -2012,7 +2012,7 @@ trash_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, local = mem_get0(this->local_pool); if (!local) { gf_log(this->name, GF_LOG_DEBUG, "out of memory"); - TRASH_STACK_UNWIND(truncate, frame, -1, ENOMEM, NULL, NULL, xdata); + TRASH_STACK_UNWIND(truncate, frame, gf_failure, ENOMEM, NULL, NULL, xdata); ret = ENOMEM; goto out; } @@ -2100,7 +2100,7 @@ trash_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, local = mem_get0(this->local_pool); if (!local) { gf_log(this->name, GF_LOG_DEBUG, "out of memory"); - TRASH_STACK_UNWIND(ftruncate, frame, -1, ENOMEM, NULL, NULL, xdata); + TRASH_STACK_UNWIND(ftruncate, frame, gf_failure, ENOMEM, NULL, NULL, xdata); ret = -1; goto out; } diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c index c5dced5f50..59c025c820 100644 --- a/xlators/features/upcall/src/upcall.c +++ b/xlators/features/upcall/src/upcall.c @@ -74,7 +74,7 @@ up_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, return 0; err: - UPCALL_STACK_UNWIND(open, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(open, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -128,7 +128,7 @@ up_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, return 0; err: - UPCALL_STACK_UNWIND(writev, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -182,7 +182,7 @@ up_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - UPCALL_STACK_UNWIND(readv, frame, -1, op_errno, NULL, 0, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(readv, frame, gf_failure, op_errno, NULL, 0, NULL, NULL, NULL); return 0; } @@ -233,7 +233,7 @@ up_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, return 0; err: - UPCALL_STACK_UNWIND(lk, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(lk, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -287,7 +287,7 @@ up_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, return 0; err: - UPCALL_STACK_UNWIND(truncate, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(truncate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -355,7 +355,7 @@ up_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, return 0; err: - UPCALL_STACK_UNWIND(setattr, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(setattr, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -424,7 +424,7 @@ up_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - UPCALL_STACK_UNWIND(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, + UPCALL_STACK_UNWIND(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -483,7 +483,7 @@ up_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, return 0; err: - UPCALL_STACK_UNWIND(unlink, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(unlink, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -542,7 +542,7 @@ up_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; err: - UPCALL_STACK_UNWIND(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, + UPCALL_STACK_UNWIND(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -602,7 +602,7 @@ up_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, return 0; err: - UPCALL_STACK_UNWIND(rmdir, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(rmdir, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -663,7 +663,7 @@ up_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - UPCALL_STACK_UNWIND(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, + UPCALL_STACK_UNWIND(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -728,7 +728,7 @@ up_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, return 0; err: - UPCALL_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, + UPCALL_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -782,7 +782,7 @@ up_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) return 0; err: - UPCALL_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -834,7 +834,7 @@ up_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) return 0; err: - UPCALL_STACK_UNWIND(stat, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(stat, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -859,7 +859,7 @@ up_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) return 0; err: - UPCALL_STACK_UNWIND(fstat, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(fstat, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -885,7 +885,7 @@ up_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; err: - UPCALL_STACK_UNWIND(ftruncate, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(ftruncate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -937,7 +937,7 @@ up_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, return 0; err: - UPCALL_STACK_UNWIND(access, frame, -1, op_errno, NULL); + UPCALL_STACK_UNWIND(access, frame, gf_failure, op_errno, NULL); return 0; } @@ -990,7 +990,7 @@ up_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, return 0; err: - UPCALL_STACK_UNWIND(readlink, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(readlink, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1051,7 +1051,7 @@ up_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; err: - UPCALL_STACK_UNWIND(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, + UPCALL_STACK_UNWIND(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -1113,7 +1113,7 @@ up_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, return 0; err: - UPCALL_STACK_UNWIND(symlink, frame, -1, op_errno, NULL, NULL, NULL, NULL, + UPCALL_STACK_UNWIND(symlink, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -1166,7 +1166,7 @@ up_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, return 0; err: - UPCALL_STACK_UNWIND(opendir, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(opendir, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1218,7 +1218,7 @@ up_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) return 0; err: - UPCALL_STACK_UNWIND(statfs, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(statfs, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1271,7 +1271,7 @@ up_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - UPCALL_STACK_UNWIND(readdir, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(readdir, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1334,7 +1334,7 @@ up_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - UPCALL_STACK_UNWIND(readdirp, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(readdirp, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1360,7 +1360,7 @@ up_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, return 0; err: - UPCALL_STACK_UNWIND(fsetattr, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(fsetattr, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1414,7 +1414,7 @@ up_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, return 0; err: - UPCALL_STACK_UNWIND(fallocate, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(fallocate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1467,7 +1467,7 @@ up_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; err: - UPCALL_STACK_UNWIND(discard, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(discard, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1520,7 +1520,7 @@ up_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; err: - UPCALL_STACK_UNWIND(zerofill, frame, -1, op_errno, NULL, NULL, NULL); + UPCALL_STACK_UNWIND(zerofill, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1572,7 +1572,7 @@ up_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; err: - UPCALL_STACK_UNWIND(seek, frame, -1, op_errno, 0, NULL); + UPCALL_STACK_UNWIND(seek, frame, gf_failure, op_errno, 0, NULL); return 0; } @@ -1646,7 +1646,7 @@ up_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, return 0; err: - UPCALL_STACK_UNWIND(setxattr, frame, -1, op_errno, NULL); + UPCALL_STACK_UNWIND(setxattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -1720,7 +1720,7 @@ up_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, return 0; err: - UPCALL_STACK_UNWIND(fsetxattr, frame, -1, op_errno, NULL); + UPCALL_STACK_UNWIND(fsetxattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -1803,7 +1803,7 @@ up_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, if (xattr) dict_unref(xattr); - UPCALL_STACK_UNWIND(fremovexattr, frame, -1, op_errno, NULL); + UPCALL_STACK_UNWIND(fremovexattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -1886,7 +1886,7 @@ up_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, if (xattr) dict_unref(xattr); - UPCALL_STACK_UNWIND(removexattr, frame, -1, op_errno, NULL); + UPCALL_STACK_UNWIND(removexattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -1937,7 +1937,7 @@ up_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, FIRST_CHILD(this)->fops->fgetxattr, fd, name, xdata); return 0; err: - UPCALL_STACK_UNWIND(fgetxattr, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(fgetxattr, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -1987,7 +1987,7 @@ up_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, FIRST_CHILD(this)->fops->getxattr, loc, name, xdata); return 0; err: - UPCALL_STACK_UNWIND(getxattr, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(getxattr, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -2081,7 +2081,7 @@ up_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, FIRST_CHILD(this)->fops->xattrop, loc, optype, xattr, xdata); return 0; err: - UPCALL_STACK_UNWIND(xattrop, frame, -1, op_errno, NULL, NULL); + UPCALL_STACK_UNWIND(xattrop, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -2115,7 +2115,7 @@ up_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, FIRST_CHILD(this)->fops->fxattrop, fd, optype, xattr, xdata); return 0; err: - STACK_UNWIND_STRICT(fxattrop, frame, -1, op_errno, NULL, NULL); + STACK_UNWIND_STRICT(fxattrop, frame, gf_failure, op_errno, NULL, NULL); return 0; } diff --git a/xlators/features/utime/src/utime.c b/xlators/features/utime/src/utime.c index 89eb7a6331..16e74d6f37 100644 --- a/xlators/features/utime/src/utime.c +++ b/xlators/features/utime/src/utime.c @@ -227,7 +227,7 @@ gf_utime_set_mdata_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (dict) { dict_unref(dict); } - STACK_UNWIND_STRICT(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } diff --git a/xlators/meta/src/meta-defaults.c b/xlators/meta/src/meta-defaults.c index 91c328473f..bb313524fe 100644 --- a/xlators/meta/src/meta-defaults.c +++ b/xlators/meta/src/meta-defaults.c @@ -245,13 +245,13 @@ meta_default_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, ops = meta_ops_get(loc->inode, this); if (!ops || !ops->link_fill) { - META_STACK_UNWIND(readlink, frame, -1, EPERM, 0, 0, 0); + META_STACK_UNWIND(readlink, frame, gf_failure, EPERM, 0, 0, 0); return 0; } strfd = strfd_open(); if (!strfd) { - META_STACK_UNWIND(readlink, frame, -1, ENOMEM, 0, 0, 0); + META_STACK_UNWIND(readlink, frame, gf_failure, ENOMEM, 0, 0, 0); return 0; } @@ -263,7 +263,7 @@ meta_default_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, len = strlen(strfd->data); META_STACK_UNWIND(readlink, frame, len, 0, strfd->data, &iatt, xdata); } else - META_STACK_UNWIND(readlink, frame, -1, ENODATA, 0, 0, 0); + META_STACK_UNWIND(readlink, frame, gf_failure, ENODATA, 0, 0, 0); strfd_close(strfd); @@ -470,7 +470,7 @@ meta_default_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - META_STACK_UNWIND(readdir, frame, -1, ENOMEM, 0, 0); + META_STACK_UNWIND(readdir, frame, gf_failure, ENOMEM, 0, 0); return 0; } @@ -558,7 +558,7 @@ meta_default_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, META_STACK_UNWIND(lookup, frame, 0, 0, loc->inode, &iatt, xdata, &parent); } else { - META_STACK_UNWIND(lookup, frame, -1, ENOENT, 0, 0, 0, 0); + META_STACK_UNWIND(lookup, frame, gf_failure, ENOENT, 0, 0, 0, 0); } for (i = 0; i < ret; i++) diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index f8e71437ed..7002307c39 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -318,7 +318,7 @@ int32_t ioc_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { ioc_local_t *local = NULL; - int32_t op_errno = -1, ret = -1; + int32_t op_errno = gf_failure, ret = -1; local = mem_get0(this->local_pool); if (local == NULL) { @@ -347,7 +347,7 @@ ioc_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) mem_put(local); } - STACK_UNWIND_STRICT(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -805,7 +805,7 @@ ioc_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata) { ioc_local_t *local = NULL; - int32_t op_errno = -1, ret = -1; + int32_t op_errno = gf_failure, ret = -1; local = mem_get0(this->local_pool); if (local == NULL) { @@ -833,7 +833,7 @@ ioc_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, mem_put(local); } - STACK_UNWIND_STRICT(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -856,7 +856,7 @@ ioc_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, local = mem_get0(this->local_pool); if (local == NULL) { gf_smsg(this->name, GF_LOG_ERROR, ENOMEM, IO_CACHE_MSG_NO_MEMORY, NULL); - STACK_UNWIND_STRICT(open, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -891,7 +891,7 @@ ioc_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, local = mem_get0(this->local_pool); if (local == NULL) { gf_smsg(this->name, GF_LOG_ERROR, ENOMEM, IO_CACHE_MSG_NO_MEMORY, NULL); - STACK_UNWIND_STRICT(create, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1203,7 +1203,7 @@ ioc_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; out: - STACK_UNWIND_STRICT(readv, frame, -1, op_errno, NULL, 0, NULL, NULL, NULL); + STACK_UNWIND_STRICT(readv, frame, gf_failure, op_errno, NULL, 0, NULL, NULL, NULL); return 0; } @@ -1268,7 +1268,7 @@ ioc_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, if (local == NULL) { gf_smsg(this->name, GF_LOG_ERROR, ENOMEM, IO_CACHE_MSG_NO_MEMORY, NULL); - STACK_UNWIND_STRICT(writev, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(writev, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -1404,7 +1404,7 @@ ioc_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, if (!ioc_inode) { gf_msg_debug(this->name, EBADFD, "inode context is NULL: returning EBADFD"); - STACK_UNWIND_STRICT(lk, frame, -1, EBADFD, NULL, NULL); + STACK_UNWIND_STRICT(lk, frame, gf_failure, EBADFD, NULL, NULL); return 0; } diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index c1a626cdf1..b90fb3cca8 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -2926,7 +2926,7 @@ mdc_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; out: - MDC_STACK_UNWIND(readdirp, frame, -1, ENOMEM, NULL, NULL); + MDC_STACK_UNWIND(readdirp, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -2981,7 +2981,7 @@ mdc_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; unwind: - MDC_STACK_UNWIND(readdir, frame, -1, ENOMEM, NULL, NULL); + MDC_STACK_UNWIND(readdir, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -3155,7 +3155,7 @@ mdc_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, return 0; unwind: - MDC_STACK_UNWIND(readlink, frame, -1, ENOMEM, NULL, NULL, NULL); + MDC_STACK_UNWIND(readlink, frame, gf_failure, ENOMEM, NULL, NULL, NULL); return 0; } @@ -3197,7 +3197,7 @@ mdc_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, return 0; unwind: - MDC_STACK_UNWIND(fsyncdir, frame, -1, ENOMEM, NULL); + MDC_STACK_UNWIND(fsyncdir, frame, gf_failure, ENOMEM, NULL); return 0; } @@ -3239,7 +3239,7 @@ mdc_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, return 0; unwind: - MDC_STACK_UNWIND(access, frame, -1, ENOMEM, NULL); + MDC_STACK_UNWIND(access, frame, gf_failure, ENOMEM, NULL); return 0; } diff --git a/xlators/performance/nl-cache/src/nl-cache.c b/xlators/performance/nl-cache/src/nl-cache.c index a072b8cf25..e6cc72677d 100644 --- a/xlators/performance/nl-cache/src/nl-cache.c +++ b/xlators/performance/nl-cache/src/nl-cache.c @@ -244,10 +244,10 @@ nlc_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) FIRST_CHILD(this)->fops->lookup, loc, xdata); return 0; unwind: - NLC_STACK_UNWIND(lookup, frame, -1, ENOENT, NULL, NULL, NULL, NULL); + NLC_STACK_UNWIND(lookup, frame, gf_failure, ENOENT, NULL, NULL, NULL, NULL); return 0; err: - NLC_STACK_UNWIND(lookup, frame, -1, ENOMEM, NULL, NULL, NULL, NULL); + NLC_STACK_UNWIND(lookup, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); return 0; } @@ -343,7 +343,7 @@ nlc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, dict_unref(dict); return 0; err: - NLC_STACK_UNWIND(getxattr, frame, -1, ENOMEM, NULL, NULL); + NLC_STACK_UNWIND(getxattr, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index c4de1b2ba5..6e17bce04a 100644 --- a/xlators/performance/read-ahead/src/read-ahead.c +++ b/xlators/performance/read-ahead/src/read-ahead.c @@ -521,7 +521,7 @@ ra_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; unwind: - STACK_UNWIND_STRICT(readv, frame, -1, op_errno, NULL, 0, NULL, NULL, NULL); + STACK_UNWIND_STRICT(readv, frame, gf_failure, op_errno, NULL, 0, NULL, NULL, NULL); return 0; @@ -565,7 +565,7 @@ ra_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) return 0; unwind: - STACK_UNWIND_STRICT(flush, frame, -1, op_errno, NULL); + STACK_UNWIND_STRICT(flush, frame, gf_failure, op_errno, NULL); return 0; } @@ -584,7 +584,7 @@ ra_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, return 0; unwind: - STACK_UNWIND_STRICT(fsync, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsync, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -655,7 +655,7 @@ ra_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, return 0; unwind: - STACK_UNWIND_STRICT(writev, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -726,7 +726,7 @@ ra_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, return 0; unwind: - STACK_UNWIND_STRICT(truncate, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -860,7 +860,7 @@ ra_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) return 0; unwind: - STACK_UNWIND_STRICT(stat, frame, -1, op_errno, NULL, NULL); + STACK_UNWIND_STRICT(stat, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -907,7 +907,7 @@ ra_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; unwind: - STACK_UNWIND_STRICT(truncate, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -959,7 +959,7 @@ ra_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; unwind: - STACK_UNWIND_STRICT(discard, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(discard, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1011,7 +1011,7 @@ ra_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; unwind: - STACK_UNWIND_STRICT(zerofill, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(zerofill, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.c b/xlators/performance/readdir-ahead/src/readdir-ahead.c index 0762e195f3..7acfef8079 100644 --- a/xlators/performance/readdir-ahead/src/readdir-ahead.c +++ b/xlators/performance/readdir-ahead/src/readdir-ahead.c @@ -474,7 +474,7 @@ rda_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - STACK_UNWIND_STRICT(readdirp, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(readdirp, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -750,7 +750,7 @@ rda_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, return 0; unwind: - STACK_UNWIND_STRICT(opendir, frame, -1, op_errno, fd, xdata); + STACK_UNWIND_STRICT(opendir, frame, gf_failure, op_errno, fd, xdata); return 0; } diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index b88b0e2159..a3bacf1d55 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -1899,7 +1899,7 @@ wb_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, return 0; unwind: - STACK_UNWIND_STRICT(writev, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -1940,7 +1940,7 @@ wb_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; unwind: - STACK_UNWIND_STRICT(readv, frame, -1, ENOMEM, NULL, 0, NULL, NULL, NULL); + STACK_UNWIND_STRICT(readv, frame, gf_failure, ENOMEM, NULL, 0, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2024,7 +2024,7 @@ wb_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) return 0; unwind: - STACK_UNWIND_STRICT(flush, frame, -1, ENOMEM, NULL); + STACK_UNWIND_STRICT(flush, frame, gf_failure, ENOMEM, NULL); if (stub) call_stub_destroy(stub); @@ -2070,7 +2070,7 @@ wb_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, return 0; unwind: - STACK_UNWIND_STRICT(fsync, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsync, frame, gf_failure, op_errno, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2112,7 +2112,7 @@ wb_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) return 0; unwind: - STACK_UNWIND_STRICT(stat, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(stat, frame, gf_failure, ENOMEM, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2154,7 +2154,7 @@ wb_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) return 0; unwind: - STACK_UNWIND_STRICT(fstat, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(fstat, frame, gf_failure, ENOMEM, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2217,7 +2217,7 @@ wb_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, return 0; unwind: - STACK_UNWIND_STRICT(truncate, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2285,7 +2285,7 @@ wb_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, unwind: frame->local = NULL; - STACK_UNWIND_STRICT(ftruncate, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(ftruncate, frame, gf_failure, op_errno, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2323,7 +2323,7 @@ wb_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, return 0; unwind: - STACK_UNWIND_STRICT(setattr, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(setattr, frame, gf_failure, ENOMEM, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2367,7 +2367,7 @@ wb_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, return 0; unwind: - STACK_UNWIND_STRICT(fsetattr, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsetattr, frame, gf_failure, ENOMEM, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2397,7 +2397,7 @@ wb_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, return 0; unwind: - STACK_UNWIND_STRICT(create, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -2420,7 +2420,7 @@ wb_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, return 0; unwind: - STACK_UNWIND_STRICT(open, frame, -1, ENOMEM, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, ENOMEM, NULL, NULL); return 0; } @@ -2473,7 +2473,7 @@ wb_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) if (stub) call_stub_destroy(stub); - STACK_UNWIND_STRICT(lookup, frame, -1, ENOMEM, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(lookup, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL); return 0; noqueue: @@ -2630,7 +2630,7 @@ wb_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, return 0; unwind: - STACK_UNWIND_STRICT(link, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(link, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2677,7 +2677,7 @@ wb_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t keep_size, return 0; unwind: - STACK_UNWIND_STRICT(fallocate, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fallocate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2723,7 +2723,7 @@ wb_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; unwind: - STACK_UNWIND_STRICT(discard, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(discard, frame, gf_failure, ENOMEM, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2768,7 +2768,7 @@ wb_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, return 0; unwind: - STACK_UNWIND_STRICT(zerofill, frame, -1, ENOMEM, NULL, NULL, NULL); + STACK_UNWIND_STRICT(zerofill, frame, gf_failure, ENOMEM, NULL, NULL, NULL); if (stub) call_stub_destroy(stub); @@ -2805,7 +2805,7 @@ wb_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, if (stub) call_stub_destroy(stub); - STACK_UNWIND_STRICT(rename, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, ENOMEM, NULL, NULL, NULL, NULL, NULL, NULL); return 0; diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 5a30c934f4..a53c433994 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -30,7 +30,7 @@ extern rpc_clnt_prog_t clnt_pmap_prog; int32_t client3_getspec(call_frame_t *frame, xlator_t *this, void *data) { - CLIENT_STACK_UNWIND(getspec, frame, -1, ENOSYS, NULL); + CLIENT_STACK_UNWIND(getspec, frame, gf_failure, ENOSYS, NULL); return 0; } diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c index f6199f2a17..32f098650f 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -3228,7 +3228,7 @@ client3_3_lookup(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -3273,7 +3273,7 @@ client3_3_stat(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(stat, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(stat, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -3315,7 +3315,7 @@ client3_3_truncate(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(truncate, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(truncate, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -3357,7 +3357,7 @@ client3_3_ftruncate(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(ftruncate, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(ftruncate, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -3399,7 +3399,7 @@ client3_3_access(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(access, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(access, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -3487,7 +3487,7 @@ client3_3_readlink(call_frame_t *frame, xlator_t *this, void *data) iobref_unref(rsp_iobref); } - CLIENT_STACK_UNWIND(readlink, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(readlink, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -3528,7 +3528,7 @@ client3_3_unlink(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(unlink, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(unlink, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -3569,7 +3569,7 @@ client3_3_rmdir(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(rmdir, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(rmdir, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -3629,7 +3629,7 @@ client3_3_symlink(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(symlink, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(symlink, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -3673,7 +3673,7 @@ client3_3_rename(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -3731,7 +3731,7 @@ client3_3_link(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -3784,7 +3784,7 @@ client3_3_mknod(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -3850,7 +3850,7 @@ client3_3_mkdir(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -3908,7 +3908,7 @@ client3_3_create(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -3968,7 +3968,7 @@ client3_3_open(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(open, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(open, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -4067,7 +4067,7 @@ client3_3_readv(call_frame_t *frame, xlator_t *this, void *data) if (rsp_iobref) iobref_unref(rsp_iobref); - CLIENT_STACK_UNWIND(readv, frame, -1, op_errno, NULL, 0, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(readv, frame, gf_failure, op_errno, NULL, 0, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -4128,7 +4128,7 @@ client3_3_writev(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(writev, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -4189,7 +4189,7 @@ client3_3_flush(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(flush, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(flush, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -4231,7 +4231,7 @@ client3_3_fsync(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fsync, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(fsync, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -4275,7 +4275,7 @@ client3_3_fstat(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fstat, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(fstat, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -4329,7 +4329,7 @@ client3_3_opendir(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(opendir, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(opendir, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -4372,7 +4372,7 @@ client3_3_fsyncdir(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fsyncdir, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(fsyncdir, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -4415,7 +4415,7 @@ client3_3_statfs(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(statfs, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(statfs, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -4458,7 +4458,7 @@ client3_3_setxattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(setxattr, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(setxattr, frame, gf_failure, op_errno, NULL); GF_FREE(req.dict.dict_val); GF_FREE(req.xdata.xdata_val); @@ -4504,7 +4504,7 @@ client3_3_fsetxattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fsetxattr, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(fsetxattr, frame, gf_failure, op_errno, NULL); GF_FREE(req.dict.dict_val); GF_FREE(req.xdata.xdata_val); @@ -4592,7 +4592,7 @@ client3_3_fgetxattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fgetxattr, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(fgetxattr, frame, gf_failure, op_errno, NULL, NULL); if (rsp_iobref) iobref_unref(rsp_iobref); @@ -4819,7 +4819,7 @@ client3_3_xattrop(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(xattrop, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(xattrop, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.dict.dict_val); @@ -4913,7 +4913,7 @@ client3_3_fxattrop(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fxattrop, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(fxattrop, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.dict.dict_val); @@ -4961,7 +4961,7 @@ client3_3_removexattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(removexattr, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(removexattr, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5004,7 +5004,7 @@ client3_3_fremovexattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fremovexattr, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(fremovexattr, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5046,7 +5046,7 @@ client3_3_lease(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(lease, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(lease, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5116,7 +5116,7 @@ client3_3_lk(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(lk, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(lk, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5158,7 +5158,7 @@ client3_3_inodelk(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(inodelk, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(inodelk, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5206,7 +5206,7 @@ client3_3_finodelk(call_frame_t *frame, xlator_t *this, void *data) GF_FREE(req.xdata.xdata_val); return 0; unwind: - CLIENT_STACK_UNWIND(finodelk, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(finodelk, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5251,7 +5251,7 @@ client3_3_entrylk(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(entrylk, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(entrylk, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5294,7 +5294,7 @@ client3_3_fentrylk(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fentrylk, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(fentrylk, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5334,7 +5334,7 @@ client3_3_rchecksum(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(rchecksum, frame, -1, op_errno, 0, NULL, NULL); + CLIENT_STACK_UNWIND(rchecksum, frame, gf_failure, op_errno, 0, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5439,7 +5439,7 @@ client3_3_readdir(call_frame_t *frame, xlator_t *this, void *data) if (rsp_iobref) iobref_unref(rsp_iobref); - CLIENT_STACK_UNWIND(readdir, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(readdir, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5543,7 +5543,7 @@ client3_3_readdirp(call_frame_t *frame, xlator_t *this, void *data) GF_FREE(req.dict.dict_val); - CLIENT_STACK_UNWIND(readdirp, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(readdirp, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -5585,7 +5585,7 @@ client3_3_setattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(setattr, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(setattr, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5626,7 +5626,7 @@ client3_3_fsetattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fsetattr, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(fsetattr, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5667,7 +5667,7 @@ client3_3_fallocate(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fallocate, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(fallocate, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5707,7 +5707,7 @@ client3_3_discard(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(discard, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(discard, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5749,7 +5749,7 @@ client3_3_zerofill(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(zerofill, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(zerofill, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5791,7 +5791,7 @@ client3_3_ipc(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(ipc, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(ipc, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5835,7 +5835,7 @@ client3_3_seek(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(ipc, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(ipc, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); return 0; @@ -5885,7 +5885,7 @@ client3_3_getactivelk(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(getactivelk, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(getactivelk, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -5945,7 +5945,7 @@ client3_3_setactivelk(call_frame_t *frame, xlator_t *this, void *data) unwind: - CLIENT_STACK_UNWIND(setactivelk, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(setactivelk, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.xdata_val); diff --git a/xlators/protocol/client/src/client-rpc-fops_v2.c b/xlators/protocol/client/src/client-rpc-fops_v2.c index 9dfcff3e6c..dc1cc3e834 100644 --- a/xlators/protocol/client/src/client-rpc-fops_v2.c +++ b/xlators/protocol/client/src/client-rpc-fops_v2.c @@ -3069,7 +3069,7 @@ client4_0_lookup(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(lookup, frame, -1, op_errno, NULL, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(lookup, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -3114,7 +3114,7 @@ client4_0_stat(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(stat, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(stat, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -3157,7 +3157,7 @@ client4_0_truncate(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(truncate, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(truncate, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -3200,7 +3200,7 @@ client4_0_ftruncate(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(ftruncate, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(ftruncate, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -3242,7 +3242,7 @@ client4_0_access(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(access, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(access, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -3296,7 +3296,7 @@ client4_0_readlink(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(readlink, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(readlink, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -3337,7 +3337,7 @@ client4_0_unlink(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(unlink, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(unlink, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -3378,7 +3378,7 @@ client4_0_rmdir(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(rmdir, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(rmdir, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -3438,7 +3438,7 @@ client4_0_symlink(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(symlink, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(symlink, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -3482,7 +3482,7 @@ client4_0_rename(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(rename, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -3541,7 +3541,7 @@ client4_0_link(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -3594,7 +3594,7 @@ client4_0_mknod(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -3660,7 +3660,7 @@ client4_0_mkdir(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(mkdir, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(mkdir, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -3718,7 +3718,7 @@ client4_0_create(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(create, frame, -1, op_errno, NULL, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -3778,7 +3778,7 @@ client4_0_open(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(open, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(open, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -3872,7 +3872,7 @@ client4_0_readv(call_frame_t *frame, xlator_t *this, void *data) if (rsp_iobuf) iobuf_unref(rsp_iobuf); - CLIENT_STACK_UNWIND(readv, frame, -1, op_errno, NULL, 0, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(readv, frame, gf_failure, op_errno, NULL, 0, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -3934,7 +3934,7 @@ client4_0_writev(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(writev, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(writev, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -3994,7 +3994,7 @@ client4_0_flush(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(flush, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(flush, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4036,7 +4036,7 @@ client4_0_fsync(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fsync, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(fsync, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4080,7 +4080,7 @@ client4_0_fstat(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fstat, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(fstat, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4134,7 +4134,7 @@ client4_0_opendir(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(opendir, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(opendir, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -4178,7 +4178,7 @@ client4_0_fsyncdir(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fsyncdir, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(fsyncdir, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4221,7 +4221,7 @@ client4_0_statfs(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(statfs, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(statfs, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4264,7 +4264,7 @@ client4_0_setxattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(setxattr, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(setxattr, frame, gf_failure, op_errno, NULL); GF_FREE(req.dict.pairs.pairs_val); GF_FREE(req.xdata.pairs.pairs_val); @@ -4309,7 +4309,7 @@ client4_0_fsetxattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fsetxattr, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(fsetxattr, frame, gf_failure, op_errno, NULL); GF_FREE(req.dict.pairs.pairs_val); GF_FREE(req.xdata.pairs.pairs_val); @@ -4360,7 +4360,7 @@ client4_0_fgetxattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fgetxattr, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(fgetxattr, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -4508,7 +4508,7 @@ client4_0_xattrop(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(xattrop, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(xattrop, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.dict.pairs.pairs_val); GF_FREE(req.xdata.pairs.pairs_val); @@ -4559,7 +4559,7 @@ client4_0_fxattrop(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fxattrop, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(fxattrop, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.dict.pairs.pairs_val); GF_FREE(req.xdata.pairs.pairs_val); @@ -4603,7 +4603,7 @@ client4_0_removexattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(removexattr, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(removexattr, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4646,7 +4646,7 @@ client4_0_fremovexattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fremovexattr, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(fremovexattr, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4688,7 +4688,7 @@ client4_0_lease(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(lease, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(lease, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4758,7 +4758,7 @@ client4_0_lk(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(lk, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(lk, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4800,7 +4800,7 @@ client4_0_inodelk(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(inodelk, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(inodelk, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4848,7 +4848,7 @@ client4_0_finodelk(call_frame_t *frame, xlator_t *this, void *data) GF_FREE(req.xdata.pairs.pairs_val); return 0; unwind: - CLIENT_STACK_UNWIND(finodelk, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(finodelk, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4893,7 +4893,7 @@ client4_0_entrylk(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(entrylk, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(entrylk, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -4936,7 +4936,7 @@ client4_0_fentrylk(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fentrylk, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(fentrylk, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -5042,7 +5042,7 @@ client4_0_readdir(call_frame_t *frame, xlator_t *this, void *data) if (rsp_iobref) iobref_unref(rsp_iobref); - CLIENT_STACK_UNWIND(readdir, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(readdir, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -5147,7 +5147,7 @@ client4_0_readdirp(call_frame_t *frame, xlator_t *this, void *data) GF_FREE(req.xdata.pairs.pairs_val); - CLIENT_STACK_UNWIND(readdirp, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(readdirp, frame, gf_failure, op_errno, NULL, NULL); return 0; } @@ -5189,7 +5189,7 @@ client4_0_setattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(setattr, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(setattr, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -5230,7 +5230,7 @@ client4_0_fallocate(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fallocate, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(fallocate, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -5270,7 +5270,7 @@ client4_0_discard(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(discard, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(discard, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -5312,7 +5312,7 @@ client4_0_zerofill(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(zerofill, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(zerofill, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -5354,7 +5354,7 @@ client4_0_ipc(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(ipc, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(ipc, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -5398,7 +5398,7 @@ client4_0_seek(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(ipc, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(ipc, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -5447,7 +5447,7 @@ client4_0_getactivelk(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(getactivelk, frame, -1, op_errno, NULL, NULL); + CLIENT_STACK_UNWIND(getactivelk, frame, gf_failure, op_errno, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -5505,7 +5505,7 @@ client4_0_setactivelk(call_frame_t *frame, xlator_t *this, void *data) unwind: - CLIENT_STACK_UNWIND(setactivelk, frame, -1, op_errno, NULL); + CLIENT_STACK_UNWIND(setactivelk, frame, gf_failure, op_errno, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -5771,7 +5771,7 @@ client4_0_namelink(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(namelink, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(namelink, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -5822,7 +5822,7 @@ client4_0_icreate(call_frame_t *frame, xlator_t *this, void *data) free_reqdata: GF_FREE(req.xdata.pairs.pairs_val); unwind: - CLIENT_STACK_UNWIND(icreate, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(icreate, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -5886,7 +5886,7 @@ client4_0_put(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(put, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(put, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -5956,7 +5956,7 @@ client4_0_copy_file_range(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(copy_file_range, frame, -1, op_errno, NULL, NULL, NULL, + CLIENT_STACK_UNWIND(copy_file_range, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); @@ -5997,7 +5997,7 @@ client4_0_fsetattr(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(fsetattr, frame, -1, op_errno, NULL, NULL, NULL); + CLIENT_STACK_UNWIND(fsetattr, frame, gf_failure, op_errno, NULL, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; @@ -6042,7 +6042,7 @@ client4_0_rchecksum(call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: - CLIENT_STACK_UNWIND(rchecksum, frame, -1, op_errno, 0, NULL, NULL); + CLIENT_STACK_UNWIND(rchecksum, frame, gf_failure, op_errno, 0, NULL, NULL); GF_FREE(req.xdata.pairs.pairs_val); return 0; diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 58140fa1de..f16dd7d7e5 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -379,7 +379,7 @@ client_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) out: /* think of avoiding a missing frame */ if (ret) - STACK_UNWIND_STRICT(lookup, frame, -1, ENOTCONN, NULL, NULL, NULL, + STACK_UNWIND_STRICT(lookup, frame, gf_failure, ENOTCONN, NULL, NULL, NULL, NULL); return 0; @@ -407,7 +407,7 @@ client_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } out: if (ret) - STACK_UNWIND_STRICT(stat, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(stat, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -436,7 +436,7 @@ client_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, } out: if (ret) - STACK_UNWIND_STRICT(truncate, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -465,7 +465,7 @@ client_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } out: if (ret) - STACK_UNWIND_STRICT(ftruncate, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(ftruncate, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -494,7 +494,7 @@ client_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, } out: if (ret) - STACK_UNWIND_STRICT(access, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(access, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -523,7 +523,7 @@ client_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, } out: if (ret) - STACK_UNWIND_STRICT(readlink, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(readlink, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -554,7 +554,7 @@ client_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, } out: if (ret) - STACK_UNWIND_STRICT(mknod, frame, -1, ENOTCONN, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(mknod, frame, gf_failure, ENOTCONN, NULL, NULL, NULL, NULL, NULL); return 0; @@ -585,7 +585,7 @@ client_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, } out: if (ret) - STACK_UNWIND_STRICT(mkdir, frame, -1, ENOTCONN, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(mkdir, frame, gf_failure, ENOTCONN, NULL, NULL, NULL, NULL, NULL); return 0; @@ -615,7 +615,7 @@ client_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, } out: if (ret) - STACK_UNWIND_STRICT(unlink, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -645,7 +645,7 @@ client_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, out: /* think of avoiding a missing frame */ if (ret) - STACK_UNWIND_STRICT(rmdir, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(rmdir, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -675,7 +675,7 @@ client_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, } out: if (ret) - STACK_UNWIND_STRICT(symlink, frame, -1, ENOTCONN, NULL, NULL, NULL, + STACK_UNWIND_STRICT(symlink, frame, gf_failure, ENOTCONN, NULL, NULL, NULL, NULL, NULL); return 0; @@ -705,7 +705,7 @@ client_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } out: if (ret) - STACK_UNWIND_STRICT(rename, frame, -1, ENOTCONN, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, ENOTCONN, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -735,7 +735,7 @@ client_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } out: if (ret) - STACK_UNWIND_STRICT(link, frame, -1, ENOTCONN, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(link, frame, gf_failure, ENOTCONN, NULL, NULL, NULL, NULL, NULL); return 0; @@ -769,7 +769,7 @@ client_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } out: if (ret) - STACK_UNWIND_STRICT(create, frame, -1, ENOTCONN, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, ENOTCONN, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -801,7 +801,7 @@ client_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } out: if (ret) - STACK_UNWIND_STRICT(open, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -834,7 +834,7 @@ client_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } out: if (ret) - STACK_UNWIND_STRICT(readv, frame, -1, ENOTCONN, NULL, 0, NULL, NULL, + STACK_UNWIND_STRICT(readv, frame, gf_failure, ENOTCONN, NULL, 0, NULL, NULL, NULL); return 0; @@ -871,7 +871,7 @@ client_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, } out: if (ret) - STACK_UNWIND_STRICT(writev, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(writev, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -898,7 +898,7 @@ client_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) } out: if (ret) - STACK_UNWIND_STRICT(flush, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(flush, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -927,7 +927,7 @@ client_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, } out: if (ret) - STACK_UNWIND_STRICT(fsync, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsync, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -954,7 +954,7 @@ client_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) } out: if (ret) - STACK_UNWIND_STRICT(fstat, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(fstat, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -983,7 +983,7 @@ client_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, } out: if (ret) - STACK_UNWIND_STRICT(opendir, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(opendir, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -1012,7 +1012,7 @@ client_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, } out: if (ret) - STACK_UNWIND_STRICT(fsyncdir, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(fsyncdir, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -1039,7 +1039,7 @@ client_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } out: if (ret) - STACK_UNWIND_STRICT(statfs, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(statfs, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -1073,7 +1073,7 @@ client_copy_file_range(call_frame_t *frame, xlator_t *this, fd_t *fd_in, } out: if (ret) - STACK_UNWIND_STRICT(copy_file_range, frame, -1, ENOTCONN, NULL, NULL, + STACK_UNWIND_STRICT(copy_file_range, frame, gf_failure, ENOTCONN, NULL, NULL, NULL, NULL); return 0; @@ -1278,7 +1278,7 @@ client_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, } out: if (ret) - STACK_UNWIND_STRICT(fsetxattr, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(fsetxattr, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -1307,7 +1307,7 @@ client_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, } out: if (ret) - STACK_UNWIND_STRICT(fgetxattr, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(fgetxattr, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -1336,7 +1336,7 @@ client_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, } out: if (ret) - STACK_UNWIND_STRICT(getxattr, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(getxattr, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -1366,7 +1366,7 @@ client_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, } out: if (ret) - STACK_UNWIND_STRICT(xattrop, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(xattrop, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -1396,7 +1396,7 @@ client_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, } out: if (ret) - STACK_UNWIND_STRICT(fxattrop, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(fxattrop, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -1425,7 +1425,7 @@ client_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, } out: if (ret) - STACK_UNWIND_STRICT(removexattr, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(removexattr, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -1454,7 +1454,7 @@ client_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, } out: if (ret) - STACK_UNWIND_STRICT(fremovexattr, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(fremovexattr, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -1483,7 +1483,7 @@ client_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, } out: if (ret) - STACK_UNWIND_STRICT(lk, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(lk, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -1513,7 +1513,7 @@ client_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, } out: if (ret) - STACK_UNWIND_STRICT(lk, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(lk, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -1544,7 +1544,7 @@ client_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, } out: if (ret) - STACK_UNWIND_STRICT(inodelk, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(inodelk, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -1575,7 +1575,7 @@ client_finodelk(call_frame_t *frame, xlator_t *this, const char *volume, } out: if (ret) - STACK_UNWIND_STRICT(finodelk, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(finodelk, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -1608,7 +1608,7 @@ client_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, } out: if (ret) - STACK_UNWIND_STRICT(entrylk, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(entrylk, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -1641,7 +1641,7 @@ client_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, } out: if (ret) - STACK_UNWIND_STRICT(fentrylk, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(fentrylk, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -1671,7 +1671,7 @@ client_rchecksum(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } out: if (ret) - STACK_UNWIND_STRICT(rchecksum, frame, -1, ENOTCONN, 0, NULL, NULL); + STACK_UNWIND_STRICT(rchecksum, frame, gf_failure, ENOTCONN, 0, NULL, NULL); return 0; } @@ -1704,7 +1704,7 @@ client_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } out: if (ret) - STACK_UNWIND_STRICT(readdir, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(readdir, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -1737,7 +1737,7 @@ client_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } out: if (ret) - STACK_UNWIND_STRICT(readdirp, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(readdirp, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -1767,7 +1767,7 @@ client_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, } out: if (ret) - STACK_UNWIND_STRICT(setattr, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(setattr, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -1797,7 +1797,7 @@ client_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, } out: if (ret) - STACK_UNWIND_STRICT(fsetattr, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsetattr, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -1828,7 +1828,7 @@ client_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, } out: if (ret) - STACK_UNWIND_STRICT(fallocate, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fallocate, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -1858,7 +1858,7 @@ client_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } out: if (ret) - STACK_UNWIND_STRICT(discard, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(discard, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -1888,7 +1888,7 @@ client_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } out: if (ret) - STACK_UNWIND_STRICT(zerofill, frame, -1, ENOTCONN, NULL, NULL, NULL); + STACK_UNWIND_STRICT(zerofill, frame, gf_failure, ENOTCONN, NULL, NULL, NULL); return 0; } @@ -1915,7 +1915,7 @@ client_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata) } out: if (ret) - STACK_UNWIND_STRICT(ipc, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(ipc, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -1945,7 +1945,7 @@ client_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } out: if (ret) - STACK_UNWIND_STRICT(seek, frame, -1, ENOTCONN, 0, NULL); + STACK_UNWIND_STRICT(seek, frame, gf_failure, ENOTCONN, 0, NULL); return 0; } @@ -1973,7 +1973,7 @@ client_getactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc, } out: if (ret) - STACK_UNWIND_STRICT(getactivelk, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(getactivelk, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -2002,7 +2002,7 @@ client_setactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc, } out: if (ret) - STACK_UNWIND_STRICT(setactivelk, frame, -1, ENOTCONN, NULL); + STACK_UNWIND_STRICT(setactivelk, frame, gf_failure, ENOTCONN, NULL); return 0; } @@ -2032,7 +2032,7 @@ client_getspec(call_frame_t *frame, xlator_t *this, const char *key, } out: if (ret) - STACK_UNWIND_STRICT(getspec, frame, -1, EINVAL, NULL); + STACK_UNWIND_STRICT(getspec, frame, gf_failure, EINVAL, NULL); return 0; } @@ -2056,7 +2056,7 @@ client_compound(call_frame_t *frame, xlator_t *this, void *data, dict_t *xdata) } out: if (ret) - STACK_UNWIND_STRICT(compound, frame, -1, ENOTCONN, NULL, NULL); + STACK_UNWIND_STRICT(compound, frame, gf_failure, ENOTCONN, NULL, NULL); return 0; } @@ -2083,7 +2083,7 @@ client_namelink(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } out: if (ret) - STACK_UNWIND_STRICT(namelink, frame, -1, EINVAL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(namelink, frame, gf_failure, EINVAL, NULL, NULL, NULL); return 0; } @@ -2111,7 +2111,7 @@ client_icreate(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, } out: if (ret) - STACK_UNWIND_STRICT(icreate, frame, -1, EINVAL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(icreate, frame, gf_failure, EINVAL, NULL, NULL, NULL); return 0; } @@ -2150,7 +2150,7 @@ client_put(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, } out: if (ret) - STACK_UNWIND_STRICT(put, frame, -1, ENOTCONN, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(put, frame, gf_failure, ENOTCONN, NULL, NULL, NULL, NULL, NULL); return 0; @@ -2633,7 +2633,7 @@ init(xlator_t *this) this->private = conf; - /* If it returns -1, then its a failure, if it returns +1 we need + /* If it returns gf_failure, then its a failure, if it returns +1 we need have to understand that 'this' is subvolume of a xlator which, will set the remote host and remote subvolume in a setxattr call. diff --git a/xlators/storage/posix/src/posix-aio.c b/xlators/storage/posix/src/posix-aio.c index e0a5d1bb93..2df8780ac0 100644 --- a/xlators/storage/posix/src/posix-aio.c +++ b/xlators/storage/posix/src/posix-aio.c @@ -229,7 +229,7 @@ posix_aio_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; err: - STACK_UNWIND_STRICT(readv, frame, -1, op_errno, 0, 0, 0, 0, 0); + STACK_UNWIND_STRICT(readv, frame, gf_failure, op_errno, 0, 0, 0, 0, 0); if (iobuf) iobuf_unref(iobuf); @@ -389,7 +389,7 @@ posix_aio_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, return 0; err: - STACK_UNWIND_STRICT(writev, frame, -1, op_errno, 0, 0, 0); + STACK_UNWIND_STRICT(writev, frame, gf_failure, op_errno, 0, 0, 0); if (paiocb) { if (paiocb->iobref) diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c index 60a4039902..4f3818f47d 100644 --- a/xlators/storage/posix/src/posix-inode-fd-ops.c +++ b/xlators/storage/posix/src/posix-inode-fd-ops.c @@ -198,16 +198,16 @@ posix_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) goto out; } if (xdata) { - xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, -1, xdata, + xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, gf_failure, xdata, &buf); posix_cs_maintenance(this, NULL, loc, NULL, &buf, real_path, xdata, &xattr_rsp, _gf_true); - posix_cs_build_xattr_rsp(this, &xattr_rsp, xdata, -1, real_path); + posix_cs_build_xattr_rsp(this, &xattr_rsp, xdata, gf_failure, real_path); } - posix_update_iatt_buf(&buf, -1, real_path, xdata); + posix_update_iatt_buf(&buf, gf_failure, real_path, xdata); op_ret = 0; out: @@ -421,21 +421,21 @@ posix_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, real_path, loc->path); goto out; } - posix_update_utime_in_mdata(this, real_path, -1, loc->inode, + posix_update_utime_in_mdata(this, real_path, gf_failure, loc->inode, &frame->root->ctime, stbuf, valid); } if ((valid & GF_SET_ATTR_CTIME) && priv->ctime) { - posix_update_ctime_in_mdata(this, real_path, -1, loc->inode, + posix_update_ctime_in_mdata(this, real_path, gf_failure, loc->inode, &frame->root->ctime, stbuf, valid); } if (!valid) { - op_ret = sys_lchown(real_path, -1, -1); + op_ret = sys_lchown(real_path, gf_failure, -1); if (op_ret == -1) { op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, errno, P_MSG_LCHOWN_FAILED, - "lchown (gfid-handle: %s, path: %s, -1, -1) " + "lchown (gfid-handle: %s, path: %s, gf_failure, -1) " "failed", real_path, loc->path); @@ -453,13 +453,13 @@ posix_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, goto out; } - posix_set_ctime(frame, this, real_path, -1, loc->inode, &statpost); + posix_set_ctime(frame, this, real_path, gf_failure, loc->inode, &statpost); if (xdata) - xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, -1, xdata, + xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, gf_failure, xdata, &statpost); - posix_update_iatt_buf(&statpre, -1, real_path, xdata); - posix_update_iatt_buf(&statpost, -1, real_path, xdata); + posix_update_iatt_buf(&statpre, gf_failure, real_path, xdata); + posix_update_iatt_buf(&statpost, gf_failure, real_path, xdata); op_ret = 0; out: @@ -651,11 +651,11 @@ posix_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, } if (!valid) { - op_ret = sys_fchown(pfd->fd, -1, -1); + op_ret = sys_fchown(pfd->fd, gf_failure, -1); if (op_ret == -1) { op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, errno, P_MSG_FCHOWN_FAILED, - "fchown (%d, -1, -1) failed", pfd->fd); + "fchown (%d, gf_failure, -1) failed", pfd->fd); goto out; } @@ -1076,7 +1076,7 @@ posix_glfallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, return 0; err: - STACK_UNWIND_STRICT(fallocate, frame, -1, -ret, NULL, NULL, rsp_xdata); + STACK_UNWIND_STRICT(fallocate, frame, gf_failure, -ret, NULL, NULL, rsp_xdata); return 0; } @@ -1108,7 +1108,7 @@ posix_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, err: #endif /* FALLOC_FL_KEEP_SIZE */ - STACK_UNWIND_STRICT(discard, frame, -1, -ret, NULL, NULL, rsp_xdata); + STACK_UNWIND_STRICT(discard, frame, gf_failure, -ret, NULL, NULL, rsp_xdata); return 0; } @@ -1193,7 +1193,7 @@ posix_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata) */ gf_msg(this->name, GF_LOG_ERROR, 0, P_MSG_IPC_NOT_HANDLE, "GF_LOG_IPC(%d) not handled", op); - STACK_UNWIND_STRICT(ipc, frame, -1, EOPNOTSUPP, NULL); + STACK_UNWIND_STRICT(ipc, frame, gf_failure, EOPNOTSUPP, NULL); return 0; } @@ -1273,7 +1273,7 @@ posix_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, STACK_UNWIND_STRICT(seek, frame, (ret == -1 ? -1 : 0), err, (ret == -1 ? -1 : ret), rsp_xdata); #else - STACK_UNWIND_STRICT(seek, frame, -1, EINVAL, 0, NULL); + STACK_UNWIND_STRICT(seek, frame, gf_failure, EINVAL, 0, NULL); #endif return 0; } @@ -1500,7 +1500,7 @@ posix_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, } } - posix_update_iatt_buf(&prebuf, -1, real_path, xdata); + posix_update_iatt_buf(&prebuf, gf_failure, real_path, xdata); op_ret = sys_truncate(real_path, offset); if (op_ret == -1) { op_errno = errno; @@ -1520,7 +1520,7 @@ posix_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, goto out; } - posix_set_ctime(frame, this, real_path, -1, loc->inode, &postbuf); + posix_set_ctime(frame, this, real_path, gf_failure, loc->inode, &postbuf); op_ret = 0; out: @@ -1602,7 +1602,7 @@ posix_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, goto out; } - posix_set_ctime(frame, this, real_path, -1, loc->inode, &stbuf); + posix_set_ctime(frame, this, real_path, gf_failure, loc->inode, &stbuf); pfd = GF_CALLOC(1, sizeof(*pfd), gf_posix_mt_posix_fd); if (!pfd) { @@ -2559,7 +2559,7 @@ posix_batch_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, stub = fop_fsync_stub(frame, default_fsync, fd, datasync, xdata); if (!stub) { - STACK_UNWIND_STRICT(fsync, frame, -1, ENOMEM, 0, 0, 0); + STACK_UNWIND_STRICT(fsync, frame, gf_failure, ENOMEM, 0, 0, 0); return 0; } @@ -2932,7 +2932,7 @@ posix_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, goto out; } - subvol_xattrs = posix_xattr_fill(this, real_path, loc, NULL, -1, xdata, + subvol_xattrs = posix_xattr_fill(this, real_path, loc, NULL, gf_failure, xdata, NULL); /* Remove all user xattrs from the file */ @@ -3269,7 +3269,7 @@ posix_links_in_same_directory(char *dirpath, int count, inode_t *leaf_inode, goto out; } gf_entry->inode = inode_ref(leaf_inode); - gf_entry->dict = posix_xattr_fill(this, temppath, &loc, NULL, -1, + gf_entry->dict = posix_xattr_fill(this, temppath, &loc, NULL, gf_failure, xdata, NULL); iatt_from_stat(&(gf_entry->d_stat), stbuf); @@ -3320,7 +3320,7 @@ posix_get_ancestry_non_directory(xlator_t *this, inode_t *leaf_inode, int32_t *op_errno, dict_t *xdata) { size_t remaining_size = 0; - gf_return_t op_ret = -1, pathlen = -1; + gf_return_t op_ret = gf_failure, pathlen = -1; ssize_t handle_size = 0; uuid_t pgfid = { 0, @@ -3573,7 +3573,7 @@ posix_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, } if (loc->inode && name && GF_POSIX_ACL_REQUEST(name)) { - ret = posix_pacl_get(real_path, -1, name, &value); + ret = posix_pacl_get(real_path, gf_failure, name, &value); if (ret || !value) { op_errno = errno; gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_ACL_FAILED, @@ -4005,7 +4005,7 @@ posix_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, op_ret = size; if (xdata && (op_ret >= 0)) { - xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, -1, xdata, + xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, gf_failure, xdata, &buf); } @@ -4618,7 +4618,7 @@ posix_common_removexattr(call_frame_t *frame, loc_t *loc, fd_t *fd, } if (loc) { - posix_set_ctime(frame, this, real_path, -1, inode, NULL); + posix_set_ctime(frame, this, real_path, gf_failure, inode, NULL); ret = posix_pstat(this, inode, loc->gfid, real_path, &postop, _gf_false); if (ret) { @@ -5358,7 +5358,7 @@ posix_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, "\"features/leases\" translator is not loaded. You need" "to use it for proper functioning of your application"); - STACK_UNWIND_STRICT(lease, frame, -1, ENOSYS, &nullease, NULL); + STACK_UNWIND_STRICT(lease, frame, gf_failure, ENOSYS, &nullease, NULL); return 0; } @@ -5377,7 +5377,7 @@ posix_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, "not loaded. You need to use it for proper " "functioning of your application."); - STACK_UNWIND_STRICT(lk, frame, -1, ENOSYS, &nullock, NULL); + STACK_UNWIND_STRICT(lk, frame, gf_failure, ENOSYS, &nullock, NULL); return 0; } @@ -5390,7 +5390,7 @@ posix_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, "not loaded. You need to use it for proper " "functioning of your application."); - STACK_UNWIND_STRICT(inodelk, frame, -1, ENOSYS, NULL); + STACK_UNWIND_STRICT(inodelk, frame, gf_failure, ENOSYS, NULL); return 0; } @@ -5403,7 +5403,7 @@ posix_finodelk(call_frame_t *frame, xlator_t *this, const char *volume, "not loaded. You need to use it for proper " "functioning of your application."); - STACK_UNWIND_STRICT(finodelk, frame, -1, ENOSYS, NULL); + STACK_UNWIND_STRICT(finodelk, frame, gf_failure, ENOSYS, NULL); return 0; } @@ -5417,7 +5417,7 @@ posix_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, "not loaded. You need to use it for proper " "functioning of your application."); - STACK_UNWIND_STRICT(entrylk, frame, -1, ENOSYS, NULL); + STACK_UNWIND_STRICT(entrylk, frame, gf_failure, ENOSYS, NULL); return 0; } @@ -5431,7 +5431,7 @@ posix_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, "not loaded. You need to use it for proper " "functioning of your application."); - STACK_UNWIND_STRICT(fentrylk, frame, -1, ENOSYS, NULL); + STACK_UNWIND_STRICT(fentrylk, frame, gf_failure, ENOSYS, NULL); return 0; } @@ -5621,7 +5621,7 @@ posix_entry_xattr_fill(xlator_t *this, inode_t *inode, fd_t *fd, /* if we don't send the 'loc', open-fd-count be a problem. */ tmp_loc.inode = inode; - return posix_xattr_fill(this, entry_path, &tmp_loc, NULL, -1, dict, stbuf); + return posix_xattr_fill(this, entry_path, &tmp_loc, NULL, gf_failure, dict, stbuf); } int @@ -5673,7 +5673,7 @@ posix_readdirp_fill(xlator_t *this, fd_t *fd, gf_dirent_t *entries, continue; } - posix_update_iatt_buf(&stbuf, -1, hpath, dict); + posix_update_iatt_buf(&stbuf, gf_failure, hpath, dict); if (!inode) inode = inode_find(itable, stbuf.ia_gfid); @@ -5796,7 +5796,7 @@ posix_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t off, dict_t *dict) { gf_dirent_t entries; - gf_return_t op_ret = -1, op_errno = 0; + gf_return_t op_ret = gf_failure, op_errno = 0; gf_dirent_t *entry = NULL; if ((dict != NULL) && (dict_get(dict, GET_ANCESTRY_DENTRY_KEY))) { diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c index 8ef735ae76..df9a635b9e 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -951,12 +951,12 @@ posix_acl_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int ret = 0; dict_t *my_xattr = NULL; - if (op_ret != 0) + if (IS_ERROR(op_ret)) goto unwind; ctx = posix_acl_ctx_new(inode, this); if (!ctx) { - op_ret = -1; + op_ret.op_ret = -1; op_errno = ENOMEM; goto unwind; } @@ -1052,7 +1052,9 @@ posix_acl_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr) FIRST_CHILD(this)->fops->lookup, loc, my_xattr); return 0; red: - STACK_UNWIND_STRICT(lookup, frame, -1, EACCES, NULL, NULL, NULL, NULL); + gf_return_t op_ret; + op_ret.op_ret = -1; + STACK_UNWIND_STRICT(lookup, frame, gf_failure, EACCES, NULL, NULL, NULL, NULL); return 0; } @@ -1061,7 +1063,7 @@ int posix_acl_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, dict_t *xdata) { - gf_return_t op_ret = 0; + gf_return_t op_ret; int op_errno = 0; int perm = 0; int mode = 0; @@ -1079,7 +1081,7 @@ posix_acl_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, goto unwind; } if (!perm) { - op_ret = -1; + op_ret.op_ret = -1; op_errno = EINVAL; goto unwind; } @@ -1087,10 +1089,10 @@ posix_acl_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, if (is_fuse_call) { mode = acl_permits(frame, loc->inode, perm); if (mode) { - op_ret = 0; + op_ret.op_ret = 0; op_errno = 0; } else { - op_ret = -1; + op_ret.op_ret = -1; op_errno = EACCES; } } else { @@ -1114,7 +1116,7 @@ posix_acl_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, if (is_fuse_call) STACK_UNWIND_STRICT(access, frame, op_ret, op_errno, NULL); else - STACK_UNWIND_STRICT(access, frame, 0, mode, NULL); + STACK_UNWIND_STRICT(access, frame, {0}, mode, NULL); return 0; } @@ -1137,7 +1139,7 @@ posix_acl_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t off, } /* fail by default */ - STACK_UNWIND_STRICT(truncate, frame, -1, EACCES, NULL, NULL, NULL); + STACK_UNWIND_STRICT(truncate, frame, gf_failure, EACCES, NULL, NULL, NULL); return 0; green: @@ -1183,7 +1185,7 @@ posix_acl_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, FIRST_CHILD(this)->fops->open, loc, flags, fd, xdata); return 0; red: - STACK_UNWIND_STRICT(open, frame, -1, EACCES, NULL, NULL); + STACK_UNWIND_STRICT(open, frame, gf_failure, EACCES, NULL, NULL); return 0; } @@ -1204,7 +1206,7 @@ posix_acl_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, FIRST_CHILD(this)->fops->readv, fd, size, offset, flags, xdata); return 0; red: - STACK_UNWIND_STRICT(readv, frame, -1, EACCES, NULL, 0, NULL, NULL, NULL); + STACK_UNWIND_STRICT(readv, frame, gf_failure, EACCES, NULL, 0, NULL, NULL, NULL); return 0; } @@ -1227,7 +1229,7 @@ posix_acl_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, flags, iobref, xdata); return 0; red: - STACK_UNWIND_STRICT(writev, frame, -1, EACCES, NULL, NULL, NULL); + STACK_UNWIND_STRICT(writev, frame, gf_failure, EACCES, NULL, NULL, NULL); return 0; } @@ -1248,7 +1250,7 @@ posix_acl_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, FIRST_CHILD(this)->fops->ftruncate, fd, offset, xdata); return 0; red: - STACK_UNWIND_STRICT(ftruncate, frame, -1, EACCES, NULL, NULL, NULL); + STACK_UNWIND_STRICT(ftruncate, frame, gf_failure, EACCES, NULL, NULL, NULL); return 0; } @@ -1265,7 +1267,7 @@ posix_acl_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, FIRST_CHILD(this)->fops->opendir, loc, fd, xdata); return 0; red: - STACK_UNWIND_STRICT(opendir, frame, -1, EACCES, NULL, NULL); + STACK_UNWIND_STRICT(opendir, frame, gf_failure, EACCES, NULL, NULL); return 0; } @@ -1275,7 +1277,7 @@ posix_acl_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { - if (op_ret != 0) + if (IS_ERROR(op_ret)) goto unwind; posix_acl_ctx_update(inode, this, buf, GF_FOP_MKDIR); @@ -1304,7 +1306,7 @@ posix_acl_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, FIRST_CHILD(this)->fops->mkdir, loc, newmode, umask, xdata); return 0; red: - STACK_UNWIND_STRICT(mkdir, frame, -1, EACCES, NULL, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(mkdir, frame, gf_failure, EACCES, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1314,7 +1316,7 @@ posix_acl_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { - if (op_ret != 0) + if (IS_ERROR(op_ret)) goto unwind; posix_acl_ctx_update(inode, this, buf, GF_FOP_MKNOD); @@ -1344,7 +1346,7 @@ posix_acl_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, xdata); return 0; red: - STACK_UNWIND_STRICT(mknod, frame, -1, EACCES, NULL, NULL, NULL, NULL, NULL); + STACK_UNWIND_STRICT(mknod, frame, gf_failure, EACCES, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1354,7 +1356,7 @@ posix_acl_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { - if (op_ret != 0) + if (IS_ERROR(op_ret)) goto unwind; posix_acl_ctx_update(inode, this, buf, GF_FOP_CREATE); @@ -1384,7 +1386,7 @@ posix_acl_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, xdata); return 0; red: - STACK_UNWIND_STRICT(create, frame, -1, EACCES, NULL, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(create, frame, gf_failure, EACCES, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1395,7 +1397,7 @@ posix_acl_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { - if (op_ret != 0) + if (IS_ERROR(op_ret)) goto unwind; posix_acl_ctx_update(inode, this, buf, GF_FOP_SYMLINK); @@ -1419,7 +1421,7 @@ posix_acl_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, FIRST_CHILD(this)->fops->symlink, linkname, loc, umask, xdata); return 0; red: - STACK_UNWIND_STRICT(symlink, frame, -1, EACCES, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(symlink, frame, gf_failure, EACCES, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1440,7 +1442,7 @@ posix_acl_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, FIRST_CHILD(this)->fops->unlink, loc, xflag, xdata); return 0; red: - STACK_UNWIND_STRICT(unlink, frame, -1, EACCES, NULL, NULL, NULL); + STACK_UNWIND_STRICT(unlink, frame, gf_failure, EACCES, NULL, NULL, NULL); return 0; } @@ -1460,7 +1462,7 @@ posix_acl_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, FIRST_CHILD(this)->fops->rmdir, loc, flags, xdata); return 0; red: - STACK_UNWIND_STRICT(rmdir, frame, -1, EACCES, NULL, NULL, NULL); + STACK_UNWIND_STRICT(rmdir, frame, gf_failure, EACCES, NULL, NULL, NULL); return 0; } @@ -1486,7 +1488,7 @@ posix_acl_rename(call_frame_t *frame, xlator_t *this, loc_t *old, loc_t *new, FIRST_CHILD(this)->fops->rename, old, new, xdata); return 0; red: - STACK_UNWIND_STRICT(rename, frame, -1, EACCES, NULL, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(rename, frame, gf_failure, EACCES, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -1518,7 +1520,7 @@ posix_acl_link(call_frame_t *frame, xlator_t *this, loc_t *old, loc_t *new, FIRST_CHILD(this)->fops->link, old, new, xdata); return 0; red: - STACK_UNWIND_STRICT(link, frame, -1, op_errno, NULL, NULL, NULL, NULL, + STACK_UNWIND_STRICT(link, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -1537,7 +1539,7 @@ posix_acl_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, FIRST_CHILD(this)->fops->readdir, fd, size, offset, xdata); return 0; red: - STACK_UNWIND_STRICT(readdir, frame, -1, EACCES, NULL, NULL); + STACK_UNWIND_STRICT(readdir, frame, gf_failure, EACCES, NULL, NULL); return 0; } @@ -1554,7 +1556,7 @@ posix_acl_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, data_t *data = NULL; int ret = 0; - if (op_ret <= 0) + if (IS_ERROR(op_ret)) goto unwind; list_for_each_entry(entry, &entries->list, list) @@ -1565,7 +1567,7 @@ posix_acl_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ctx = posix_acl_ctx_new(entry->inode, this); if (!ctx) { - op_ret = -1; + op_ret.op_ret = -1; op_errno = ENOMEM; goto unwind; } @@ -1652,7 +1654,7 @@ posix_acl_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, dict_unref(alloc_dict); return 0; red: - STACK_UNWIND_STRICT(readdirp, frame, -1, EACCES, NULL, NULL); + STACK_UNWIND_STRICT(readdirp, frame, gf_failure, EACCES, NULL, NULL); return 0; } @@ -1726,7 +1728,7 @@ posix_acl_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, inode = frame->local; frame->local = NULL; - if (op_ret != 0) + if (IS_ERROR(op_ret)) goto unwind; posix_acl_ctx_update(inode, this, postbuf, GF_FOP_SETATTR); @@ -1754,7 +1756,7 @@ posix_acl_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, FIRST_CHILD(this)->fops->setattr, loc, buf, valid, xdata); return 0; red: - STACK_UNWIND_STRICT(setattr, frame, -1, op_errno, NULL, NULL, NULL); + STACK_UNWIND_STRICT(setattr, frame, gf_failure, op_errno, NULL, NULL, NULL); return 0; } @@ -1769,7 +1771,7 @@ posix_acl_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, inode = frame->local; frame->local = NULL; - if (op_ret != 0) + if (IS_ERROR(op_ret)) goto unwind; posix_acl_ctx_update(inode, this, postbuf, GF_FOP_FSETATTR); @@ -1797,7 +1799,7 @@ posix_acl_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, FIRST_CHILD(this)->fops->fsetattr, fd, buf, valid, xdata); return 0; red: - STACK_UNWIND_STRICT(fsetattr, frame, -1, EACCES, NULL, NULL, NULL); + STACK_UNWIND_STRICT(fsetattr, frame, gf_failure, EACCES, NULL, NULL, NULL); return 0; } @@ -1983,7 +1985,7 @@ posix_acl_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, xattr, flags, xdata); return 0; red: - STACK_UNWIND_STRICT(setxattr, frame, -1, op_errno, NULL); + STACK_UNWIND_STRICT(setxattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -2007,7 +2009,7 @@ posix_acl_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, FIRST_CHILD(this)->fops->fsetxattr, fd, xattr, flags, xdata); return 0; red: - STACK_UNWIND_STRICT(fsetxattr, frame, -1, op_errno, NULL); + STACK_UNWIND_STRICT(fsetxattr, frame, gf_failure, op_errno, NULL); return 0; } @@ -2030,7 +2032,7 @@ posix_acl_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; red: - STACK_UNWIND_STRICT(getxattr, frame, -1, EACCES, NULL, NULL); + STACK_UNWIND_STRICT(getxattr, frame, gf_failure, EACCES, NULL, NULL); return 0; } @@ -2051,7 +2053,7 @@ posix_acl_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, FIRST_CHILD(this)->fops->fgetxattr, fd, name, xdata); return 0; red: - STACK_UNWIND_STRICT(fgetxattr, frame, -1, EACCES, NULL, NULL); + STACK_UNWIND_STRICT(fgetxattr, frame, gf_failure, EACCES, NULL, NULL); return 0; } @@ -2088,7 +2090,7 @@ posix_acl_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, FIRST_CHILD(this)->fops->removexattr, loc, name, xdata); return 0; red: - STACK_UNWIND_STRICT(removexattr, frame, -1, op_errno, NULL); + STACK_UNWIND_STRICT(removexattr, frame, gf_failure, op_errno, NULL); return 0; } From 0dda1beccb6ff1dbe46c7b7e695a4df349fd988c Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 10 Sep 2020 23:52:44 +0530 Subject: [PATCH 05/24] use gf_failure instead of -1 in return usecase Change-Id: I94fb5178332ed9cee0c370cc6b63c32a78bdecc4 Signed-off-by: Amar Tumballi --- libglusterfs/src/glusterfs/globals.h | 2 +- libglusterfs/src/libglusterfs.sym | 1 + xlators/system/posix-acl/src/posix-acl.c | 25 +++++++++++++----------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/libglusterfs/src/glusterfs/globals.h b/libglusterfs/src/glusterfs/globals.h index f12fd5a122..80fbf5492d 100644 --- a/libglusterfs/src/glusterfs/globals.h +++ b/libglusterfs/src/glusterfs/globals.h @@ -142,7 +142,7 @@ glusterfs_this_set(xlator_t *); extern xlator_t global_xlator; extern struct volume_options global_xl_options[]; -extern gf_return_t gf_failure; +extern const gf_return_t gf_failure; /* syncopctx */ void * diff --git a/libglusterfs/src/libglusterfs.sym b/libglusterfs/src/libglusterfs.sym index ba002db5aa..3e0195e9b0 100644 --- a/libglusterfs/src/libglusterfs.sym +++ b/libglusterfs/src/libglusterfs.sym @@ -589,6 +589,7 @@ gf_dnscache_deinit gf_errno_to_error gf_error_to_errno _gf_event +gf_failure gf_fd_fdptr_get gf_fd_fdtable_alloc gf_fd_fdtable_copy_all_fds diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c index df9a635b9e..5a798b878a 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -11,6 +11,7 @@ #include #include +#include #include "posix-acl.h" #include "posix-acl-xattr.h" @@ -956,7 +957,7 @@ posix_acl_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ctx = posix_acl_ctx_new(inode, this); if (!ctx) { - op_ret.op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -1051,9 +1052,9 @@ posix_acl_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr) STACK_WIND(frame, posix_acl_lookup_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->lookup, loc, my_xattr); return 0; -red: - gf_return_t op_ret; - op_ret.op_ret = -1; + + red: + STACK_UNWIND_STRICT(lookup, frame, gf_failure, EACCES, NULL, NULL, NULL, NULL); return 0; @@ -1063,7 +1064,7 @@ int posix_acl_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, dict_t *xdata) { - gf_return_t op_ret; + gf_return_t op_ret = { 0 }; int op_errno = 0; int perm = 0; int mode = 0; @@ -1081,7 +1082,7 @@ posix_acl_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, goto unwind; } if (!perm) { - op_ret.op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto unwind; } @@ -1092,7 +1093,7 @@ posix_acl_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, op_ret.op_ret = 0; op_errno = 0; } else { - op_ret.op_ret = -1; + op_ret = gf_failure; op_errno = EACCES; } } else { @@ -1113,10 +1114,12 @@ posix_acl_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, } unwind: - if (is_fuse_call) + if (is_fuse_call) { STACK_UNWIND_STRICT(access, frame, op_ret, op_errno, NULL); - else - STACK_UNWIND_STRICT(access, frame, {0}, mode, NULL); + } else { + op_ret.op_ret = 0; + STACK_UNWIND_STRICT(access, frame, op_ret, mode, NULL); + } return 0; } @@ -1567,7 +1570,7 @@ posix_acl_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ctx = posix_acl_ctx_new(entry->inode, this); if (!ctx) { - op_ret.op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } From 5343140e424c7c98089237b17e9287e2b258ae58 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 14 Sep 2020 07:39:03 +0530 Subject: [PATCH 06/24] rpc: revert rpc xdr changes to get compilation going Change-Id: I89e3ec2ecb3aa33a86ea96d4077dbe3206551c89 Signed-off-by: Amar Tumballi --- rpc/xdr/src/changelog-xdr.x | 4 +- rpc/xdr/src/cli1-xdr.x | 12 ++--- rpc/xdr/src/glusterd1-xdr.x | 32 ++++++------- rpc/xdr/src/glusterfs3-xdr.x | 92 ++++++++++++++++++------------------ rpc/xdr/src/glusterfs4-xdr.x | 46 +++++++++--------- rpc/xdr/src/portmap-xdr.x | 8 ++-- rpc/xdr/src/rpc-common-xdr.x | 4 +- 7 files changed, 99 insertions(+), 99 deletions(-) diff --git a/rpc/xdr/src/changelog-xdr.x b/rpc/xdr/src/changelog-xdr.x index 0ef9b8ff93..5956245d5c 100644 --- a/rpc/xdr/src/changelog-xdr.x +++ b/rpc/xdr/src/changelog-xdr.x @@ -21,7 +21,7 @@ struct changelog_probe_req { }; struct changelog_probe_rsp { - gf_return_t op_ret; + int op_ret; }; /* XDR: changelog -> libgfchangelog */ @@ -35,7 +35,7 @@ struct changelog_event_req { }; struct changelog_event_rsp { - gf_return_t op_ret; + int op_ret; /* ack'd buffers sequence number */ unsigned hyper seq; diff --git a/rpc/xdr/src/cli1-xdr.x b/rpc/xdr/src/cli1-xdr.x index 0d59ca52fb..777cb0046a 100644 --- a/rpc/xdr/src/cli1-xdr.x +++ b/rpc/xdr/src/cli1-xdr.x @@ -246,7 +246,7 @@ struct gf_cli_req { }; struct gf_cli_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -258,7 +258,7 @@ struct gf1_cli_peer_list_req { }; struct gf1_cli_peer_list_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque friends<>; }; @@ -268,7 +268,7 @@ struct gf1_cli_fsm_log_req { }; struct gf1_cli_fsm_log_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; string op_errstr<>; opaque fsm_log<>; @@ -279,7 +279,7 @@ struct gf1_cli_getwd_req { }; struct gf1_cli_getwd_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; string wd<>; }; @@ -290,7 +290,7 @@ struct gf1_cli_mount_req { }; struct gf1_cli_mount_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; string path<>; }; @@ -301,6 +301,6 @@ struct gf1_cli_umount_req { }; struct gf1_cli_umount_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; }; diff --git a/rpc/xdr/src/glusterd1-xdr.x b/rpc/xdr/src/glusterd1-xdr.x index 8388f2531a..02ebec26c0 100644 --- a/rpc/xdr/src/glusterd1-xdr.x +++ b/rpc/xdr/src/glusterd1-xdr.x @@ -29,7 +29,7 @@ unsigned char uuid[16]; string hostname<>; int port; - gf_return_t op_ret; + int op_ret; int op_errno; string op_errstr<>; } ; @@ -44,7 +44,7 @@ struct gd1_mgmt_friend_req { struct gd1_mgmt_friend_rsp { unsigned char uuid[16]; string hostname<>; - gf_return_t op_ret; + int op_ret; int op_errno; int port; } ; @@ -58,7 +58,7 @@ struct gd1_mgmt_unfriend_req { struct gd1_mgmt_unfriend_rsp { unsigned char uuid[16]; string hostname<>; - gf_return_t op_ret; + int op_ret; int op_errno; int port; } ; @@ -69,7 +69,7 @@ struct gd1_mgmt_cluster_lock_req { struct gd1_mgmt_cluster_lock_rsp { unsigned char uuid[16]; - gf_return_t op_ret; + int op_ret; int op_errno; } ; @@ -79,7 +79,7 @@ struct gd1_mgmt_cluster_unlock_req { struct gd1_mgmt_cluster_unlock_rsp { unsigned char uuid[16]; - gf_return_t op_ret; + int op_ret; int op_errno; } ; @@ -93,7 +93,7 @@ struct gd1_mgmt_stage_op_req { struct gd1_mgmt_stage_op_rsp { unsigned char uuid[16]; int op; - gf_return_t op_ret; + int op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -109,7 +109,7 @@ struct gd1_mgmt_commit_op_req { struct gd1_mgmt_commit_op_rsp { unsigned char uuid[16]; int op; - gf_return_t op_ret; + int op_ret; int op_errno; opaque dict<>; string op_errstr<>; @@ -124,7 +124,7 @@ struct gd1_mgmt_friend_update { struct gd1_mgmt_friend_update_rsp { unsigned char uuid[16]; int op; - gf_return_t op_ret; + int op_ret; int op_errno; } ; @@ -136,7 +136,7 @@ struct gd1_mgmt_brick_op_req { } ; struct gd1_mgmt_brick_op_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque output<>; string op_errstr<>; @@ -153,7 +153,7 @@ struct gd1_mgmt_v3_lock_rsp { unsigned char uuid[16]; unsigned char txn_id[16]; opaque dict<>; - gf_return_t op_ret; + int op_ret; int op_errno; } ; @@ -166,7 +166,7 @@ struct gd1_mgmt_v3_pre_val_req { struct gd1_mgmt_v3_pre_val_rsp { unsigned char uuid[16]; int op; - gf_return_t op_ret; + int op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -181,7 +181,7 @@ struct gd1_mgmt_v3_brick_op_req { struct gd1_mgmt_v3_brick_op_rsp { unsigned char uuid[16]; int op; - gf_return_t op_ret; + int op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -196,7 +196,7 @@ struct gd1_mgmt_v3_commit_req { struct gd1_mgmt_v3_commit_rsp { unsigned char uuid[16]; int op; - gf_return_t op_ret; + int op_ret; int op_errno; opaque dict<>; string op_errstr<>; @@ -205,14 +205,14 @@ struct gd1_mgmt_v3_commit_rsp { struct gd1_mgmt_v3_post_val_req { unsigned char uuid[16]; int op; - gf_return_t op_ret; + int op_ret; opaque dict<>; } ; struct gd1_mgmt_v3_post_val_rsp { unsigned char uuid[16]; int op; - gf_return_t op_ret; + int op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -229,6 +229,6 @@ struct gd1_mgmt_v3_unlock_rsp { unsigned char uuid[16]; unsigned char txn_id[16]; opaque dict<>; - gf_return_t op_ret; + int op_ret; int op_errno; } ; diff --git a/rpc/xdr/src/glusterfs3-xdr.x b/rpc/xdr/src/glusterfs3-xdr.x index 9a70b4f48e..1c99099a72 100644 --- a/rpc/xdr/src/glusterfs3-xdr.x +++ b/rpc/xdr/src/glusterfs3-xdr.x @@ -87,7 +87,7 @@ struct gfs3_stat_req { opaque xdata<>; /* Extra data */ }; struct gfs3_stat_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt stat; opaque xdata<>; /* Extra data */ @@ -100,7 +100,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_readlink_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt buf; string path<>; /* NULL terminated */ @@ -117,7 +117,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_mknod_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt stat; gf_iatt preparent; @@ -134,7 +134,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_mkdir_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt stat; gf_iatt preparent; @@ -150,7 +150,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_unlink_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt preparent; gf_iatt postparent; @@ -165,7 +165,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_rmdir_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt preparent; gf_iatt postparent; @@ -181,7 +181,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_symlink_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt stat; gf_iatt preparent; @@ -198,7 +198,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_rename_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt stat; gf_iatt preoldparent; @@ -216,7 +216,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_link_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt stat; gf_iatt preparent; @@ -230,7 +230,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_truncate_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt prestat; gf_iatt poststat; @@ -244,7 +244,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_open_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; quad_t fd; opaque xdata<>; /* Extra data */ @@ -260,7 +260,7 @@ struct gfs3_readlink_req { opaque xdata<>; /* Extra data */ }; struct gfs3_read_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt stat; unsigned int size; @@ -275,7 +275,7 @@ struct gfs3_lookup_req { opaque xdata<>; /* Extra data */ }; struct gfs3_lookup_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt stat; gf_iatt postparent; @@ -293,7 +293,7 @@ struct gfs3_lookup_req { opaque xdata<>; /* Extra data */ }; struct gfs3_write_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt prestat; gf_iatt poststat; @@ -306,7 +306,7 @@ struct gfs3_lookup_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_statfs_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_statfs statfs; opaque xdata<>; /* Extra data */ @@ -321,7 +321,7 @@ struct gfs3_lookup_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_lk_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_proto_flock flock; opaque xdata<>; /* Extra data */ @@ -334,7 +334,7 @@ struct gfs3_lease_req { } ; struct gfs3_lease_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_proto_lease lease; opaque xdata<>; /* Extra data */ @@ -381,7 +381,7 @@ struct gfs3_finodelk_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_fsync_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt prestat; gf_iatt poststat; @@ -416,7 +416,7 @@ struct gfs3_finodelk_req { } ; struct gfs3_xattrop_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque dict<>; opaque xdata<>; /* Extra data */ @@ -432,7 +432,7 @@ struct gfs3_finodelk_req { } ; struct gfs3_fxattrop_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque dict<>; opaque xdata<>; /* Extra data */ @@ -446,7 +446,7 @@ struct gfs3_finodelk_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_getxattr_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque dict<>; opaque xdata<>; /* Extra data */ @@ -461,7 +461,7 @@ struct gfs3_finodelk_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_fgetxattr_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque dict<>; opaque xdata<>; /* Extra data */ @@ -488,7 +488,7 @@ struct gfs3_finodelk_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_opendir_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; quad_t fd; opaque xdata<>; /* Extra data */ @@ -535,7 +535,7 @@ struct gfs3_create_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_create_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt stat; u_quad_t fd; @@ -553,7 +553,7 @@ struct gfs3_ftruncate_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_ftruncate_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt prestat; gf_iatt poststat; @@ -567,7 +567,7 @@ struct gfs3_fstat_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_fstat_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt stat; opaque xdata<>; /* Extra data */ @@ -604,7 +604,7 @@ struct gfs3_fstat_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_setattr_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt statpre; gf_iatt statpost; @@ -618,7 +618,7 @@ struct gfs3_fstat_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_fsetattr_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt statpre; gf_iatt statpost; @@ -635,7 +635,7 @@ struct gfs3_fstat_req { } ; struct gfs3_fallocate_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt statpre; gf_iatt statpost; @@ -651,7 +651,7 @@ struct gfs3_fstat_req { } ; struct gfs3_discard_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt statpre; gf_iatt statpost; @@ -667,7 +667,7 @@ struct gfs3_fstat_req { } ; struct gfs3_zerofill_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gf_iatt statpre; gf_iatt statpost; @@ -682,7 +682,7 @@ struct gfs3_fstat_req { opaque xdata<>; /* Extra data */ } ; struct gfs3_rchecksum_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; unsigned int weak_checksum; opaque strong_checksum<>; @@ -696,7 +696,7 @@ struct gfs3_ipc_req { }; struct gfs3_ipc_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque xdata<>; }; @@ -711,7 +711,7 @@ struct gfs3_seek_req { }; struct gfs3_seek_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; u_quad_t offset; opaque xdata<>; @@ -722,7 +722,7 @@ struct gfs3_seek_rsp { opaque dict<>; } ; struct gf_setvolume_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque dict<>; } ; @@ -734,7 +734,7 @@ struct gfs3_seek_rsp { opaque xdata<>; /* Extra data */ } ; struct gf_getspec_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; string spec<>; opaque xdata<>; /* Extra data */ @@ -744,7 +744,7 @@ struct gfs3_seek_rsp { opaque dict<>; /* Extra data */ } ; struct gf_get_volume_info_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; string op_errstr<>; opaque dict<>; /* Extra data */ @@ -755,7 +755,7 @@ struct gfs3_seek_rsp { } ; struct gf_mgmt_hndsk_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque hndsk<>; } ; @@ -770,7 +770,7 @@ struct gfs3_seek_rsp { opaque xdata<>; /* Extra data */ } ; struct gf_notify_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; unsigned int flags; string buf<>; @@ -800,7 +800,7 @@ struct gfs3_dirlist { struct gfs3_readdir_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfs3_dirlist *reply; opaque xdata<>; /* Extra data */ @@ -818,14 +818,14 @@ struct gfs3_dirplist { }; struct gfs3_readdirp_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfs3_dirplist *reply; opaque xdata<>; /* Extra data */ }; struct gf_set_lk_ver_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; int lk_ver; }; @@ -841,7 +841,7 @@ struct gf_event_notify_req { }; struct gf_event_notify_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque dict<>; }; @@ -852,7 +852,7 @@ struct gf_getsnap_name_uuid_req { }; struct gf_getsnap_name_uuid_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; string op_errstr<>; opaque dict<>; @@ -866,7 +866,7 @@ struct gfs3_locklist { }; struct gfs3_getactivelk_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfs3_locklist *reply; opaque xdata<>; @@ -878,7 +878,7 @@ struct gfs3_getactivelk_req { }; struct gfs3_setactivelk_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque xdata<>; }; diff --git a/rpc/xdr/src/glusterfs4-xdr.x b/rpc/xdr/src/glusterfs4-xdr.x index 4c3f9a1e7a..d3b1d0dfaf 100644 --- a/rpc/xdr/src/glusterfs4-xdr.x +++ b/rpc/xdr/src/glusterfs4-xdr.x @@ -112,20 +112,20 @@ struct gfx_dict { /* FOPS */ struct gfx_common_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ }; struct gfx_common_iatt_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; gfx_iattx stat; }; struct gfx_common_2iatt_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; gfx_iattx prestat; @@ -133,7 +133,7 @@ struct gfx_common_2iatt_rsp { }; struct gfx_common_3iatt_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_iattx stat; @@ -200,7 +200,7 @@ struct gfx_readlink_req { }; struct gfx_readlink_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_iattx buf; @@ -256,7 +256,7 @@ struct gfx_rename_req { }; struct gfx_rename_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_iattx stat; @@ -287,7 +287,7 @@ struct gfx_rename_rsp { }; struct gfx_open_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ quad_t fd; @@ -308,7 +308,7 @@ struct gfx_opendir_req { gfx_dict xdata; /* Extra data */ }; struct gfx_read_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_iattx stat; unsigned int size; @@ -338,7 +338,7 @@ struct gfx_lookup_req { gfx_dict xdata; /* Extra data */ } ; struct gfx_statfs_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gf_statfs statfs; @@ -353,7 +353,7 @@ struct gfx_lookup_req { gfx_dict xdata; /* Extra data */ } ; struct gfx_lk_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gf_proto_flock flock; @@ -366,7 +366,7 @@ struct gfx_lease_req { } ; struct gfx_lease_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gf_proto_lease lease; @@ -440,7 +440,7 @@ struct gfx_finodelk_req { } ; struct gfx_common_dict_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_dict dict; @@ -527,7 +527,7 @@ struct gfx_create_req { gfx_dict xdata; /* Extra data */ } ; struct gfx_create_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_iattx stat; @@ -605,7 +605,7 @@ struct gfx_zerofill_req { } ; struct gfx_rchecksum_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ unsigned int flags; @@ -629,7 +629,7 @@ struct gfx_seek_req { }; struct gfx_seek_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; u_quad_t offset; @@ -653,7 +653,7 @@ struct gfx_seek_rsp { }; struct gfx_setvolume_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict dict; } ; @@ -665,7 +665,7 @@ struct gfx_seek_rsp { gfx_dict xdata; /* Extra data */ } ; struct gfx_getspec_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; string spec<>; gfx_dict xdata; /* Extra data */ @@ -678,7 +678,7 @@ struct gfx_seek_rsp { gfx_dict xdata; /* Extra data */ } ; struct gfx_notify_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; unsigned int flags; string buf<>; @@ -708,7 +708,7 @@ struct gfx_dirlist { struct gfx_readdir_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_dirlist *reply; @@ -726,14 +726,14 @@ struct gfx_dirplist { }; struct gfx_readdirp_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; /* Extra data */ gfx_dirplist *reply; }; struct gfx_set_lk_ver_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; int lk_ver; @@ -755,14 +755,14 @@ struct gfx_getsnap_name_uuid_req { }; struct gfx_getsnap_name_uuid_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict dict; string op_errstr<>; }; struct gfx_getactivelk_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; gfx_dict xdata; gfs3_locklist *reply; diff --git a/rpc/xdr/src/portmap-xdr.x b/rpc/xdr/src/portmap-xdr.x index 978db2a8d6..23515572b9 100644 --- a/rpc/xdr/src/portmap-xdr.x +++ b/rpc/xdr/src/portmap-xdr.x @@ -18,7 +18,7 @@ struct pmap_port_by_brick_req { }; struct pmap_port_by_brick_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; int status; int port; @@ -30,7 +30,7 @@ struct pmap_brick_by_port_req { }; struct pmap_brick_by_port_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; int status; string brick<>; @@ -44,7 +44,7 @@ struct pmap_signin_req { }; struct pmap_signin_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; }; @@ -55,6 +55,6 @@ struct pmap_signout_req { }; struct pmap_signout_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; }; diff --git a/rpc/xdr/src/rpc-common-xdr.x b/rpc/xdr/src/rpc-common-xdr.x index cc34f48d83..baf8b4313c 100644 --- a/rpc/xdr/src/rpc-common-xdr.x +++ b/rpc/xdr/src/rpc-common-xdr.x @@ -53,14 +53,14 @@ struct gf_prog_detail { struct gf_dump_rsp { u_quad_t gfs_id; - gf_return_t op_ret; + int op_ret; int op_errno; struct gf_prog_detail *prog; }; struct gf_common_rsp { - gf_return_t op_ret; + int op_ret; int op_errno; opaque xdata<>; /* Extra data */ } ; From b5279e46f34c759c7eec090ffe5014668b6e1a52 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 14 Sep 2020 07:43:21 +0530 Subject: [PATCH 07/24] api/: compile success Change-Id: I2b09cda0ef290b4ba970fb7858d7efaf2e8264ab Signed-off-by: Amar Tumballi --- api/src/glfs-fops.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index 28d29e7921..fcd6f56b4d 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -1192,21 +1192,22 @@ glfs_io_async_cbk(gf_return_t op_ret, int op_errno, call_frame_t *frame, subvol = cookie; glfd = gio->glfd; fs = glfd->fs; + ret = op_ret.op_ret; if (!glfs_is_glfd_still_valid(glfd)) goto err; - if (op_ret <= 0) { + if (IS_ERROR(op_ret)) { goto out; } else if (gio->op == GF_FOP_READ) { if (!iovec) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } - op_ret = iov_copy(gio->iov, gio->count, iovec, count); - glfd->offset = gio->offset + op_ret; + ret = iov_copy(gio->iov, gio->count, iovec, count); + glfd->offset = gio->offset + ret; } else if (gio->op == GF_FOP_WRITE) { glfd->offset = gio->offset + gio->iov->iov_len; } @@ -1214,7 +1215,7 @@ glfs_io_async_cbk(gf_return_t op_ret, int op_errno, call_frame_t *frame, out: errno = op_errno; if (gio->oldcb) { - gio->fn34(gio->glfd, op_ret, gio->data); + gio->fn34(gio->glfd, ret, gio->data); } else { if (prebuf) { prestatp = &prestat; @@ -1226,7 +1227,7 @@ glfs_io_async_cbk(gf_return_t op_ret, int op_errno, call_frame_t *frame, glfs_iatt_to_statx(fs, postbuf, poststatp); } - gio->fn(gio->glfd, op_ret, prestatp, poststatp, gio->data); + gio->fn(gio->glfd, ret, prestatp, poststatp, gio->data); } err: fd_unref(glfd->fd); From 3395e54861a64ce9d6716155fd6a9b61e23f78cf Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 14 Sep 2020 07:47:38 +0530 Subject: [PATCH 08/24] glusterfsd/: compile successful Change-Id: I6646f932ed84b0a1e985125a916d32c8f07f625b Signed-off-by: Amar Tumballi --- glusterfsd/src/glusterfsd-mgmt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index a4fc750a17..14d0201978 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -275,7 +275,7 @@ glusterfs_submit_reply(rpcsvc_request_t *req, void *arg, struct iovec *payload, } int -glusterfs_terminate_response_send(rpcsvc_request_t *req, gf_return_t op_ret) +glusterfs_terminate_response_send(rpcsvc_request_t *req, int op_ret) { gd1_mgmt_brick_op_rsp rsp = { 0, @@ -436,7 +436,7 @@ glusterfs_translator_info_response_send(rpcsvc_request_t *req, int ret, } int -glusterfs_xlator_op_response_send(rpcsvc_request_t *req, gf_return_t op_ret, +glusterfs_xlator_op_response_send(rpcsvc_request_t *req, int op_ret, char *msg, dict_t *output) { gd1_mgmt_brick_op_rsp rsp = { @@ -715,7 +715,7 @@ int glusterfs_handle_translator_op(rpcsvc_request_t *req) { int32_t ret = -1; - gf_return_t op_ret = 0; + int op_ret = 0; gd1_mgmt_brick_op_req xlator_req = { 0, }; From 312a2087ae9aa3f31e55cac95c9d485dd8c42cc9 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 14 Sep 2020 08:04:28 +0530 Subject: [PATCH 09/24] afr/: compile fixes Change-Id: I25e1e3e7dd513ac324c40e777c06f29c820e5d91 Signed-off-by: Amar Tumballi --- libglusterfs/src/glusterfs/glusterfs.h | 6 +- xlators/cluster/afr/src/afr-common.c | 197 +++++++++--------- xlators/cluster/afr/src/afr-dir-read.c | 8 +- xlators/cluster/afr/src/afr-dir-write.c | 12 +- xlators/cluster/afr/src/afr-inode-read.c | 137 ++++++------ xlators/cluster/afr/src/afr-inode-write.c | 49 +++-- xlators/cluster/afr/src/afr-lk-common.c | 36 ++-- xlators/cluster/afr/src/afr-open.c | 8 +- xlators/cluster/afr/src/afr-read-txn.c | 12 +- .../cluster/afr/src/afr-self-heal-common.c | 48 ++--- xlators/cluster/afr/src/afr-self-heal-data.c | 10 +- xlators/cluster/afr/src/afr-self-heal-entry.c | 14 +- .../cluster/afr/src/afr-self-heal-metadata.c | 4 +- xlators/cluster/afr/src/afr-self-heal-name.c | 20 +- xlators/cluster/afr/src/afr-self-heald.c | 17 +- xlators/cluster/afr/src/afr-transaction.c | 42 ++-- xlators/cluster/afr/src/afr.h | 12 +- xlators/lib/src/libxlator.c | 16 +- 18 files changed, 334 insertions(+), 314 deletions(-) diff --git a/libglusterfs/src/glusterfs/glusterfs.h b/libglusterfs/src/glusterfs/glusterfs.h index 2680824623..273632d415 100644 --- a/libglusterfs/src/glusterfs/glusterfs.h +++ b/libglusterfs/src/glusterfs/glusterfs.h @@ -47,8 +47,10 @@ typedef struct _gf_return { int32_t op_ret; } gf_return_t; -#define IS_ERROR(ret) ((ret.op_ret) < 0) -#define IS_SUCCESS(ret) ((ret.op_ret) >= 0) +#define IS_ERROR(ret) (((ret).op_ret) < 0) +#define IS_SUCCESS(ret) (((ret).op_ret) >= 0) +#define GET_RET(ret) ((ret).op_ret) +#define SET_RET(ret, val) ((ret).op_ret = val) #ifndef O_LARGEFILE /* savannah bug #20053, patch for compiling on darwin */ diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 21282d9974..c88807a58e 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -52,7 +52,7 @@ afr_fill_success_replies(afr_local_t *local, afr_private_t *priv, int i = 0; for (i = 0; i < priv->child_count; i++) { - if (local->replies[i].valid && local->replies[i].op_ret == 0) { + if (local->replies[i].valid && IS_SUCCESS(local->replies[i].op_ret)) { replies[i] = 1; } else { replies[i] = 0; @@ -77,9 +77,9 @@ afr_dom_lock_acquire_cbk(call_frame_t *frame, void *cookie, xlator_t *this, afr_private_t *priv = this->private; int i = (long)cookie; - local->cont.lk.dom_lock_op_ret[i] = op_ret; + local->cont.lk.dom_lock_op_ret[i] = GET_RET(op_ret); local->cont.lk.dom_lock_op_errno[i] = op_errno; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, op_errno, AFR_MSG_LK_HEAL_DOM, "%s: Failed to acquire %s on %s", uuid_utoa(local->fd->inode->gfid), AFR_LK_HEAL_DOM, @@ -163,7 +163,7 @@ afr_dom_lock_release_cbk(call_frame_t *frame, void *cookie, xlator_t *this, afr_private_t *priv = this->private; int i = (long)cookie; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, op_errno, AFR_MSG_LK_HEAL_DOM, "%s: Failed to release %s on %s", local->loc.path, AFR_LK_HEAL_DOM, priv->children[i]->name); @@ -340,7 +340,7 @@ afr_lock_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->replies[i].valid = 1; local->replies[i].op_ret = op_ret; local->replies[i].op_errno = op_errno; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, op_errno, AFR_MSG_LK_HEAL_DOM, "Failed to heal lock on child %d for %s", i, uuid_utoa(local->fd->inode->gfid)); @@ -360,7 +360,7 @@ afr_getlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->replies[i].valid = 1; local->replies[i].op_ret = op_ret; local->replies[i].op_errno = op_errno; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, op_errno, AFR_MSG_LK_HEAL_DOM, "Failed getlk for %s", uuid_utoa(local->fd->inode->gfid)); } else { @@ -402,7 +402,7 @@ afr_does_lk_owner_match(call_frame_t *frame, afr_private_t *priv, } for (i = 0; i < priv->child_count; i++) { - if (!local->replies[i].valid || local->replies[i].op_ret != 0) + if (!local->replies[i].valid || IS_ERROR(local->replies[i].op_ret)) continue; if (local->cont.lk.getlk_rsp[i].l_type == F_UNLCK) continue; @@ -494,7 +494,7 @@ afr_lock_heal_do(call_frame_t *frame, afr_private_t *priv, for (i = 0; i < priv->child_count; i++) { if (!wind_on[i]) continue; - if ((!local->replies[i].valid) || (local->replies[i].op_ret != 0)) { + if ((!local->replies[i].valid) || IS_ERROR(local->replies[i].op_ret)) { continue; } @@ -932,7 +932,7 @@ afr_is_symmetric_error(call_frame_t *frame, xlator_t *this) for (i = 0; i < priv->child_count; i++) { if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret != -1) { + if (IS_ERROR(local->replies[i].op_ret)) { /* Operation succeeded on at least one subvol, so it is not a failed-everywhere situation. */ @@ -1530,7 +1530,9 @@ afr_set_split_brain_choice(int ret, call_frame_t *frame, void *opaque) inode_invalidate(inode); out: GF_FREE(data); - AFR_STACK_UNWIND(setxattr, frame, ret, op_errno, NULL); + gf_return_t op_ret; + SET_RET(op_ret, ret); + AFR_STACK_UNWIND(setxattr, frame, op_ret, op_errno, NULL); return 0; } @@ -1619,7 +1621,7 @@ afr_readables_fill(call_frame_t *frame, xlator_t *this, inode_t *inode, for (i = 0; i < priv->child_count; i++) { if (replies) { /* Lookup */ - if (!replies[i].valid || replies[i].op_ret == -1 || + if (!replies[i].valid || IS_ERROR(replies[i].op_ret) || (replies[i].xdata && dict_get_sizen(replies[i].xdata, GLUSTERFS_BAD_INODE))) { data_readable[i] = 0; @@ -1727,7 +1729,7 @@ afr_inode_refresh_err(call_frame_t *frame, xlator_t *this) priv = this->private; for (i = 0; i < priv->child_count; i++) { - if (local->replies[i].valid && !local->replies[i].op_ret) { + if (local->replies[i].valid && IS_SUCCESS(local->replies[i].op_ret)) { err = 0; goto ret; } @@ -1886,7 +1888,7 @@ afr_inode_refresh_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->replies[call_child].valid = 1; local->replies[call_child].op_ret = op_ret; local->replies[call_child].op_errno = op_errno; - if (op_ret != -1) { + if (IS_ERROR(op_ret)) { local->replies[call_child].poststat = *buf; if (par) local->replies[call_child].postparent = *par; @@ -2532,7 +2534,7 @@ afr_handle_inconsistent_fop(call_frame_t *frame, int32_t *op_ret, if (!frame || !frame->this || !frame->local || !frame->this->private) return; - if (*op_ret < 0) + if (*op_ret < -1) return; /* Failing inodelk/entrylk/lk here is not a good idea because we @@ -2784,7 +2786,7 @@ afr_get_parent_read_subvol(xlator_t *this, inode_t *parent, if (!replies[i].valid) continue; - if (replies[i].op_ret < 0) + if (IS_ERROR(replies[i].op_ret)) continue; if (par_read_subvol_iter == -1) { @@ -2845,7 +2847,7 @@ afr_first_up_child(call_frame_t *frame, xlator_t *this) priv = this->private; for (i = 0; i < priv->child_count; i++) - if (local->replies[i].valid && local->replies[i].op_ret == 0) + if (local->replies[i].valid && IS_SUCCESS(local->replies[i].op_ret)) return i; return -1; } @@ -2882,7 +2884,7 @@ afr_attempt_readsubvol_set(call_frame_t *frame, xlator_t *this, /* If quorum is enabled and we do not have a readable yet, it means all good copies are down. */ - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOTCONN; gf_msg(this->name, GF_LOG_WARNING, 0, AFR_MSG_READ_SUBVOL_ERROR, "no read " @@ -2940,7 +2942,7 @@ afr_lookup_done(call_frame_t *frame, xlator_t *this) issued */ if (local->cont.lookup.needs_fresh_lookup) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ESTALE; goto error; } @@ -2955,7 +2957,7 @@ afr_lookup_done(call_frame_t *frame, xlator_t *this) if (!replies[i].valid) continue; - if (replies[i].op_ret == -1) { + if (IS_ERROR(replies[i].op_ret)) { if (locked_entry && replies[i].op_errno == ENOENT) { in_flight_create = _gf_true; } @@ -2966,12 +2968,12 @@ afr_lookup_done(call_frame_t *frame, xlator_t *this) read_subvol = i; gf_uuid_copy(read_gfid, replies[i].poststat.ia_gfid); ia_type = replies[i].poststat.ia_type; - local->op_ret = 0; + SET_RET(local->op_ret, 0); } } if (in_flight_create && !afr_has_quorum(success_replies, this, NULL)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOENT; goto error; } @@ -2984,7 +2986,7 @@ afr_lookup_done(call_frame_t *frame, xlator_t *this) readable[] but the mismatching GFID subvol is not. */ for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret == -1) { + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) { continue; } @@ -3009,7 +3011,7 @@ afr_lookup_done(call_frame_t *frame, xlator_t *this) goto cant_interpret; /* LOG ERROR */ - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EIO; goto error; } @@ -3049,8 +3051,8 @@ afr_lookup_done(call_frame_t *frame, xlator_t *this) afr_handle_quota_size(frame, this); afr_set_need_heal(this, local); - if (AFR_IS_ARBITER_BRICK(priv, read_subvol) && local->op_ret == 0) { - local->op_ret = -1; + if (AFR_IS_ARBITER_BRICK(priv, read_subvol) && IS_SUCCESS(local->op_ret)) { + local->op_ret = gf_failure; local->op_errno = ENOTCONN; gf_msg_debug(this->name, 0, "Arbiter cannot be a read subvol " @@ -3066,7 +3068,7 @@ afr_lookup_done(call_frame_t *frame, xlator_t *this) if (ret) { gf_msg(this->name, GF_LOG_ERROR, 0, AFR_MSG_DICT_SET_FAILED, "Error setting gfid-heal-msg dict"); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; } } @@ -3115,7 +3117,7 @@ afr_final_errno(afr_local_t *local, afr_private_t *priv) for (i = 0; i < priv->child_count; i++) { if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret >= 0) + if (IS_SUCCESS(local->replies[i].op_ret)) continue; tmp_errno = local->replies[i].op_errno; op_errno = afr_higher_errno(op_errno, tmp_errno); @@ -3135,7 +3137,7 @@ afr_local_discovery_cbk(call_frame_t *frame, void *cookie, xlator_t *this, afr_private_t *priv = NULL; int32_t child_index = -1; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3214,7 +3216,7 @@ afr_lookup_sh_metadata_wrap(void *opaque) replies = local->replies; for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret == -1) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; first = i; break; @@ -3317,7 +3319,7 @@ afr_can_start_metadata_self_heal(call_frame_t *frame, xlator_t *this) return _gf_false; for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret == -1) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if (first == -1) { first = i; @@ -3462,7 +3464,7 @@ afr_lookup_entry_heal(call_frame_t *frame, xlator_t *this) if (!replies[i].valid) continue; - if (replies[i].op_ret == 0) { + if (IS_SUCCESS(replies[i].op_ret)) { if (gf_uuid_is_null(gfid)) { gf_uuid_copy(gfid, replies[i].poststat.ia_gfid); } @@ -3476,7 +3478,7 @@ afr_lookup_entry_heal(call_frame_t *frame, xlator_t *this) } /*gfid is missing, needs heal*/ - if ((replies[i].op_ret == -1) && (replies[i].op_errno == ENODATA)) { + if (IS_ERROR(replies[i].op_ret) && (replies[i].op_errno == ENODATA)) { goto name_heal; } @@ -3485,11 +3487,11 @@ afr_lookup_entry_heal(call_frame_t *frame, xlator_t *this) continue; } - if (replies[i].op_ret != replies[first].op_ret) { + if (GET_RET(replies[i].op_ret) != GET_RET(replies[first].op_ret)) { name_state_mismatch = _gf_true; } - if (replies[i].op_ret == 0) { + if (GET_RET(replies[i].op_ret) == 0) { /* Rename after this lookup may succeed if we don't do * a name-heal and the destination may not have pending xattrs * to indicate which name is good and which is bad so always do @@ -3510,7 +3512,7 @@ afr_lookup_entry_heal(call_frame_t *frame, xlator_t *this) for (i = 0; i < priv->child_count; i++) { if (!replies[i].valid) continue; - if (par_readables[i] && replies[i].op_ret < 0 && + if (par_readables[i] && IS_ERROR(replies[i].op_ret) && replies[i].op_errno != ENOTCONN) { goto name_heal; } @@ -3570,7 +3572,7 @@ afr_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } else { local->replies[child_index].need_heal = need_heal; } - if (op_ret != -1) { + if (IS_SUCCESS(op_ret)) { local->replies[child_index].poststat = *buf; local->replies[child_index].postparent = *postparent; if (xdata) @@ -3603,10 +3605,10 @@ afr_discover_unwind(call_frame_t *frame, xlator_t *this) afr_fill_success_replies(local, priv, success_replies); if (AFR_COUNT(success_replies, priv->child_count) > 0) - local->op_ret = 0; + SET_RET(local->op_ret, 0); - if (local->op_ret < 0) { - local->op_ret = -1; + if (IS_ERROR(local->op_ret)) { + local->op_ret = gf_failure; local->op_errno = afr_final_errno(frame->local, this->private); goto error; } @@ -3628,8 +3630,8 @@ afr_discover_unwind(call_frame_t *frame, xlator_t *this) if (read_subvol == -1) goto error; - if (AFR_IS_ARBITER_BRICK(priv, read_subvol) && local->op_ret == 0) { - local->op_ret = -1; + if (AFR_IS_ARBITER_BRICK(priv, read_subvol) && IS_SUCCESS(local->op_ret)) { + local->op_ret = gf_failure; local->op_errno = ENOTCONN; gf_msg_debug(this->name, 0, "Arbiter cannot be a read subvol " @@ -3753,14 +3755,14 @@ afr_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->replies[child_index].valid = 1; local->replies[child_index].op_ret = op_ret; local->replies[child_index].op_errno = op_errno; - if (op_ret != -1) { + if (IS_SUCCESS(op_ret)) { local->replies[child_index].poststat = *buf; local->replies[child_index].postparent = *postparent; if (xdata) local->replies[child_index].xdata = dict_ref(xdata); } - if (local->do_discovery && (op_ret == 0)) + if (local->do_discovery && IS_SUCCESS(op_ret)) afr_attempt_local_discovery(this, child_index); if (xdata) { @@ -4177,7 +4179,7 @@ afr_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret != -1) { + if (IS_SUCCESS(op_ret)) { local->op_ret = op_ret; if (!local->xdata_rsp && xdata) local->xdata_rsp = dict_ref(xdata); @@ -4317,8 +4319,8 @@ afr_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == 0) { - local->op_ret = 0; + if (IS_SUCCESS(op_ret)) { + SET_RET(local->op_ret, 0); if (!local->xdata_rsp && xdata) local->xdata_rsp = dict_ref(xdata); } else { @@ -4380,7 +4382,7 @@ afr_serialized_lock_wind(call_frame_t *frame, xlator_t *this); static gf_boolean_t afr_is_conflicting_lock_present(gf_return_t op_ret, int32_t op_errno) { - if (op_ret == -1 && op_errno == EAGAIN) + if (IS_ERROR(op_ret) && op_errno == EAGAIN) return _gf_true; return _gf_false; } @@ -4410,7 +4412,7 @@ afr_fop_lock_unwind(call_frame_t *frame, glusterfs_fop_t op, gf_return_t op_ret, static void afr_fop_lock_wind(call_frame_t *frame, xlator_t *this, int child_index, int32_t (*lock_cbk)(call_frame_t *, void *, xlator_t *, - int32_t, int32_t, dict_t *)) + gf_return_t, int32_t, dict_t *)) { afr_local_t *local = frame->local; afr_private_t *priv = this->private; @@ -4480,7 +4482,7 @@ afr_fop_lock_proceed(call_frame_t *frame) * both the mounts only got partial locks, afr treats them as failure in * gaining the locks and unwinds with EAGAIN errno. */ - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EUCLEAN; local->fop_lock_state = AFR_FOP_LOCK_SERIAL; afr_local_replies_wipe(local, priv); @@ -4527,7 +4529,7 @@ afr_unlock_partial_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; priv = this->private; - if (op_ret < 0 && op_errno != ENOTCONN) { + if (IS_ERROR(op_ret) && op_errno != ENOTCONN) { if (local->fd) gf_uuid_copy(gfid, local->fd->inode->gfid); else @@ -4587,7 +4589,7 @@ afr_unlock_locks_and_proceed(call_frame_t *frame, xlator_t *this, if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret == -1) + if (IS_ERROR(local->replies[i].op_ret)) continue; afr_fop_lock_wind(frame, this, i, afr_unlock_partial_lock_cbk); @@ -4618,23 +4620,23 @@ afr_fop_lock_done(call_frame_t *frame, xlator_t *this) if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret == 0) { + if (IS_SUCCESS(local->replies[i].op_ret)) { lock_count++; success[i] = 1; } - if (local->op_ret == -1 && local->op_errno == EAGAIN) + if (IS_ERROR(local->op_ret) && local->op_errno == EAGAIN) continue; - if ((local->replies[i].op_ret == -1) && + if (IS_ERROR(local->replies[i].op_ret) && (local->replies[i].op_errno == EAGAIN)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EAGAIN; continue; } - if (local->replies[i].op_ret == 0) - local->op_ret = 0; + if (IS_SUCCESS(local->replies[i].op_ret)) + SET_RET(local->op_ret,0); local->op_errno = local->replies[i].op_errno; } @@ -4646,7 +4648,7 @@ afr_fop_lock_done(call_frame_t *frame, xlator_t *this) afr_unlock_locks_and_proceed(frame, this, lock_count); } else if (priv->quorum_count && !afr_has_quorum(success, this, NULL)) { local->fop_lock_state = AFR_FOP_LOCK_QUORUM_FAILED; - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = afr_final_errno(local, priv); if (local->op_errno == 0) local->op_errno = afr_quorum_errno(priv); @@ -4674,7 +4676,7 @@ afr_common_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->replies[child_index].valid = 1; local->replies[child_index].op_ret = op_ret; local->replies[child_index].op_errno = op_errno; - if (op_ret == 0 && xdata) { + if (IS_SUCCESS(op_ret) && xdata) { local->replies[child_index].xdata = dict_ref(xdata); LOCK(&frame->lock); { @@ -4954,7 +4956,7 @@ afr_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; goto unlock; } @@ -5046,7 +5048,7 @@ afr_lk_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0 && op_errno != ENOTCONN && op_errno != EBADFD) { + if (IS_ERROR(op_ret) && op_errno != ENOTCONN && op_errno != EBADFD) { gf_msg(this->name, GF_LOG_ERROR, op_errno, AFR_MSG_UNLOCK_FAIL, "gfid=%s: unlock failed on subvolume %s " "with lock owner %s", @@ -5118,16 +5120,16 @@ afr_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, child_index = (long)cookie; afr_common_lock_cbk(frame, cookie, this, op_ret, op_errno, xdata); - if (op_ret < 0 && op_errno == EAGAIN) { - local->op_ret = -1; + if (IS_ERROR(op_ret) && op_errno == EAGAIN) { + local->op_ret = gf_failure; local->op_errno = EAGAIN; afr_lk_unlock(frame, this); return 0; } - if (op_ret == 0) { - local->op_ret = 0; + if (IS_SUCCESS(op_ret)) { + SET_RET(local->op_ret,0); local->op_errno = 0; local->cont.lk.locked_nodes[child_index] = 1; local->cont.lk.ret_flock = *lock; @@ -5143,12 +5145,12 @@ afr_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->xdata_req); } else if (priv->quorum_count && !afr_has_quorum(local->cont.lk.locked_nodes, this, NULL)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = afr_final_errno(local, priv); afr_lk_unlock(frame, this); } else { - if (local->op_ret < 0) + if (IS_ERROR(local->op_ret)) local->op_errno = afr_final_errno(local, priv); AFR_STACK_UNWIND(lk, frame, local->op_ret, local->op_errno, @@ -5175,8 +5177,8 @@ afr_lk_txn_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; child_index = (long)cookie; afr_common_lock_cbk(frame, cookie, this, op_ret, op_errno, xdata); - if (op_ret == 0) { - local->op_ret = 0; + if (IS_SUCCESS(op_ret)) { + SET_RET(local->op_ret, 0); local->op_errno = 0; local->cont.lk.locked_nodes[child_index] = 1; local->cont.lk.ret_flock = *lock; @@ -5194,7 +5196,7 @@ afr_lk_txn_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, afr_private_t *priv = this->private; int child_index = (long)cookie; - if (op_ret < 0 && op_errno != ENOTCONN && op_errno != EBADFD) { + if (IS_ERROR(op_ret) && op_errno != ENOTCONN && op_errno != EBADFD) { gf_msg(this->name, GF_LOG_ERROR, op_errno, AFR_MSG_UNLOCK_FAIL, "gfid=%s: unlock failed on subvolume %s " "with lock owner %s", @@ -5251,7 +5253,7 @@ afr_lk_transaction(void *opaque) if (priv->quorum_count && !afr_has_quorum(local->cont.lk.locked_nodes, this, NULL)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = afr_final_errno(local, priv); goto unlock; } else { @@ -5260,7 +5262,7 @@ afr_lk_transaction(void *opaque) else ret = afr_add_lock_to_saved_locks(frame, this); if (ret) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = -ret; goto unlock; } @@ -5410,16 +5412,16 @@ afr_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, child_index = (long)cookie; afr_common_lock_cbk(frame, cookie, this, op_ret, op_errno, xdata); - if (op_ret < 0 && op_errno == EAGAIN) { - local->op_ret = -1; + if (IS_ERROR(op_ret) && op_errno == EAGAIN) { + local->op_ret = gf_failure; local->op_errno = EAGAIN; afr_lease_unlock(frame, this); return 0; } - if (op_ret == 0) { - local->op_ret = 0; + if (IS_SUCCESS(op_ret)) { + SET_RET(local->op_ret, 0); local->op_errno = 0; local->cont.lease.locked_nodes[child_index] = 1; local->cont.lease.ret_lease = *lease; @@ -5433,12 +5435,12 @@ afr_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, &local->cont.lease.user_lease, xdata); } else if (priv->quorum_count && !afr_has_quorum(local->cont.lease.locked_nodes, this, NULL)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = afr_final_errno(local, priv); afr_lease_unlock(frame, this); } else { - if (local->op_ret < 0) + if (IS_ERROR(local->op_ret)) local->op_errno = afr_final_errno(local, priv); AFR_STACK_UNWIND(lease, frame, local->op_ret, local->op_errno, &local->cont.lease.ret_lease, NULL); @@ -5518,7 +5520,7 @@ afr_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, for (i = 0; i < priv->child_count; i++) { if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret < 0 && + if (IS_ERROR(local->replies[i].op_ret) && local->replies[i].op_errno != ENOTCONN) { local->op_ret = local->replies[i].op_ret; local->op_errno = local->replies[i].op_errno; @@ -5531,9 +5533,9 @@ afr_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, failed = _gf_true; break; } - if (local->replies[i].op_ret == 0) { + if (IS_SUCCESS(local->replies[i].op_ret)) { succeeded = _gf_true; - local->op_ret = 0; + SET_RET(local->op_ret, 0); local->op_errno = 0; if (!local->xdata_rsp && local->replies[i].xdata) { local->xdata_rsp = dict_ref(local->replies[i].xdata); @@ -5542,7 +5544,7 @@ afr_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } if (!succeeded && !failed) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOTCONN; } @@ -6438,7 +6440,7 @@ int afr_local_init(afr_local_t *local, afr_private_t *priv, int32_t *op_errno) { int __ret = -1; - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EUCLEAN; __ret = syncbarrier_init(&local->barrier); @@ -6529,7 +6531,7 @@ afr_internal_lock_init(afr_internal_lock_t *lk, size_t child_count) if (NULL == lk->lower_locked_nodes) goto out; - lk->lock_op_ret = -1; + lk->lock_op_ret = gf_failure; lk->lock_op_errno = EUCLEAN; ret = 0; @@ -6817,7 +6819,7 @@ afr_update_heal_status(xlator_t *this, struct afr_reply *replies, sprintf(key2, "%s:%s", GLUSTERFS_INODELK_DOM_PREFIX, priv->sh_domain); for (i = 0; i < priv->child_count; i++) { - if ((replies[i].valid != 1) || (replies[i].op_ret != 0)) + if ((replies[i].valid != 1) || IS_ERROR(replies[i].op_ret)) continue; if (!io_domain_lk_count) { ret1 = dict_get_int32(replies[i].xdata, key1, &io_domain_lk_count); @@ -6878,7 +6880,7 @@ afr_lockless_inspect(call_frame_t *frame, xlator_t *this, uuid_t gfid, if (ret) goto out; for (i = 0; i < priv->child_count; i++) { - if (replies[i].valid && replies[i].op_ret == 0) { + if (replies[i].valid && IS_SUCCESS(replies[i].op_ret)) { valid_on[i] = 1; } } @@ -7037,7 +7039,9 @@ afr_get_heal_info(call_frame_t *frame, xlator_t *this, loc_t *loc) heal_frame->local = heal_local; AFR_STACK_DESTROY(heal_frame); } - AFR_STACK_UNWIND(getxattr, frame, ret, op_errno, dict, NULL); + gf_return_t op_ret; + SET_RET(op_ret, ret); + AFR_STACK_UNWIND(getxattr, frame, op_ret, op_errno, dict, NULL); if (dict) dict_unref(dict); if (inode) @@ -7138,6 +7142,7 @@ afr_get_split_brain_status(void *opaque) xlator_t *this = NULL; loc_t *loc = NULL; afr_spb_status_t *data = NULL; + gf_return_t op_ret = {0}; data = opaque; frame = data->frame; @@ -7217,8 +7222,11 @@ afr_get_split_brain_status(void *opaque) } ret = 0; -out: - AFR_STACK_UNWIND(getxattr, frame, ret, op_errno, dict, NULL); + + out: + + SET_RET(op_ret, ret); + AFR_STACK_UNWIND(getxattr, frame, op_ret, op_errno, dict, NULL); if (dict) dict_unref(dict); if (inode) @@ -7279,10 +7287,13 @@ afr_heal_splitbrain_file(call_frame_t *frame, xlator_t *this, loc_t *loc) heal_frame->local = heal_local; AFR_STACK_DESTROY(heal_frame); } + + gf_return_t op_ret; + SET_RET(op_ret, ret); if (local->op == GF_FOP_GETXATTR) - AFR_STACK_UNWIND(getxattr, frame, ret, op_errno, dict, NULL); + AFR_STACK_UNWIND(getxattr, frame, op_ret, op_errno, dict, NULL); else if (local->op == GF_FOP_SETXATTR) - AFR_STACK_UNWIND(setxattr, frame, ret, op_errno, NULL); + AFR_STACK_UNWIND(setxattr, frame, op_ret, op_errno, NULL); if (dict) dict_unref(dict); return ret; @@ -7474,7 +7485,7 @@ afr_serialize_xattrs_with_delimiter(call_frame_t *frame, xlator_t *this, keylen = strlen(local->cont.getxattr.name); for (i = 0; i < priv->child_count; i++) { - if (!local->replies[i].valid || local->replies[i].op_ret) { + if (!local->replies[i].valid || IS_SUCCESS(local->replies[i].op_ret)) { str_len = strlen(default_str); buf = strncat(buf, default_str, str_len); len += str_len; @@ -7819,7 +7830,7 @@ afr_handle_replies_quorum(call_frame_t *frame, xlator_t *this) local->op_errno = afr_final_errno(local, priv); if (!local->op_errno) local->op_errno = afr_quorum_errno(priv); - local->op_ret = -1; + local->op_ret = gf_failure; } } diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c index da84ce6130..4ce038d62d 100644 --- a/xlators/cluster/afr/src/afr-dir-read.c +++ b/xlators/cluster/afr/src/afr-dir-read.c @@ -44,7 +44,7 @@ afr_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; fd_ctx->opened_on[child_index] = AFR_FD_NOT_OPENED; } else { @@ -217,7 +217,7 @@ afr_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0 && !local->cont.readdir.offset) { + if (IS_ERROR(op_ret) && !local->cont.readdir.offset) { /* failover only if this was first readdir, detected by offset == 0 */ local->op_ret = op_ret; @@ -227,7 +227,7 @@ afr_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if (op_ret >= 0) + if (IS_SUCCESS(op_ret)) afr_readdir_transform_entries(subvol_entries, (long)cookie, &entries, local->fd); @@ -250,7 +250,7 @@ afr_readdir_wind(call_frame_t *frame, xlator_t *this, int subvol) fd_ctx = afr_fd_ctx_get(local->fd, this); if (!fd_ctx) { local->op_errno = EINVAL; - local->op_ret = -1; + local->op_ret = gf_failure; } if (subvol == -1 || !fd_ctx) { diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c index 78e9d6fab5..b7520e6eb5 100644 --- a/xlators/cluster/afr/src/afr-dir-write.c +++ b/xlators/cluster/afr/src/afr-dir-write.c @@ -86,7 +86,7 @@ __afr_dir_write_finalize(call_frame_t *frame, xlator_t *this) for (i = 0; i < priv->child_count; i++) { if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret == -1) + if (IS_ERROR(local->replies[i].op_ret)) continue; gf_uuid_copy(args.gfid, local->replies[i].poststat.ia_gfid); args.ia_type = local->replies[i].poststat.ia_type; @@ -109,7 +109,7 @@ __afr_dir_write_finalize(call_frame_t *frame, xlator_t *this) parent2_read_subvol = afr_data_subvol_get(local->parent2, this, NULL, local->readable2, NULL, NULL); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = afr_final_errno(local, priv); afr_pick_error_xdata(local, priv, local->parent, local->readable, local->parent2, local->readable2); @@ -117,7 +117,7 @@ __afr_dir_write_finalize(call_frame_t *frame, xlator_t *this) for (i = 0; i < priv->child_count; i++) { if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret < 0) { + if (IS_ERROR(local->replies[i].op_ret)) { if (local->inode) afr_inode_need_refresh_set(local->inode, this); if (local->parent) @@ -127,7 +127,7 @@ __afr_dir_write_finalize(call_frame_t *frame, xlator_t *this) continue; } - if (local->op_ret == -1) { + if (IS_ERROR(local->op_ret)) { local->op_ret = local->replies[i].op_ret; local->op_errno = local->replies[i].op_errno; @@ -186,7 +186,7 @@ __afr_dir_write_fill(call_frame_t *frame, xlator_t *this, int child_index, if (xdata) local->replies[child_index].xdata = dict_ref(xdata); - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { if (poststat) local->replies[child_index].poststat = *poststat; if (preparent) @@ -350,7 +350,7 @@ afr_mark_entry_pending_changelog(call_frame_t *frame, xlator_t *this) local = frame->local; priv = this->private; - if (local->op_ret < 0) + if (IS_ERROR(local->op_ret)) return; if (local->op != GF_FOP_CREATE && local->op != GF_FOP_MKNOD && diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index 8114a671f7..28cb8e9d93 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -68,7 +68,7 @@ afr_handle_quota_size(call_frame_t *frame, xlator_t *this) readable_cnt = AFR_COUNT(readable, priv->child_count); for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret == -1) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if (readable_cnt && !readable[i]) continue; @@ -98,7 +98,7 @@ afr_handle_quota_size(call_frame_t *frame, xlator_t *this) return read_subvol; for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret == -1) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if (readable_cnt && !readable[i]) continue; @@ -121,7 +121,7 @@ afr_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; @@ -195,7 +195,7 @@ afr_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; @@ -265,7 +265,7 @@ afr_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; @@ -338,8 +338,8 @@ afr_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { - local->op_ret = -1; + if (IS_ERROR(op_ret)) { + local->op_ret = op_ret; local->op_errno = op_errno; afr_read_txn_continue(frame, this, (long)cookie); @@ -468,7 +468,7 @@ afr_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0 && !afr_getxattr_ignorable_errnos(op_errno)) { + if (IS_ERROR(op_ret) && !afr_getxattr_ignorable_errnos(op_errno)) { local->op_ret = op_ret; local->op_errno = op_errno; @@ -546,7 +546,7 @@ afr_fgetxattr_clrlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { callcnt = --local->call_count; - if (op_ret == -1) + if (IS_ERROR(op_ret)) local->replies[cky].op_errno = op_errno; if (!local->dict) @@ -568,14 +568,14 @@ afr_fgetxattr_clrlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!callcnt) { xattr = dict_new(); if (!xattr) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } ret = dict_serialize_value_with_delim(local->dict, lk_summary, &serz_len, '\n'); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -584,7 +584,7 @@ afr_fgetxattr_clrlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = dict_set_dynstrn(xattr, local->cont.getxattr.name, keylen, gf_strdup(lk_summary)); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, ENOMEM, AFR_MSG_DICT_SET_FAILED, "Error setting dictionary"); @@ -634,7 +634,7 @@ afr_getxattr_clrlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { callcnt = --local->call_count; - if (op_ret == -1) + if (IS_ERROR(op_ret)) local->replies[cky].op_errno = op_errno; if (!local->dict) @@ -656,14 +656,14 @@ afr_getxattr_clrlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!callcnt) { xattr = dict_new(); if (!xattr) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } ret = dict_serialize_value_with_delim(local->dict, lk_summary, &serz_len, '\n'); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -672,7 +672,7 @@ afr_getxattr_clrlk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = dict_set_dynstrn(xattr, local->cont.getxattr.name, keylen, gf_strdup(lk_summary)); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, ENOMEM, AFR_MSG_DICT_SET_FAILED, "Error setting dictionary"); @@ -710,7 +710,7 @@ afr_getxattr_node_uuid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret == -1) { /** query the _next_ child */ + if (IS_ERROR(op_ret)) { /** query the _next_ child */ /** * _current_ becomes _next_ @@ -766,10 +766,10 @@ afr_getxattr_list_node_uuids_cbk(call_frame_t *frame, void *cookie, local->replies[cky].op_ret = op_ret; local->replies[cky].op_errno = op_errno; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unlock; - local->op_ret = 0; + local->op_ret.op_ret = 0; if (!local->xdata_rsp && xdata) local->xdata_rsp = dict_ref(xdata); @@ -780,7 +780,7 @@ afr_getxattr_list_node_uuids_cbk(call_frame_t *frame, void *cookie, UNLOCK(&frame->lock); if (!callcnt) { - if (local->op_ret != 0) { + if (IS_ERROR(local->op_ret)) { /* All bricks gave an error. */ local->op_errno = afr_final_errno(local, priv); goto unwind; @@ -795,7 +795,7 @@ afr_getxattr_list_node_uuids_cbk(call_frame_t *frame, void *cookie, if (!local->dict) local->dict = dict_new(); if (!local->dict) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unwind; } @@ -804,7 +804,7 @@ afr_getxattr_list_node_uuids_cbk(call_frame_t *frame, void *cookie, gf_common_mt_char); if (!xattr_serz) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unwind; } @@ -812,7 +812,7 @@ afr_getxattr_list_node_uuids_cbk(call_frame_t *frame, void *cookie, ret = afr_serialize_xattrs_with_delimiter(frame, this, xattr_serz, UUID0_STR, &tlen, ' '); if (ret) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; GF_FREE(xattr_serz); goto unwind; @@ -822,12 +822,12 @@ afr_getxattr_list_node_uuids_cbk(call_frame_t *frame, void *cookie, if (ret) { gf_msg(this->name, GF_LOG_ERROR, -ret, AFR_MSG_DICT_SET_FAILED, "Cannot set node_uuid key in dict"); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; if (ret == -EINVAL) GF_FREE(xattr_serz); } else { - local->op_ret = local->cont.getxattr.xattr_len - 1; + local->op_ret.op_ret = local->cont.getxattr.xattr_len - 1; local->op_errno = 0; } @@ -874,7 +874,7 @@ afr_getxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { - int call_cnt = 0, len = 0; + int call_cnt = 0, len = 0, ret = 0; char *lockinfo_buf = NULL; dict_t *lockinfo = NULL, *newdict = NULL; afr_local_t *local = NULL; @@ -885,7 +885,7 @@ afr_getxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, call_cnt = --local->call_count; - if ((op_ret < 0) || (!dict && !xdata)) { + if ((IS_ERROR(op_ret)) || (!dict && !xdata)) { goto unlock; } @@ -893,7 +893,7 @@ afr_getxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local->xdata_rsp) { local->xdata_rsp = dict_new(); if (!local->xdata_rsp) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unlock; } @@ -904,7 +904,7 @@ afr_getxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto unlock; } - op_ret = dict_get_ptr_and_len(dict, GF_XATTR_LOCKINFO_KEY, + ret = dict_get_ptr_and_len(dict, GF_XATTR_LOCKINFO_KEY, (void **)&lockinfo_buf, &len); if (!lockinfo_buf) { @@ -914,7 +914,7 @@ afr_getxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local->dict) { local->dict = dict_new(); if (!local->dict) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unlock; } @@ -926,11 +926,10 @@ afr_getxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (lockinfo_buf != NULL) { lockinfo = dict_new(); if (lockinfo == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; } else { - op_ret = dict_unserialize(lockinfo_buf, len, &lockinfo); - + ret = dict_unserialize(lockinfo_buf, len, &lockinfo); if (lockinfo && local->dict) { dict_copy(lockinfo, local->dict); } @@ -944,23 +943,23 @@ afr_getxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!call_cnt) { newdict = dict_new(); if (!newdict) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unwind; } - op_ret = dict_allocate_and_serialize( - local->dict, (char **)&lockinfo_buf, (unsigned int *)&len); - if (op_ret != 0) { - local->op_ret = -1; + ret = dict_allocate_and_serialize(local->dict, + (char **)&lockinfo_buf, (unsigned int *)&len); + if (ret != 0) { + local->op_ret = gf_failure; goto unwind; } - op_ret = dict_set_dynptr(newdict, GF_XATTR_LOCKINFO_KEY, + ret = dict_set_dynptr(newdict, GF_XATTR_LOCKINFO_KEY, (void *)lockinfo_buf, len); - if (op_ret < 0) { - local->op_ret = -1; - local->op_errno = -op_ret; + if (ret) { + local->op_ret = gf_failure; + local->op_errno = -ret; goto unwind; } @@ -979,7 +978,7 @@ afr_fgetxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { - int call_cnt = 0, len = 0; + int call_cnt = 0, len = 0, ret = 0; char *lockinfo_buf = NULL; dict_t *lockinfo = NULL, *newdict = NULL; afr_local_t *local = NULL; @@ -990,7 +989,7 @@ afr_fgetxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, call_cnt = --local->call_count; - if ((op_ret < 0) || (!dict && !xdata)) { + if ((IS_ERROR(op_ret)) || (!dict && !xdata)) { goto unlock; } @@ -998,7 +997,7 @@ afr_fgetxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local->xdata_rsp) { local->xdata_rsp = dict_new(); if (!local->xdata_rsp) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unlock; } @@ -1009,7 +1008,7 @@ afr_fgetxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto unlock; } - op_ret = dict_get_ptr_and_len(dict, GF_XATTR_LOCKINFO_KEY, + ret = dict_get_ptr_and_len(dict, GF_XATTR_LOCKINFO_KEY, (void **)&lockinfo_buf, &len); if (!lockinfo_buf) { @@ -1019,7 +1018,7 @@ afr_fgetxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local->dict) { local->dict = dict_new(); if (!local->dict) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unlock; } @@ -1031,10 +1030,10 @@ afr_fgetxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (lockinfo_buf != NULL) { lockinfo = dict_new(); if (lockinfo == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; } else { - op_ret = dict_unserialize(lockinfo_buf, len, &lockinfo); + ret = dict_unserialize(lockinfo_buf, len, &lockinfo); if (lockinfo && local->dict) { dict_copy(lockinfo, local->dict); @@ -1049,23 +1048,23 @@ afr_fgetxattr_lockinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!call_cnt) { newdict = dict_new(); if (!newdict) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unwind; } - op_ret = dict_allocate_and_serialize( + ret = dict_allocate_and_serialize( local->dict, (char **)&lockinfo_buf, (unsigned int *)&len); - if (op_ret != 0) { - local->op_ret = -1; + if (ret != 0) { + local->op_ret = gf_failure; goto unwind; } - op_ret = dict_set_dynptr(newdict, GF_XATTR_LOCKINFO_KEY, + ret = dict_set_dynptr(newdict, GF_XATTR_LOCKINFO_KEY, (void *)lockinfo_buf, len); - if (op_ret < 0) { - local->op_ret = -1; - local->op_errno = -op_ret; + if (ret) { + local->op_ret = gf_failure; + local->op_errno = -ret; goto unwind; } @@ -1113,7 +1112,7 @@ afr_fgetxattr_pathinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { callcnt = --local->call_count; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; } else { local->op_ret = op_ret; @@ -1121,7 +1120,7 @@ afr_fgetxattr_pathinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->xdata_rsp = dict_ref(xdata); } - if (!dict || (op_ret < 0)) + if (!dict || (IS_ERROR(op_ret))) goto unlock; if (!local->dict) { @@ -1237,7 +1236,7 @@ afr_getxattr_pathinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { callcnt = --local->call_count; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; } else { local->op_ret = op_ret; @@ -1245,7 +1244,7 @@ afr_getxattr_pathinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->xdata_rsp = dict_ref(xdata); } - if (!dict || (op_ret < 0)) + if (!dict || (IS_ERROR(op_ret))) goto unlock; if (!local->dict) { @@ -1357,7 +1356,7 @@ afr_common_getxattr_stime_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { callcnt = --local->call_count; - if (!dict || (op_ret < 0)) { + if (!dict || (IS_ERROR(op_ret))) { local->op_errno = op_errno; goto cleanup; } @@ -1366,7 +1365,7 @@ afr_common_getxattr_stime_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->dict = dict_copy_with_ref(dict, NULL); else dict_foreach(dict, afr_aggregate_stime_xattr, local->dict); - local->op_ret = 0; + local->op_ret.op_ret = 0; } cleanup: @@ -1626,8 +1625,8 @@ afr_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { - local->op_ret = -1; + if (IS_ERROR(op_ret)) { + local->op_ret = gf_failure; local->op_errno = op_errno; afr_read_txn_continue(frame, this, (long)cookie); @@ -1756,8 +1755,8 @@ afr_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { - local->op_ret = -1; + if (IS_ERROR(op_ret)) { + local->op_ret = gf_failure; local->op_errno = op_errno; afr_read_txn_continue(frame, this, (long)cookie); @@ -1834,8 +1833,8 @@ afr_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { - local->op_ret = -1; + if (IS_ERROR(op_ret)) { + local->op_ret = gf_failure; local->op_errno = op_errno; afr_read_txn_continue(frame, this, (long)cookie); diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c index 31ae2df2c5..9b9312a410 100644 --- a/xlators/cluster/afr/src/afr-inode-write.c +++ b/xlators/cluster/afr/src/afr-inode-write.c @@ -50,7 +50,7 @@ __afr_inode_write_finalize(call_frame_t *frame, xlator_t *this) for (i = 0; i < priv->child_count; i++) { if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret == -1) + if (IS_ERROR(local->replies[i].op_ret)) continue; if (!gf_uuid_is_null(local->replies[i].poststat.ia_gfid)) { gf_uuid_copy(args.gfid, local->replies[i].poststat.ia_gfid); @@ -76,7 +76,7 @@ __afr_inode_write_finalize(call_frame_t *frame, xlator_t *this) local->readable, NULL, &args); } - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = afr_final_errno(local, priv); afr_pick_error_xdata(local, priv, local->inode, local->readable, NULL, NULL); @@ -84,7 +84,7 @@ __afr_inode_write_finalize(call_frame_t *frame, xlator_t *this) for (i = 0; i < priv->child_count; i++) { if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret < 0) + if (IS_ERROR(local->replies[i].op_ret)) continue; /* Order of checks in the compound conditional @@ -93,9 +93,11 @@ __afr_inode_write_finalize(call_frame_t *frame, xlator_t *this) - Highest precedence: largest op_ret - Next precedence: if all op_rets are equal, read subvol - Least precedence: any succeeded subvol + // FIXME: check if this changes with 'gf_return_t', and we need + // something more */ - if ((local->op_ret < local->replies[i].op_ret) || - ((local->op_ret == local->replies[i].op_ret) && + if ((GET_RET(local->op_ret) < GET_RET(local->replies[i].op_ret)) || + ((GET_RET(local->op_ret) == GET_RET(local->replies[i].op_ret)) && (i == read_subvol))) { local->op_ret = local->replies[i].op_ret; local->op_errno = local->replies[i].op_errno; @@ -134,16 +136,18 @@ __afr_inode_write_fill(call_frame_t *frame, xlator_t *this, int child_index, local->replies[child_index].valid = 1; - if (AFR_IS_ARBITER_BRICK(priv, child_index) && op_ret == 1) - op_ret = iov_length(local->cont.writev.vector, + if (AFR_IS_ARBITER_BRICK(priv, child_index) && GET_RET(op_ret) == 1) { + int ret = iov_length(local->cont.writev.vector, local->cont.writev.count); + SET_RET(op_ret, ret); + } local->replies[child_index].op_ret = op_ret; local->replies[child_index].op_errno = op_errno; if (xdata) local->replies[child_index].xdata = dict_ref(xdata); - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { if (prebuf) local->replies[child_index].prestat = *prebuf; if (postbuf) @@ -260,10 +264,10 @@ afr_writev_handle_short_writes(call_frame_t *frame, xlator_t *this) * already been marked as failed. */ for (i = 0; i < priv->child_count; i++) { - if ((!local->replies[i].valid) || (local->replies[i].op_ret == -1)) + if ((!local->replies[i].valid) || IS_ERROR(local->replies[i].op_ret)) continue; - if (local->replies[i].op_ret < local->op_ret) + if (GET_RET(local->replies[i].op_ret) < GET_RET(local->op_ret)) afr_transaction_fop_failed(frame, this, i); } } @@ -283,7 +287,7 @@ afr_inode_write_fill(call_frame_t *frame, xlator_t *this, int child_index, { __afr_inode_write_fill(frame, this, child_index, op_ret, op_errno, prebuf, postbuf, NULL, xdata); - if (op_ret == -1 || !xdata) + if (IS_ERROR(op_ret) || !xdata) goto unlock; write_is_append = 0; @@ -586,7 +590,7 @@ afr_truncate_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret == 0 && prebuf->ia_size != postbuf->ia_size) + if (IS_SUCCESS(op_ret) && prebuf->ia_size != postbuf->ia_size) local->stable_write = _gf_false; return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, prebuf, @@ -699,7 +703,7 @@ afr_ftruncate_wind_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret == 0 && prebuf->ia_size != postbuf->ia_size) + if (IS_SUCCESS(op_ret) && prebuf->ia_size != postbuf->ia_size) local->stable_write = _gf_false; return __afr_inode_write_cbk(frame, cookie, this, op_ret, op_errno, prebuf, @@ -1059,10 +1063,10 @@ afr_emptyb_set_pending_changelog_cbk(call_frame_t *frame, void *cookie, if (ret) goto out; - gf_smsg(this->name, op_ret ? GF_LOG_ERROR : GF_LOG_INFO, - op_ret ? op_errno : 0, AFR_MSG_SET_PEND_XATTR, "name=%s", + gf_smsg(this->name, IS_ERROR(op_ret) ? GF_LOG_ERROR : GF_LOG_INFO, + IS_ERROR(op_ret) ? op_errno : 0, AFR_MSG_SET_PEND_XATTR, "name=%s", priv->children[i]->name, "op_ret=%s", - op_ret ? "failed" : "succeeded", NULL); + IS_ERROR(op_ret) ? "failed" : "succeeded", NULL); out: syncbarrier_wake(&local->barrier); @@ -1089,7 +1093,7 @@ afr_emptyb_set_pending_changelog(call_frame_t *frame, xlator_t *this, if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret == 0) { + if (IS_SUCCESS(local->replies[i].op_ret)) { ret = 0; goto out; } else { @@ -1267,7 +1271,9 @@ _afr_handle_empty_brick(void *opaque) if (op_frame) { AFR_STACK_DESTROY(op_frame); } - AFR_STACK_UNWIND(setxattr, frame, ret, op_errno, NULL); + gf_return_t op_ret; + SET_RET(op_ret, ret); + AFR_STACK_UNWIND(setxattr, frame, op_ret, op_errno, NULL); return 0; } @@ -1468,7 +1474,9 @@ afr_handle_spb_choice_timeout(xlator_t *this, call_frame_t *frame, dict_t *dict) ret = dict_get_uint64(dict, GF_AFR_SPB_CHOICE_TIMEOUT, &timeout); if (!ret) { priv->spb_choice_timeout = timeout * 60; - AFR_STACK_UNWIND(setxattr, frame, ret, op_errno, NULL); + gf_return_t op_ret; + SET_RET(op_ret, ret); + AFR_STACK_UNWIND(setxattr, frame, op_ret, op_errno, NULL); } return ret; @@ -1509,7 +1517,8 @@ afr_handle_empty_brick(xlator_t *this, call_frame_t *frame, loc_t *loc, /* Didn't belong to this replica pair * Just do a no-op */ - AFR_STACK_UNWIND(setxattr, frame, 0, 0, NULL); + gf_return_t op_ret = {0}; + AFR_STACK_UNWIND(setxattr, frame, op_ret, 0, NULL); return 0; } else { data = GF_CALLOC(1, sizeof(*data), gf_afr_mt_empty_brick_t); diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c index 237d9920e9..df1f59d442 100644 --- a/xlators/cluster/afr/src/afr-lk-common.c +++ b/xlators/cluster/afr/src/afr-lk-common.c @@ -182,7 +182,7 @@ initialize_internal_lock_variables(call_frame_t *frame, xlator_t *this) int_lock = &local->internal_lock; int_lock->lock_count = 0; - int_lock->lock_op_ret = -1; + int_lock->lock_op_ret = gf_failure; int_lock->lock_op_errno = 0; int_lock->lk_attempted_count = 0; @@ -286,13 +286,13 @@ afr_unlock_common_cbk(call_frame_t *frame, void *cookie, xlator_t *this, lockee_num = (int)((long)cookie) / priv->child_count; child_index = (int)((long)cookie) % priv->child_count; - if (op_ret < 0 && op_errno != ENOTCONN && op_errno != EBADFD) { + if (IS_ERROR(op_ret) && op_errno != ENOTCONN && op_errno != EBADFD) { afr_log_locks_failure(frame, priv->children[child_index]->name, "unlock", op_errno); } int_lock->lockee[lockee_num].locked_nodes[child_index] &= LOCKED_NO; - if (local->transaction.type == AFR_DATA_TRANSACTION && op_ret != 1) + if (local->transaction.type == AFR_DATA_TRANSACTION && GET_RET(op_ret) != 1) ret = afr_write_subvol_reset(frame, this); LOCK(&frame->lock); @@ -311,7 +311,7 @@ afr_unlock_common_cbk(call_frame_t *frame, void *cookie, xlator_t *this, void afr_internal_lock_wind(call_frame_t *frame, int32_t (*cbk)(call_frame_t *, void *, xlator_t *, - int32_t, int32_t, dict_t *), + gf_return_t, int32_t, dict_t *), void *cookie, int child, int lockee_num, gf_boolean_t blocking, gf_boolean_t unlock) { @@ -439,7 +439,7 @@ afr_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { if (op_errno == ENOSYS) { /* return ENOTSUP */ gf_msg(this->name, GF_LOG_ERROR, ENOSYS, @@ -458,10 +458,10 @@ afr_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } UNLOCK(&frame->lock); - if ((op_ret == -1) && (op_errno == ENOSYS)) { + if (IS_ERROR(op_ret) && (op_errno == ENOSYS)) { afr_unlock_now(frame, this); } else { - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { int_lock->lockee[lockee_num] .locked_nodes[child_index] |= LOCKED_YES; int_lock->lockee[lockee_num].locked_count++; @@ -552,8 +552,8 @@ afr_lock_blocking(call_frame_t *frame, xlator_t *this, int cookie) gf_msg(this->name, GF_LOG_INFO, 0, AFR_MSG_FD_CTX_GET_FAILED, "unable to get fd ctx for fd=%p", local->fd); - local->op_ret = -1; - int_lock->lock_op_ret = -1; + local->op_ret = gf_failure; + int_lock->lock_op_ret = gf_failure; afr_unlock_now(frame, this); @@ -563,8 +563,8 @@ afr_lock_blocking(call_frame_t *frame, xlator_t *this, int cookie) if (int_lock->lk_expected_count == int_lock->lk_attempted_count) { if (!is_blocking_locks_count_sufficient(frame, this)) { - local->op_ret = -1; - int_lock->lock_op_ret = -1; + local->op_ret = gf_failure; + int_lock->lock_op_ret = gf_failure; afr_unlock_now(frame, this); @@ -577,7 +577,7 @@ afr_lock_blocking(call_frame_t *frame, xlator_t *this, int cookie) gf_msg_debug(this->name, 0, "we're done locking"); - int_lock->lock_op_ret = 0; + SET_RET(int_lock->lock_op_ret, 0); int_lock->lock_cbk(frame, this); return 0; } @@ -634,7 +634,7 @@ afr_nb_internal_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; int_lock = &local->internal_lock; - if (op_ret == 0 && local->transaction.type == AFR_DATA_TRANSACTION) { + if (IS_SUCCESS(op_ret) && local->transaction.type == AFR_DATA_TRANSACTION) { LOCK(&local->inode->lock); { local->inode_ctx->lock_count++; @@ -644,7 +644,7 @@ afr_nb_internal_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { if (op_errno == ENOSYS) { /* return ENOTSUP */ gf_msg(this->name, GF_LOG_ERROR, ENOSYS, @@ -658,7 +658,7 @@ afr_nb_internal_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int_lock->lock_op_errno = op_errno; local->op_errno = op_errno; } - } else if (op_ret == 0) { + } else if (IS_SUCCESS(op_ret)) { int_lock->lockee[lockee_num] .locked_nodes[child_index] |= LOCKED_YES; int_lock->lockee[lockee_num].locked_count++; @@ -674,7 +674,7 @@ afr_nb_internal_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* all locks successful. Proceed to call FOP */ if (int_lock->lock_count == int_lock->lk_expected_count) { gf_msg_trace(this->name, 0, "All servers locked. Calling the cbk"); - int_lock->lock_op_ret = 0; + SET_RET(int_lock->lock_op_ret, 0); int_lock->lock_cbk(frame, this); } /* Not all locks were successful. Unlock and try locking @@ -717,8 +717,8 @@ afr_lock_nonblocking(call_frame_t *frame, xlator_t *this) gf_msg(this->name, GF_LOG_INFO, 0, AFR_MSG_FD_CTX_GET_FAILED, "unable to get fd ctx for fd=%p", local->fd); - local->op_ret = -1; - int_lock->lock_op_ret = -1; + local->op_ret = gf_failure; + int_lock->lock_op_ret = gf_failure; local->op_errno = EINVAL; int_lock->lock_op_errno = EINVAL; diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c index 1dcacc1f9e..8a4cae1b53 100644 --- a/xlators/cluster/afr/src/afr-open.c +++ b/xlators/cluster/afr/src/afr-open.c @@ -69,7 +69,7 @@ afr_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; fd_ctx->opened_on[child_index] = AFR_FD_NOT_OPENED; } else { @@ -84,7 +84,7 @@ afr_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (call_count == 0) { afr_handle_replies_quorum(frame, this); - if (local->op_ret == -1) { + if (IS_ERROR(local->op_ret)) { AFR_STACK_UNWIND(open, frame, local->op_ret, local->op_errno, NULL, NULL); } else if (fd_ctx->flags & O_TRUNC) { @@ -209,7 +209,7 @@ afr_openfd_fix_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { gf_msg_debug(this->name, 0, "fd for %s opened " "successfully on subvolume %s", @@ -224,7 +224,7 @@ afr_openfd_fix_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&local->fd->lock); { - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { fd_ctx->opened_on[child_index] = AFR_FD_OPENED; } else { fd_ctx->opened_on[child_index] = AFR_FD_NOT_OPENED; diff --git a/xlators/cluster/afr/src/afr-read-txn.c b/xlators/cluster/afr/src/afr-read-txn.c index 6fc2c75145..9de02a2e34 100644 --- a/xlators/cluster/afr/src/afr-read-txn.c +++ b/xlators/cluster/afr/src/afr-read-txn.c @@ -224,7 +224,7 @@ afr_ta_read_txn(void *opaque) loc_wipe(&loc); if (read_subvol == -1) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; } afr_read_txn_wind(frame, this, read_subvol); @@ -241,7 +241,7 @@ afr_ta_read_txn_synctask(call_frame_t *frame, xlator_t *this) local = frame->local; ta_frame = afr_ta_frame_create(this); if (!ta_frame) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, ENOMEM, AFR_MSG_THIN_ARB, "Failed to create ta_frame"); @@ -254,7 +254,7 @@ afr_ta_read_txn_synctask(call_frame_t *frame, xlator_t *this) "Failed to launch " "afr_ta_read_txn synctask for gfid %s.", uuid_utoa(local->inode->gfid)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; STACK_DESTROY(ta_frame->root); goto out; @@ -414,18 +414,18 @@ afr_read_txn(call_frame_t *frame, xlator_t *this, inode_t *inode, local->transaction.type = type; if (priv->quorum_count && !afr_has_quorum(local->child_up, this, NULL)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = afr_quorum_errno(priv); goto read; } if (!afr_is_consistent_io_possible(local, priv, &local->op_errno)) { - local->op_ret = -1; + local->op_ret = gf_failure; goto read; } if (priv->thin_arbiter_count && !afr_ta_has_quorum(priv, local)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = -afr_quorum_errno(priv); goto read; } diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 4e828d7699..5443dcdf9e 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -37,7 +37,7 @@ afr_lookup_and_heal_gfid(xlator_t *this, inode_t *parent, const char *name, priv = this->private; wind_on = alloca0(priv->child_count); - if (source >= 0 && replies[source].valid && replies[source].op_ret == 0) + if (source >= 0 && replies[source].valid && IS_SUCCESS(replies[source].op_ret)) ia_type = replies[source].poststat.ia_type; if (ia_type != IA_INVAL) @@ -55,7 +55,7 @@ afr_lookup_and_heal_gfid(xlator_t *this, inode_t *parent, const char *name, for (i = 0; i < priv->child_count; i++) { if (source == -1) { /* case (a) above. */ - if (replies[i].valid && replies[i].op_ret == 0 && + if (replies[i].valid && IS_SUCCESS(replies[i].op_ret) && replies[i].poststat.ia_type != IA_INVAL) { ia_type = replies[i].poststat.ia_type; break; @@ -64,7 +64,7 @@ afr_lookup_and_heal_gfid(xlator_t *this, inode_t *parent, const char *name, /* case (b) above. */ if (i == source) continue; - if (sources[i] && replies[i].valid && replies[i].op_ret == 0 && + if (sources[i] && replies[i].valid && IS_SUCCESS(replies[i].op_ret) && replies[i].poststat.ia_type != IA_INVAL) { ia_type = replies[i].poststat.ia_type; break; @@ -77,7 +77,7 @@ afr_lookup_and_heal_gfid(xlator_t *this, inode_t *parent, const char *name, * with the inode and update those replies. */ for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret != 0) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if (gf_uuid_is_null(gfid) && @@ -132,7 +132,7 @@ afr_lookup_and_heal_gfid(xlator_t *this, inode_t *parent, const char *name, for (i = 0; i < priv->child_count; i++) { if (!wind_on[i]) continue; - if (replies[i].valid && replies[i].op_ret == 0 && + if (replies[i].valid && IS_SUCCESS(replies[i].op_ret) && !gf_uuid_is_null(replies[i].poststat.ia_gfid)) { *gfid_idx = i; break; @@ -161,7 +161,7 @@ afr_gfid_sbrain_source_from_src_brick(xlator_t *this, struct afr_reply *replies, priv = this->private; for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret == -1) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if (strcmp(priv->children[i]->name, src_brick) == 0) return i; @@ -178,7 +178,7 @@ afr_selfheal_gfid_mismatch_by_majority(struct afr_reply *replies, int votes; for (i = 0; i < child_count; i++) { - if (!replies[i].valid || replies[i].op_ret == -1) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; votes = 1; @@ -203,7 +203,7 @@ afr_gfid_sbrain_source_from_bigger_file(struct afr_reply *replies, uint64_t size = 0; for (i = 0; i < child_count; i++) { - if (!replies[i].valid || replies[i].op_ret == -1) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if (size < replies[i].poststat.ia_size) { src = i; @@ -225,7 +225,7 @@ afr_gfid_sbrain_source_from_latest_mtime(struct afr_reply *replies, uint32_t mtime_nsec = 0; for (i = 0; i < child_count; i++) { - if (!replies[i].valid || replies[i].op_ret != 0) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if ((mtime < replies[i].poststat.ia_mtime) || ((mtime == replies[i].poststat.ia_mtime) && @@ -438,18 +438,18 @@ afr_selfheal_post_op(call_frame_t *frame, xlator_t *this, inode_t *inode, loc.inode = inode_ref(inode); gf_uuid_copy(loc.gfid, inode->gfid); - local->op_ret = 0; + SET_RET(local->op_ret, 0); STACK_WIND(frame, afr_selfheal_post_op_cbk, priv->children[subvol], priv->children[subvol]->fops->xattrop, &loc, GF_XATTROP_ADD_ARRAY, xattr, xdata); syncbarrier_wait(&local->barrier, 1); - if (local->op_ret < 0) + if (IS_ERROR(local->op_ret)) ret = -local->op_errno; loc_wipe(&loc); - local->op_ret = 0; + SET_RET(local->op_ret, 0); return ret; } @@ -798,7 +798,7 @@ afr_selfheal_extract_xattr(xlator_t *this, struct afr_reply *replies, priv = this->private; for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret != 0) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if (!replies[i].xdata) @@ -832,7 +832,7 @@ afr_mark_largest_file_as_source(xlator_t *this, unsigned char *sources, for (i = 0; i < priv->child_count; i++) { if (!sources[i]) continue; - if (!replies[i].valid || replies[i].op_ret != 0) { + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) { sources[i] = 0; continue; } @@ -863,7 +863,7 @@ afr_mark_latest_mtime_file_as_source(xlator_t *this, unsigned char *sources, for (i = 0; i < priv->child_count; i++) { if (!sources[i]) continue; - if (!replies[i].valid || replies[i].op_ret != 0) { + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) { sources[i] = 0; continue; } @@ -933,7 +933,7 @@ afr_can_decide_split_brain_source_sinks(struct afr_reply *replies, int i = 0; for (i = 0; i < child_count; i++) - if (replies[i].valid != 1 || replies[i].op_ret != 0) + if (replies[i].valid != 1 || IS_ERROR(replies[i].op_ret)) return _gf_false; return _gf_true; @@ -1316,7 +1316,7 @@ afr_is_file_empty_on_all_children(afr_private_t *priv, int i = 0; for (i = 0; i < priv->child_count; i++) { - if ((!replies[i].valid) || (replies[i].op_ret != 0) || + if ((!replies[i].valid) || IS_ERROR(replies[i].op_ret) || (replies[i].poststat.ia_size != 0)) return _gf_false; } @@ -1925,7 +1925,7 @@ afr_success_count(struct afr_reply *replies, unsigned int count) unsigned int success = 0; for (i = 0; i < count; i++) - if (replies[i].valid && replies[i].op_ret == 0) + if (replies[i].valid && IS_SUCCESS(replies[i].op_ret)) success++; return success; } @@ -1961,7 +1961,7 @@ afr_locked_fill(call_frame_t *frame, xlator_t *this, unsigned char *locked_on) priv = this->private; for (i = 0; i < priv->child_count; i++) { - if (local->replies[i].valid && local->replies[i].op_ret == 0) { + if (local->replies[i].valid && IS_SUCCESS(local->replies[i].op_ret)) { locked_on[i] = 1; count++; } else { @@ -2028,7 +2028,7 @@ afr_selfheal_inodelk(call_frame_t *frame, xlator_t *this, inode_t *inode, NULL); for (i = 0; i < priv->child_count; i++) { - if (local->replies[i].op_ret == -1 && + if (IS_ERROR(local->replies[i].op_ret) && local->replies[i].op_errno == EAGAIN) { afr_locked_fill(frame, this, locked_on); afr_selfheal_uninodelk(frame, this, inode, dom, off, size, @@ -2054,9 +2054,9 @@ afr_get_lock_and_eagain_counts(afr_private_t *priv, struct afr_reply *replies, for (i = 0; i < priv->child_count; i++) { if (!replies[i].valid) continue; - if (replies[i].op_ret == 0) { + if (IS_SUCCESS(replies[i].op_ret)) { (*lock_count)++; - } else if (replies[i].op_ret == -1 && replies[i].op_errno == EAGAIN) { + } else if (IS_ERROR(replies[i].op_ret) && replies[i].op_errno == EAGAIN) { (*eagain_count)++; } } @@ -2176,7 +2176,7 @@ afr_selfheal_entrylk(call_frame_t *frame, xlator_t *this, inode_t *inode, ENTRYLK_LOCK_NB, ENTRYLK_WRLCK, NULL); for (i = 0; i < priv->child_count; i++) { - if (local->replies[i].op_ret == -1 && + if (IS_ERROR(local->replies[i].op_ret) && local->replies[i].op_errno == EAGAIN) { afr_locked_fill(frame, this, locked_on); afr_selfheal_unentrylk(frame, this, inode, dom, name, locked_on, @@ -2311,7 +2311,7 @@ afr_selfheal_unlocked_inspect(call_frame_t *frame, xlator_t *this, uuid_t gfid, for (i = 0; i < priv->child_count; i++) { if (!replies[i].valid) continue; - if (replies[i].op_ret == -1) + if (IS_ERROR(replies[i].op_ret)) continue; /* The data segment of the changelog can be non-zero to indicate diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 19696b8ce2..b82778459d 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -85,7 +85,7 @@ __afr_can_skip_data_block_heal(call_frame_t *frame, xlator_t *this, fd_t *fd, if (xdata) dict_unref(xdata); - if (!replies[source].valid || replies[source].op_ret != 0) + if (!replies[source].valid || IS_ERROR(replies[source].op_ret)) return _gf_false; for (i = 0; i < priv->child_count; i++) { @@ -298,7 +298,7 @@ afr_selfheal_data_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, AFR_ONLIST(healed_sinks, frame, afr_sh_generic_fop_cbk, fsync, fd, 0, NULL); for (i = 0; i < priv->child_count; i++) - if (healed_sinks[i] && local->replies[i].op_ret != 0) + if (healed_sinks[i] && IS_ERROR(local->replies[i].op_ret)) /* fsync() failed. Do NOT consider this server as successfully healed. Mark it so. */ @@ -411,7 +411,7 @@ __afr_selfheal_truncate_sinks(call_frame_t *frame, xlator_t *this, fd_t *fd, NULL); for (i = 0; i < priv->child_count; i++) - if (healed_sinks[i] && local->replies[i].op_ret == -1) + if (healed_sinks[i] && IS_ERROR(local->replies[i].op_ret)) /* truncate() failed. Do NOT consider this server as successfully healed. Mark it so. */ @@ -451,7 +451,7 @@ afr_does_size_mismatch(xlator_t *this, unsigned char *sources, if (!replies[i].valid) continue; - if (replies[i].op_ret < 0) + if (IS_ERROR(replies[i].op_ret)) continue; if (!sources[i]) @@ -829,7 +829,7 @@ afr_selfheal_data_open(xlator_t *this, inode_t *inode, fd_t **fd) if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret < 0) { + if (IS_ERROR(local->replies[i].op_ret)) { ret = -local->replies[i].op_errno; continue; } diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index ac31751997..26510d4c6f 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -37,7 +37,7 @@ afr_selfheal_entry_delete(xlator_t *this, inode_t *dir, const char *name, loc.name = name; loc.inode = inode_ref(inode); - if (replies[child].valid && replies[child].op_ret == 0) { + if (replies[child].valid && IS_SUCCESS(replies[child].op_ret)) { switch (replies[child].poststat.ia_type) { case IA_IFDIR: gf_msg(this->name, GF_LOG_WARNING, 0, @@ -187,10 +187,10 @@ __afr_selfheal_heal_dirent(call_frame_t *frame, xlator_t *this, fd_t *fd, /* Skip healing this entry if the last lookup on it failed for reasons * other than ENOENT. */ - if ((replies[source].op_ret < 0) && (replies[source].op_errno != ENOENT)) + if (IS_ERROR(replies[source].op_ret) && (replies[source].op_errno != ENOENT)) return -replies[source].op_errno; - if (replies[source].op_ret == 0) { + if (IS_SUCCESS(replies[source].op_ret)) { ret = afr_lookup_and_heal_gfid(this, fd->inode, name, inode, replies, source, sources, &replies[source].poststat.ia_gfid, NULL); @@ -201,7 +201,7 @@ __afr_selfheal_heal_dirent(call_frame_t *frame, xlator_t *this, fd_t *fd, for (i = 0; i < priv->child_count; i++) { if (!healed_sinks[i]) continue; - if (replies[source].op_ret == -1 && + if (IS_ERROR(replies[source].op_ret) && replies[source].op_errno == ENOENT) { ret = afr_selfheal_entry_delete(this, fd->inode, name, inode, i, replies); @@ -244,7 +244,7 @@ afr_selfheal_detect_gfid_and_type_mismatch(xlator_t *this, if (!replies[i].valid) continue; - if (replies[i].op_ret != 0) + if (IS_ERROR(replies[i].op_ret)) continue; if (gf_uuid_is_null(replies[i].poststat.ia_gfid)) @@ -314,7 +314,7 @@ __afr_selfheal_merge_dirent(call_frame_t *frame, xlator_t *this, fd_t *fd, priv = this->private; for (i = 0; i < priv->child_count; i++) { - if (replies[i].valid && replies[i].op_ret == 0) { + if (replies[i].valid && IS_SUCCESS(replies[i].op_ret)) { source = i; break; } @@ -327,7 +327,7 @@ __afr_selfheal_merge_dirent(call_frame_t *frame, xlator_t *this, fd_t *fd, /* Set all the sources as 1, otheriwse newentry_mark won't be set */ for (i = 0; i < priv->child_count; i++) { - if (replies[i].valid && replies[i].op_ret == 0) { + if (replies[i].valid && IS_SUCCESS(replies[i].op_ret)) { sources[i] = 1; } } diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index 03f43bad16..3982022f7c 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -143,7 +143,7 @@ afr_dirtime_splitbrain_source(call_frame_t *frame, xlator_t *this, if (!replies[i].valid) continue; - if (replies[i].op_ret != 0) + if (IS_ERROR(replies[i].op_ret)) continue; if (mtime_ns(&replies[i].poststat) <= mtime) @@ -167,7 +167,7 @@ afr_dirtime_splitbrain_source(call_frame_t *frame, xlator_t *this, if (!replies[i].valid) continue; - if (replies[i].op_ret != 0) + if (IS_ERROR(replies[i].op_ret)) continue; child_ia = replies[i].poststat; diff --git a/xlators/cluster/afr/src/afr-self-heal-name.c b/xlators/cluster/afr/src/afr-self-heal-name.c index dd40c57ab1..31bc909ce3 100644 --- a/xlators/cluster/afr/src/afr-self-heal-name.c +++ b/xlators/cluster/afr/src/afr-self-heal-name.c @@ -72,7 +72,7 @@ __afr_selfheal_name_impunge(call_frame_t *frame, xlator_t *this, gf_uuid_copy(parent->gfid, pargfid); for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret != 0) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if (gf_uuid_compare(replies[i].poststat.ia_gfid, @@ -117,7 +117,7 @@ __afr_selfheal_name_expunge(xlator_t *this, inode_t *parent, uuid_t pargfid, if (!replies[i].valid) continue; - if (replies[i].op_ret) + if (IS_ERROR(replies[i].op_ret)) continue; switch (replies[i].poststat.ia_type) { @@ -161,7 +161,7 @@ afr_selfheal_name_need_heal_check(xlator_t *this, struct afr_reply *replies) if (!replies[i].valid) continue; - if ((replies[i].op_ret == -1) && (replies[i].op_errno == ENODATA)) + if (IS_ERROR(replies[i].op_ret) && (replies[i].op_errno == ENODATA)) need_heal = _gf_true; if (first_idx == -1) { @@ -169,14 +169,14 @@ afr_selfheal_name_need_heal_check(xlator_t *this, struct afr_reply *replies) continue; } - if (replies[i].op_ret != replies[first_idx].op_ret) + if (GET_RET(replies[i].op_ret) != GET_RET(replies[first_idx].op_ret)) need_heal = _gf_true; if (gf_uuid_compare(replies[i].poststat.ia_gfid, replies[first_idx].poststat.ia_gfid)) need_heal = _gf_true; - if ((replies[i].op_ret == 0) && + if (IS_SUCCESS(replies[i].op_ret) && (gf_uuid_is_null(replies[i].poststat.ia_gfid))) need_heal = _gf_true; } @@ -198,7 +198,7 @@ afr_selfheal_name_type_mismatch_check(xlator_t *this, struct afr_reply *replies, priv = this->private; for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret != 0) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if (replies[i].poststat.ia_type == IA_INVAL) @@ -258,7 +258,7 @@ afr_selfheal_name_gfid_mismatch_check(xlator_t *this, struct afr_reply *replies, priv = this->private; for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret != 0) + if (!replies[i].valid || IS_ERROR(replies[i].op_ret)) continue; if (gf_uuid_is_null(replies[i].poststat.ia_gfid)) @@ -316,7 +316,7 @@ afr_selfheal_name_source_empty_check(xlator_t *this, struct afr_reply *replies, if (!sources[i]) continue; - if (replies[i].op_ret == -1 && replies[i].op_errno == ENOENT) + if (IS_ERROR(replies[i].op_ret) && replies[i].op_errno == ENOENT) continue; source_is_empty = _gf_false; @@ -576,7 +576,7 @@ afr_selfheal_name_unlocked_inspect(call_frame_t *frame, xlator_t *this, if (!replies[i].valid) continue; - if ((replies[i].op_ret == -1) && (replies[i].op_errno == ENODATA)) { + if (IS_ERROR(replies[i].op_ret) && (replies[i].op_errno == ENODATA)) { *need_heal = _gf_true; break; } @@ -586,7 +586,7 @@ afr_selfheal_name_unlocked_inspect(call_frame_t *frame, xlator_t *this, continue; } - if (replies[i].op_ret != replies[first_idx].op_ret) { + if (GET_RET(replies[i].op_ret) != GET_RET(replies[first_idx].op_ret)) { *need_heal = _gf_true; break; } diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c index 2fe202bfcf..c4f97b60b9 100644 --- a/xlators/cluster/afr/src/afr-self-heald.c +++ b/xlators/cluster/afr/src/afr-self-heald.c @@ -1371,7 +1371,7 @@ afr_xl_op(xlator_t *this, dict_t *input, dict_t *output) char key[64]; int keylen = 0; int this_name_len = 0; - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; uint64_t cnt = 0; #define AFR_SET_DICT_AND_LOG(name, output, key, keylen, dict_str, \ @@ -1410,7 +1410,6 @@ afr_xl_op(xlator_t *this, dict_t *input, dict_t *output) } switch (op) { case GF_SHD_OP_HEAL_INDEX: - op_ret = 0; for (i = 0; i < priv->child_count; i++) { healer = &shd->index_healers[i]; @@ -1420,12 +1419,12 @@ afr_xl_op(xlator_t *this, dict_t *input, dict_t *output) AFR_SET_DICT_AND_LOG(this->name, output, key, keylen, SBRICK_NOT_CONNECTED, SLEN(SBRICK_NOT_CONNECTED)); - op_ret = -1; + op_ret = gf_failure; } else if (AFR_COUNT(priv->child_up, priv->child_count) < 2) { AFR_SET_DICT_AND_LOG(this->name, output, key, keylen, SLESS_THAN2_BRICKS_in_REP, SLEN(SLESS_THAN2_BRICKS_in_REP)); - op_ret = -1; + op_ret = gf_failure; } else if (!afr_shd_is_subvol_local(this, healer->subvol)) { AFR_SET_DICT_AND_LOG(this->name, output, key, keylen, SBRICK_IS_REMOTE, @@ -1445,7 +1444,7 @@ afr_xl_op(xlator_t *this, dict_t *input, dict_t *output) } break; case GF_SHD_OP_HEAL_FULL: - op_ret = -1; + op_ret = gf_failure; for (i = 0; i < priv->child_count; i++) { healer = &shd->full_healers[i]; @@ -1474,7 +1473,7 @@ afr_xl_op(xlator_t *this, dict_t *input, dict_t *output) gf_smsg(this->name, GF_LOG_ERROR, -ret, AFR_MSG_HEALER_SPAWN_FAILED, NULL); } - op_ret = 0; + SET_RET(op_ret, 0); } } break; @@ -1504,7 +1503,7 @@ afr_xl_op(xlator_t *this, dict_t *input, dict_t *output) break; case GF_SHD_OP_STATISTICS_HEAL_COUNT: case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA: - op_ret = -1; + op_ret = gf_failure; for (i = 0; i < priv->child_count; i++) { if (!priv->child_up[i]) { @@ -1523,7 +1522,7 @@ afr_xl_op(xlator_t *this, dict_t *input, dict_t *output) gf_smsg(this->name, GF_LOG_ERROR, -ret, AFR_MSG_DICT_SET_FAILED, NULL); } - op_ret = 0; + SET_RET(op_ret, 0); } } @@ -1536,7 +1535,7 @@ afr_xl_op(xlator_t *this, dict_t *input, dict_t *output) } out: dict_deln(output, this->name, this_name_len); - return op_ret; + return GET_RET(op_ret); #undef AFR_SET_DICT_AND_LOG } diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index 85ff45324c..beb5657966 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -200,7 +200,7 @@ afr_pick_error_xdata(afr_local_t *local, afr_private_t *priv, inode_t *inode1, if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret >= 0) + if (IS_SUCCESS(local->replies[i].op_ret)) continue; if (local->replies[i].op_errno == ENOTCONN) @@ -218,7 +218,7 @@ afr_pick_error_xdata(afr_local_t *local, afr_private_t *priv, inode_t *inode1, if (!local->replies[i].valid) continue; - if (local->replies[i].op_ret >= 0) + if (IS_SUCCESS(local->replies[i].op_ret)) continue; if (!local->replies[i].xdata) @@ -306,7 +306,7 @@ afr_transaction_fop(call_frame_t *frame, xlator_t *this) AFR_COUNT(failed_subvols, priv->child_count); /* Fail if pre-op did not succeed on quorum no. of bricks. */ if (!afr_changelog_has_quorum(local, this) || !call_count) { - local->op_ret = -1; + local->op_ret = gf_failure; /* local->op_errno is already captured in changelog cbk. */ afr_transaction_resume(frame, this); return 0; @@ -315,7 +315,7 @@ afr_transaction_fop(call_frame_t *frame, xlator_t *this) /* Fail if at least one writeable brick isn't up.*/ if (local->transaction.type == AFR_DATA_TRANSACTION && !afr_is_write_subvol_valid(frame, this)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EIO; afr_transaction_resume(frame, this); return 0; @@ -394,7 +394,7 @@ afr_lock_fail_shared(afr_local_t *local, struct list_head *list) while (!list_empty(list)) { each = list_entry(list->next, afr_local_t, transaction.wait_list); list_del_init(&each->transaction.wait_list); - each->op_ret = -1; + each->op_ret = gf_failure; each->op_errno = local->op_errno; afr_transaction_done(each->transaction.frame, each->transaction.frame->this); @@ -435,7 +435,7 @@ afr_transaction_detach_fop_frame(call_frame_t *frame) local = frame->local; - afr_handle_inconsistent_fop(frame, &local->op_ret, &local->op_errno); + afr_handle_inconsistent_fop(frame, &local->op_ret.op_ret, &local->op_errno); LOCK(&frame->lock); { fop_frame = local->transaction.main_frame; @@ -539,7 +539,7 @@ afr_txn_arbitrate_fop(call_frame_t *frame, xlator_t *this) /* If arbiter is the only source, do not proceed. */ if (pre_op_sources_count < 2 && local->transaction.pre_op_sources[ARBITER_BRICK_INDEX]) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOTCONN; for (i = 0; i < priv->child_count; i++) local->transaction.failed_subvols[i] = 1; @@ -570,7 +570,7 @@ afr_transaction_perform_fop(call_frame_t *frame, xlator_t *this) ret = afr_write_subvol_set(frame, this); if (ret) { /*act as if operation failed on all subvols*/ - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = -ret; for (i = 0; i < priv->child_count; i++) local->transaction.failed_subvols[i] = 1; @@ -736,7 +736,7 @@ afr_changelog_post_op_done(call_frame_t *frame, xlator_t *this) /* Fail the FOP if post-op did not succeed on quorum no. of bricks. */ if (!afr_changelog_has_quorum(local, this)) { - local->op_ret = -1; + local->op_ret = gf_failure; /*local->op_errno is already captured in changelog cbk*/ } @@ -755,7 +755,7 @@ static void afr_changelog_post_op_fail(call_frame_t *frame, xlator_t *this, int op_errno) { afr_local_t *local = frame->local; - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, AFR_MSG_THIN_ARB, @@ -957,7 +957,7 @@ afr_handle_quorum(call_frame_t *frame, xlator_t *this) return; /* If the fop already failed return right away to preserve errno */ - if (local->op_ret == -1) + if (IS_ERROR(local->op_ret)) return; /* @@ -998,7 +998,7 @@ afr_handle_quorum(call_frame_t *frame, xlator_t *this) } set_response: - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = afr_final_errno(local, priv); if (local->op_errno == 0) local->op_errno = afr_quorum_errno(priv); @@ -1395,7 +1395,7 @@ afr_changelog_post_op_do(call_frame_t *frame, xlator_t *this) else need_undirty = _gf_true; - if (local->op_ret < 0 && !nothing_failed) { + if (IS_ERROR(local->op_ret) && !nothing_failed) { if (afr_need_dirty_marking(frame, this)) { local->dirty[idx] = hton32(1); goto set_dirty; @@ -1652,7 +1652,7 @@ afr_changelog_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; child_index = (long)cookie; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; afr_transaction_fop_failed(frame, this, child_index); } @@ -1725,7 +1725,7 @@ afr_changelog_populate_xdata(call_frame_t *frame, afr_xattrop_type_t op, * an earlier entry txn that may have failed on some * of the sub-volumes. */ - if (local->op_ret) + if (IS_ERROR(local->op_ret)) need_entry_key_set = _gf_false; } else { key = GF_XATTROP_ENTRY_IN_KEY; @@ -2005,7 +2005,7 @@ afr_changelog_pre_op(call_frame_t *frame, xlator_t *this) return 0; err: local->internal_lock.lock_cbk = afr_transaction_done; - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; afr_handle_lock_acquire_failure(local); @@ -2026,7 +2026,7 @@ afr_post_nonblocking_lock_cbk(call_frame_t *frame, xlator_t *this) int_lock = &local->internal_lock; /* Initiate blocking locks if non-blocking has failed */ - if (int_lock->lock_op_ret < 0) { + if (IS_ERROR(int_lock->lock_op_ret)) { gf_msg_debug(this->name, 0, "Non blocking locks failed. Proceeding to blocking"); int_lock->lock_cbk = afr_internal_lock_finish; @@ -2050,7 +2050,7 @@ afr_post_blocking_rename_cbk(call_frame_t *frame, xlator_t *this) local = frame->local; int_lock = &local->internal_lock; - if (int_lock->lock_op_ret < 0) { + if (IS_ERROR(int_lock->lock_op_ret)) { gf_msg(this->name, GF_LOG_INFO, 0, AFR_MSG_INTERNAL_LKS_FAILED, "Blocking entrylks failed."); @@ -2269,14 +2269,14 @@ afr_internal_lock_finish(call_frame_t *frame, xlator_t *this) local->internal_lock.lock_cbk = NULL; if (!local->transaction.eager_lock_on) { - if (local->internal_lock.lock_op_ret < 0) { + if (IS_ERROR(local->internal_lock.lock_op_ret)) { afr_transaction_done(frame, this); return 0; } afr_changelog_pre_op(frame, this); } else { lock = &local->inode_ctx->lock[local->transaction.type]; - if (local->internal_lock.lock_op_ret < 0) { + if (IS_ERROR(local->internal_lock.lock_op_ret)) { afr_handle_lock_acquire_failure(local); } else { lock->event_generation = local->event_generation; @@ -2437,7 +2437,7 @@ afr_changelog_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { /* Failure of fsync() is as good as failure of previous write(). So treat it like one. */ diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 375ad2e6e0..1a9de6c1ce 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -87,7 +87,7 @@ typedef int (*afr_changelog_resume_t)(call_frame_t *frame, xlator_t *this); #define AFR_SET_ERROR_AND_CHECK_SPLIT_BRAIN(ret, errnum) \ do { \ - local->op_ret = ret; \ + local->op_ret.op_ret = ret; \ local->op_errno = errnum; \ if (local->op_errno == EIO) \ gf_msg(this->name, GF_LOG_ERROR, local->op_errno, \ @@ -358,7 +358,7 @@ typedef struct { int32_t lk_expected_count; int32_t lk_attempted_count; - int32_t lock_op_ret; + gf_return_t lock_op_ret; int32_t lock_op_errno; char *domain; /* Domain on which inode/entry lock/unlock in progress.*/ int32_t lock_count; @@ -1100,19 +1100,19 @@ afr_local_transaction_cleanup(afr_local_t *local, xlator_t *this); int afr_cleanup_fd_ctx(xlator_t *this, fd_t *fd); -#define AFR_STACK_UNWIND(fop, frame, op_ret, op_errno, params...) \ +#define AFR_STACK_UNWIND(fop, frame, op_return, op_errno, params...) \ do { \ afr_local_t *__local = NULL; \ xlator_t *__this = NULL; \ - int32_t __op_ret = 0; \ + gf_return_t __op_ret; \ int32_t __op_errno = 0; \ \ - __op_ret = op_ret; \ + __op_ret = op_return; \ __op_errno = op_errno; \ if (frame) { \ __local = frame->local; \ __this = frame->this; \ - afr_handle_inconsistent_fop(frame, &__op_ret, &__op_errno); \ + afr_handle_inconsistent_fop(frame, &__op_ret.op_ret, &__op_errno); \ if (__local && __local->is_read_txn) \ afr_pending_read_decrement(__this->private, \ __local->read_subvol); \ diff --git a/xlators/lib/src/libxlator.c b/xlators/lib/src/libxlator.c index b5fba149be..c3045a279f 100644 --- a/xlators/lib/src/libxlator.c +++ b/xlators/lib/src/libxlator.c @@ -127,7 +127,7 @@ cluster_marker_unwind(call_frame_t *frame, char *key, void *value, size_t size, { xl_marker_local_t *local = frame->local; int ret = 0; - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; int32_t op_errno = 0; gf_boolean_t unref = _gf_false; @@ -139,7 +139,7 @@ cluster_marker_unwind(call_frame_t *frame, char *key, void *value, size_t size, if (dict) { unref = _gf_true; } else { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } @@ -147,7 +147,7 @@ cluster_marker_unwind(call_frame_t *frame, char *key, void *value, size_t size, ret = dict_set_static_bin(dict, key, value, size); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } @@ -155,7 +155,7 @@ cluster_marker_unwind(call_frame_t *frame, char *key, void *value, size_t size, op_errno = evaluate_marker_results(local->gauge, local->count); if (op_errno) - op_ret = -1; + op_ret = gf_failure; out: if (local->xl_specf_unwind) { @@ -193,7 +193,7 @@ cluster_markerxtime_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { callcnt = --local->call_count; - if (op_ret) { + if (IS_ERROR(op_ret)) { marker_local_incr_errcount(local, op_errno); goto unlock; } @@ -248,7 +248,7 @@ cluster_markeruuid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, callcnt = --local->call_count; vol_uuid = local->vol_uuid; - if (op_ret) { + if (IS_ERROR(op_ret)) { marker_local_incr_errcount(local, op_errno); goto unlock; } @@ -260,7 +260,7 @@ cluster_markeruuid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (local->count[MCNT_FOUND]) { if ((local->volmark->major != volmark->major) || (local->volmark->minor != volmark->minor)) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto unlock; } @@ -485,7 +485,7 @@ cluster_handle_marker_getxattr(call_frame_t *frame, loc_t *loc, return 0; fail: if (unwind) - unwind(frame, -1, ENOMEM, NULL, NULL); + unwind(frame, gf_failure, ENOMEM, NULL, NULL); else default_getxattr_failure_cbk(frame, ENOMEM); return 0; From 5a778f8ccb5487f9a8e32323cfcc67b7728fefa0 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 15 Sep 2020 11:07:57 +0530 Subject: [PATCH 10/24] dht/: compile success Change-Id: Id320e156a5550998bf75844d9ede9d18b4c9d830 Signed-off-by: Amar Tumballi --- xlators/cluster/dht/src/dht-common.c | 442 ++++++++++++---------- xlators/cluster/dht/src/dht-common.h | 8 +- xlators/cluster/dht/src/dht-diskusage.c | 2 +- xlators/cluster/dht/src/dht-helper.c | 27 +- xlators/cluster/dht/src/dht-inode-read.c | 40 +- xlators/cluster/dht/src/dht-inode-write.c | 57 +-- xlators/cluster/dht/src/dht-layout.c | 4 +- xlators/cluster/dht/src/dht-linkfile.c | 12 +- xlators/cluster/dht/src/dht-lock.c | 48 +-- xlators/cluster/dht/src/dht-rebalance.c | 17 +- xlators/cluster/dht/src/dht-rename.c | 117 +++--- xlators/cluster/dht/src/dht-selfheal.c | 58 +-- 12 files changed, 437 insertions(+), 395 deletions(-) diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index f004c74224..ada64ee897 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -51,7 +51,7 @@ int32_t dht_check_remote_fd_failed_error(dht_local_t *local, gf_return_t op_ret, int op_errno) { - if (op_ret == -1 && (op_errno == EBADF || op_errno == EBADFD) && + if (IS_ERROR(op_ret) && (op_errno == EBADF || op_errno == EBADFD) && !(local->fd_checked)) { return 1; } @@ -466,13 +466,14 @@ dht_lookup_selfheal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; conf = this->private; - ret = op_ret; + ret = GET_RET(op_ret); FRAME_SU_UNDO(frame, dht_local_t); if (ret == 0) { layout = local->selfheal.layout; ret = dht_layout_set(this, local->inode, layout); + SET_RET(op_ret, ret); } dht_inode_ctx_time_update(local->inode, this, &local->stbuf, 1); @@ -486,7 +487,7 @@ dht_lookup_selfheal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* Delete mds xattr at the time of STACK UNWIND */ GF_REMOVE_INTERNAL_XATTR(conf->mds_xattr_key, local->xattr); - DHT_STACK_UNWIND(lookup, frame, ret, local->op_errno, local->inode, + DHT_STACK_UNWIND(lookup, frame, op_ret, local->op_errno, local->inode, &local->stbuf, local->xattr, &local->postparent); out: @@ -566,7 +567,7 @@ dht_discover_complete(xlator_t *this, call_frame_t *discover_frame) } } else { ret = dht_layout_normalize(this, &local->loc, layout); - if ((ret < 0) || ((ret > 0) && (local->op_ret != 0))) { + if ((ret < 0) || ((ret > 0) && IS_ERROR(local->op_ret))) { /* either the layout is incorrect or the directory is * not found even in one subvolume. */ @@ -608,7 +609,7 @@ dht_discover_complete(xlator_t *this, call_frame_t *discover_frame) /* Call function to save hashed subvol on inode ctx if internal mds xattr is not present and all subvols are up */ - if (!local->op_ret && !__is_root_gfid(local->stbuf.ia_gfid)) + if (IS_SUCCESS(local->op_ret) && !__is_root_gfid(local->stbuf.ia_gfid)) (void)dht_common_mark_mdsxattr(discover_frame, &error_while_marking_mds, 1); @@ -701,8 +702,8 @@ dht_common_mark_mdsxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, layout = local->selfheal.layout; mds_heal_fresh_lookup = local->mds_heal_fresh_lookup; - if (op_ret) { - gf_msg_debug(this->name, op_ret, + if (IS_ERROR(op_ret)) { + gf_msg_debug(this->name, GET_RET(op_ret), "Failed to set %s on the MDS %s for path %s. ", conf->mds_xattr_key, prev->name, local->loc.path); } else { @@ -1004,7 +1005,7 @@ dht_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, layout = local->layout; /* Check if the gfid is different for file from other node */ - if (!op_ret && gf_uuid_compare(local->gfid, stbuf->ia_gfid)) { + if (IS_SUCCESS(op_ret) && gf_uuid_compare(local->gfid, stbuf->ia_gfid)) { gf_uuid_unparse(stbuf->ia_gfid, gfid_node); gf_uuid_unparse(local->gfid, gfid_local); @@ -1028,7 +1029,7 @@ dht_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%s: failed to merge layouts for subvol %s", local->loc.path, prev->name); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; gf_msg_debug(this->name, op_errno, "lookup of %s on %s returned error", local->loc.path, @@ -1061,7 +1062,7 @@ dht_discover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } - local->op_ret = 0; + SET_RET(local->op_ret, 0); if (local->xattr == NULL) { local->xattr = dict_ref(xattr); @@ -1380,10 +1381,10 @@ dht_lookup_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, layout = local->layout; gf_msg_debug(this->name, op_errno, "%s: lookup on %s returned with op_ret = %d, op_errno = %d", - local->loc.path, prev->name, op_ret, op_errno); + local->loc.path, prev->name, GET_RET(op_ret), op_errno); /* The first successful lookup*/ - if (!op_ret && gf_uuid_is_null(local->gfid)) { + if (IS_SUCCESS(op_ret) && gf_uuid_is_null(local->gfid)) { memcpy(local->gfid, stbuf->ia_gfid, 16); } if (!gf_uuid_is_null(local->gfid)) { @@ -1391,7 +1392,7 @@ dht_lookup_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } /* Check if the gfid is different for file from other node */ - if (!op_ret && gf_uuid_compare(local->gfid, stbuf->ia_gfid)) { + if (IS_SUCCESS(op_ret) && gf_uuid_compare(local->gfid, stbuf->ia_gfid)) { gf_uuid_unparse(stbuf->ia_gfid, gfid_node); gf_msg(this->name, GF_LOG_WARNING, 0, DHT_MSG_GFID_MISMATCH, @@ -1408,7 +1409,7 @@ dht_lookup_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ ret = dht_layout_merge(this, layout, prev, op_ret, op_errno, xattr); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; /* The GFID is missing on this subvol. Force a heal. */ @@ -1429,7 +1430,7 @@ dht_lookup_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto unlock; } - local->op_ret = 0; + SET_RET(local->op_ret, 0); if (local->xattr == NULL) { local->xattr = dict_ref(xattr); } else { @@ -1544,7 +1545,7 @@ dht_lookup_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if (local->op_ret == 0) { + if (IS_SUCCESS(local->op_ret)) { if (dht_needs_selfheal(frame, this)) { goto selfheal; } @@ -1679,7 +1680,7 @@ dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg_debug(this->name, op_errno, "%s: revalidate lookup on %s returned op_ret %d", - local->loc.path, prev->name, op_ret); + local->loc.path, prev->name, GET_RET(op_ret)); LOCK(&frame->lock); { @@ -1687,7 +1688,7 @@ dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, memcpy(local->gfid, local->loc.gfid, 16); } - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; if ((op_errno != ENOTCONN) && (op_errno != ENOENT) && @@ -1750,7 +1751,7 @@ dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, (stbuf->ia_type), (local->inode->ia_type), local->loc.path, gfid); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; goto unlock; @@ -1848,7 +1849,7 @@ dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_iatt_merge(this, &local->stbuf, stbuf); dht_iatt_merge(this, &local->postparent, postparent); - local->op_ret = 0; + SET_RET(local->op_ret, 0); if (!local->xattr) { local->xattr = dict_ref(xattr); @@ -1867,7 +1868,7 @@ dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, subvol = dht_linkfile_subvol(this, inode, stbuf, xattr); if (!subvol) { op_errno = ESTALE; - local->op_ret = -1; + local->op_ret = gf_failure; } else { STACK_WIND_COOKIE(frame, dht_lookup_linkfile_cbk, subvol, subvol, subvol->fops->lookup, &local->loc, @@ -1945,7 +1946,7 @@ dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } if (local->return_estale) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ESTALE; } @@ -1965,7 +1966,7 @@ dht_revalidate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, * active in the cluster do not have layouts on disk. * Unwind with ESTALE to trigger a fresh lookup */ if (is_dir && local->stbuf.ia_type == IA_INVAL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ESTALE; } /* Delete mds xattr at the time of STACK UNWIND */ @@ -2014,12 +2015,12 @@ dht_lookup_linkfile_create_cbk(call_frame_t *frame, void *cooie, xlator_t *this, "Failed to set layout for subvolume %s, " "(gfid = %s)", cached_subvol ? cached_subvol->name : "", gfid); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; goto unwind; } - local->op_ret = 0; + SET_RET(local->op_ret, 0); if ((local->stbuf.ia_nlink == 1) && (conf && conf->unhashed_sticky_bit)) { local->stbuf.ia_prot.sticky = 1; } @@ -2032,7 +2033,7 @@ dht_lookup_linkfile_create_cbk(call_frame_t *frame, void *cooie, xlator_t *this, gf_msg_debug(this->name, 0, "creation of linkto on hashed subvol:%s, " "returned with op_ret %d and op_errno %d: %s", - local->hashed_subvol->name, op_ret, op_errno, + local->hashed_subvol->name, GET_RET(op_ret), op_errno, uuid_utoa(local->loc.gfid)); if (local->linked == _gf_true) @@ -2064,7 +2065,7 @@ dht_lookup_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg(this->name, GF_LOG_INFO, 0, DHT_MSG_UNLINK_LOOKUP_INFO, "lookup_unlink returned with " "op_ret -> %d and op-errno -> %d for %s", - op_ret, op_errno, ((path == NULL) ? "null" : path)); + GET_RET(op_ret), op_errno, ((path == NULL) ? "null" : path)); this_call_cnt = dht_frame_return(frame); if (is_last_call(this_call_cnt)) { @@ -2092,11 +2093,11 @@ dht_lookup_unlink_of_false_linkto_cbk(call_frame_t *frame, void *cookie, gf_msg(this->name, GF_LOG_INFO, 0, DHT_MSG_UNLINK_LOOKUP_INFO, "lookup_unlink returned with " "op_ret -> %d and op-errno -> %d for %s", - op_ret, op_errno, ((path == NULL) ? "null" : path)); + GET_RET(op_ret), op_errno, ((path == NULL) ? "null" : path)); this_call_cnt = dht_frame_return(frame); if (is_last_call(this_call_cnt)) { - if ((op_ret == 0) || ((op_errno != EBUSY) && (op_errno != ENOTCONN))) { + if ((IS_SUCCESS(op_ret)) || ((op_errno != EBUSY) && (op_errno != ENOTCONN))) { dht_lookup_everywhere_done(frame, this); } else { /*When dht_lookup_everywhere is performed, one cached @@ -2152,7 +2153,7 @@ dht_lookup_unlink_stale_linkto_cbk(call_frame_t *frame, void *cookie, gf_msg(this->name, GF_LOG_INFO, 0, DHT_MSG_UNLINK_LOOKUP_INFO, "Returned with op_ret %d and " "op_errno %d for %s", - op_ret, op_errno, ((path == NULL) ? "null" : path)); + GET_RET(op_ret), op_errno, ((path == NULL) ? "null" : path)); DHT_STACK_UNWIND(lookup, frame, gf_failure, ENOENT, NULL, NULL, NULL, NULL); @@ -2209,7 +2210,7 @@ dht_linkfile_create_lookup_cbk(call_frame_t *frame, void *cookie, local = frame->local; if (subvol == local->hashed_subvol) { - if ((op_ret == 0) || (op_errno != ENOENT)) + if ((IS_SUCCESS(op_ret)) || (op_errno != ENOENT)) local->dont_create_linkto = _gf_true; } else { if (gf_uuid_is_null(local->gfid)) @@ -2217,7 +2218,7 @@ dht_linkfile_create_lookup_cbk(call_frame_t *frame, void *cookie, else gf_uuid_copy(gfid, local->gfid); - if ((op_ret == 0) && gf_uuid_compare(gfid, buf->ia_gfid)) { + if ((IS_SUCCESS(op_ret)) && gf_uuid_compare(gfid, buf->ia_gfid)) { gf_uuid_unparse(gfid, gfid_str); gf_msg_debug(this->name, 0, "gfid (%s) different on cached subvol " @@ -2225,7 +2226,7 @@ dht_linkfile_create_lookup_cbk(call_frame_t *frame, void *cookie, "creating linkto", uuid_utoa(buf->ia_gfid), subvol->name, gfid_str); local->dont_create_linkto = _gf_true; - } else if (op_ret == -1) { + } else if (IS_ERROR(op_ret)) { local->dont_create_linkto = _gf_true; } } @@ -2259,7 +2260,8 @@ dht_linkfile_create_lookup_cbk(call_frame_t *frame, void *cookie, local->loc.path, gfid_str, local->hashed_subvol->name, local->cached_subvol->name); - dht_lookup_linkfile_create_cbk(frame, NULL, this, 0, 0, local->loc.inode, + SET_RET(op_ret, 0); + dht_lookup_linkfile_create_cbk(frame, NULL, this, op_ret, 0, local->loc.inode, &local->stbuf, &local->preparent, &local->postparent, local->xattr); return 0; @@ -2281,7 +2283,7 @@ dht_call_lookup_linkfile_create(call_frame_t *frame, void *cookie, else gf_uuid_unparse(local->gfid, gfid); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_WARNING, "protecting namespace failed, skipping linkto " "creation (path:%s)(gfid:%s)(hashed-subvol:%s)" @@ -2305,7 +2307,9 @@ dht_call_lookup_linkfile_create(call_frame_t *frame, void *cookie, return 0; err: - dht_lookup_linkfile_create_cbk(frame, NULL, this, 0, 0, local->loc.inode, + + SET_RET(op_ret, 0); + dht_lookup_linkfile_create_cbk(frame, NULL, this, op_ret, 0, local->loc.inode, &local->stbuf, &local->preparent, &local->postparent, local->xattr); return 0; @@ -2377,7 +2381,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) DHT_STACK_UNWIND(lookup, frame, gf_failure, EIO, NULL, NULL, NULL, NULL); return 0; } - if (local->op_ret && local->gfid_missing) { + if (IS_ERROR(local->op_ret) && local->gfid_missing) { if (gf_uuid_is_null(local->gfid_req)) { DHT_STACK_UNWIND(lookup, frame, gf_failure, ENODATA, NULL, NULL, NULL, NULL); @@ -2505,14 +2509,14 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) cached_subvol->name); } - local->op_ret = (ret == 0) ? ret : -1; + SET_RET(local->op_ret, ((ret == 0) ? ret : -1)); local->op_errno = (ret == 0) ? ret : EINVAL; /* Presence of local->cached_subvol validates * that lookup from cached node is successful */ - if (!local->op_ret && local->loc.parent) { + if (IS_SUCCESS(local->op_ret) && local->loc.parent) { dht_inode_ctx_time_update(local->loc.parent, this, &local->postparent, 1); } @@ -2573,7 +2577,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) } } - local->op_ret = 0; + SET_RET(local->op_ret, 0); local->op_errno = 0; layout = dht_layout_for_subvol(this, cached_subvol); if (!layout) { @@ -2612,7 +2616,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) "hashed subvolume cannot be found, gfid = %s.", local->loc.path, cached_subvol->name, gfid); - local->op_ret = 0; + SET_RET(local->op_ret, 0); local->op_errno = 0; ret = dht_layout_preset(frame->this, cached_subvol, local->inode); @@ -2621,7 +2625,7 @@ dht_lookup_everywhere_done(call_frame_t *frame, xlator_t *this) "Failed to set layout for subvol %s" ", gfid = %s", cached_subvol ? cached_subvol->name : "", gfid); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; } @@ -2699,11 +2703,11 @@ dht_lookup_everywhere_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg_debug(this->name, 0, "returned with op_ret %d and op_errno %d (%s) " "from subvol %s", - op_ret, op_errno, loc->path, prev->name); + GET_RET(op_ret), op_errno, loc->path, prev->name); LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { if (op_errno != ENOENT) local->op_errno = op_errno; if (op_errno == ENODATA) @@ -2927,7 +2931,7 @@ dht_lookup_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_uuid_unparse(loc->gfid, gfid); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_INFO, op_errno, DHT_MSG_LINK_FILE_LOOKUP_INFO, "Lookup of %s on %s (following linkfile) failed " ",gfid = %s", @@ -2979,7 +2983,7 @@ dht_lookup_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "Failed to set layout for subvolume %s," "gfid = %s", prev->name, gfid); - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; } @@ -3080,9 +3084,9 @@ dht_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg_debug(this->name, op_errno, "%s: fresh_lookup on %s returned with op_ret %d", loc->path, - prev->name, op_ret); + prev->name, GET_RET(op_ret)); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { if (ENTRY_MISSING(op_ret, op_errno)) { if (1 == conf->subvolume_cnt) { /* No need to lookup again */ @@ -3154,7 +3158,7 @@ dht_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg(this->name, GF_LOG_INFO, 0, DHT_MSG_LAYOUT_PRESET_FAILED, "%s: could not set pre-set layout for subvolume %s", loc->path, prev->name); - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -3188,7 +3192,7 @@ dht_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, * from each of the subvolume. See dht_iatt_merge for reference. */ - if (!op_ret && local && local->loc.parent) { + if (IS_SUCCESS(op_ret) && local && local->loc.parent) { dht_inode_ctx_time_update(local->loc.parent, this, postparent, 1); } @@ -3605,7 +3609,7 @@ dht_unlink_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if ((op_ret == -1) && + if ((IS_ERROR(op_ret)) && !((op_errno == ENOENT) || (op_errno == ENOTCONN))) { local->op_errno = op_errno; UNLOCK(&frame->lock); @@ -3614,7 +3618,7 @@ dht_unlink_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto post_unlock; } - local->op_ret = 0; + SET_RET(local->op_ret, 0); } UNLOCK(&frame->lock); post_unlock: @@ -3640,12 +3644,12 @@ dht_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { if (op_errno != ENOENT) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; } else { - local->op_ret = 0; + SET_RET(local->op_ret, 0); } UNLOCK(&frame->lock); gf_msg_debug(this->name, op_errno, @@ -3653,7 +3657,7 @@ dht_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto post_unlock; } - local->op_ret = 0; + SET_RET(local->op_ret, 0); local->postparent = *postparent; local->preparent = *preparent; @@ -3667,7 +3671,7 @@ dht_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } UNLOCK(&frame->lock); post_unlock: - if (!local->op_ret) { + if (IS_SUCCESS(local->op_ret)) { hashed_subvol = dht_subvol_get_hashed(this, &local->loc); if (hashed_subvol && hashed_subvol != local->cached_subvol) { /* @@ -3705,7 +3709,7 @@ dht_fix_layout_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_local_t *local = NULL; dht_layout_t *layout = NULL; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { /* update the layout in the inode ctx */ local = frame->local; layout = local->selfheal.layout; @@ -3730,7 +3734,7 @@ dht_err_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; UNLOCK(&frame->lock); gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", @@ -3738,7 +3742,7 @@ dht_err_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto post_unlock; } - local->op_ret = 0; + SET_RET(local->op_ret, 0); } UNLOCK(&frame->lock); post_unlock: @@ -3799,30 +3803,31 @@ dht_common_mds_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret) + if (IS_ERROR(op_ret)) gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", prev->this->name); + SET_RET(op_ret, 0); if (local->fop == GF_FOP_SETXATTR) { - DHT_STACK_UNWIND(setxattr, frame, 0, op_errno, local->xdata); + DHT_STACK_UNWIND(setxattr, frame, op_ret, op_errno, local->xdata); /* 'local' itself may not be valid after this */ goto out; } if (local->fop == GF_FOP_FSETXATTR) { - DHT_STACK_UNWIND(fsetxattr, frame, 0, op_errno, local->xdata); + DHT_STACK_UNWIND(fsetxattr, frame, op_ret, op_errno, local->xdata); /* 'local' itself may not be valid after this */ goto out; } if (local->fop == GF_FOP_REMOVEXATTR) { - DHT_STACK_UNWIND(removexattr, frame, 0, op_errno, NULL); + DHT_STACK_UNWIND(removexattr, frame, op_ret, op_errno, NULL); /* 'local' itself may not be valid after this */ goto out; } if (local->fop == GF_FOP_FREMOVEXATTR) { - DHT_STACK_UNWIND(fremovexattr, frame, 0, op_errno, NULL); + DHT_STACK_UNWIND(fremovexattr, frame, op_ret, op_errno, NULL); } out: @@ -3850,7 +3855,7 @@ dht_setxattr_non_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret && !local->op_ret) { + if (IS_ERROR(op_ret) && IS_SUCCESS(local->op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; UNLOCK(&frame->lock); @@ -3864,7 +3869,7 @@ dht_setxattr_non_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, this_call_cnt = dht_frame_return(frame); if (is_last_call(this_call_cnt)) { - if (!local->op_ret) { + if (IS_SUCCESS(local->op_ret)) { xattrop = dict_new(); if (!xattrop) { gf_msg(this->name, GF_LOG_ERROR, DHT_MSG_NO_MEMORY, 0, @@ -3890,26 +3895,27 @@ dht_setxattr_non_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_XATTROP_ADD_ARRAY, xattrop, NULL); } } else { + SET_RET(op_ret, 0); if (local->fop == GF_FOP_SETXATTR) { - DHT_STACK_UNWIND(setxattr, frame, 0, 0, local->xdata); + DHT_STACK_UNWIND(setxattr, frame, op_ret, 0, local->xdata); /* 'local' itself may not be valid after this */ goto just_return; } if (local->fop == GF_FOP_FSETXATTR) { - DHT_STACK_UNWIND(fsetxattr, frame, 0, 0, local->xdata); + DHT_STACK_UNWIND(fsetxattr, frame, op_ret, 0, local->xdata); /* 'local' itself may not be valid after this */ goto just_return; } if (local->fop == GF_FOP_REMOVEXATTR) { - DHT_STACK_UNWIND(removexattr, frame, 0, 0, NULL); + DHT_STACK_UNWIND(removexattr, frame, op_ret, 0, NULL); /* 'local' itself may not be valid after this */ goto just_return; } if (local->fop == GF_FOP_FREMOVEXATTR) { - DHT_STACK_UNWIND(fremovexattr, frame, 0, 0, NULL); + DHT_STACK_UNWIND(fremovexattr, frame, op_ret, 0, NULL); /* 'local' itself may not be valid after this */ goto just_return; } @@ -3917,26 +3923,27 @@ dht_setxattr_non_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: if (ret) { + SET_RET(op_ret, 0); if (local->fop == GF_FOP_SETXATTR) { - DHT_STACK_UNWIND(setxattr, frame, 0, 0, local->xdata); + DHT_STACK_UNWIND(setxattr, frame, op_ret, 0, local->xdata); /* 'local' itself may not be valid after this */ goto just_return; } if (local->fop == GF_FOP_FSETXATTR) { - DHT_STACK_UNWIND(fsetxattr, frame, 0, 0, local->xdata); + DHT_STACK_UNWIND(fsetxattr, frame, op_ret, 0, local->xdata); /* 'local' itself may not be valid after this */ goto just_return; } if (local->fop == GF_FOP_REMOVEXATTR) { - DHT_STACK_UNWIND(removexattr, frame, 0, 0, NULL); + DHT_STACK_UNWIND(removexattr, frame, op_ret, 0, NULL); /* 'local' itself may not be valid after this */ goto just_return; } if (local->fop == GF_FOP_FREMOVEXATTR) { - DHT_STACK_UNWIND(fremovexattr, frame, 0, 0, NULL); + DHT_STACK_UNWIND(fremovexattr, frame, op_ret, 0, NULL); } } just_return: @@ -3960,7 +3967,7 @@ dht_setxattr_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, conf = this->private; mds_subvol = local->mds_subvol; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", @@ -3968,7 +3975,7 @@ dht_setxattr_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - local->op_ret = 0; + SET_RET(local->op_ret, 0); local->call_cnt = conf->subvolume_cnt - 1; local->xdata = dict_ref(xdata); @@ -4043,7 +4050,7 @@ dht_xattrop_mds_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; prev = cookie; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; local->op_ret = op_ret; gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", @@ -4157,7 +4164,7 @@ dht_vgetxattr_alloc_and_fill(dht_local_t *local, dict_t *xattr, xlator_t *this, if (ret) { gf_msg(this->name, GF_LOG_ERROR, op_errno, DHT_MSG_GET_XATTR_FAILED, "Subvolume %s returned -1", this->name); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; goto out; } @@ -4187,7 +4194,7 @@ dht_vgetxattr_alloc_and_fill(dht_local_t *local, dict_t *xattr, xlator_t *this, (void)strcat(local->xattr_val, value); (void)strcat(local->xattr_val, " "); - local->op_ret = 0; + SET_RET(local->op_ret, 0); ret = 0; @@ -4289,8 +4296,8 @@ dht_find_local_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { this_call_cnt = --local->call_cnt; - if (op_ret < 0) { - local->op_ret = -1; + if (IS_ERROR(op_ret)) { + local->op_ret = gf_failure; local->op_errno = op_errno; UNLOCK(&frame->lock); if (op_errno == ENODATA) @@ -4306,7 +4313,7 @@ dht_find_local_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (ret < 0) { gf_msg(this->name, GF_LOG_ERROR, 0, DHT_MSG_DICT_GET_FAILED, "Failed to get %s", local->xsel); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; goto unlock; } @@ -4324,7 +4331,7 @@ dht_find_local_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, uuid_str = next_uuid_str) { next_uuid_str = strtok_r(NULL, " ", &saveptr); if (gf_uuid_parse(uuid_str, node_uuid)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; UNLOCK(&frame->lock); gf_msg(this->name, GF_LOG_ERROR, 0, DHT_MSG_UUID_PARSE_ERROR, @@ -4353,7 +4360,7 @@ dht_find_local_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } if (!found) { - local->op_ret = 0; + SET_RET(local->op_ret, 0); goto unlock; } @@ -4383,18 +4390,19 @@ dht_find_local_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } - local->op_ret = 0; +SET_RET(local->op_ret, 0); unlock: UNLOCK(&frame->lock); post_unlock: if (!is_last_call(this_call_cnt)) goto out; - if (local->op_ret == -1) { + if (IS_ERROR(local->op_ret)) { goto unwind; } - DHT_STACK_UNWIND(getxattr, frame, 0, 0, xattr, xdata); + SET_RET(op_ret, 0); + DHT_STACK_UNWIND(getxattr, frame, op_ret, 0, xattr, xdata); goto out; unwind: @@ -4426,9 +4434,9 @@ dht_vgetxattr_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { this_call_cnt = --local->call_cnt; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { if (op_errno != ENOTCONN) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; UNLOCK(&frame->lock); gf_msg(this->name, GF_LOG_ERROR, op_errno, @@ -4455,7 +4463,7 @@ dht_vgetxattr_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* -- last call: do patch ups -- */ - if (local->op_ret == -1) { + if (IS_ERROR(local->op_ret)) { goto unwind; } @@ -4463,7 +4471,8 @@ dht_vgetxattr_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (ret) goto unwind; - DHT_STACK_UNWIND(getxattr, frame, 0, 0, dict, xdata); + SET_RET(op_ret, 0); + DHT_STACK_UNWIND(getxattr, frame, op_ret, 0, dict, xdata); goto cleanup; unwind: @@ -4489,8 +4498,8 @@ dht_vgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; prev = cookie; - if (op_ret < 0) { - local->op_ret = -1; + if (IS_ERROR(op_ret)) { + local->op_ret = gf_failure; local->op_errno = op_errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, DHT_MSG_GET_XATTR_FAILED, "vgetxattr: Subvolume %s returned -1", prev->name); @@ -4510,7 +4519,8 @@ dht_vgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (ret) goto unwind; - DHT_STACK_UNWIND(getxattr, frame, 0, 0, dict, xdata); + SET_RET(op_ret, 0); + DHT_STACK_UNWIND(getxattr, frame, op_ret, 0, dict, xdata); goto cleanup; unwind: @@ -4530,7 +4540,7 @@ dht_linkinfo_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int ret = 0; char *value = NULL; - if (op_ret != -1) { + if (IS_SUCCESS(op_ret)) { ret = dict_get_str(xattr, GF_XATTR_PATHINFO_KEY, &value); if (!ret) { ret = dict_set_str(xattr, GF_XATTR_LINKINFO_KEY, value); @@ -4559,12 +4569,12 @@ dht_mds_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, conf = this->private; local = frame->local; - if (!xattr || (op_ret == -1)) { + if (!xattr || (IS_ERROR(op_ret))) { local->op_ret = op_ret; goto out; } dict_del(xattr, conf->xattr_name); - local->op_ret = 0; +SET_RET(local->op_ret, 0); if (!local->xattr) { local->xattr = dict_copy_with_ref(xattr, NULL); @@ -4604,7 +4614,7 @@ dht_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (!xattr || (op_ret == -1)) { + if (!xattr || (IS_ERROR(op_ret))) { local->op_ret = op_ret; goto unlock; } @@ -4629,7 +4639,7 @@ dht_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_REMOVE_INTERNAL_XATTR("trusted.pgfid*", xattr); } - local->op_ret = 0; +SET_RET(local->op_ret, 0); if (!local->xattr) { local->xattr = dict_copy_with_ref(xattr, NULL); @@ -4652,7 +4662,7 @@ dht_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* If we have a valid xattr received from any one of the * subvolume, let's return it */ if (local->xattr) { - local->op_ret = 0; +SET_RET(local->op_ret, 0); } DHT_STACK_UNWIND(getxattr, frame, local->op_ret, op_errno, local->xattr, @@ -4692,7 +4702,7 @@ dht_getxattr_get_real_filename_cbk(call_frame_t *frame, void *cookie, goto unlock; } - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { if (op_errno == EOPNOTSUPP) { /* This subvol does not have the optimization. * Better let the user know we don't support it. @@ -4788,7 +4798,7 @@ dht_getxattr_get_real_filename(call_frame_t *frame, xlator_t *this, loc_t *loc, cnt = local->call_cnt = layout->cnt; - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOATTR; for (i = 0; i < cnt; i++) { @@ -4838,6 +4848,7 @@ dht_handle_debug_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, { dht_local_t *local = NULL; int ret = -1; + gf_return_t op_ret; int op_errno = ENODATA; char *value = NULL; loc_t file_loc = {0}; @@ -4893,7 +4904,8 @@ dht_handle_debug_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, out: loc_wipe(&file_loc); - DHT_STACK_UNWIND(getxattr, frame, ret, op_errno, local->xattr, NULL); + SET_RET(op_ret, ret); + DHT_STACK_UNWIND(getxattr, frame, op_ret, op_errno, local->xattr, NULL); return 0; } @@ -4913,6 +4925,7 @@ dht_vgetxattr_subvol_status(call_frame_t *frame, xlator_t *this, { dht_local_t *local = NULL; int ret = -1; + gf_return_t op_ret; int op_errno = ENODATA; int value = DHT_VXATTR_SUBVOLS_UP; int i = 0; @@ -4947,7 +4960,8 @@ dht_vgetxattr_subvol_status(call_frame_t *frame, xlator_t *this, ret = 0; out: - DHT_STACK_UNWIND(getxattr, frame, ret, op_errno, local->xattr, NULL); + SET_RET(op_ret, ret); + DHT_STACK_UNWIND(getxattr, frame, op_ret, op_errno, local->xattr, NULL); return 0; } @@ -5350,7 +5364,8 @@ dht_setxattr2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) return 0; err: - DHT_STACK_UNWIND(setxattr, frame, (local ? local->op_ret : -1), op_errno, + + DHT_STACK_UNWIND(setxattr, frame, (local ? local->op_ret : gf_failure), op_errno, NULL); return 0; } @@ -5379,7 +5394,7 @@ dht_file_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if ((op_ret == -1) && !dht_inode_missing(op_errno)) { + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) { gf_msg_debug(this->name, op_errno, "subvolume %s returned -1.", prev->name); goto out; @@ -5390,7 +5405,7 @@ dht_file_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = dict_get_bin(xdata, DHT_IATT_IN_XDATA_KEY, (void **)&stbuf); - if ((!op_ret) && !stbuf) { + if ((IS_SUCCESS(op_ret)) && !stbuf) { goto out; } @@ -5400,7 +5415,7 @@ dht_file_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->rebalance.xdata = dict_ref(xdata); /* Phase 2 of migration */ - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(stbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(stbuf)) { ret = dht_rebalance_complete_check(this, frame); if (!ret) return 0; @@ -5717,7 +5732,7 @@ dht_checking_pathinfo_cbk(call_frame_t *frame, void *cookie, xlator_t *this, prev = cookie; conf = this->private; - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto out; ret = dict_get_str(xattr, GF_XATTR_PATHINFO_KEY, &value); @@ -6103,7 +6118,7 @@ dht_file_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if ((op_ret == -1) && !dht_inode_missing(op_errno)) { + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) { gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", prev->name); goto out; @@ -6114,18 +6129,18 @@ dht_file_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = dict_get_bin(xdata, DHT_IATT_IN_XDATA_KEY, (void **)&stbuf); - if ((!op_ret) && !stbuf) { + if ((IS_SUCCESS(op_ret)) && !stbuf) { goto out; } - local->op_ret = 0; +SET_RET(local->op_ret, 0); local->rebalance.target_op_fn = dht_removexattr2; if (xdata) local->rebalance.xdata = dict_ref(xdata); /* Phase 2 of migration */ - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(stbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(stbuf)) { ret = dht_rebalance_complete_check(this, frame); if (!ret) return 0; @@ -6330,7 +6345,7 @@ dht_fd_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; UNLOCK(&frame->lock); gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", @@ -6338,7 +6353,7 @@ dht_fd_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto post_unlock; } - local->op_ret = 0; +SET_RET(local->op_ret, 0); } UNLOCK(&frame->lock); post_unlock: @@ -6395,16 +6410,16 @@ dht_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; goto unlock; } if (!statvfs) { op_errno = EINVAL; - local->op_ret = -1; + local->op_ret = gf_failure; goto unlock; } - local->op_ret = 0; +SET_RET(local->op_ret, 0); if (local->quota_deem_statfs) { if (event == _gf_true) { @@ -6632,6 +6647,7 @@ dht_populate_inode_for_dentry(xlator_t *this, xlator_t *subvol, { dht_layout_t *layout = NULL; int ret = 0; + gf_return_t op_ret = {0}; loc_t loc = { 0, }; @@ -6652,7 +6668,7 @@ dht_populate_inode_for_dentry(xlator_t *this, xlator_t *subvol, if (!layout) goto out; - ret = dht_layout_merge(this, layout, subvol, 0, 0, orig_entry->dict); + ret = dht_layout_merge(this, layout, subvol, op_ret, 0, orig_entry->dict); if (!ret) { ret = dht_layout_normalize(this, &loc, layout); if (ret == 0) { @@ -6710,7 +6726,7 @@ dht_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, methods = &(conf->methods); - if (op_ret <= 0) { + if (IS_ERROR(op_ret)) { goto done; } @@ -6910,7 +6926,7 @@ dht_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, * */ - op_ret = count; + SET_RET(op_ret, count); if (count == 0) { /* non-zero next_offset means that * EOF is not yet hit on the current subvol @@ -6953,8 +6969,8 @@ dht_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, * distribute we're not concerned only with a posix's view of the * directory but the aggregated namespace' view of the directory. */ - if (op_ret < 0) - op_ret = 0; + if (IS_ERROR(op_ret)) +SET_RET(op_ret, 0); if (prev != dht_last_up_subvol(this)) op_errno = 0; @@ -6994,7 +7010,7 @@ dht_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, methods = &(conf->methods); - if (op_ret <= 0) + if (IS_ERROR(op_ret)) goto done; if (!local->layout) @@ -7007,7 +7023,7 @@ dht_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (conf->subvolume_cnt == 1) { /*return everything*/ skip_hashed_check = _gf_true; - count = op_ret; + count = GET_RET(op_ret); goto done; } @@ -7041,7 +7057,7 @@ dht_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } done: - op_ret = count; + SET_RET(op_ret, count); /* We need to ensure that only the last subvolume's end-of-directory * notification is respected so that directory reading does not stop * before all subvolumes have been read. That could happen because the @@ -7116,7 +7132,7 @@ dht_do_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, local->size = size; local->xattr_req = (dict) ? dict_ref(dict) : NULL; local->first_up_subvol = dht_first_up_subvol(this); - local->op_ret = -1; + local->op_ret = gf_failure; dht_deitransform(this, yoff, &xvol); @@ -7224,10 +7240,10 @@ dht_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) + if (IS_ERROR(op_ret)) local->op_errno = op_errno; - else if (op_ret == 0) - local->op_ret = 0; + else if (IS_SUCCESS(op_ret)) +SET_RET(local->op_ret, 0); } UNLOCK(&frame->lock); this_call_cnt = dht_frame_return(frame); @@ -7287,12 +7303,12 @@ dht_newfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int ret = -1; dht_local_t *local = NULL; - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto out; local = frame->local; if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -7309,7 +7325,7 @@ dht_newfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg_debug(this->name, EINVAL, "could not set pre-set layout for subvolume %s", prev ? prev->name : NULL); - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -7330,9 +7346,9 @@ dht_newfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (local && local->lock[0].layout.parent_layout.locks) { /* store op_errno for failure case*/ local->op_errno = op_errno; - local->refresh_layout_unlock(frame, this, op_ret, 1); + local->refresh_layout_unlock(frame, this, GET_RET(op_ret), 1); - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { DHT_STACK_UNWIND(mknod, frame, op_ret, op_errno, inode, stbuf, preparent, postparent, xdata); } @@ -7362,7 +7378,7 @@ dht_mknod_linkfile_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto err; } - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; goto err; } @@ -7388,7 +7404,7 @@ dht_mknod_linkfile_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; err: if (local && local->lock[0].layout.parent_layout.locks) { - local->refresh_layout_unlock(frame, this, gf_failure, 1); + local->refresh_layout_unlock(frame, this, -1, 1); } else { DHT_STACK_UNWIND(mknod, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL); @@ -7487,7 +7503,7 @@ dht_mknod_do(call_frame_t *frame) local->params); return 0; err: - local->refresh_layout_unlock(frame, this, gf_failure, 1); + local->refresh_layout_unlock(frame, this, -1, 1); return 0; } @@ -7501,7 +7517,7 @@ dht_mknod_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } static int32_t -dht_mknod_finish(call_frame_t *frame, xlator_t *this, gf_return_t op_ret, +dht_mknod_finish(call_frame_t *frame, xlator_t *this, int ret, int invoke_cbk) { dht_local_t *local = NULL, *lock_local = NULL; @@ -7544,9 +7560,11 @@ dht_mknod_finish(call_frame_t *frame, xlator_t *this, gf_return_t op_ret, DHT_STACK_DESTROY(lock_frame); } - if (op_ret == 0) + if (ret >= 0) return 0; + gf_return_t op_ret; + SET_RET(op_ret, ret); DHT_STACK_UNWIND(mknod, frame, op_ret, local->op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -7564,7 +7582,7 @@ dht_mknod_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto err; } - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg("DHT", GF_LOG_ERROR, 0, DHT_MSG_INODE_LK_ERROR, "mknod lock failed for file: %s", local->loc2.name); @@ -7582,7 +7600,7 @@ dht_mknod_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; err: if (local) - dht_mknod_finish(frame, this, gf_failure, 0); + dht_mknod_finish(frame, this, -1, 0); else DHT_STACK_UNWIND(mknod, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL, NULL); @@ -7651,10 +7669,10 @@ dht_refresh_parent_layout_resume(call_frame_t *frame, xlator_t *this, int ret, parent_local = parent_frame->local; if (ret < 0) { - parent_local->op_ret = -1; + parent_local->op_ret = gf_failure; parent_local->op_errno = local->op_errno ? local->op_errno : EIO; } else { - parent_local->op_ret = 0; +SET_RET(parent_local->op_ret, 0); } call_resume(stub); @@ -7672,7 +7690,7 @@ dht_refresh_parent_layout_done(call_frame_t *frame) local = frame->local; - if (local->op_ret < 0) { + if (IS_ERROR(local->op_ret)) { ret = -1; goto resume; } @@ -7731,11 +7749,11 @@ dht_call_mkdir_stub(call_frame_t *frame, void *cookie, xlator_t *this, stub = local->stub; local->stub = NULL; - if (op_ret < 0) { - local->op_ret = -1; + if (IS_ERROR(op_ret)) { + local->op_ret = gf_failure; local->op_errno = op_errno; } else { - local->op_ret = 0; +SET_RET(local->op_ret, 0); } call_resume(stub); @@ -8120,7 +8138,7 @@ dht_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { /* Remove the linkto if exists */ if (local->linked) { cleanup_frame = create_frame(this, this->ctx->pool); @@ -8227,7 +8245,8 @@ dht_link2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) { dht_local_t *local = NULL; int op_errno = EINVAL; - + gf_return_t op_ret; + local = frame->local; if (!local) goto err; @@ -8260,7 +8279,8 @@ dht_link2(xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret) DHT_STRIP_PHASE1_FLAGS(&local->stbuf); dht_set_fixed_dir_stat(&local->preparent); dht_set_fixed_dir_stat(&local->postparent); - DHT_STACK_UNWIND(link, frame, 0, 0, local->inode, &local->stbuf, + SET_RET(op_ret, 0); + DHT_STACK_UNWIND(link, frame, op_ret, 0, local->inode, &local->stbuf, &local->preparent, &local->postparent, NULL); return 0; @@ -8287,7 +8307,7 @@ dht_link_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_local_t *local = NULL; xlator_t *srcvol = NULL; - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto err; local = frame->local; @@ -8390,12 +8410,12 @@ dht_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; parent_layout_changed = (xdata && dict_get(xdata, GF_PREOP_CHECK_FAILED)) @@ -8479,7 +8499,7 @@ dht_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (ret != 0) { gf_msg_debug(this->name, 0, "could not set preset layout for subvol %s", prev->name); - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -8499,9 +8519,9 @@ dht_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (local && local->lock[0].layout.parent_layout.locks) { /* store op_errno for failure case*/ local->op_errno = op_errno; - local->refresh_layout_unlock(frame, this, op_ret, 1); + local->refresh_layout_unlock(frame, this, GET_RET(op_ret), 1); - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { DHT_STACK_UNWIND(create, frame, op_ret, op_errno, fd, inode, stbuf, preparent, postparent, xdata); } @@ -8529,7 +8549,7 @@ dht_create_linkfile_create_cbk(call_frame_t *frame, void *cookie, goto err; } - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; goto err; } @@ -8555,7 +8575,7 @@ dht_create_linkfile_create_cbk(call_frame_t *frame, void *cookie, return 0; err: if (local && local->lock[0].layout.parent_layout.locks) { - local->refresh_layout_unlock(frame, this, gf_failure, 1); + local->refresh_layout_unlock(frame, this, -1, 1); } else { DHT_STACK_UNWIND(create, frame, gf_failure, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); @@ -8718,7 +8738,7 @@ dht_create_do(call_frame_t *frame) local->fd, local->params); return 0; err: - local->refresh_layout_unlock(frame, this, gf_failure, 1); + local->refresh_layout_unlock(frame, this, -1, 1); return 0; } @@ -8732,7 +8752,7 @@ dht_create_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } static int32_t -dht_create_finish(call_frame_t *frame, xlator_t *this, gf_return_t op_ret, +dht_create_finish(call_frame_t *frame, xlator_t *this, int ret, int invoke_cbk) { dht_local_t *local = NULL, *lock_local = NULL; @@ -8775,9 +8795,11 @@ dht_create_finish(call_frame_t *frame, xlator_t *this, gf_return_t op_ret, DHT_STACK_DESTROY(lock_frame); } - if (op_ret == 0) + if (ret >= 0) return 0; + gf_return_t op_ret; + SET_RET(op_ret, ret); DHT_STACK_UNWIND(create, frame, op_ret, local->op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; @@ -8795,7 +8817,7 @@ dht_create_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto err; } - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg("DHT", GF_LOG_ERROR, 0, DHT_MSG_INODE_LK_ERROR, "Create lock failed for file: %s", local->loc2.name); @@ -8813,7 +8835,7 @@ dht_create_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; err: if (local) - dht_create_finish(frame, this, gf_failure, 0); + dht_create_finish(frame, this, -1, 0); else DHT_STACK_UNWIND(create, frame, gf_failure, EINVAL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -9082,7 +9104,7 @@ dht_mkdir_selfheal_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_set_fixed_dir_stat(&local->preparent); dht_set_fixed_dir_stat(&local->postparent); - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { dht_layout_set(this, local->inode, layout); dht_inode_ctx_time_update(local->inode, this, &local->stbuf, 1); @@ -9124,10 +9146,10 @@ dht_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (subvol_filled && (op_ret != -1)) { + if (subvol_filled && IS_SUCCESS(op_ret)) { ret = dht_layout_merge(this, layout, prev, gf_failure, ENOSPC, NULL); } else { - if (op_ret == -1 && op_errno == EEXIST) { + if (IS_ERROR(op_ret) && op_errno == EEXIST) { /* Very likely just a race between mkdir and self-heal (from lookup of a concurrent mkdir attempt). @@ -9135,7 +9157,7 @@ dht_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, anyways fail if this was a different (old) pre-existing different directory. */ - op_ret = 0; +SET_RET(op_ret, 0); dir_exists = _gf_true; } ret = dht_layout_merge(this, layout, prev, op_ret, op_errno, NULL); @@ -9145,7 +9167,7 @@ dht_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%s: failed to merge layouts for subvol %s", local->loc.path, prev->name); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; goto unlock; } @@ -9183,7 +9205,7 @@ dht_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, { dht_local_t *local = NULL; dht_conf_t *conf = NULL; - int op_errno = gf_failure, ret = -1; + int op_errno = 1, ret = -1; xlator_t *hashed_subvol = NULL; int32_t *parent_disk_layout = NULL; dht_layout_t *parent_layout = NULL; @@ -9201,7 +9223,7 @@ dht_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, conf = this->private; local = frame->local; - if (local->op_ret == -1) { + if (IS_ERROR(local->op_ret)) { gf_msg(this->name, GF_LOG_WARNING, local->op_errno, DHT_MSG_PARENT_LAYOUT_CHANGED, "mkdir (%s/%s) (path: %s): refreshing parent layout " @@ -9212,7 +9234,7 @@ dht_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, goto err; } - local->op_ret = -1; + local->op_ret = gf_failure; hashed_subvol = dht_subvol_get_hashed(this, loc); if (hashed_subvol == NULL) { @@ -9325,10 +9347,10 @@ dht_mkdir_hashed_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_uuid_unparse(local->loc.parent->gfid, pgfid); - if (gf_uuid_is_null(local->loc.gfid) && !op_ret) + if (gf_uuid_is_null(local->loc.gfid) && IS_SUCCESS(op_ret)) gf_uuid_copy(local->loc.gfid, stbuf->ia_gfid); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; parent_layout_changed = (xdata && @@ -9376,7 +9398,7 @@ dht_mkdir_hashed_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%s: failed to merge layouts for subvol %s", local->loc.path, prev->name); - local->op_ret = 0; +SET_RET(local->op_ret, 0); dht_iatt_merge(this, &local->stbuf, stbuf); dht_iatt_merge(this, &local->preparent, preparent); @@ -9422,7 +9444,7 @@ dht_mkdir_hashed_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; err: - if (local->op_ret != 0) { + if (IS_ERROR(local->op_ret)) { dht_unlock_namespace(frame, &local->lock[0]); } @@ -9447,7 +9469,7 @@ dht_mkdir_guard_parent_layout_cbk(call_frame_t *frame, xlator_t *this, gf_uuid_unparse(loc->parent->gfid, pgfid); - if (local->op_ret < 0) { + if (IS_ERROR(local->op_ret)) { gf_msg(this->name, GF_LOG_WARNING, local->op_errno, DHT_MSG_PARENT_LAYOUT_CHANGED, "mkdir (%s/%s) (path: %s): " @@ -9457,7 +9479,7 @@ dht_mkdir_guard_parent_layout_cbk(call_frame_t *frame, xlator_t *this, goto err; } - local->op_ret = -1; + local->op_ret = gf_failure; /* Add internal MDS xattr on disk for hashed subvol */ ret = dht_dict_set_array(params, conf->mds_xattr_key, zero, 1); @@ -9626,9 +9648,9 @@ dht_rmdir_hashed_subvol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; - local->op_ret = -1; + local->op_ret = gf_failure; if (conf->subvolume_cnt != 1) { if (op_errno != ENOENT && op_errno != EACCES && op_errno != ESTALE) { @@ -9783,10 +9805,10 @@ dht_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { if ((op_errno != ENOENT) && (op_errno != ESTALE)) { local->op_errno = op_errno; - local->op_ret = -1; + local->op_ret = gf_failure; if (op_errno != EACCES) local->need_selfheal = 1; @@ -9850,7 +9872,7 @@ dht_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } else if (this_call_cnt) { /* If non-hashed subvol's have responded, proceed */ - if (local->op_ret == 0) { + if (IS_SUCCESS(local->op_ret)) { /* Delete the dir from the hashed subvol if: * The fop succeeded on at least one subvol * and did not fail on any @@ -9911,12 +9933,12 @@ dht_rmdir_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, conf = this->private; local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, op_errno, DHT_MSG_INODE_LK_ERROR, "acquiring entrylk after inodelk failed rmdir for %s)", local->loc.path); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; goto err; } @@ -9954,7 +9976,7 @@ dht_rmdir_do(call_frame_t *frame, xlator_t *this) VALIDATE_OR_GOTO(this->private, out); conf = this->private; - if (local->op_ret == -1) + if (IS_ERROR(local->op_ret)) goto out; local->call_cnt = conf->subvolume_cnt; @@ -9985,7 +10007,7 @@ dht_rmdir_do(call_frame_t *frame, xlator_t *this) ret = dht_protect_namespace(frame, &local->loc, local->hashed_subvol, &local->current->ns, dht_rmdir_lock_cbk); if (ret < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = errno ? errno : EINVAL; goto out; } @@ -10020,7 +10042,7 @@ dht_rmdir_readdirp_done(call_frame_t *readdirp_frame, xlator_t *this) * This is a bit hit or miss - if readdirp failed on more than * one subvol, we don't know which error is returned. */ - if (local->op_ret == -1) { + if (IS_ERROR(local->op_ret)) { main_local->op_ret = local->op_ret; main_local->op_errno = local->op_errno; } @@ -10045,7 +10067,7 @@ dht_rmdir_readdirp_do(call_frame_t *readdirp_frame, xlator_t *this) local = readdirp_frame->local; - if (local->op_ret == -1) { + if (IS_ERROR(local->op_ret)) { /* there is no point doing another readdirp on this * subvol . */ dht_rmdir_readdirp_done(readdirp_frame, this); @@ -10083,12 +10105,12 @@ dht_rmdir_linkfile_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_uuid_unparse(local->loc.gfid, gfid); - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { gf_msg_trace(this->name, 0, "Unlinked linkfile %s on %s, gfid = %s", local->loc.path, src->name, gfid); } else { if (op_errno != ENOENT) { - readdirp_local->op_ret = -1; + readdirp_local->op_ret = gf_failure; readdirp_local->op_errno = op_errno; } gf_msg_debug(this->name, op_errno, @@ -10128,14 +10150,14 @@ dht_rmdir_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, readdirp_frame = local->main_frame; readdirp_local = readdirp_frame->local; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, op_errno, DHT_MSG_FILE_LOOKUP_FAILED, "lookup failed for %s on %s", local->loc.path, src->name); goto err; } if (!check_is_linkfile(inode, stbuf, xattr, conf->link_xattr_name)) { - readdirp_local->op_ret = -1; + readdirp_local->op_ret = gf_failure; readdirp_local->op_errno = ENOTEMPTY; gf_uuid_unparse(local->loc.gfid, gfid); @@ -10185,15 +10207,15 @@ dht_rmdir_cached_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg_debug(this->name, 0, "returning for %s ", local->loc.path); - if (op_ret == 0) { - readdirp_local->op_ret = -1; + if (IS_SUCCESS(op_ret)) { + readdirp_local->op_ret = gf_failure; readdirp_local->op_errno = ENOTEMPTY; gf_msg(this->name, GF_LOG_WARNING, 0, DHT_MSG_SUBVOL_ERROR, "%s found on cached subvol %s", local->loc.path, src->name); goto err; } else if (op_errno != ENOENT) { - readdirp_local->op_ret = -1; + readdirp_local->op_ret = gf_failure; readdirp_local->op_errno = op_errno; gf_msg(this->name, GF_LOG_WARNING, op_errno, DHT_MSG_SUBVOL_ERROR, @@ -10382,7 +10404,7 @@ dht_rmdir_is_subvol_empty(call_frame_t *frame, xlator_t *this, LOCK(&frame->lock); { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOTEMPTY; local->call_cnt -= (count - ret); @@ -10416,7 +10438,7 @@ dht_rmdir_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, prev = cookie; src = prev; - if (op_ret > 2) { + if (GET_RET(op_ret) > 2) { /* dht_rmdir_is_subvol_empty() may free the frame, * copy path for logging. */ @@ -10429,8 +10451,8 @@ dht_rmdir_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg_trace(this->name, 0, "readdir on %s for %s returned %d " "entries", - prev->name, local->loc.path, op_ret); - local->op_ret = -1; + prev->name, local->loc.path, GET_RET(op_ret)); + local->op_ret = gf_failure; local->op_errno = ENOTEMPTY; break; default: @@ -10471,7 +10493,7 @@ dht_rmdir_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, prev = cookie; this_call_cnt = dht_frame_return(frame); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_uuid_unparse(local->loc.gfid, gfid); gf_msg_debug(this->name, op_errno, @@ -10479,7 +10501,7 @@ dht_rmdir_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "gfid = %s,", prev->name, local->loc.path, gfid); if ((op_errno != ENOENT) && (op_errno != ESTALE)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; } goto err; @@ -10488,14 +10510,14 @@ dht_rmdir_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!is_last_call(this_call_cnt)) return 0; - if (local->op_ret == -1) + if (IS_ERROR(local->op_ret)) goto err; fd_bind(fd); dict = dict_new(); if (!dict) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -10534,7 +10556,7 @@ dht_rmdir_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, continue; } readdirp_local->main_frame = frame; - readdirp_local->op_ret = 0; +SET_RET(readdirp_local->op_ret, 0); readdirp_local->xattr = dict_ref(dict); /* overload this field to save the subvol info */ readdirp_local->hashed_subvol = conf->subvolumes[i]; @@ -10590,7 +10612,7 @@ dht_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, } local->call_cnt = conf->subvolume_cnt; - local->op_ret = 0; +SET_RET(local->op_ret, 0); local->fop_succeeded = 0; local->flags = flags; @@ -10766,11 +10788,11 @@ dht_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret < 0 && op_errno != ENOTCONN) { + if (IS_ERROR(op_ret) && op_errno != ENOTCONN) { local->op_errno = op_errno; goto unlock; } - local->op_ret = 0; + SET_RET(local->op_ret, 0); } unlock: UNLOCK(&frame->lock); @@ -11337,7 +11359,7 @@ dht_pt_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (!op_ret) { + if (IS_SUCCESS(op_ret)) { dht_layout_set(this, inode, local->layout); } diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index df5997aecb..a4097c81d6 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -62,7 +62,7 @@ typedef int (*dht_defrag_cbk_fn_t)(xlator_t *this, xlator_t *dst_node, call_frame_t *frame, int ret); typedef int (*dht_refresh_layout_unlock)(call_frame_t *frame, xlator_t *this, - gf_return_t op_ret, int invoke_cbk); + int ret, int invoke_cbk); typedef int (*dht_refresh_layout_done_handle)(call_frame_t *frame); @@ -356,7 +356,7 @@ struct dht_local { int32_t parent_disk_layout[4]; /* rename rollback */ - int *ret_cache; + gf_return_t *ret_cache; loc_t loc2_copy; @@ -763,7 +763,7 @@ typedef struct dht_fd_ctx { GF_REF_DECL; } dht_fd_ctx_t; -#define ENTRY_MISSING(op_ret, op_errno) (op_ret == -1 && op_errno == ENOENT) +#define ENTRY_MISSING(op_ret, op_errno) (IS_ERROR(op_ret) && op_errno == ENOENT) #define is_revalidate(loc) \ (dht_inode_ctx_layout_get((loc)->inode, this, NULL) == 0) @@ -1311,7 +1311,7 @@ int dht_heal_full_path(void *data); int -dht_heal_full_path_done(gf_return_t op_ret, call_frame_t *frame, void *data); +dht_heal_full_path_done(int ret, call_frame_t *frame, void *data); int dht_layout_missing_dirs(dht_layout_t *layout); diff --git a/xlators/cluster/dht/src/dht-diskusage.c b/xlators/cluster/dht/src/dht-diskusage.c index 992fcadfd6..f6daa57207 100644 --- a/xlators/cluster/dht/src/dht-diskusage.c +++ b/xlators/cluster/dht/src/dht-diskusage.c @@ -33,7 +33,7 @@ dht_du_info_cbk(call_frame_t *frame, void *cookie, xlator_t *this, conf = this->private; prev = cookie; - if (op_ret == -1 || !statvfs) { + if (IS_ERROR(op_ret) || !statvfs) { gf_msg(this->name, GF_LOG_WARNING, op_errno, DHT_MSG_GET_DISK_INFO_ERROR, "failed to get disk info from %s", prev->name); diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index a29e279c8b..e7deda7ffc 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -830,7 +830,7 @@ dht_local_init(call_frame_t *frame, loc_t *loc, fd_t *fd, glusterfs_fop_t fop) inode = fd->inode; } - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EUCLEAN; local->fop = fop; @@ -1238,7 +1238,7 @@ dht_init_subvolumes(xlator_t *this, dht_conf_t *conf) */ static int -dht_migration_complete_check_done(gf_return_t op_ret, call_frame_t *frame, +dht_migration_complete_check_done(int ret, call_frame_t *frame, void *data) { dht_local_t *local = NULL; @@ -1246,7 +1246,7 @@ dht_migration_complete_check_done(gf_return_t op_ret, call_frame_t *frame, local = frame->local; - if (op_ret != 0) + if (ret != 0) goto out; if (local->cached_subvol == NULL) { @@ -1257,7 +1257,7 @@ dht_migration_complete_check_done(gf_return_t op_ret, call_frame_t *frame, subvol = local->cached_subvol; out: - local->rebalance.target_op_fn(THIS, subvol, frame, op_ret); + local->rebalance.target_op_fn(THIS, subvol, frame, ret); return 0; } @@ -1517,7 +1517,7 @@ dht_rebalance_complete_check(xlator_t *this, call_frame_t *frame) 1 : File is being migrated but not by this DHT layer. */ static int -dht_inprogress_check_done(gf_return_t op_ret, call_frame_t *frame, void *data) +dht_inprogress_check_done(int ret, call_frame_t *frame, void *data) { dht_local_t *local = NULL; xlator_t *dst_subvol = NULL, *src_subvol = NULL; @@ -1525,7 +1525,7 @@ dht_inprogress_check_done(gf_return_t op_ret, call_frame_t *frame, void *data) local = frame->local; - if (op_ret != 0) + if (ret != 0) goto out; inode = local->loc.inode ? local->loc.inode : local->fd->inode; @@ -1540,7 +1540,7 @@ dht_inprogress_check_done(gf_return_t op_ret, call_frame_t *frame, void *data) } out: - local->rebalance.target_op_fn(THIS, dst_subvol, frame, op_ret); + local->rebalance.target_op_fn(THIS, dst_subvol, frame, ret); return 0; } @@ -2078,15 +2078,15 @@ dht_heal_full_path(void *data) } int -dht_heal_full_path_done(gf_return_t op_ret, call_frame_t *heal_frame, +dht_heal_full_path_done(int ret, call_frame_t *heal_frame, void *data) { call_frame_t *main_frame = NULL; dht_local_t *local = NULL; xlator_t *this = NULL; - int ret = -1; int op_errno = 0; - + gf_return_t op_ret; + local = heal_frame->local; main_frame = local->main_frame; local->main_frame = NULL; @@ -2103,7 +2103,8 @@ dht_heal_full_path_done(gf_return_t op_ret, call_frame_t *heal_frame, } } - DHT_STACK_UNWIND(lookup, main_frame, 0, 0, local->inode, &local->stbuf, + SET_RET(op_ret, 0); + DHT_STACK_UNWIND(lookup, main_frame, op_ret, 0, local->inode, &local->stbuf, local->xattr, &local->postparent); DHT_STACK_DESTROY(heal_frame); @@ -2232,7 +2233,7 @@ dht_lk_inode_unref(call_frame_t *frame, gf_return_t op_ret) switch (local->lock_type) { case F_RDLCK: case F_WRLCK: - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_uuid_unparse(inode->gfid, gfid); gf_msg_debug(this->name, 0, "lock request failed for gfid %s", gfid); @@ -2242,7 +2243,7 @@ dht_lk_inode_unref(call_frame_t *frame, gf_return_t op_ret) break; case F_UNLCK: - if (!op_ret) { + if (IS_SUCCESS(op_ret)) { inode_unref(inode); } else { gf_uuid_unparse(inode->gfid, gfid); diff --git a/xlators/cluster/dht/src/dht-inode-read.c b/xlators/cluster/dht/src/dht-inode-read.c index a4ca9abe38..68b40f1170 100644 --- a/xlators/cluster/dht/src/dht-inode-read.c +++ b/xlators/cluster/dht/src/dht-inode-read.c @@ -40,19 +40,19 @@ dht_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, prev = cookie; local->op_errno = op_errno; - if ((op_ret == -1) && !dht_inode_missing(op_errno)) { + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) { gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", prev->name); goto out; } /* Update ctx if the fd has been opened on the target*/ - if (!op_ret && (local->call_cnt == 1)) { + if (IS_SUCCESS(op_ret) && (local->call_cnt == 1)) { dht_fd_ctx_set(this, fd, prev); goto out; } - if (!op_ret || (local->call_cnt != 1)) + if (IS_SUCCESS(op_ret) || (local->call_cnt != 1)) goto out; /* rebalance would have happened */ @@ -171,7 +171,7 @@ dht_file_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if ((op_ret == -1) && !dht_inode_missing(op_errno)) { + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) { local->op_errno = op_errno; gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", prev->name); @@ -185,7 +185,7 @@ dht_file_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->op_ret = op_ret; /* Check if the rebalance phase2 is true */ - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(stbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(stbuf)) { local->rebalance.target_op_fn = dht_attr2; dht_set_local_rebalance(this, local, NULL, NULL, stbuf, xdata); inode = (local->fd) ? local->fd->inode : local->loc.inode; @@ -272,7 +272,7 @@ dht_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; UNLOCK(&frame->lock); gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", @@ -283,7 +283,7 @@ dht_attr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_iatt_merge(this, &local->stbuf, stbuf); - local->op_ret = 0; + SET_RET(local->op_ret, 0); } UNLOCK(&frame->lock); post_unlock: @@ -424,7 +424,7 @@ dht_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -440,11 +440,11 @@ dht_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if ((op_ret == -1) && !dht_inode_missing(op_errno)) + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) goto out; local->op_errno = op_errno; - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(stbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(stbuf)) { local->op_ret = op_ret; local->rebalance.target_op_fn = dht_readv2; dht_set_local_rebalance(this, local, NULL, NULL, stbuf, xdata); @@ -576,7 +576,7 @@ dht_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; if (local->call_cnt != 1) goto out; - if ((op_ret == -1) && + if ((IS_ERROR(op_ret)) && ((op_errno == ENOTCONN) || dht_inode_missing(op_errno)) && IA_ISDIR(local->loc.inode->ia_type)) { subvol = dht_subvol_next_available(this, prev); @@ -593,7 +593,7 @@ dht_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->rebalance.flags, NULL); return 0; } - if ((op_ret == -1) && dht_inode_missing(op_errno) && + if ((IS_ERROR(op_ret)) && dht_inode_missing(op_errno) && !(IA_ISDIR(local->loc.inode->ia_type))) { /* File would be migrated to other node */ local->op_errno = op_errno; @@ -829,7 +829,7 @@ dht_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if (op_ret == -1 && !dht_inode_missing(op_errno)) { + if (IS_ERROR(op_ret) && !dht_inode_missing(op_errno)) { gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", prev->name); goto out; @@ -849,7 +849,7 @@ dht_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->rebalance.target_op_fn = dht_fsync2; dht_set_local_rebalance(this, local, NULL, prebuf, postbuf, xdata); - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(postbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(postbuf)) { ret = dht_rebalance_complete_check(this, frame); if (!ret) return 0; @@ -973,7 +973,7 @@ dht_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -1141,11 +1141,11 @@ dht_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_local_t *local = NULL; local = frame->local; - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto err; if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; } @@ -1241,7 +1241,7 @@ dht_common_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->op_errno = op_errno; - if ((op_ret == -1) && !dht_inode_missing(op_errno)) { + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) { gf_msg_debug(this->name, op_errno, "subvolume %s returned -1.", prev->name); goto out; @@ -1259,7 +1259,7 @@ dht_common_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = dht_read_iatt_from_xdata(xdata, &stbuf); - if ((!op_ret) && (ret)) { + if (IS_SUCCESS(op_ret) && (ret)) { /* This is a potential problem and can cause corruption * with sharding. * Oh well. We tried. @@ -1276,7 +1276,7 @@ dht_common_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->rebalance.dict = dict_ref(dict); /* Phase 2 of migration */ - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(&stbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(&stbuf)) { ret = dht_rebalance_complete_check(this, frame); if (!ret) return 0; diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c index f7bc8ef7e5..e679cedf62 100644 --- a/xlators/cluster/dht/src/dht-inode-write.c +++ b/xlators/cluster/dht/src/dht-inode-write.c @@ -38,7 +38,7 @@ dht_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, prev = cookie; if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -56,9 +56,9 @@ dht_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if (op_ret == -1 && !dht_inode_missing(op_errno)) { + if (IS_ERROR(op_ret) && !dht_inode_missing(op_errno)) { local->op_errno = op_errno; - local->op_ret = -1; + local->op_ret = gf_failure; gf_msg_debug(this->name, 0, "subvolume %s returned -1 (%s)", prev->name, strerror(op_errno)); goto out; @@ -85,7 +85,7 @@ dht_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_set_local_rebalance(this, local, NULL, prebuf, postbuf, xdata); /* Phase 2 of migration */ - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(postbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(postbuf)) { ret = dht_rebalance_complete_check(this, frame); if (!ret) return 0; @@ -100,7 +100,7 @@ dht_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg(this->name, GF_LOG_ERROR, DHT_MSG_NO_MEMORY, ENOMEM, "insufficient memory"); local->op_errno = ENOMEM; - local->op_ret = -1; + local->op_ret = gf_failure; goto out; } } @@ -112,7 +112,7 @@ dht_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "Failed to set key %s in dictionary", GF_PROTECT_FROM_EXTERNAL_WRITES); local->op_errno = ENOMEM; - local->op_ret = -1; + local->op_ret = gf_failure; goto out; } } @@ -270,9 +270,9 @@ dht_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if ((op_ret == -1) && !dht_inode_missing(op_errno)) { + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) { local->op_errno = op_errno; - local->op_ret = -1; + local->op_ret = gf_failure; gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", prev->name); @@ -299,7 +299,7 @@ dht_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_set_local_rebalance(this, local, NULL, prebuf, postbuf, xdata); /* Phase 2 of migration */ - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(postbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(postbuf)) { ret = dht_rebalance_complete_check(this, frame); if (!ret) return 0; @@ -496,9 +496,9 @@ dht_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if ((op_ret == -1) && !dht_inode_missing(op_errno)) { + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) { local->op_errno = op_errno; - local->op_ret = -1; + local->op_ret = gf_failure; gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", prev->name); @@ -520,7 +520,7 @@ dht_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_set_local_rebalance(this, local, NULL, prebuf, postbuf, xdata); /* Phase 2 of migration */ - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(postbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(postbuf)) { ret = dht_rebalance_complete_check(this, frame); if (!ret) return 0; @@ -673,9 +673,9 @@ dht_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if ((op_ret == -1) && !dht_inode_missing(op_errno)) { + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) { local->op_errno = op_errno; - local->op_ret = -1; + local->op_ret = gf_failure; gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", prev->name); @@ -697,7 +697,7 @@ dht_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_set_local_rebalance(this, local, NULL, prebuf, postbuf, xdata); /* Phase 2 of migration */ - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(postbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(postbuf)) { ret = dht_rebalance_complete_check(this, frame); if (!ret) return 0; @@ -845,9 +845,9 @@ dht_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if ((op_ret == -1) && !dht_inode_missing(op_errno)) { + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) { local->op_errno = op_errno; - local->op_ret = -1; + local->op_ret = gf_failure; gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", prev->name); goto out; @@ -868,7 +868,7 @@ dht_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_set_local_rebalance(this, local, NULL, prebuf, postbuf, xdata); /* Phase 2 of migration */ - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(postbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(postbuf)) { ret = dht_rebalance_complete_check(this, frame); if (!ret) return 0; @@ -1013,7 +1013,7 @@ dht_file_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - if ((op_ret == -1) && !dht_inode_missing(op_errno)) { + if ((IS_ERROR(op_ret)) && !dht_inode_missing(op_errno)) { gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", prev->name); goto out; @@ -1028,7 +1028,7 @@ dht_file_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->rebalance.target_op_fn = dht_setattr2; /* Phase 2 of migration */ - if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2(postbuf)) { + if ((IS_ERROR(op_ret)) || IS_DHT_MIGRATION_PHASE2(postbuf)) { dht_set_local_rebalance(this, local, NULL, prebuf, postbuf, xdata); ret = dht_rebalance_complete_check(this, frame); @@ -1111,7 +1111,7 @@ dht_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; UNLOCK(&frame->lock); gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", @@ -1122,14 +1122,14 @@ dht_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_iatt_merge(this, &local->prebuf, statpre); dht_iatt_merge(this, &local->stbuf, statpost); - local->op_ret = 0; + SET_RET(local->op_ret, 0); local->op_errno = 0; } UNLOCK(&frame->lock); post_unlock: this_call_cnt = dht_frame_return(frame); if (is_last_call(this_call_cnt)) { - if (local->op_ret == 0) + if (IS_SUCCESS(local->op_ret)) dht_inode_ctx_time_set(local->loc.inode, this, &local->stbuf); DHT_STACK_UNWIND(setattr, frame, local->op_ret, local->op_errno, &local->prebuf, &local->stbuf, xdata); @@ -1151,7 +1151,7 @@ dht_non_mds_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; prev = cookie; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, op_errno, 0, 0, "subvolume %s returned -1", prev->name); goto post_unlock; @@ -1162,7 +1162,7 @@ dht_non_mds_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_iatt_merge(this, &local->prebuf, statpre); dht_iatt_merge(this, &local->stbuf, statpost); - local->op_ret = 0; + SET_RET(local->op_ret, 0); local->op_errno = 0; } UNLOCK(&frame->lock); @@ -1170,7 +1170,8 @@ dht_non_mds_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, this_call_cnt = dht_frame_return(frame); if (is_last_call(this_call_cnt)) { dht_inode_ctx_time_set(local->loc.inode, this, &local->stbuf); - DHT_STACK_UNWIND(setattr, frame, 0, 0, &local->prebuf, &local->stbuf, + SET_RET(op_ret, 0); + DHT_STACK_UNWIND(setattr, frame, op_ret, 0, &local->prebuf, &local->stbuf, xdata); } @@ -1197,7 +1198,7 @@ dht_mds_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, conf = this->private; mds_subvol = local->mds_subvol; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; gf_msg_debug(this->name, op_errno, "subvolume %s returned -1", @@ -1205,7 +1206,7 @@ dht_mds_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - local->op_ret = 0; + SET_RET(local->op_ret, 0); loc_stbuf = local->stbuf; dht_iatt_merge(this, &local->prebuf, statpre); dht_iatt_merge(this, &local->stbuf, statpost); diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index 0da274ad2d..e6c990242f 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -315,7 +315,7 @@ dht_layout_merge(xlator_t *this, dht_layout_t *layout, xlator_t *subvol, int disk_layout_len = 0; dht_conf_t *conf = this->private; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { err = op_errno; } @@ -330,7 +330,7 @@ dht_layout_merge(xlator_t *this, dht_layout_t *layout, xlator_t *subvol, } } - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { ret = 0; goto out; } diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c index 88c7af83f7..4befbbd593 100644 --- a/xlators/cluster/dht/src/dht-linkfile.c +++ b/xlators/cluster/dht/src/dht-linkfile.c @@ -27,7 +27,7 @@ dht_linkfile_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, prev = cookie; conf = this->private; - if (op_ret) + if (IS_ERROR(op_ret)) goto out; gf_uuid_unparse(local->loc.gfid, gfid); @@ -57,12 +57,12 @@ dht_linkfile_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (!op_ret) + if (IS_SUCCESS(op_ret)) local->linked = _gf_true; FRAME_SU_UNDO(frame, dht_local_t); - if (op_ret && (op_errno == EEXIST)) { + if (IS_ERROR(op_ret) && (op_errno == EEXIST)) { conf = this->private; subvol = cookie; if (!subvol) @@ -156,7 +156,7 @@ dht_linkfile_create(call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk, return 0; out: - local->linkfile.linkfile_cbk(frame, frame->this, frame->this, -1, ENOMEM, + local->linkfile.linkfile_cbk(frame, frame->this, frame->this, gf_failure, ENOMEM, loc->inode, NULL, NULL, NULL, NULL); if (need_unref && dict) @@ -178,7 +178,7 @@ dht_linkfile_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; subvol = cookie; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_uuid_unparse(local->loc.gfid, gfid); gf_smsg(this->name, GF_LOG_INFO, op_errno, DHT_MSG_UNLINK_FAILED, "path=%s", local->loc.path, "gfid=%s", gfid, "subvolume=%s", @@ -261,7 +261,7 @@ dht_linkfile_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; loc = &local->loc; - if (op_ret) + if (IS_ERROR(op_ret)) gf_smsg(this->name, GF_LOG_ERROR, op_errno, DHT_MSG_SETATTR_FAILED, "path=%s", (loc->path ? loc->path : "NULL"), "gfid=%s", uuid_utoa(local->gfid), NULL); diff --git a/xlators/cluster/dht/src/dht-lock.c b/xlators/cluster/dht/src/dht-lock.c index b1f9eebfb4..ceced1f4a8 100644 --- a/xlators/cluster/dht/src/dht-lock.c +++ b/xlators/cluster/dht/src/dht-lock.c @@ -313,7 +313,7 @@ dht_unlock_entrylk_done(call_frame_t *frame, void *cookie, xlator_t *this, gf_uuid_unparse(local->lock[0].ns.directory_ns.locks[0]->loc.inode->gfid, gfid); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, GF_LOG_WARNING, op_errno, DHT_MSG_UNLOCK_GFID_FAILED, "gfid=%s", gfid, "DHT_LAYOUT_HEAL_DOMAIN", NULL); @@ -337,7 +337,7 @@ dht_unlock_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, uuid_utoa_r(local->lock[0].ns.directory_ns.locks[lk_index]->loc.gfid, gfid); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, GF_LOG_WARNING, op_errno, DHT_MSG_UNLOCKING_FAILED, "name=%s", local->lock[0].ns.directory_ns.locks[lk_index]->xl->name, @@ -360,6 +360,7 @@ dht_unlock_entrylk(call_frame_t *frame, dht_lock_t **lk_array, int lk_count, { dht_local_t *local = NULL; int ret = -1, i = 0; + gf_return_t op_ret = {0}; call_frame_t *lock_frame = NULL; int call_cnt = 0; @@ -424,7 +425,7 @@ dht_unlock_entrylk(call_frame_t *frame, dht_lock_t **lk_array, int lk_count, /* no locks acquired, invoke entrylk_cbk */ if (ret == 0) - entrylk_cbk(frame, NULL, frame->this, 0, 0, NULL); + entrylk_cbk(frame, NULL, frame->this, op_ret, 0, NULL); return ret; } @@ -526,7 +527,7 @@ dht_blocking_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, lk_index = (long)cookie; local = frame->local; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { local->lock[0].ns.directory_ns.locks[lk_index]->locked = _gf_true; } else { switch (op_errno) { @@ -535,13 +536,13 @@ dht_blocking_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (local->lock[0] .ns.directory_ns.locks[lk_index] ->do_on_failure != IGNORE_ENOENT_ESTALE) { - local->lock[0].ns.directory_ns.op_ret = -1; + local->lock[0].ns.directory_ns.op_ret = gf_failure; local->lock[0].ns.directory_ns.op_errno = op_errno; goto cleanup; } break; default: - local->lock[0].ns.directory_ns.op_ret = -1; + local->lock[0].ns.directory_ns.op_ret = gf_failure; local->lock[0].ns.directory_ns.op_errno = op_errno; goto cleanup; } @@ -554,7 +555,7 @@ dht_blocking_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ; if (i == local->lock[0].ns.directory_ns.lk_count) { - local->lock[0].ns.directory_ns.op_ret = -1; + local->lock[0].ns.directory_ns.op_ret = gf_failure; local->lock[0].ns.directory_ns.op_errno = op_errno; } @@ -692,7 +693,7 @@ dht_unlock_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, lk_index = (long)cookie; local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { uuid_utoa_r(local->lock[0].layout.my_layout.locks[lk_index]->loc.gfid, gfid); @@ -723,7 +724,7 @@ dht_unlock_inodelk_done(call_frame_t *frame, void *cookie, xlator_t *this, gf_uuid_unparse(local->lock[0].layout.my_layout.locks[0]->loc.inode->gfid, gfid); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, GF_LOG_WARNING, op_errno, DHT_MSG_UNLOCK_GFID_FAILED, "DHT_LAYOUT_HEAL_DOMAIN gfid=%s", gfid, NULL); @@ -741,6 +742,7 @@ dht_unlock_inodelk(call_frame_t *frame, dht_lock_t **lk_array, int lk_count, struct gf_flock flock = { 0, }; + gf_return_t op_ret = {0}; int ret = -1, i = 0; call_frame_t *lock_frame = NULL; int call_cnt = 0; @@ -807,7 +809,7 @@ dht_unlock_inodelk(call_frame_t *frame, dht_lock_t **lk_array, int lk_count, /* no locks acquired, invoke inodelk_cbk */ if (ret == 0) - inodelk_cbk(frame, NULL, frame->this, 0, 0, NULL); + inodelk_cbk(frame, NULL, frame->this, op_ret, 0, NULL); return ret; } @@ -909,8 +911,8 @@ dht_nonblocking_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; lk_index = (long)cookie; - if (op_ret == -1) { - local->lock[0].layout.my_layout.op_ret = -1; + if (IS_ERROR(op_ret)) { + local->lock[0].layout.my_layout.op_ret = gf_failure; local->lock[0].layout.my_layout.op_errno = op_errno; if (local && local->lock[0].layout.my_layout.locks[lk_index]) { @@ -935,7 +937,7 @@ dht_nonblocking_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, out: call_cnt = dht_frame_return(frame); if (is_last_call(call_cnt)) { - if (local->lock[0].layout.my_layout.op_ret < 0) { + if (IS_ERROR(local->lock[0].layout.my_layout.op_ret)) { dht_inodelk_cleanup(frame); return 0; } @@ -1013,7 +1015,7 @@ dht_blocking_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, lk_index = (long)cookie; local = frame->local; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { local->lock[0].layout.my_layout.locks[lk_index]->locked = _gf_true; } else { switch (op_errno) { @@ -1028,7 +1030,7 @@ dht_blocking_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, .layout.my_layout.locks[lk_index] ->loc.gfid, gfid); - local->lock[0].layout.my_layout.op_ret = -1; + local->lock[0].layout.my_layout.op_ret = gf_failure; local->lock[0].layout.my_layout.op_errno = op_errno; gf_smsg(this->name, GF_LOG_ERROR, op_errno, DHT_MSG_INODELK_FAILED, "subvol=%s", @@ -1048,7 +1050,7 @@ dht_blocking_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, .layout.my_layout.locks[lk_index] ->loc.gfid, gfid); - local->lock[0].layout.my_layout.op_ret = -1; + local->lock[0].layout.my_layout.op_ret = gf_failure; local->lock[0].layout.my_layout.op_errno = op_errno; gf_smsg(this->name, GF_LOG_ERROR, op_errno, DHT_MSG_INODELK_FAILED, "subvol=%s", @@ -1064,7 +1066,7 @@ dht_blocking_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_uuid_unparse( local->lock[0].layout.my_layout.locks[lk_index]->loc.gfid, gfid); - local->lock[0].layout.my_layout.op_ret = -1; + local->lock[0].layout.my_layout.op_ret = gf_failure; local->lock[0].layout.my_layout.op_errno = op_errno; gf_smsg( this->name, GF_LOG_ERROR, op_errno, DHT_MSG_INODELK_FAILED, @@ -1082,7 +1084,7 @@ dht_blocking_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ; if (i == local->lock[0].layout.my_layout.lk_count) { - local->lock[0].layout.my_layout.op_ret = -1; + local->lock[0].layout.my_layout.op_ret = gf_failure; local->lock[0].layout.my_layout.op_errno = op_errno; } @@ -1190,7 +1192,7 @@ dht_protect_namespace_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dht_local_t *local = NULL; local = frame->local; - if (op_ret != 0) + if (IS_ERROR(op_ret)) dht_unlock_inodelk_wrapper(frame, &local->current->ns.parent_layout); local->current->ns.ns_cbk(frame, cookie, this, op_ret, op_errno, xdata); @@ -1213,8 +1215,8 @@ dht_blocking_entrylk_after_inodelk(call_frame_t *frame, void *cookie, local = frame->local; entrylk = &local->current->ns.directory_ns; - if (op_ret < 0) { - local->op_ret = -1; + if (IS_ERROR(op_ret)) { + local->op_ret = gf_failure; local->op_errno = op_errno; goto err; } @@ -1222,7 +1224,7 @@ dht_blocking_entrylk_after_inodelk(call_frame_t *frame, void *cookie, loc = &entrylk->locks[0]->loc; gf_uuid_unparse(loc->gfid, pgfid); - local->op_ret = 0; + SET_RET(local->op_ret, 0); lk_array = entrylk->locks; count = entrylk->lk_count; @@ -1230,7 +1232,7 @@ dht_blocking_entrylk_after_inodelk(call_frame_t *frame, void *cookie, dht_protect_namespace_cbk); if (ret < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EIO; gf_smsg(this->name, GF_LOG_WARNING, local->op_errno, DHT_MSG_ENTRYLK_FAILED_AFT_INODELK, "fop=%s", diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 8844d4cd65..95c61076a2 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -2357,29 +2357,32 @@ rebalance_task(void *data) } static int -rebalance_task_completion(gf_return_t op_ret, call_frame_t *sync_frame, +rebalance_task_completion(int ret, call_frame_t *sync_frame, void *data) { int32_t op_errno = EINVAL; - if (op_ret == -1) { + if (ret == -1) { /* Failure of migration process, mostly due to write process. as we can't preserve the exact errno, lets say there was no space to migrate-data */ op_errno = ENOSPC; - } else if (op_ret == 1) { + } else if (ret == 1) { /* migration didn't happen, but is not a failure, let the user understand that he doesn't have permission to migrate the file. */ - op_ret = -1; + ret = -1; op_errno = EPERM; - } else if (op_ret != 0) { - op_errno = -op_ret; - op_ret = -1; + } else if (ret != 0) { + op_errno = -ret; + ret = -1; } + /* */ + gf_return_t op_ret; + SET_RET(op_ret, ret); DHT_STACK_UNWIND(setxattr, sync_frame, op_ret, op_errno, NULL); return 0; } diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c index 6a957ce5fd..b8f3c51984 100644 --- a/xlators/cluster/dht/src/dht-rename.c +++ b/xlators/cluster/dht/src/dht-rename.c @@ -57,7 +57,8 @@ static void dht_rename_dir_unlock_dst(call_frame_t *frame, xlator_t *this) { dht_local_t *local = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret; + int ret; char src_gfid[GF_UUID_BUF_SIZE] = {0}; char dst_gfid[GF_UUID_BUF_SIZE] = {0}; @@ -67,10 +68,10 @@ dht_rename_dir_unlock_dst(call_frame_t *frame, xlator_t *this) dht_unlock_entrylk_wrapper(frame, &local->lock[1].ns.directory_ns); /* Unlock inodelk */ - op_ret = dht_unlock_inodelk(frame, local->lock[1].ns.parent_layout.locks, + ret = dht_unlock_inodelk(frame, local->lock[1].ns.parent_layout.locks, local->lock[1].ns.parent_layout.lk_count, dht_rename_unlock_cbk); - if (op_ret < 0) { + if (ret < 0) { uuid_utoa_r(local->loc.inode->gfid, src_gfid); if (local->loc2.inode) @@ -91,7 +92,8 @@ dht_rename_dir_unlock_dst(call_frame_t *frame, xlator_t *this) "stale locks left on bricks", local->loc.path, src_gfid, local->loc2.path, dst_gfid); - dht_rename_unlock_cbk(frame, NULL, this, 0, 0, NULL); + SET_RET(op_ret, 0); + dht_rename_unlock_cbk(frame, NULL, this, op_ret, 0, NULL); } return; @@ -125,7 +127,7 @@ dht_rename_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, subvol_cnt = dht_subvol_cnt(this, prev); local->ret_cache[subvol_cnt] = op_ret; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_uuid_unparse(local->loc.inode->gfid, gfid); gf_msg(this->name, GF_LOG_INFO, op_errno, DHT_MSG_RENAME_FAILED, @@ -155,23 +157,25 @@ dht_rename_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, * no contention. Therefore it's safe to manipulate or * deref local->call_cnt directly (without locking). */ - if (local->ret_cache[conf->subvolume_cnt] == 0) { + if (IS_SUCCESS(local->ret_cache[conf->subvolume_cnt])) { /* count errant subvols in last field of ret_cache */ for (i = 0; i < conf->subvolume_cnt; i++) { - if (local->ret_cache[i] != 0) - ++local->ret_cache[conf->subvolume_cnt]; + if (IS_ERROR(local->ret_cache[i])) { + int temp = GET_RET(local->ret_cache[conf->subvolume_cnt]); + SET_RET(local->ret_cache[conf->subvolume_cnt], (temp + 1)); + } } - if (local->ret_cache[conf->subvolume_cnt]) { + if (IS_SUCCESS(local->ret_cache[conf->subvolume_cnt])) { /* undoing the damage: * for all subvolumes, where rename * succeeded, we perform the reverse operation */ for (i = 0; i < conf->subvolume_cnt; i++) { - if (local->ret_cache[i] == 0) + if (IS_SUCCESS(local->ret_cache[i])) ++local->call_cnt; } for (i = 0; i < conf->subvolume_cnt; i++) { - if (local->ret_cache[i]) + if (IS_ERROR(local->ret_cache[i])) continue; STACK_WIND(frame, dht_rename_dir_cbk, conf->subvolumes[i], @@ -212,7 +216,7 @@ dht_rename_hashed_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; prev = cookie; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_uuid_unparse(local->loc.inode->gfid, gfid); gf_msg(this->name, GF_LOG_INFO, op_errno, DHT_MSG_RENAME_FAILED, @@ -267,10 +271,10 @@ dht_rename_dir_do(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret == -1) + if (IS_ERROR(local->op_ret)) goto err; - local->op_ret = 0; + SET_RET(local->op_ret, 0); STACK_WIND_COOKIE(frame, dht_rename_hashed_dir_cbk, local->dst_hashed, local->dst_hashed, local->dst_hashed->fops->rename, @@ -294,10 +298,10 @@ dht_rename_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; prev = cookie; - if (op_ret > 2) { + if (GET_RET(op_ret) > 2) { gf_msg_trace(this->name, 0, "readdir on %s for %s returned %d entries", - prev->name, local->loc.path, op_ret); - local->op_ret = -1; + prev->name, local->loc.path, GET_RET(op_ret)); + local->op_ret = gf_failure; local->op_errno = ENOTEMPTY; } @@ -323,7 +327,7 @@ dht_rename_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; prev = cookie; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_uuid_unparse(local->loc.inode->gfid, gfid); gf_msg(this->name, GF_LOG_INFO, op_errno, DHT_MSG_OPENDIR_FAILED, "opendir on %s for %s failed,(gfid = %s) ", prev->name, @@ -360,7 +364,7 @@ dht_rename_dir_lock2_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; conf = this->private; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { uuid_utoa_r(local->loc.inode->gfid, src_gfid); if (local->loc2.inode) @@ -373,7 +377,7 @@ dht_rename_dir_lock2_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->loc2.path, dst_gfid, local->dst_cached ? local->dst_cached->name : NULL); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; goto err; } @@ -384,7 +388,7 @@ dht_rename_dir_lock2_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto err; } - local->op_ret = 0; + SET_RET(local->op_ret, 0); if (!local->dst_cached) { dht_rename_dir_do(frame, this); @@ -419,7 +423,7 @@ dht_rename_dir_lock1_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { uuid_utoa_r(local->loc.inode->gfid, src_gfid); if (local->loc2.inode) @@ -432,7 +436,7 @@ dht_rename_dir_lock1_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->loc2.path, dst_gfid, local->dst_cached ? local->dst_cached->name : NULL); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; goto err; } @@ -475,7 +479,7 @@ static int dht_order_rename_lock(call_frame_t *frame, loc_t **loc, xlator_t **subvol) { int ret = 0; - gf_return_t op_ret = 0; + int op_ret = 0; dht_local_t *local = NULL; char *src = NULL; char *dst = NULL; @@ -561,7 +565,7 @@ dht_rename_dir(call_frame_t *frame, xlator_t *this) conf = frame->this->private; local = frame->local; - local->ret_cache = GF_CALLOC(conf->subvolume_cnt + 1, sizeof(int), + local->ret_cache = GF_CALLOC(conf->subvolume_cnt + 1, sizeof(gf_return_t), gf_dht_ret_cache_t); if (local->ret_cache == NULL) { @@ -700,8 +704,8 @@ dht_rename_track_for_changelog(xlator_t *this, dict_t *xattr, loc_t *oldloc, int dht_rename_unlock(call_frame_t *frame, xlator_t *this) { + int ret; dht_local_t *local = NULL; - gf_return_t op_ret = -1; char src_gfid[GF_UUID_BUF_SIZE] = {0}; char dst_gfid[GF_UUID_BUF_SIZE] = {0}; dht_ilock_wrap_t inodelk_wrapper = { @@ -712,8 +716,8 @@ dht_rename_unlock(call_frame_t *frame, xlator_t *this) inodelk_wrapper.locks = local->rename_inodelk_backward_compatible; inodelk_wrapper.lk_count = local->rename_inodelk_bc_count; - op_ret = dht_unlock_inodelk_wrapper(frame, &inodelk_wrapper); - if (op_ret < 0) { + ret = dht_unlock_inodelk_wrapper(frame, &inodelk_wrapper); + if (ret) { uuid_utoa_r(local->loc.inode->gfid, src_gfid); if (local->loc2.inode) @@ -781,7 +785,7 @@ dht_rename_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, this_call_cnt = dht_frame_return(frame); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, op_errno, DHT_MSG_UNLINK_FAILED, "%s: Rename: unlink on %s failed ", local->loc.path, prev->name); } @@ -1021,7 +1025,7 @@ dht_rename_links_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, main_frame = local->main_frame; /* TODO: Handle this case in lookup-optimize */ - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, op_errno, DHT_MSG_CREATE_LINK_FAILED, "link/file %s on %s failed", local->loc.path, prev->name); } @@ -1079,7 +1083,7 @@ dht_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, * lookup, the first case by a rebalance, like for all stale linkto * files */ - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { /* Critical failure: unable to rename the cached file */ if (prev == src_cached) { gf_msg(this->name, GF_LOG_WARNING, op_errno, DHT_MSG_RENAME_FAILED, @@ -1212,16 +1216,16 @@ dht_rename_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; prev = cookie; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_msg_debug(this->name, 0, "link/file on %s failed (%s)", prev->name, strerror(op_errno)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; local->added_link = _gf_false; } else dht_iatt_merge(this, &local->stbuf, stbuf); - if (local->op_ret == -1) + if (IS_ERROR(local->op_ret)) goto cleanup; dht_do_rename(frame); @@ -1250,16 +1254,16 @@ dht_rename_linkto_cbk(call_frame_t *frame, void *cookie, xlator_t *this, prev = cookie; src_cached = local->src_cached; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_msg_debug(this->name, 0, "link/file on %s failed (%s)", prev->name, strerror(op_errno)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; } /* If linkto creation failed move to failure cleanup code, * instead of continuing with creating the link file */ - if (local->op_ret != 0) { + if (IS_ERROR(local->op_ret)) { goto cleanup; } @@ -1300,14 +1304,14 @@ dht_rename_unlink_links_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; prev = cookie; - if ((op_ret == -1) && (op_errno != ENOENT)) { + if ((IS_ERROR(op_ret)) && (op_errno != ENOENT)) { gf_msg_debug(this->name, 0, "unlink of %s on %s failed (%s)", local->loc2.path, prev->name, strerror(op_errno)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; } - if (local->op_ret == -1) + if (IS_ERROR(local->op_ret)) goto cleanup; dht_do_rename(frame); @@ -1449,7 +1453,7 @@ dht_rename_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, else loc = &local->loc2; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { if (is_src) local->src_cached = dht_subvol_get_cached(this, local->loc.inode); else { @@ -1491,7 +1495,7 @@ dht_rename_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { if (is_src) { /* The meaning of is_linkfile is overloaded here. For locking * to work properly both rebalance and rename should acquire @@ -1528,7 +1532,7 @@ dht_rename_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->op_errno = ENOENT; } - if (!local->is_linkfile && (op_ret >= 0) && + if (!local->is_linkfile && IS_SUCCESS(op_ret) && gf_uuid_compare(loc->gfid, stbuf->ia_gfid)) { gf_uuid_unparse(loc->gfid, gfid_local); gf_uuid_unparse(stbuf->ia_gfid, gfid_server); @@ -1549,7 +1553,7 @@ dht_rename_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, call_cnt = dht_frame_return(frame); if (is_last_call(call_cnt)) { if (local->is_linkfile) { - local->op_ret = -1; + local->op_ret = gf_failure; goto fail; } @@ -1575,7 +1579,7 @@ dht_rename_file_lock1_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { uuid_utoa_r(local->loc.inode->gfid, src_gfid); if (local->loc2.inode) @@ -1590,7 +1594,7 @@ dht_rename_file_lock1_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->loc2.path, dst_gfid, local->dst_hashed ? local->dst_hashed->name : NULL); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; goto err; } @@ -1633,7 +1637,7 @@ dht_rename_file_protect_namespace(call_frame_t *frame, void *cookie, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { uuid_utoa_r(local->loc.inode->gfid, src_gfid); if (local->loc2.inode) @@ -1646,7 +1650,7 @@ dht_rename_file_protect_namespace(call_frame_t *frame, void *cookie, local->loc2.path, dst_gfid, local->dst_cached ? local->dst_cached->name : NULL); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; goto err; @@ -1684,6 +1688,7 @@ int32_t dht_rename_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { + int ret; dht_local_t *local = NULL; char src_gfid[GF_UUID_BUF_SIZE] = {0}; char dst_gfid[GF_UUID_BUF_SIZE] = {0}; @@ -1696,7 +1701,7 @@ dht_rename_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; conf = this->private; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { uuid_utoa_r(local->loc.inode->gfid, src_gfid); if (local->loc2.inode) @@ -1711,7 +1716,7 @@ dht_rename_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->loc2.path, dst_gfid, local->dst_hashed ? local->dst_hashed->name : NULL); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = op_errno; goto done; @@ -1719,15 +1724,15 @@ dht_rename_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, xattr_req = dict_new(); if (xattr_req == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto done; } - op_ret = dict_set_uint32(xattr_req, conf->link_xattr_name, 256); - if (op_ret < 0) { - local->op_ret = -1; - local->op_errno = -op_ret; + ret = dict_set_uint32(xattr_req, conf->link_xattr_name, 256); + if (ret) { + local->op_ret = gf_failure; + local->op_errno = -ret; goto done; } @@ -1960,7 +1965,7 @@ dht_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, if (IA_ISDIR(oldloc->inode->ia_type)) { dht_rename_dir(frame, this); } else { - local->op_ret = 0; + SET_RET(local->op_ret, 0); ret = dht_rename_lock(frame); if (ret < 0) { op_errno = ENOMEM; diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index 3529eaf2bf..51d3d69d68 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -78,6 +78,7 @@ dht_selfheal_dir_finish(call_frame_t *frame, xlator_t *this, int ret, dht_local_t *local = NULL, *lock_local = NULL; call_frame_t *lock_frame = NULL; int lock_count = 0; + gf_return_t op_ret; local = frame->local; @@ -115,8 +116,10 @@ dht_selfheal_dir_finish(call_frame_t *frame, xlator_t *this, int ret, lock_frame = NULL; done: + + SET_RET(op_ret, ret); if (invoke_cbk) - local->selfheal.dir_cbk(frame, NULL, frame->this, ret, local->op_errno, + local->selfheal.dir_cbk(frame, NULL, frame->this, op_ret, local->op_errno, NULL); if (lock_frame != NULL) { DHT_STACK_DESTROY(lock_frame); @@ -174,6 +177,7 @@ dht_refresh_layout_cbk(call_frame_t *frame, void *cookie, xlator_t *this, struct iatt *stbuf, dict_t *xattr, struct iatt *postparent) { + int ret; dht_local_t *local = NULL; int this_call_cnt = 0; xlator_t *prev = NULL; @@ -194,21 +198,22 @@ dht_refresh_layout_cbk(call_frame_t *frame, void *cookie, xlator_t *this, LOCK(&frame->lock); { - op_ret = dht_layout_merge(this, layout, prev, op_ret, op_errno, xattr); + ret = dht_layout_merge(this, layout, prev, op_ret, op_errno, xattr); dht_iatt_merge(this, &local->stbuf, stbuf); - if (op_ret == -1) { + if (ret == -1) { gf_uuid_unparse(local->loc.gfid, gfid); local->op_errno = op_errno; gf_smsg(this->name, GF_LOG_ERROR, op_errno, DHT_MSG_FILE_LOOKUP_FAILED, "path=%s", local->loc.path, "name=%s", prev->name, "gfid=%s", gfid, NULL); + SET_RET(op_ret, ret); goto unlock; } - local->op_ret = 0; + SET_RET(local->op_ret, 0); } unlock: UNLOCK(&frame->lock); @@ -216,7 +221,7 @@ dht_refresh_layout_cbk(call_frame_t *frame, void *cookie, xlator_t *this, this_call_cnt = dht_frame_return(frame); if (is_last_call(this_call_cnt)) { - if (local->op_ret == 0) { + if (IS_SUCCESS(local->op_ret)) { local->refresh_layout_done(frame); } else { goto err; @@ -253,7 +258,7 @@ dht_refresh_layout(call_frame_t *frame) call_cnt = conf->subvolume_cnt; local->call_cnt = call_cnt; - local->op_ret = -1; + local->op_ret = gf_failure; if (local->selfheal.refreshed_layout) { dht_layout_unref(this, local->selfheal.refreshed_layout); @@ -320,7 +325,7 @@ dht_selfheal_layout_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto err; } - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_errno = op_errno; goto err; } @@ -631,7 +636,7 @@ dht_selfheal_dir_xattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, layout = local->selfheal.layout; subvol = cookie; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { err = 0; } else { gf_uuid_unparse(local->loc.gfid, gfid); @@ -808,7 +813,7 @@ dht_selfheal_dir_xattr_persubvol(call_frame_t *frame, loc_t *loc, GF_FREE(disk_layout); - dht_selfheal_dir_xattr_cbk(frame, (void *)subvol, frame->this, -1, ENOMEM, + dht_selfheal_dir_xattr_cbk(frame, (void *)subvol, frame->this, gf_failure, ENOMEM, NULL); return 0; } @@ -1049,7 +1054,7 @@ dht_selfheal_dir_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, prev = cookie; subvol = prev; - if ((op_ret == 0) || ((op_ret == -1) && (op_errno == EEXIST))) { + if (IS_SUCCESS(op_ret) || (IS_ERROR(op_ret) && (op_errno == EEXIST))) { for (i = 0; i < layout->cnt; i++) { if (layout->list[i].xlator == subvol) { layout->list[i].err = -1; @@ -1058,7 +1063,7 @@ dht_selfheal_dir_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_uuid_unparse(local->loc.gfid, gfid); gf_smsg(this->name, ((op_errno == EEXIST) ? GF_LOG_DEBUG : GF_LOG_WARNING), @@ -1189,7 +1194,7 @@ dht_selfheal_dir_mkdir_lookup_cbk(call_frame_t *frame, void *cookie, LOCK(&frame->lock); { index = dht_layout_index_for_subvol(layout, prev); - if ((op_ret < 0) && (op_errno == ENOENT || op_errno == ESTALE)) { + if (IS_ERROR(op_ret) && (op_errno == ENOENT || op_errno == ESTALE)) { local->selfheal.hole_cnt = !local->selfheal.hole_cnt ? 1 : local->selfheal.hole_cnt + 1; @@ -1201,7 +1206,7 @@ dht_selfheal_dir_mkdir_lookup_cbk(call_frame_t *frame, void *cookie, } } - if (!op_ret) { + if (IS_SUCCESS(op_ret)) { dht_iatt_merge(this, &local->stbuf, stbuf); if (prev == local->mds_subvol) { dict_unref(local->xattr); @@ -1273,7 +1278,7 @@ dht_selfheal_dir_mkdir_lock_cbk(call_frame_t *frame, void *cookie, local->call_cnt = conf->subvolume_cnt; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { /* We get this error when the directory entry was not created * on a newky attached tier subvol. Hence proceed and do mkdir * on the tier subvol. @@ -1896,7 +1901,7 @@ dht_selfheal_new_directory(call_frame_t *frame, dht_selfheal_dir_cbk_t dir_cbk, out: if (ret < 0) { - dir_cbk(frame, NULL, frame->this, -1, op_errno, NULL); + dir_cbk(frame, NULL, frame->this, gf_failure, op_errno, NULL); } return 0; @@ -2311,7 +2316,7 @@ dht_update_commit_hash_for_layout_done(call_frame_t *frame, void *cookie, local = frame->local; /* preserve oldest error */ - if (op_ret && !local->op_ret) { + if (IS_ERROR(op_ret) && IS_SUCCESS(local->op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; } @@ -2325,6 +2330,7 @@ static int dht_update_commit_hash_for_layout_unlock(call_frame_t *frame, xlator_t *this) { dht_local_t *local = NULL; + gf_return_t op_ret; int ret = 0; local = frame->local; @@ -2334,15 +2340,16 @@ dht_update_commit_hash_for_layout_unlock(call_frame_t *frame, xlator_t *this) dht_update_commit_hash_for_layout_done); if (ret < 0) { /* preserve oldest error, just ... */ - if (!local->op_ret) { + if (IS_SUCCESS(local->op_ret)) { local->op_errno = errno; - local->op_ret = -1; + local->op_ret = gf_failure; } gf_smsg(this->name, GF_LOG_WARNING, errno, DHT_MSG_WIND_UNLOCK_FAILED, "path=%s", local->loc.path, NULL); - dht_update_commit_hash_for_layout_done(frame, NULL, this, 0, 0, NULL); + SET_RET(op_ret, 0); + dht_update_commit_hash_for_layout_done(frame, NULL, this, op_ret, 0, NULL); } return 0; @@ -2360,7 +2367,7 @@ dht_update_commit_hash_for_layout_cbk(call_frame_t *frame, void *cookie, LOCK(&frame->lock); /* store first failure, just because */ - if (op_ret && !local->op_ret) { + if (IS_ERROR(op_ret) && IS_SUCCESS(local->op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; } @@ -2392,7 +2399,7 @@ dht_update_commit_hash_for_layout_resume(call_frame_t *frame, void *cookie, count = conf->local_subvols_cnt; layout = local->layout; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto err_done; } @@ -2473,7 +2480,7 @@ dht_update_commit_hash_for_layout_resume(call_frame_t *frame, void *cookie, /* wind the setting of the commit hash across the local subvols */ local->call_cnt = count; - local->op_ret = 0; + SET_RET(local->op_ret, 0); local->op_errno = 0; for (i = 0; i < count; i++) { STACK_WIND(frame, dht_update_commit_hash_for_layout_cbk, @@ -2498,15 +2505,16 @@ dht_update_commit_hash_for_layout_resume(call_frame_t *frame, void *cookie, GF_FREE(disk_layout); - local->op_ret = -1; + local->op_ret = gf_failure; dht_update_commit_hash_for_layout_unlock(frame, this); return 0; err_done: - local->op_ret = -1; - dht_update_commit_hash_for_layout_done(frame, NULL, this, 0, 0, NULL); + local->op_ret = gf_failure; + SET_RET(op_ret, 0); + dht_update_commit_hash_for_layout_done(frame, NULL, this, op_ret, 0, NULL); return 0; } From 3c9d6399d27acded128c51a68a954253118f7fd9 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 15 Sep 2020 14:49:15 +0530 Subject: [PATCH 11/24] nufa/switch: compile success Change-Id: I63b15901787097373ef408be11befbfb3333374f Signed-off-by: Amar Tumballi --- xlators/cluster/dht/src/nufa.c | 14 +++++++------- xlators/cluster/dht/src/switch.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c index 7647f13d43..1ad634ad3e 100644 --- a/xlators/cluster/dht/src/nufa.c +++ b/xlators/cluster/dht/src/nufa.c @@ -45,7 +45,7 @@ nufa_local_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto out; is_linkfile = check_is_linkfile(inode, stbuf, xattr, conf->link_xattr_name); @@ -59,7 +59,7 @@ nufa_local_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "could not set pre-set layout for subvol" " %s", prev->name); - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto err; } @@ -74,12 +74,12 @@ nufa_local_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->inode = inode_ref(inode); local->xattr = dict_ref(xattr); - local->op_ret = 0; + SET_RET(local->op_ret, 0); local->op_errno = 0; local->layout = dht_layout_new(this, conf->subvolume_cnt); if (!local->layout) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto err; } @@ -253,7 +253,7 @@ nufa_create_linkfile_create_cbk(call_frame_t *frame, void *cookie, local = frame->local; - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto err; STACK_WIND_COOKIE(frame, dht_create_cbk, local->cached_subvol, @@ -346,11 +346,11 @@ nufa_mknod_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; if (!local || !local->cached_subvol) { op_errno = EINVAL; - op_ret = -1; + op_ret = gf_failure; goto err; } - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { STACK_WIND_COOKIE( frame, dht_newfile_cbk, (void *)local->cached_subvol, local->cached_subvol, local->cached_subvol->fops->mknod, diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c index 9fdb5e426e..92bded473d 100644 --- a/xlators/cluster/dht/src/switch.c +++ b/xlators/cluster/dht/src/switch.c @@ -126,7 +126,7 @@ switch_local_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto out; is_linkfile = check_is_linkfile(inode, stbuf, xattr, conf->link_xattr_name); @@ -141,7 +141,7 @@ switch_local_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "could not set pre-set layout " "for subvol %s", prev->name); - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto err; } @@ -156,12 +156,12 @@ switch_local_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->inode = inode_ref(inode); local->xattr = dict_ref(xattr); - local->op_ret = 0; + SET_RET(local->op_ret, 0); local->op_errno = 0; local->layout = dht_layout_new(this, conf->subvolume_cnt); if (!local->layout) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg_debug(this->name, 0, "memory allocation failed :("); goto err; @@ -359,7 +359,7 @@ switch_create_linkfile_create_cbk(call_frame_t *frame, void *cookie, local = frame->local; - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto err; STACK_WIND_COOKIE(frame, dht_create_cbk, local->cached_subvol, @@ -451,11 +451,11 @@ switch_mknod_linkfile_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; if (!local || !local->cached_subvol) { op_errno = EINVAL; - op_ret = -1; + op_ret = gf_failure; goto err; } - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { STACK_WIND_COOKIE( frame, dht_newfile_cbk, (void *)local->cached_subvol, local->cached_subvol, local->cached_subvol->fops->mknod, From dc4884f847cada3845fb0816f978e601509fbf6a Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 15 Sep 2020 14:59:16 +0530 Subject: [PATCH 12/24] meta/: compile success Change-Id: Ibb28c249b80aeddf42d64fef7f44d1e90146cbdf Signed-off-by: Amar Tumballi --- libglusterfs/src/globals.c | 1 + libglusterfs/src/glusterfs/globals.h | 1 + libglusterfs/src/libglusterfs.sym | 1 + xlators/meta/src/meta-defaults.c | 32 +++++++++++++++++----------- xlators/meta/src/meta-helpers.c | 2 +- xlators/meta/src/meta.c | 2 +- 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/libglusterfs/src/globals.c b/libglusterfs/src/globals.c index 69218f34ef..d104292b5c 100644 --- a/libglusterfs/src/globals.c +++ b/libglusterfs/src/globals.c @@ -94,6 +94,7 @@ const char *gf_xlator_list[GF_XLATOR_MAXVALUE] = { }; const gf_return_t gf_failure = { -1 }; +const gf_return_t gf_zero_ret = { 0 }; /* THIS */ diff --git a/libglusterfs/src/glusterfs/globals.h b/libglusterfs/src/glusterfs/globals.h index 80fbf5492d..cd73b64f13 100644 --- a/libglusterfs/src/glusterfs/globals.h +++ b/libglusterfs/src/glusterfs/globals.h @@ -143,6 +143,7 @@ glusterfs_this_set(xlator_t *); extern xlator_t global_xlator; extern struct volume_options global_xl_options[]; extern const gf_return_t gf_failure; +extern const gf_return_t gf_zero_ret; /* syncopctx */ void * diff --git a/libglusterfs/src/libglusterfs.sym b/libglusterfs/src/libglusterfs.sym index 3e0195e9b0..36bd403bc7 100644 --- a/libglusterfs/src/libglusterfs.sym +++ b/libglusterfs/src/libglusterfs.sym @@ -746,6 +746,7 @@ gf_vasprintf gf_volfile_reconfigure gf_xxh64_wrapper gf_zero_fill_stat +gf_zero_ret gid_cache_add gid_cache_init gid_cache_lookup diff --git a/xlators/meta/src/meta-defaults.c b/xlators/meta/src/meta-defaults.c index bb313524fe..71b480feee 100644 --- a/xlators/meta/src/meta-defaults.c +++ b/xlators/meta/src/meta-defaults.c @@ -55,7 +55,7 @@ int meta_default_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, dict_t *xdata) { - META_STACK_UNWIND(opendir, frame, 0, 0, fd, xdata); + META_STACK_UNWIND(opendir, frame, gf_zero_ret, 0, fd, xdata); return 0; } @@ -66,7 +66,7 @@ meta_default_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) meta_iatt_fill(&iatt, fd->inode, fd->inode->ia_type); - META_STACK_UNWIND(fstat, frame, 0, 0, &iatt, xdata); + META_STACK_UNWIND(fstat, frame, gf_zero_ret, 0, &iatt, xdata); return 0; } @@ -81,7 +81,7 @@ meta_default_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, int meta_default_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - META_STACK_UNWIND(flush, frame, 0, 0, xdata); + META_STACK_UNWIND(flush, frame, gf_zero_ret, 0, xdata); return 0; } @@ -93,6 +93,7 @@ meta_default_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct meta_ops *ops = NULL; int ret = 0; struct iatt dummy = {}; + gf_return_t op_ret; ops = meta_ops_get(fd->inode, this); if (!ops) @@ -103,7 +104,8 @@ meta_default_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, ret = ops->file_write(this, fd, vector, count); - META_STACK_UNWIND(writev, frame, (ret >= 0 ? ret : -1), + SET_RET(op_ret, ret); + META_STACK_UNWIND(writev, frame, (IS_SUCCESS(op_ret) ? op_ret : gf_failure), (ret < 0 ? -ret : 0), &dummy, &dummy, xdata); return 0; err: @@ -121,6 +123,7 @@ meta_default_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t copy_offset = 0; int copy_size = 0; struct iatt iatt = {}; + gf_return_t op_ret; meta_fd = meta_fd_get(fd, this); if (!meta_fd) @@ -157,7 +160,8 @@ meta_default_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, memcpy(iov.iov_base, meta_fd->data + copy_offset, copy_size); iov.iov_len = copy_size; - META_STACK_UNWIND(readv, frame, copy_size, 0, &iov, 1, &iatt, iobref, 0); + SET_RET(op_ret, copy_size); + META_STACK_UNWIND(readv, frame, op_ret, 0, &iov, 1, &iatt, iobref, 0); iobref_unref(iobref); @@ -172,7 +176,7 @@ meta_default_open(call_frame_t *frame, xlator_t *this, loc_t *loc, xdata_rsp = meta_direct_io_mode(xdata, frame); - META_STACK_UNWIND(open, frame, 0, 0, fd, xdata_rsp); + META_STACK_UNWIND(open, frame, gf_zero_ret, 0, fd, xdata_rsp); return 0; } @@ -242,6 +246,7 @@ meta_default_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, strfd_t *strfd = NULL; struct iatt iatt = {}; int len = -1; + gf_return_t op_ret; ops = meta_ops_get(loc->inode, this); if (!ops || !ops->link_fill) { @@ -261,7 +266,8 @@ meta_default_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, if (strfd->data) { len = strlen(strfd->data); - META_STACK_UNWIND(readlink, frame, len, 0, strfd->data, &iatt, xdata); + SET_RET(op_ret, len); + META_STACK_UNWIND(readlink, frame, op_ret, 0, strfd->data, &iatt, xdata); } else META_STACK_UNWIND(readlink, frame, gf_failure, ENODATA, 0, 0, 0); @@ -285,7 +291,7 @@ meta_default_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, meta_iatt_fill(&iatt, fd->inode, IA_IFREG); - META_STACK_UNWIND(ftruncate, frame, 0, 0, &iatt, &iatt, xdata); + META_STACK_UNWIND(ftruncate, frame, gf_zero_ret, 0, &iatt, &iatt, xdata); return 0; } @@ -384,6 +390,7 @@ meta_default_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int filled_size = 0; int fixed_size = 0; int dyn_size = 0; + gf_return_t op_ret; struct meta_dirent *fixed_dirents = NULL; struct meta_dirent *dyn_dirents = NULL; struct meta_dirent *dirents = NULL; @@ -464,7 +471,8 @@ meta_default_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } unwind: - META_STACK_UNWIND(readdir, frame, ret, 0, &head, xdata); + SET_RET(op_ret, ret); + META_STACK_UNWIND(readdir, frame, op_ret, 0, &head, xdata); gf_dirent_free(&head); @@ -496,7 +504,7 @@ meta_default_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, meta_iatt_fill(&iatt, loc->inode, IA_IFREG); - META_STACK_UNWIND(truncate, frame, 0, 0, &iatt, &iatt, xdata); + META_STACK_UNWIND(truncate, frame, gf_zero_ret, 0, &iatt, &iatt, xdata); return 0; } @@ -509,7 +517,7 @@ meta_default_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, meta_iatt_fill(&iatt, loc->inode, loc->inode->ia_type); - META_STACK_UNWIND(stat, frame, 0, 0, &iatt, xdata); + META_STACK_UNWIND(stat, frame, gf_zero_ret, 0, &iatt, xdata); return 0; } @@ -555,7 +563,7 @@ meta_default_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, meta_iatt_fill(&iatt, loc->inode, dirent->type); - META_STACK_UNWIND(lookup, frame, 0, 0, loc->inode, &iatt, xdata, + META_STACK_UNWIND(lookup, frame, gf_zero_ret, 0, loc->inode, &iatt, xdata, &parent); } else { META_STACK_UNWIND(lookup, frame, gf_failure, ENOENT, 0, 0, 0, 0); diff --git a/xlators/meta/src/meta-helpers.c b/xlators/meta/src/meta-helpers.c index cb54f54746..6f8965431e 100644 --- a/xlators/meta/src/meta-helpers.c +++ b/xlators/meta/src/meta-helpers.c @@ -241,7 +241,7 @@ meta_inode_discover(call_frame_t *frame, xlator_t *this, loc_t *loc, meta_iatt_fill(&iatt, loc->inode, loc->inode->ia_type); - META_STACK_UNWIND(lookup, frame, 0, 0, loc->inode, &iatt, xdata, + META_STACK_UNWIND(lookup, frame, gf_zero_ret, 0, loc->inode, &iatt, xdata, &postparent); return 0; } diff --git a/xlators/meta/src/meta.c b/xlators/meta/src/meta.c index e1b9a2b658..b04d8e561b 100644 --- a/xlators/meta/src/meta.c +++ b/xlators/meta/src/meta.c @@ -30,7 +30,7 @@ meta_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) meta_iatt_fill(&iatt, loc->inode, IA_IFDIR); gf_uuid_parse(META_ROOT_GFID, iatt.ia_gfid); - META_STACK_UNWIND(lookup, frame, 0, 0, loc->inode, &iatt, xdata, + META_STACK_UNWIND(lookup, frame, gf_zero_ret, 0, loc->inode, &iatt, xdata, &parent); return 0; } From 8be8b15a28f36dede9474c8d561052ff0f024995 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 16 Sep 2020 08:12:17 +0530 Subject: [PATCH 13/24] ec/: compile working Change-Id: I32a9fe11fef019f2b94ddf86a3ca5854d3831825 Signed-off-by: Amar Tumballi --- xlators/cluster/ec/src/ec-combine.c | 8 +- xlators/cluster/ec/src/ec-common.c | 36 ++++----- xlators/cluster/ec/src/ec-common.h | 8 +- xlators/cluster/ec/src/ec-dir-read.c | 22 +++--- xlators/cluster/ec/src/ec-dir-write.c | 36 ++++----- xlators/cluster/ec/src/ec-generic.c | 56 ++++++------- xlators/cluster/ec/src/ec-heal.c | 82 +++++++++---------- xlators/cluster/ec/src/ec-heald.c | 8 +- xlators/cluster/ec/src/ec-inode-read.c | 100 ++++++++++++------------ xlators/cluster/ec/src/ec-inode-write.c | 83 ++++++++++---------- xlators/cluster/ec/src/ec-locks.c | 40 +++++----- xlators/cluster/ec/src/ec-types.h | 8 +- xlators/cluster/ec/src/ec.c | 93 +++++++++++----------- 13 files changed, 292 insertions(+), 288 deletions(-) diff --git a/xlators/cluster/ec/src/ec-combine.c b/xlators/cluster/ec/src/ec-combine.c index 703a30e248..ace2ebc15f 100644 --- a/xlators/cluster/ec/src/ec-combine.c +++ b/xlators/cluster/ec/src/ec-combine.c @@ -907,15 +907,15 @@ ec_combine_check(ec_cbk_data_t *dst, ec_cbk_data_t *src, ec_combine_f combine) { ec_fop_data_t *fop = dst->fop; - if (dst->op_ret != src->op_ret) { + if (GET_RET(dst->op_ret) != GET_RET(src->op_ret)) { gf_msg_debug(fop->xl->name, 0, "Mismatching return code in " "answers of '%s': %d <-> %d", - ec_fop_name(fop->id), dst->op_ret, src->op_ret); + ec_fop_name(fop->id), GET_RET(dst->op_ret), GET_RET(src->op_ret)); return 0; } - if (dst->op_ret < 0) { + if (IS_ERROR(dst->op_ret)) { if (dst->op_errno != src->op_errno) { gf_msg_debug(fop->xl->name, 0, "Mismatching errno code in " @@ -935,7 +935,7 @@ ec_combine_check(ec_cbk_data_t *dst, ec_cbk_data_t *src, ec_combine_f combine) return 0; } - if ((dst->op_ret >= 0) && (combine != NULL)) { + if (IS_SUCCESS(dst->op_ret) && (combine != NULL)) { return combine(fop, dst, src); } diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c index ddb8d71883..334d3bb445 100644 --- a/xlators/cluster/ec/src/ec-common.c +++ b/xlators/cluster/ec/src/ec-common.c @@ -24,7 +24,7 @@ #define EC_INVALID_INDEX UINT32_MAX void -ec_update_fd_status(fd_t *fd, xlator_t *xl, int idx, int32_t ret_status) +ec_update_fd_status(fd_t *fd, xlator_t *xl, int idx, gf_return_t ret_status) { ec_fd_t *fd_ctx; @@ -35,7 +35,7 @@ ec_update_fd_status(fd_t *fd, xlator_t *xl, int idx, int32_t ret_status) { fd_ctx = __ec_fd_get(fd, xl); if (fd_ctx) { - if (ret_status >= 0) + if (IS_SUCCESS(ret_status)) fd_ctx->fd_status[idx] = EC_FD_OPENED; else fd_ctx->fd_status[idx] = EC_FD_NOT_OPENED; @@ -232,7 +232,7 @@ ec_heal_report(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, uintptr_t mask, uintptr_t good, uintptr_t bad, uint32_t pending, dict_t *xdata) { - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_DEBUG, op_errno, EC_MSG_HEAL_FAIL, "Heal failed"); } else { @@ -264,7 +264,7 @@ ec_fop_needs_name_heal(ec_fop_data_t *fop) list_for_each_entry(cbk, &fop->cbk_list, list) { - if (cbk->op_ret < 0 && cbk->op_errno == ENOENT) { + if (IS_ERROR(cbk->op_ret) && cbk->op_errno == ENOENT) { enoent_cbk = cbk; break; } @@ -307,7 +307,7 @@ ec_check_status(ec_fop_data_t *fop) return; } - if (fop->answer && fop->answer->op_ret >= 0) { + if (fop->answer && IS_SUCCESS(fop->answer->op_ret)) { if ((fop->id == GF_FOP_LOOKUP) || (fop->id == GF_FOP_STAT) || (fop->id == GF_FOP_FSTAT)) { partial = fop->answer->iatt[0].ia_type == IA_IFDIR; @@ -395,19 +395,19 @@ ec_fop_set_error(ec_fop_data_t *fop, int32_t error) gf_boolean_t ec_cbk_set_error(ec_cbk_data_t *cbk, int32_t error, gf_boolean_t ro) { - if ((error != 0) && (cbk->op_ret >= 0)) { + if ((error != 0) && IS_SUCCESS(cbk->op_ret)) { /* If cbk->op_errno was 0, it means that the fop succeeded and this * error has happened while processing the answer. If the operation was * read-only, there's no problem (i.e. we simply return the generated * error code). However if it caused a modification, we must return EIO * to indicate that the operation has been partially executed. */ cbk->op_errno = ro ? error : EIO; - cbk->op_ret = -1; + cbk->op_ret = gf_failure; ec_fop_set_error(cbk->fop, cbk->op_errno); } - return (cbk->op_ret < 0); + return (IS_ERROR(cbk->op_ret)); } ec_cbk_data_t * @@ -423,7 +423,7 @@ ec_fop_prepare_answer(ec_fop_data_t *fop, gf_boolean_t ro) return NULL; } - if (cbk->op_ret < 0) { + if (IS_ERROR(cbk->op_ret)) { ec_fop_set_error(fop, cbk->op_errno); } @@ -832,7 +832,7 @@ ec_dispatch_one_retry(ec_fop_data_t *fop, ec_cbk_data_t **cbk) if (cbk != NULL) { *cbk = tmp; } - if ((tmp != NULL) && (tmp->op_ret < 0) && + if ((tmp != NULL) && IS_ERROR(tmp->op_ret) && ec_is_recoverable_error(tmp->op_errno)) { GF_ASSERT(fop->mask & (1ULL << tmp->idx)); fop->mask ^= (1ULL << tmp->idx); @@ -1243,7 +1243,7 @@ ec_prepare_update_cbk(call_frame_t *frame, void *cookie, xlator_t *this, list_add_tail(&link->fop->cbk_list, &list); } } - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, op_errno, EC_MSG_SIZE_VERS_GET_FAIL, "Failed to get size and version : %s", ec_msg_str(fop)); @@ -1700,7 +1700,7 @@ ec_get_real_size_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ec_fop_data_t *fop = cookie; ec_lock_link_t *link; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { link = fop->data; link->size = buf->ia_size; } else { @@ -1914,7 +1914,7 @@ ec_locked(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, link = fop->data; lock = link->lock; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { lock->mask = lock->good_mask = fop->good; lock->healing = 0; @@ -2140,7 +2140,7 @@ ec_lock_next_owner(ec_lock_link_t *link, ec_cbk_data_t *cbk, lock->release |= release; - if ((fop->error == 0) && (cbk != NULL) && (cbk->op_ret >= 0)) { + if ((fop->error == 0) && (cbk != NULL) && IS_SUCCESS(cbk->op_ret)) { if (link->update[0]) { ctx->post_version[0]++; } @@ -2254,7 +2254,7 @@ ec_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, ec_fop_data_t *fop = cookie; ec_lock_link_t *link = fop->data; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, op_errno, EC_MSG_UNLOCK_FAILED, "entry/inode unlocking failed :(%s)", ec_msg_str(link->fop)); } else { @@ -2324,7 +2324,7 @@ ec_update_size_version_done(call_frame_t *frame, void *cookie, xlator_t *this, lock = link->lock; ctx = lock->ctx; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { if (link->lock->fd == NULL) { ec_inode_bad_inc(link->lock->loc.inode, this); } else { @@ -2855,7 +2855,7 @@ ec_update_stripe(ec_t *ec, ec_stripe_list_t *stripe_cache, ec_stripe_t *stripe, /* On write fops, we only update existing fragments if the write has * succeeded. Otherwise, we remove them from the cache. */ if ((fop->id == GF_FOP_WRITE) && (fop->answer != NULL) && - (fop->answer->op_ret >= 0)) { + IS_SUCCESS(fop->answer->op_ret)) { base = stripe->frag_offset - fop->frag_range.first; base *= ec->fragments; @@ -2870,7 +2870,7 @@ ec_update_stripe(ec_t *ec, ec_stripe_list_t *stripe_cache, ec_stripe_t *stripe, * size by the user, so we update the stripe if the write has * modified at least one byte (meaning ec has written the full * stripe). */ - if (base < fop->answer->op_ret + fop->head) { + if (base < (GET_RET(fop->answer->op_ret) + fop->head)) { memcpy(stripe->data, fop->vector[0].iov_base + base, ec->stripe_size); list_move_tail(&stripe->lru, &stripe_cache->lru); diff --git a/xlators/cluster/ec/src/ec-common.h b/xlators/cluster/ec/src/ec-common.h index 106cfcce21..aa4b99f352 100644 --- a/xlators/cluster/ec/src/ec-common.h +++ b/xlators/cluster/ec/src/ec-common.h @@ -28,7 +28,7 @@ typedef enum { EC_DATA_TXN, EC_METADATA_TXN } ec_txn_t; #define QUORUM_CBK(fn, fop, frame, cookie, this, op_ret, op_errno, params...) \ do { \ ec_t *__ec = fop->xl->private; \ - int32_t __op_ret = 0; \ + gf_return_t __op_ret; \ int32_t __op_errno = 0; \ int32_t __success_count = gf_bits_count(fop->good); \ \ @@ -37,8 +37,8 @@ typedef enum { EC_DATA_TXN, EC_METADATA_TXN } ec_txn_t; if (!fop->parent && frame && \ (GF_CLIENT_PID_SELF_HEALD != frame->root->pid) && \ __ec->quorum_count && (__success_count < __ec->quorum_count) && \ - op_ret >= 0) { \ - __op_ret = -1; \ + IS_SUCCESS(op_ret)) { \ + __op_ret = gf_failure; \ __op_errno = EIO; \ gf_msg(__ec->xl->name, GF_LOG_ERROR, 0, \ EC_MSG_CHILDS_INSUFFICIENT, \ @@ -218,7 +218,7 @@ ec_lock_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, void ec_update_fd_status(fd_t *fd, xlator_t *xl, int child_index, - int32_t ret_status); + gf_return_t ret_status); gf_boolean_t ec_is_entry_healing(ec_fop_data_t *fop); void diff --git a/xlators/cluster/ec/src/ec-dir-read.c b/xlators/cluster/ec/src/ec-dir-read.c index 0bea635bc6..a48be2d766 100644 --- a/xlators/cluster/ec/src/ec-dir-read.c +++ b/xlators/cluster/ec/src/ec-dir-read.c @@ -52,12 +52,12 @@ ec_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_OPENDIR, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { if (fd != NULL) { cbk->fd = fd_ref(fd); if (cbk->fd == NULL) { @@ -189,7 +189,7 @@ ec_manager_opendir(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.opendir != NULL) { - fop->cbks.opendir(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.opendir(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } @@ -272,7 +272,7 @@ ec_opendir(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } @@ -345,14 +345,14 @@ ec_common_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, fop->id, idx, op_ret, op_errno); if (cbk) { if (xdata) cbk->xdata = dict_ref(xdata); - if (cbk->op_ret >= 0) + if (IS_SUCCESS(cbk->op_ret)) list_splice_init(&entries->list, &cbk->entries.list); ec_combine(cbk, NULL); } @@ -449,7 +449,7 @@ ec_manager_readdir(ec_fop_data_t *fop, int32_t state) return EC_STATE_DISPATCH; } - if ((cbk != NULL) && (cbk->op_ret > 0) && + if ((cbk != NULL) && IS_SUCCESS(cbk->op_ret) && (fop->id == GF_FOP_READDIRP)) { ec_adjust_readdirp(fop->xl->private, cbk->idx, &cbk->entries); } @@ -483,12 +483,12 @@ ec_manager_readdir(ec_fop_data_t *fop, int32_t state) case -EC_STATE_REPORT: if (fop->id == GF_FOP_READDIR) { if (fop->cbks.readdir != NULL) { - fop->cbks.readdir(fop->req_frame, fop, fop->xl, -1, + fop->cbks.readdir(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } } else { if (fop->cbks.readdirp != NULL) { - fop->cbks.readdirp(fop->req_frame, fop, fop->xl, -1, + fop->cbks.readdirp(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } } @@ -572,7 +572,7 @@ ec_readdir(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } @@ -642,6 +642,6 @@ ec_readdirp(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } diff --git a/xlators/cluster/ec/src/ec-dir-write.c b/xlators/cluster/ec/src/ec-dir-write.c index 03e293b1d2..a7f4456cda 100644 --- a/xlators/cluster/ec/src/ec-dir-write.c +++ b/xlators/cluster/ec/src/ec-dir-write.c @@ -37,7 +37,7 @@ ec_dir_write_cbk(call_frame_t *frame, xlator_t *this, void *cookie, idx = (long)cookie; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, fop->id, idx, op_ret, op_errno); @@ -47,7 +47,7 @@ ec_dir_write_cbk(call_frame_t *frame, xlator_t *this, void *cookie, if (xdata) cbk->xdata = dict_ref(xdata); - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; if (poststat) @@ -233,7 +233,7 @@ ec_manager_create(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.create != NULL) { - fop->cbks.create(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.create(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL, NULL, NULL, NULL); } @@ -320,7 +320,7 @@ ec_create(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL, NULL, NULL, NULL); } } @@ -406,7 +406,7 @@ ec_manager_link(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.link != NULL) { - fop->cbks.link(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.link(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL, NULL, NULL); } @@ -486,7 +486,7 @@ ec_link(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL, NULL, NULL); } } @@ -588,7 +588,7 @@ ec_manager_mkdir(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.mkdir != NULL) { - fop->cbks.mkdir(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.mkdir(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL, NULL, ((cbk) ? cbk->xdata : NULL)); } @@ -664,7 +664,7 @@ ec_mkdir(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL, NULL, NULL); } } @@ -793,7 +793,7 @@ ec_manager_mknod(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.mknod != NULL) { - fop->cbks.mknod(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.mknod(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL, NULL, NULL); } @@ -869,7 +869,7 @@ ec_mknod(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL, NULL, NULL); } } @@ -953,7 +953,7 @@ ec_manager_rename(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.rename != NULL) { - fop->cbks.rename(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.rename(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL, NULL, NULL, NULL); } @@ -1034,7 +1034,7 @@ ec_rename(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL, NULL, NULL, NULL); } } @@ -1104,7 +1104,7 @@ ec_manager_rmdir(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.rmdir != NULL) { - fop->cbks.rmdir(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.rmdir(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } @@ -1178,7 +1178,7 @@ ec_rmdir(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } @@ -1259,7 +1259,7 @@ ec_manager_symlink(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.symlink != NULL) { - fop->cbks.symlink(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.symlink(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL, NULL, NULL); } @@ -1343,7 +1343,7 @@ ec_symlink(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL, NULL, NULL); } } @@ -1413,7 +1413,7 @@ ec_manager_unlink(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.unlink != NULL) { - fop->cbks.unlink(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.unlink(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } @@ -1488,6 +1488,6 @@ ec_unlink(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } diff --git a/xlators/cluster/ec/src/ec-generic.c b/xlators/cluster/ec/src/ec-generic.c index 7f1309a9e8..89e8cb8bbc 100644 --- a/xlators/cluster/ec/src/ec-generic.c +++ b/xlators/cluster/ec/src/ec-generic.c @@ -35,7 +35,7 @@ ec_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_FLUSH, idx, op_ret, op_errno); @@ -121,7 +121,7 @@ ec_manager_flush(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.flush != NULL) { - fop->cbks.flush(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.flush(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL); } @@ -238,7 +238,7 @@ ec_flush(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -275,12 +275,12 @@ ec_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_FSYNC, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { if (prebuf != NULL) { cbk->iatt[0] = *prebuf; } @@ -378,7 +378,7 @@ ec_manager_fsync(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.fsync != NULL) { - fop->cbks.fsync(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.fsync(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } @@ -466,7 +466,7 @@ ec_fsync(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } @@ -488,7 +488,7 @@ ec_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_FSYNCDIR, idx, op_ret, op_errno); @@ -574,7 +574,7 @@ ec_manager_fsyncdir(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.fsyncdir != NULL) { - fop->cbks.fsyncdir(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.fsyncdir(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL); } @@ -653,7 +653,7 @@ ec_fsyncdir(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -666,7 +666,7 @@ ec_lookup_rebuild(ec_t *ec, ec_fop_data_t *fop, ec_cbk_data_t *cbk) uint64_t size = 0; int32_t have_size = 0, err; - if (cbk->op_ret < 0) { + if (IS_ERROR(cbk->op_ret)) { return; } @@ -735,12 +735,12 @@ ec_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_LOOKUP, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { if (inode != NULL) { cbk->inode = inode_ref(inode); if (cbk->inode == NULL) { @@ -881,7 +881,7 @@ ec_manager_lookup(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.lookup != NULL) { - fop->cbks.lookup(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.lookup(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL, NULL); } @@ -939,7 +939,7 @@ ec_lookup(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL, NULL); } } @@ -970,12 +970,12 @@ ec_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_STATFS, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { if (buf != NULL) { cbk->statvfs = *buf; } @@ -1067,7 +1067,7 @@ ec_manager_statfs(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.statfs != NULL) { - fop->cbks.statfs(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.statfs(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } @@ -1128,7 +1128,7 @@ ec_statfs(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } @@ -1169,14 +1169,14 @@ ec_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, fop->id, idx, op_ret, op_errno); if (!cbk) goto out; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { cbk->dict = dict_ref(xattr); data = dict_get(cbk->dict, EC_XATTR_VERSION); @@ -1287,12 +1287,12 @@ ec_manager_xattrop(ec_fop_data_t *fop, int32_t state) if (fop->id == GF_FOP_XATTROP) { if (fop->cbks.xattrop != NULL) { - fop->cbks.xattrop(fop->req_frame, fop, fop->xl, -1, + fop->cbks.xattrop(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } } else { if (fop->cbks.fxattrop != NULL) { - fop->cbks.fxattrop(fop->req_frame, fop, fop->xl, -1, + fop->cbks.fxattrop(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } } @@ -1378,7 +1378,7 @@ ec_xattrop(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } @@ -1455,7 +1455,7 @@ ec_fxattrop(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } @@ -1477,7 +1477,7 @@ ec_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_IPC, idx, op_ret, op_errno); @@ -1543,7 +1543,7 @@ ec_manager_ipc(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.ipc != NULL) { - fop->cbks.ipc(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.ipc(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL); } @@ -1588,6 +1588,6 @@ ec_ipc(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c index 73204b3914..e578be1a03 100644 --- a/xlators/cluster/ec/src/ec-heal.c +++ b/xlators/cluster/ec/src/ec-heal.c @@ -152,7 +152,7 @@ ec_heal_check(ec_fop_data_t *fop, uintptr_t *pgood) list_for_each_entry(cbk, &fop->cbk_list, list) { - mask[cbk->op_ret >= 0] |= cbk->mask; + mask[GET_RET(cbk->op_ret) >= 0] |= cbk->mask; } if (pgood != NULL) { @@ -204,7 +204,7 @@ ec_heal_lock_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ec_fop_data_t *fop = cookie; ec_heal_t *heal = fop->data; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { GF_ASSERT( ec_set_inode_size(heal->fop, heal->fd->inode, heal->total_size)); } @@ -301,12 +301,12 @@ ec_heal_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ec_fop_data_t *fop = cookie; ec_heal_t *heal = fop->data; - ec_trace("WRITE_CBK", cookie, "ret=%d, errno=%d", op_ret, op_errno); + ec_trace("WRITE_CBK", cookie, "ret=%d, errno=%d", GET_RET(op_ret), op_errno); gf_msg_debug(fop->xl->name, 0, "%s: write op_ret %d, op_errno %s" " at %" PRIu64, - uuid_utoa(heal->fd->inode->gfid), op_ret, strerror(op_errno), + uuid_utoa(heal->fd->inode->gfid), GET_RET(op_ret), strerror(op_errno), heal->offset); ec_heal_update(cookie, 0); @@ -323,11 +323,11 @@ ec_heal_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ec_fop_data_t *fop = cookie; ec_heal_t *heal = fop->data; - ec_trace("READ_CBK", fop, "ret=%d, errno=%d", op_ret, op_errno); + ec_trace("READ_CBK", fop, "ret=%d, errno=%d", GET_RET(op_ret), op_errno); ec_heal_avoid(fop); - if (op_ret > 0) { + if (IS_SUCCESS(op_ret)) { gf_msg_debug(fop->xl->name, 0, "%s: read succeeded, proceeding " "to write at %" PRIu64, @@ -336,7 +336,7 @@ ec_heal_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ec_heal_writev_cbk, heal, heal->fd, vector, count, heal->offset, 0, iobref, NULL); } else { - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg_debug(fop->xl->name, 0, "%s: read failed %s, failing " "to heal block at %" PRIu64, @@ -422,7 +422,7 @@ ec_heal_entry_find_direction(ec_t *ec, default_args_cbk_t *replies, if (!replies[i].valid) continue; - if (replies[i].op_ret == -1) + if (IS_ERROR(replies[i].op_ret)) continue; if (source == -1) @@ -453,7 +453,7 @@ ec_heal_entry_find_direction(ec_t *ec, default_args_cbk_t *replies, if (!replies[i].valid) continue; - if (replies[i].op_ret == -1) + if (IS_ERROR(replies[i].op_ret)) continue; if (versions[i] == versions[source]) @@ -476,7 +476,7 @@ ec_adjust_versions(call_frame_t *frame, ec_t *ec, ec_txn_t type, inode_t *inode, int ret = 0; int call_count = 0; dict_t **xattr = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret; loc_t loc = {0}; gf_boolean_t erase_dirty = _gf_false; uint64_t *versions_xattr = NULL; @@ -494,13 +494,13 @@ ec_adjust_versions(call_frame_t *frame, ec_t *ec, ec_txn_t type, inode_t *inode, EC_REPLIES_ALLOC(replies, ec->nodes); xattr = GF_CALLOC(ec->nodes, sizeof(*xattr), gf_common_mt_pointer); if (!xattr) { - op_ret = -ENOMEM; + SET_RET(op_ret, -ENOMEM); goto out; } for (i = 0; i < ec->nodes; i++) { xattr[i] = dict_new(); if (!xattr[i]) { - op_ret = -ENOMEM; + SET_RET(op_ret, -ENOMEM); goto out; } } @@ -511,7 +511,7 @@ ec_adjust_versions(call_frame_t *frame, ec_t *ec, ec_txn_t type, inode_t *inode, ec->nodes) erase_dirty = _gf_true; else - op_ret = -ENOTCONN; + SET_RET(op_ret, -ENOTCONN); /* Populate the xattr array */ for (i = 0; i < ec->nodes; i++) { @@ -520,7 +520,7 @@ ec_adjust_versions(call_frame_t *frame, ec_t *ec, ec_txn_t type, inode_t *inode, versions_xattr = GF_CALLOC(EC_VERSION_SIZE, sizeof(*versions_xattr), gf_common_mt_pointer); if (!versions_xattr) { - op_ret = -ENOMEM; + SET_RET(op_ret, -ENOMEM); continue; } @@ -528,7 +528,7 @@ ec_adjust_versions(call_frame_t *frame, ec_t *ec, ec_txn_t type, inode_t *inode, ret = dict_set_bin(xattr[i], EC_XATTR_VERSION, versions_xattr, (sizeof(*versions_xattr) * EC_VERSION_SIZE)); if (ret < 0) { - op_ret = -ENOMEM; + SET_RET(op_ret, -ENOMEM); continue; } @@ -536,7 +536,7 @@ ec_adjust_versions(call_frame_t *frame, ec_t *ec, ec_txn_t type, inode_t *inode, dirty_xattr = GF_CALLOC(EC_VERSION_SIZE, sizeof(*dirty_xattr), gf_common_mt_pointer); if (!dirty_xattr) { - op_ret = -ENOMEM; + SET_RET(op_ret, -ENOMEM); continue; } @@ -544,7 +544,7 @@ ec_adjust_versions(call_frame_t *frame, ec_t *ec, ec_txn_t type, inode_t *inode, ret = dict_set_bin(xattr[i], EC_XATTR_DIRTY, dirty_xattr, (sizeof(*dirty_xattr) * EC_VERSION_SIZE)); if (ret < 0) { - op_ret = -ENOMEM; + SET_RET(op_ret, -ENOMEM); continue; } } @@ -574,7 +574,7 @@ ec_adjust_versions(call_frame_t *frame, ec_t *ec, ec_txn_t type, inode_t *inode, } if (ret < call_count) { - op_ret = -ENOTCONN; + SET_RET(op_ret, -ENOTCONN); goto out; } @@ -589,7 +589,7 @@ ec_adjust_versions(call_frame_t *frame, ec_t *ec, ec_txn_t type, inode_t *inode, } cluster_replies_wipe(replies, ec->nodes); loc_wipe(&loc); - return op_ret; + return GET_RET(op_ret); } int @@ -617,7 +617,7 @@ ec_heal_metadata_find_direction(ec_t *ec, default_args_cbk_t *replies, for (i = 0; i < ec->nodes; i++) { if (!replies[i].valid) continue; - if (replies[i].op_ret < 0) + if (IS_ERROR(replies[i].op_ret)) continue; ret = ec_dict_get_array(replies[i].xdata, EC_XATTR_VERSION, xattr, EC_VERSION_SIZE); @@ -637,7 +637,7 @@ ec_heal_metadata_find_direction(ec_t *ec, default_args_cbk_t *replies, same_count = 1; source_ia = replies[i].stat; for (j = i + 1; j < ec->nodes; j++) { - if (!replies[j].valid || replies[j].op_ret < 0) + if (!replies[j].valid || IS_ERROR(replies[j].op_ret)) continue; child_ia = replies[j].stat; if (!IA_EQUAL(source_ia, child_ia, gfid) || @@ -667,7 +667,7 @@ ec_heal_metadata_find_direction(ec_t *ec, default_args_cbk_t *replies, for (i = 0; i < ec->nodes; i++) { if (groups[i] == groups[same_source]) sources[i] = 1; - else if (replies[i].valid && replies[i].op_ret >= 0) + else if (replies[i].valid && IS_SUCCESS(replies[i].op_ret)) healed_sinks[i] = 1; } for (i = 0; i < ec->nodes; i++) { @@ -1045,7 +1045,7 @@ ec_delete_stale_name(dict_t *gfid_db, char *key, data_t *d, void *data) for (i = 0; i < ec->nodes; i++) { if (!replies[i].valid) continue; - if (replies[i].op_ret == -1) { + if (IS_ERROR(replies[i].op_ret)) { if (replies[i].op_errno == ESTALE || replies[i].op_errno == ENOENT) estale_count++; else @@ -1076,7 +1076,7 @@ ec_delete_stale_name(dict_t *gfid_db, char *key, data_t *d, void *data) gf_uuid_copy(loc.pargfid, loc.parent->gfid); loc.name = name_data->name; for (i = 0; i < ec->nodes; i++) { - if (same[i] && replies[i].valid && (replies[i].op_ret == 0)) { + if (same[i] && replies[i].valid && IS_SUCCESS(replies[i].op_ret)) { ia = &replies[i].stat; break; } @@ -1219,7 +1219,7 @@ ec_create_name(call_frame_t *frame, ec_t *ec, inode_t *parent, char *name, for (i = 0; i < ec->nodes; i++) { if (!lookup_replies[i].valid) continue; - if (lookup_replies[i].op_ret) + if (IS_ERROR(lookup_replies[i].op_ret)) continue; on[i] = 1; } @@ -1364,7 +1364,7 @@ __ec_heal_name(call_frame_t *frame, ec_t *ec, inode_t *parent, char *name, if (!replies[i].valid) continue; - if (replies[i].op_ret == -1) { + if (IS_ERROR(replies[i].op_ret)) { /*If ESTALE comes here, that means parent dir is not * present, nothing to do there, so reset participants * for that brick*/ @@ -1692,7 +1692,7 @@ ec_heal_data_find_direction(ec_t *ec, default_args_cbk_t *replies, for (i = 0; i < ec->nodes; i++) { if (!replies[i].valid) continue; - if (replies[i].op_ret < 0) + if (IS_ERROR(replies[i].op_ret)) continue; dict = (which == EC_COMBINE_XDATA) ? replies[i].xdata : replies[i].xattr; @@ -1747,7 +1747,7 @@ ec_heal_data_find_direction(ec_t *ec, default_args_cbk_t *replies, goto out; memcpy(sources, same, ec->nodes); for (i = 0; i < ec->nodes; i++) { - if (replies[i].valid && (replies[i].op_ret == 0) && !sources[i]) + if (replies[i].valid && IS_SUCCESS(replies[i].op_ret) && !sources[i]) healed_sinks[i] = 1; } } @@ -1974,7 +1974,7 @@ ec_manager_heal_block(ec_fop_data_t *fop, int32_t state) case EC_STATE_REPORT: if (fop->cbks.heal) { - fop->cbks.heal(fop->req_frame, fop->data, fop->xl, 0, 0, + fop->cbks.heal(fop->req_frame, fop->data, fop->xl, gf_zero_ret, 0, (heal->good | heal->bad), heal->good, heal->bad, 0, NULL); } @@ -1982,7 +1982,7 @@ ec_manager_heal_block(ec_fop_data_t *fop, int32_t state) return EC_STATE_END; case -EC_STATE_REPORT: if (fop->cbks.heal) { - fop->cbks.heal(fop->req_frame, fop->data, fop->xl, -1, + fop->cbks.heal(fop->req_frame, fop->data, fop->xl, gf_failure, fop->error, 0, 0, 0, 0, NULL); } @@ -2020,7 +2020,7 @@ ec_heal_block(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, heal, this, -1, error, 0, 0, 0, 0, NULL); + func(frame, heal, this, gf_failure, error, 0, 0, 0, 0, NULL); } } @@ -2036,7 +2036,7 @@ ec_heal_block_done(call_frame_t *frame, void *cookie, xlator_t *this, heal->fop->heal = NULL; } heal->fop = NULL; - heal->error = op_ret < 0 ? op_errno : 0; + heal->error = IS_ERROR(op_ret) ? op_errno : 0; syncbarrier_wake(heal->data); return 0; } @@ -2211,13 +2211,13 @@ __ec_fd_data_adjust_versions(call_frame_t *frame, ec_t *ec, fd_t *fd, dict_t *xattr = NULL; int i = 0; int ret = 0; - gf_return_t op_ret = 0; + gf_return_t op_ret; int source = -1; gf_boolean_t erase_dirty = _gf_false; xattr = dict_new(); if (!xattr) { - op_ret = -ENOMEM; + SET_RET(op_ret, -ENOMEM); goto out; } @@ -2235,7 +2235,7 @@ __ec_fd_data_adjust_versions(call_frame_t *frame, ec_t *ec, fd_t *fd, } if (source == -1) { - op_ret = -ENOTCONN; + SET_RET(op_ret, -ENOTCONN); goto out; } @@ -2262,7 +2262,7 @@ __ec_fd_data_adjust_versions(call_frame_t *frame, ec_t *ec, fd_t *fd, out: if (xattr) dict_unref(xattr); - return op_ret; + return GET_RET(op_ret); } int @@ -2560,7 +2560,7 @@ ec_heal_do(xlator_t *this, void *data, loc_t *loc, int32_t partial) unsigned char *healed_sinks = NULL; ec_t *ec = NULL; int ret = 0; - gf_return_t op_ret = 0; + gf_return_t op_ret; int op_errno = 0; intptr_t mgood = 0; intptr_t mbad = 0; @@ -2658,7 +2658,7 @@ ec_heal_do(xlator_t *this, void *data, loc_t *loc, int32_t partial) good = ec_char_array_to_mask(sources, ec->nodes); bad = ec_char_array_to_mask(healed_sinks, ec->nodes); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = -ret; } msources = alloca0(ec->nodes); @@ -2668,7 +2668,7 @@ ec_heal_do(xlator_t *this, void *data, loc_t *loc, int32_t partial) mgood = ec_char_array_to_mask(msources, ec->nodes); mbad = ec_char_array_to_mask(mhealed_sinks, ec->nodes); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = -ret; } @@ -2728,7 +2728,7 @@ void ec_heal_fail(ec_t *ec, ec_fop_data_t *fop) { if (fop->cbks.heal) { - fop->cbks.heal(fop->req_frame, fop->data, ec->xl, -1, fop->error, 0, 0, + fop->cbks.heal(fop->req_frame, fop->data, ec->xl, gf_failure, fop->error, 0, 0, 0, 0, NULL); } ec_fop_data_release(fop); @@ -2916,7 +2916,7 @@ ec_heal(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop) ec_fop_data_release(fop); if (func) - func(frame, data, this, -1, err, 0, 0, 0, 0, NULL); + func(frame, data, this, gf_failure, err, 0, 0, 0, 0, NULL); } int diff --git a/xlators/cluster/ec/src/ec-heald.c b/xlators/cluster/ec/src/ec-heald.c index 4792d1fc2e..a28366d5c7 100644 --- a/xlators/cluster/ec/src/ec-heald.c +++ b/xlators/cluster/ec/src/ec-heald.c @@ -528,14 +528,14 @@ int ec_heal_op(xlator_t *this, dict_t *output, gf_xl_afr_op_t op, int xl_id) { char key[64] = {0}; - gf_return_t op_ret = 0; + gf_return_t op_ret; ec_t *ec = NULL; int i = 0; GF_UNUSED int ret = 0; ec = this->private; - op_ret = -1; + op_ret = gf_failure; for (i = 0; i < ec->nodes; i++) { snprintf(key, sizeof(key), "%d-%d-status", xl_id, i); @@ -552,10 +552,10 @@ ec_heal_op(xlator_t *this, dict_t *output, gf_xl_afr_op_t op, int xl_id) } else if (op == GF_SHD_OP_HEAL_INDEX) { ec_shd_index_healer_spawn(this, i); } - op_ret = 0; + op_ret = gf_zero_ret; } } - return op_ret; + return GET_RET(op_ret); } int diff --git a/xlators/cluster/ec/src/ec-inode-read.c b/xlators/cluster/ec/src/ec-inode-read.c index 27f9358c9c..882f006974 100644 --- a/xlators/cluster/ec/src/ec-inode-read.c +++ b/xlators/cluster/ec/src/ec-inode-read.c @@ -34,7 +34,7 @@ ec_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_ACCESS, idx, op_ret, op_errno); @@ -105,7 +105,7 @@ ec_manager_access(ec_fop_data_t *fop, int32_t state) case -EC_STATE_PREPARE_ANSWER: case -EC_STATE_REPORT: if (fop->cbks.access != NULL) { - fop->cbks.access(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.access(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL); } return EC_STATE_LOCK_REUSE; @@ -179,7 +179,7 @@ ec_access(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -216,12 +216,12 @@ ec_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_GETXATTR, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if(IS_SUCCESS(op_ret)) { if (dict != NULL) { cbk->dict = dict_ref(dict); if (cbk->dict == NULL) { @@ -272,10 +272,10 @@ ec_handle_special_xattrs(ec_fop_data_t *fop) /* Stime may not be available on all the bricks, so even if some of the * subvols succeed the operation, treat it as answer.*/ if (fop->str[0] && fnmatch(GF_XATTR_STIME_PATTERN, fop->str[0], 0) == 0) { - if (!fop->answer || (fop->answer->op_ret < 0)) { + if (!fop->answer || IS_ERROR(fop->answer->op_ret)) { list_for_each_entry(cbk, &fop->cbk_list, list) { - if (cbk->op_ret >= 0) { + if(IS_SUCCESS(cbk->op_ret)) { fop->answer = cbk; break; } @@ -362,7 +362,7 @@ ec_manager_getxattr(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.getxattr != NULL) { - fop->cbks.getxattr(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.getxattr(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } @@ -419,10 +419,10 @@ ec_getxattr_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *xl, } } - if (op_ret >= 0) { + if(IS_SUCCESS(op_ret)) { dict = dict_new(); if (dict == NULL) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } else { if (gf_asprintf(&str, "Good: %s, Bad: %s", @@ -432,7 +432,7 @@ ec_getxattr_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *xl, dict_unref(dict); dict = NULL; - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; @@ -443,7 +443,7 @@ ec_getxattr_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *xl, dict_unref(dict); dict = NULL; - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; @@ -535,7 +535,7 @@ ec_getxattr(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } @@ -558,12 +558,12 @@ ec_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_FGETXATTR, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if(IS_SUCCESS(op_ret)) { if (dict != NULL) { cbk->dict = dict_ref(dict); if (cbk->dict == NULL) { @@ -667,7 +667,7 @@ ec_fgetxattr(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } @@ -704,12 +704,12 @@ ec_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_OPEN, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if(IS_SUCCESS(op_ret)) { if (fd != NULL) { cbk->fd = fd_ref(fd); if (cbk->fd == NULL) { @@ -765,7 +765,7 @@ ec_open_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t error = 0; fop = fop->data; - if (op_ret >= 0) { + if(IS_SUCCESS(op_ret)) { fop->answer->iatt[0] = *postbuf; } else { error = op_errno; @@ -877,7 +877,7 @@ ec_manager_open(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.open != NULL) { - fop->cbks.open(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.open(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } @@ -950,7 +950,7 @@ ec_open(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } @@ -987,7 +987,7 @@ ec_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, fop->id, idx, op_ret, op_errno); @@ -995,7 +995,7 @@ ec_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (xdata) cbk->xdata = dict_ref(xdata); - if (cbk->op_ret >= 0) { + if(IS_SUCCESS(cbk->op_ret)) { cbk->iatt[0] = *buf; cbk->str = gf_strdup(path); if (!cbk->str) { @@ -1045,7 +1045,7 @@ ec_manager_readlink(ec_fop_data_t *fop, int32_t state) return EC_STATE_DISPATCH; } - if ((cbk != NULL) && (cbk->op_ret >= 0)) { + if ((cbk != NULL) && IS_SUCCESS(cbk->op_ret)) { ec_iatt_rebuild(fop->xl->private, &cbk->iatt[0], 1, 1); } @@ -1068,7 +1068,7 @@ ec_manager_readlink(ec_fop_data_t *fop, int32_t state) case -EC_STATE_PREPARE_ANSWER: case -EC_STATE_REPORT: if (fop->cbks.readlink != NULL) { - fop->cbks.readlink(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.readlink(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } return EC_STATE_LOCK_REUSE; @@ -1141,7 +1141,7 @@ ec_readlink(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } @@ -1157,7 +1157,7 @@ ec_readv_rebuild(ec_t *ec, ec_fop_data_t *fop, ec_cbk_data_t *cbk) uint64_t fsize = 0, size = 0, max = 0; int32_t pos, err = -ENOMEM; - if (cbk->op_ret < 0) { + if (IS_ERROR(cbk->op_ret)) { err = -cbk->op_errno; goto out; @@ -1166,11 +1166,11 @@ ec_readv_rebuild(ec_t *ec, ec_fop_data_t *fop, ec_cbk_data_t *cbk) /* This shouldn't fail because we have the inode locked. */ GF_ASSERT(ec_get_inode_size(fop, fop->fd->inode, &cbk->iatt[0].ia_size)); - if (cbk->op_ret > 0) { + if(IS_SUCCESS(cbk->op_ret)) { void *blocks[cbk->count]; uint32_t values[cbk->count]; - fsize = cbk->op_ret; + fsize = GET_RET(cbk->op_ret); size = fsize * ec->fragments; for (ans = cbk; ans != NULL; ans = ans->next) { pos = gf_bits_count(cbk->mask & ((1 << ans->idx) - 1)); @@ -1218,7 +1218,7 @@ ec_readv_rebuild(ec_t *ec, ec_fop_data_t *fop, ec_cbk_data_t *cbk) size = max; } - cbk->op_ret = size; + SET_RET(cbk->op_ret, size); cbk->int32 = 1; iobref_unref(cbk->buffers); @@ -1282,12 +1282,12 @@ ec_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_READ, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if(IS_SUCCESS(op_ret)) { cbk->int32 = count; if (count > 0) { @@ -1326,7 +1326,7 @@ ec_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } - if ((op_ret > 0) && ((op_ret % ec->fragment_size) != 0)) { + if(IS_SUCCESS((op_ret)) && ((GET_RET(op_ret) % ec->fragment_size) != 0)) { ec_cbk_set_error(cbk, EIO, _gf_true); } @@ -1418,7 +1418,7 @@ ec_manager_readv(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.readv != NULL) { - fop->cbks.readv(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.readv(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, 0, NULL, NULL, NULL); } @@ -1499,7 +1499,7 @@ ec_readv(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, 0, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, 0, NULL, NULL, NULL); } } @@ -1522,20 +1522,20 @@ ec_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_SEEK, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if(IS_SUCCESS(op_ret)) { cbk->offset = offset; } if (xdata != NULL) { cbk->xdata = dict_ref(xdata); } - if ((op_ret > 0) && ((cbk->offset % ec->fragment_size) != 0)) { - cbk->op_ret = -1; + if(IS_SUCCESS(op_ret) && ((cbk->offset % ec->fragment_size) != 0)) { + cbk->op_ret = gf_failure; cbk->op_errno = EIO; } @@ -1600,7 +1600,7 @@ ec_manager_seek(ec_fop_data_t *fop, int32_t state) if (ec_dispatch_one_retry(fop, &cbk)) { return EC_STATE_DISPATCH; } - if ((cbk != NULL) && (cbk->op_ret >= 0)) { + if ((cbk != NULL) && IS_SUCCESS(cbk->op_ret)) { ec_t *ec = fop->xl->private; /* This shouldn't fail because we have the inode locked. */ @@ -1638,7 +1638,7 @@ ec_manager_seek(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.seek != NULL) { - fop->cbks.seek(fop->req_frame, fop, fop->xl, -1, fop->error, 0, + fop->cbks.seek(fop->req_frame, fop, fop->xl, gf_failure, fop->error, 0, NULL); } @@ -1704,7 +1704,7 @@ ec_seek(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, EIO, 0, NULL); + func(frame, NULL, this, gf_failure, EIO, 0, NULL); } } @@ -1741,12 +1741,12 @@ ec_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_STAT, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if(IS_SUCCESS(op_ret)) { if (buf != NULL) { cbk->iatt[0] = *buf; } @@ -1851,12 +1851,12 @@ ec_manager_stat(ec_fop_data_t *fop, int32_t state) if (fop->id == GF_FOP_STAT) { if (fop->cbks.stat != NULL) { - fop->cbks.stat(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.stat(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } } else { if (fop->cbks.fstat != NULL) { - fop->cbks.fstat(fop->req_frame, fop, fop->xl, -1, + fop->cbks.fstat(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } } @@ -1930,7 +1930,7 @@ ec_stat(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } @@ -1953,12 +1953,12 @@ ec_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_FSTAT, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if(IS_SUCCESS(op_ret)) { if (buf != NULL) { cbk->iatt[0] = *buf; } @@ -2046,6 +2046,6 @@ ec_fstat(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c index ea94dc36df..93f514ee5d 100644 --- a/xlators/cluster/ec/src/ec-inode-write.c +++ b/xlators/cluster/ec/src/ec-inode-write.c @@ -27,9 +27,9 @@ ec_update_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int i = 0; ec_trace("UPDATE_WRITEV_CBK", cookie, "ret=%d, errno=%d, parent-fop=%s", - op_ret, op_errno, ec_fop_name(parent->id)); + GET_RET(op_ret), op_errno, ec_fop_name(parent->id)); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { ec_fop_set_error(parent, op_errno); goto out; } @@ -126,14 +126,14 @@ ec_inode_write_cbk(call_frame_t *frame, xlator_t *this, void *cookie, idx = (int32_t)(uintptr_t)cookie; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, fop->id, idx, op_ret, op_errno); if (!cbk) goto out; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; if (xdata) @@ -253,7 +253,7 @@ ec_manager_xattr(ec_fop_data_t *fop, int32_t state) case -EC_STATE_REPORT: GF_ASSERT(fop->error != 0); - ec_xattr_cbk(fop->req_frame, fop, fop->xl, -1, fop->error, NULL); + ec_xattr_cbk(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL); return EC_STATE_LOCK_REUSE; @@ -333,7 +333,7 @@ ec_removexattr(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -417,7 +417,7 @@ ec_fremovexattr(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -513,12 +513,12 @@ ec_manager_setattr(ec_fop_data_t *fop, int32_t state) if (fop->id == GF_FOP_SETATTR) { if (fop->cbks.setattr != NULL) { - fop->cbks.setattr(fop->req_frame, fop, fop->xl, -1, + fop->cbks.setattr(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } } else { if (fop->cbks.fsetattr != NULL) { - fop->cbks.fsetattr(fop->req_frame, fop, fop->xl, -1, + fop->cbks.fsetattr(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } } @@ -597,7 +597,7 @@ ec_setattr(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } @@ -678,7 +678,7 @@ ec_fsetattr(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } @@ -761,7 +761,7 @@ ec_setxattr(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -783,7 +783,7 @@ ec_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_FSETXATTR, idx, op_ret, op_errno); @@ -883,7 +883,7 @@ ec_fsetxattr(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -1004,7 +1004,7 @@ ec_manager_fallocate(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.fallocate != NULL) { - fop->cbks.fallocate(fop->req_frame, fop, fop->xl, -1, + fop->cbks.fallocate(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } @@ -1083,7 +1083,7 @@ ec_fallocate(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } @@ -1215,7 +1215,7 @@ ec_manager_discard(ec_fop_data_t *fop, int32_t state) case EC_STATE_DELAYED_START: if (fop->size) { - if (fop->answer && fop->answer->op_ret == 0) + if (fop->answer && IS_SUCCESS(fop->answer->op_ret)) ec_update_discard_write(fop, fop->answer->mask); } else { ec_update_discard_write(fop, fop->mask); @@ -1258,7 +1258,7 @@ ec_manager_discard(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.discard != NULL) { - fop->cbks.discard(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.discard(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } @@ -1324,7 +1324,7 @@ ec_discard(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } @@ -1351,7 +1351,7 @@ ec_truncate_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t err; fop->parent->good &= fop->good; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { fd_bind(fd); err = ec_update_truncate_write(fop->parent, fop->answer->mask); if (err != 0) { @@ -1496,12 +1496,12 @@ ec_manager_truncate(ec_fop_data_t *fop, int32_t state) if (fop->id == GF_FOP_TRUNCATE) { if (fop->cbks.truncate != NULL) { - fop->cbks.truncate(fop->req_frame, fop, fop->xl, -1, + fop->cbks.truncate(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } } else { if (fop->cbks.ftruncate != NULL) { - fop->cbks.ftruncate(fop->req_frame, fop, fop->xl, -1, + fop->cbks.ftruncate(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } } @@ -1577,7 +1577,7 @@ ec_truncate(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } @@ -1655,7 +1655,7 @@ ec_ftruncate(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } @@ -1741,12 +1741,12 @@ ec_writev_merge_tail(call_frame_t *frame, void *cookie, xlator_t *this, ec_fop_data_t *fop = frame->local; uint64_t size, base, tmp; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { tmp = 0; size = fop->size - fop->user_size - fop->head; base = ec->stripe_size - size; - if (op_ret > base) { - tmp = min(op_ret - base, size); + if (GET_RET(op_ret) > base) { + tmp = min(GET_RET(op_ret) - base, size); ec_iov_copy_to(fop->vector[0].iov_base + fop->size - size, vector, count, base, tmp); @@ -1774,12 +1774,12 @@ ec_writev_merge_head(call_frame_t *frame, void *cookie, xlator_t *this, ec_fop_data_t *fop = frame->local; uint64_t size, base; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { size = fop->head; base = 0; - if (op_ret > 0) { - base = min(op_ret, size); + if (IS_SUCCESS(op_ret)) { + base = min(GET_RET(op_ret), size); ec_iov_copy_to(fop->vector[0].iov_base, vector, count, 0, base); size -= base; @@ -2095,8 +2095,8 @@ ec_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ec_t *ec = NULL; if (this && this->private) { ec = this->private; - if ((op_ret > 0) && ((op_ret % ec->fragment_size) != 0)) { - op_ret = -1; + if (IS_SUCCESS(op_ret) && ((GET_RET(op_ret) % ec->fragment_size) != 0)) { + op_ret = gf_failure; op_errno = EIO; } } @@ -2219,14 +2219,17 @@ ec_manager_writev(ec_fop_data_t *fop, int32_t state) UNLOCK(&fop->fd->inode->lock); if (fop->error == 0) { - cbk->op_ret *= ec->fragments; - if (cbk->op_ret < fop->head) { - cbk->op_ret = 0; + int32_t temp = GET_RET(cbk->op_ret); + temp *= ec->fragments; + if (temp < fop->head) { + SET_RET(cbk->op_ret, 0); + temp = 0; } else { - cbk->op_ret -= fop->head; + temp -= fop->head; + SET_RET(cbk->op_ret, temp); } - if (cbk->op_ret > fop->user_size) { - cbk->op_ret = fop->user_size; + if (temp > fop->user_size) { + SET_RET(cbk->op_ret, fop->user_size); } } } @@ -2262,7 +2265,7 @@ ec_manager_writev(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.writev != NULL) { - fop->cbks.writev(fop->req_frame, fop, fop->xl, -1, fop->error, + fop->cbks.writev(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL, NULL); } @@ -2365,6 +2368,6 @@ ec_writev(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL, NULL); } } diff --git a/xlators/cluster/ec/src/ec-locks.c b/xlators/cluster/ec/src/ec-locks.c index 03d35805c1..a6ed06f1fd 100644 --- a/xlators/cluster/ec/src/ec-locks.c +++ b/xlators/cluster/ec/src/ec-locks.c @@ -56,7 +56,7 @@ ec_lock_check(ec_fop_data_t *fop, uintptr_t *mask) list_for_each_entry(ans, &fop->cbk_list, list) { - if (ans->op_ret >= 0) { + if (IS_SUCCESS(ans->op_ret)) { if (locked != 0) { error = EIO; } @@ -105,7 +105,7 @@ ec_lock_check(ec_fop_data_t *fop, uintptr_t *mask) * to take the lock. If we have quorum on some answer, we return * it. Otherwise we check if ESTALE answers allow us to reach * quorum. If so, we return ESTALE. */ - if (fop->answer && fop->answer->op_ret < 0) { + if (fop->answer && IS_ERROR(fop->answer->op_ret)) { error = fop->answer->op_errno; } else if ((good + eagain + estale) >= ec->fragments) { error = ESTALE; @@ -124,7 +124,7 @@ int32_t ec_lock_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *xdata) { - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, op_errno, EC_MSG_UNLOCK_FAILED, "Failed to unlock an entry/inode"); } @@ -137,7 +137,7 @@ ec_lock_lk_unlocked(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct gf_flock *flock, dict_t *xdata) { - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, op_errno, EC_MSG_LK_UNLOCK_FAILED, "Failed to unlock an lk"); } @@ -163,7 +163,7 @@ ec_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_ENTRYLK, idx, op_ret, op_errno); @@ -282,12 +282,12 @@ ec_manager_entrylk(ec_fop_data_t *fop, int32_t state) if (fop->id == GF_FOP_ENTRYLK) { if (fop->cbks.entrylk != NULL) { - fop->cbks.entrylk(fop->req_frame, fop, fop->xl, -1, + fop->cbks.entrylk(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL); } } else { if (fop->cbks.fentrylk != NULL) { - fop->cbks.fentrylk(fop->req_frame, fop, fop->xl, -1, + fop->cbks.fentrylk(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL); } } @@ -370,7 +370,7 @@ ec_entrylk(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -392,7 +392,7 @@ ec_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_FENTRYLK, idx, op_ret, op_errno); @@ -502,7 +502,7 @@ ec_fentrylk(call_frame_t *frame, xlator_t *this, uintptr_t target, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -524,7 +524,7 @@ ec_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_INODELK, idx, op_ret, op_errno); @@ -657,12 +657,12 @@ ec_manager_inodelk(ec_fop_data_t *fop, int32_t state) if (fop->id == GF_FOP_INODELK) { if (fop->cbks.inodelk != NULL) { - fop->cbks.inodelk(fop->req_frame, fop, fop->xl, -1, + fop->cbks.inodelk(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL); } } else { if (fop->cbks.finodelk != NULL) { - fop->cbks.finodelk(fop->req_frame, fop, fop->xl, -1, + fop->cbks.finodelk(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL); } } @@ -749,7 +749,7 @@ ec_inodelk(call_frame_t *frame, xlator_t *this, gf_lkowner_t *owner, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -771,7 +771,7 @@ ec_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_FINODELK, idx, op_ret, op_errno); @@ -885,7 +885,7 @@ ec_finodelk(call_frame_t *frame, xlator_t *this, gf_lkowner_t *owner, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL); + func(frame, NULL, this, gf_failure, error, NULL); } } @@ -921,12 +921,12 @@ ec_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, fop = frame->local; ec_trace("CBK", fop, "idx=%d, frame=%p, op_ret=%d, op_errno=%d", idx, frame, - op_ret, op_errno); + GET_RET(op_ret), op_errno); cbk = ec_cbk_data_allocate(frame, this, fop, GF_FOP_LK, idx, op_ret, op_errno); if (cbk != NULL) { - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { if (flock != NULL) { cbk->flock.l_type = flock->l_type; cbk->flock.l_whence = flock->l_whence; @@ -1046,7 +1046,7 @@ ec_manager_lk(ec_fop_data_t *fop, int32_t state) GF_ASSERT(fop->error != 0); if (fop->cbks.lk != NULL) { - fop->cbks.lk(fop->req_frame, fop, fop->xl, -1, fop->error, NULL, + fop->cbks.lk(fop->req_frame, fop, fop->xl, gf_failure, fop->error, NULL, NULL); } @@ -1123,6 +1123,6 @@ ec_lk(call_frame_t *frame, xlator_t *this, uintptr_t target, uint32_t fop_flags, if (fop != NULL) { ec_manager(fop, error); } else { - func(frame, NULL, this, -1, error, NULL, NULL); + func(frame, NULL, this, gf_failure, error, NULL, NULL); } } diff --git a/xlators/cluster/ec/src/ec-types.h b/xlators/cluster/ec/src/ec-types.h index 2fff2d43d7..ff574d64fe 100644 --- a/xlators/cluster/ec/src/ec-types.h +++ b/xlators/cluster/ec/src/ec-types.h @@ -189,12 +189,12 @@ struct _ec_inode { uint64_t bad_version; }; -typedef int32_t (*fop_heal_cbk_t)(call_frame_t *, void *, xlator_t *, int32_t, +typedef int32_t (*fop_heal_cbk_t)(call_frame_t *, void *, xlator_t *, gf_return_t, int32_t, uintptr_t, uintptr_t, uintptr_t, uint32_t, dict_t *); -typedef int32_t (*fop_fheal_cbk_t)(call_frame_t *, void *, xlator_t *, int32_t, - int32_t, uintptr_t, uintptr_t, uintptr_t, - uint32_t, dict_t *); +typedef int32_t (*fop_fheal_cbk_t)(call_frame_t *, void *, xlator_t *, + gf_return_t, int32_t, uintptr_t, uintptr_t, + uintptr_t, uint32_t, dict_t *); union _ec_cbk { fop_access_cbk_t access; diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c index 0000ab086d..9052916e7a 100644 --- a/xlators/cluster/ec/src/ec.c +++ b/xlators/cluster/ec/src/ec.c @@ -919,7 +919,7 @@ int32_t ec_gf_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, dict_t *xdata) { - ec_access(frame, this, gf_failure, EC_MINIMUM_ONE, default_access_cbk, NULL, loc, + ec_access(frame, this, -1, EC_MINIMUM_ONE, default_access_cbk, NULL, loc, mask, xdata); return 0; @@ -929,7 +929,7 @@ int32_t ec_gf_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata) { - ec_create(frame, this, gf_failure, EC_MINIMUM_MIN, default_create_cbk, NULL, loc, + ec_create(frame, this, -1, EC_MINIMUM_MIN, default_create_cbk, NULL, loc, flags, mode, umask, fd, xdata); return 0; @@ -939,7 +939,7 @@ int32_t ec_gf_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, size_t len, dict_t *xdata) { - ec_discard(frame, this, gf_failure, EC_MINIMUM_MIN, default_discard_cbk, NULL, fd, + ec_discard(frame, this, -1, EC_MINIMUM_MIN, default_discard_cbk, NULL, fd, offset, len, xdata); return 0; @@ -954,7 +954,7 @@ ec_gf_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, if (cmd == ENTRYLK_UNLOCK) fop_flags = EC_MINIMUM_ONE; - ec_entrylk(frame, this, gf_failure, fop_flags, default_entrylk_cbk, NULL, volume, + ec_entrylk(frame, this, -1, fop_flags, default_entrylk_cbk, NULL, volume, loc, basename, cmd, type, xdata); return 0; @@ -969,7 +969,7 @@ ec_gf_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, if (cmd == ENTRYLK_UNLOCK) fop_flags = EC_MINIMUM_ONE; - ec_fentrylk(frame, this, gf_failure, fop_flags, default_fentrylk_cbk, NULL, volume, + ec_fentrylk(frame, this, -1, fop_flags, default_fentrylk_cbk, NULL, volume, fd, basename, cmd, type, xdata); return 0; @@ -979,7 +979,7 @@ int32_t ec_gf_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, off_t offset, size_t len, dict_t *xdata) { - ec_fallocate(frame, this, gf_failure, EC_MINIMUM_MIN, default_fallocate_cbk, NULL, + ec_fallocate(frame, this, -1, EC_MINIMUM_MIN, default_fallocate_cbk, NULL, fd, mode, offset, len, xdata); return 0; @@ -988,7 +988,7 @@ ec_gf_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, int32_t ec_gf_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - ec_flush(frame, this, gf_failure, EC_MINIMUM_MIN, default_flush_cbk, NULL, fd, + ec_flush(frame, this, -1, EC_MINIMUM_MIN, default_flush_cbk, NULL, fd, xdata); return 0; @@ -998,7 +998,7 @@ int32_t ec_gf_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, dict_t *xdata) { - ec_fsync(frame, this, gf_failure, EC_MINIMUM_MIN, default_fsync_cbk, NULL, fd, + ec_fsync(frame, this, -1, EC_MINIMUM_MIN, default_fsync_cbk, NULL, fd, datasync, xdata); return 0; @@ -1008,7 +1008,7 @@ int32_t ec_gf_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, dict_t *xdata) { - ec_fsyncdir(frame, this, gf_failure, EC_MINIMUM_MIN, default_fsyncdir_cbk, NULL, fd, + ec_fsyncdir(frame, this, -1, EC_MINIMUM_MIN, default_fsyncdir_cbk, NULL, fd, datasync, xdata); return 0; @@ -1037,7 +1037,7 @@ ec_handle_heal_commands(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { dict_t *dict_rsp = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = {-1}; int op_errno = ENOMEM; if (!name || strcmp(name, GF_HEAL_INFO)) @@ -1045,7 +1045,8 @@ ec_handle_heal_commands(call_frame_t *frame, xlator_t *this, loc_t *loc, op_errno = -ec_get_heal_info(this, loc, &dict_rsp); if (op_errno <= 0) { - op_errno = op_ret = 0; + op_errno = 0; + SET_RET(op_ret, 0); } STACK_UNWIND_STRICT(getxattr, frame, op_ret, op_errno, dict_rsp, NULL); @@ -1078,7 +1079,7 @@ ec_gf_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, fop_flags = EC_MINIMUM_ALL; } - ec_getxattr(frame, this, gf_failure, fop_flags, default_getxattr_cbk, NULL, loc, + ec_getxattr(frame, this, -1, fop_flags, default_getxattr_cbk, NULL, loc, name, xdata); return 0; @@ -1096,7 +1097,7 @@ ec_gf_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, EC_INTERNAL_XATTR_OR_GOTO(name, NULL, error, out); - ec_fgetxattr(frame, this, gf_failure, EC_MINIMUM_ONE, default_fgetxattr_cbk, NULL, + ec_fgetxattr(frame, this, -1, EC_MINIMUM_ONE, default_fgetxattr_cbk, NULL, fd, name, xdata); return 0; out: @@ -1114,7 +1115,7 @@ ec_gf_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, if (flock->l_type == F_UNLCK) fop_flags = EC_MINIMUM_ONE; - ec_inodelk(frame, this, &frame->root->lk_owner, gf_failure, fop_flags, + ec_inodelk(frame, this, &frame->root->lk_owner, -1, fop_flags, default_inodelk_cbk, NULL, volume, loc, cmd, flock, xdata); return 0; @@ -1128,7 +1129,7 @@ ec_gf_finodelk(call_frame_t *frame, xlator_t *this, const char *volume, if (flock->l_type == F_UNLCK) fop_flags = EC_MINIMUM_ONE; - ec_finodelk(frame, this, &frame->root->lk_owner, gf_failure, fop_flags, + ec_finodelk(frame, this, &frame->root->lk_owner, -1, fop_flags, default_finodelk_cbk, NULL, volume, fd, cmd, flock, xdata); return 0; @@ -1138,7 +1139,7 @@ int32_t ec_gf_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { - ec_link(frame, this, gf_failure, EC_MINIMUM_MIN, default_link_cbk, NULL, oldloc, + ec_link(frame, this, -1, EC_MINIMUM_MIN, default_link_cbk, NULL, oldloc, newloc, xdata); return 0; @@ -1152,7 +1153,7 @@ ec_gf_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, if (flock->l_type == F_UNLCK) fop_flags = EC_MINIMUM_ONE; - ec_lk(frame, this, gf_failure, fop_flags, default_lk_cbk, NULL, fd, cmd, flock, + ec_lk(frame, this, -1, fop_flags, default_lk_cbk, NULL, fd, cmd, flock, xdata); return 0; @@ -1161,7 +1162,7 @@ ec_gf_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, int32_t ec_gf_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { - ec_lookup(frame, this, gf_failure, EC_MINIMUM_MIN, default_lookup_cbk, NULL, loc, + ec_lookup(frame, this, -1, EC_MINIMUM_MIN, default_lookup_cbk, NULL, loc, xdata); return 0; @@ -1171,7 +1172,7 @@ int32_t ec_gf_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata) { - ec_mkdir(frame, this, gf_failure, EC_MINIMUM_MIN, default_mkdir_cbk, NULL, loc, + ec_mkdir(frame, this, -1, EC_MINIMUM_MIN, default_mkdir_cbk, NULL, loc, mode, umask, xdata); return 0; @@ -1181,7 +1182,7 @@ int32_t ec_gf_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata) { - ec_mknod(frame, this, gf_failure, EC_MINIMUM_MIN, default_mknod_cbk, NULL, loc, + ec_mknod(frame, this, -1, EC_MINIMUM_MIN, default_mknod_cbk, NULL, loc, mode, rdev, umask, xdata); return 0; @@ -1191,7 +1192,7 @@ int32_t ec_gf_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, fd_t *fd, dict_t *xdata) { - ec_open(frame, this, gf_failure, EC_MINIMUM_MIN, default_open_cbk, NULL, loc, flags, + ec_open(frame, this, -1, EC_MINIMUM_MIN, default_open_cbk, NULL, loc, flags, fd, xdata); return 0; @@ -1201,7 +1202,7 @@ int32_t ec_gf_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, dict_t *xdata) { - ec_opendir(frame, this, gf_failure, EC_MINIMUM_MIN, default_opendir_cbk, NULL, loc, + ec_opendir(frame, this, -1, EC_MINIMUM_MIN, default_opendir_cbk, NULL, loc, fd, xdata); return 0; @@ -1211,7 +1212,7 @@ int32_t ec_gf_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, dict_t *xdata) { - ec_readdir(frame, this, gf_failure, EC_MINIMUM_ONE, default_readdir_cbk, NULL, fd, + ec_readdir(frame, this, -1, EC_MINIMUM_ONE, default_readdir_cbk, NULL, fd, size, offset, xdata); return 0; @@ -1221,7 +1222,7 @@ int32_t ec_gf_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, dict_t *xdata) { - ec_readdirp(frame, this, gf_failure, EC_MINIMUM_ONE, default_readdirp_cbk, NULL, fd, + ec_readdirp(frame, this, -1, EC_MINIMUM_ONE, default_readdirp_cbk, NULL, fd, size, offset, xdata); return 0; @@ -1231,7 +1232,7 @@ int32_t ec_gf_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, dict_t *xdata) { - ec_readlink(frame, this, gf_failure, EC_MINIMUM_ONE, default_readlink_cbk, NULL, + ec_readlink(frame, this, -1, EC_MINIMUM_ONE, default_readlink_cbk, NULL, loc, size, xdata); return 0; @@ -1241,7 +1242,7 @@ int32_t ec_gf_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata) { - ec_readv(frame, this, gf_failure, EC_MINIMUM_MIN, default_readv_cbk, NULL, fd, size, + ec_readv(frame, this, -1, EC_MINIMUM_MIN, default_readv_cbk, NULL, fd, size, offset, flags, xdata); return 0; @@ -1255,7 +1256,7 @@ ec_gf_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, EC_INTERNAL_XATTR_OR_GOTO(name, xdata, error, out); - ec_removexattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_removexattr_cbk, + ec_removexattr(frame, this, -1, EC_MINIMUM_MIN, default_removexattr_cbk, NULL, loc, name, xdata); return 0; @@ -1272,7 +1273,7 @@ ec_gf_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, EC_INTERNAL_XATTR_OR_GOTO(name, xdata, error, out); - ec_fremovexattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_fremovexattr_cbk, + ec_fremovexattr(frame, this, -1, EC_MINIMUM_MIN, default_fremovexattr_cbk, NULL, fd, name, xdata); return 0; @@ -1285,7 +1286,7 @@ int32_t ec_gf_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { - ec_rename(frame, this, gf_failure, EC_MINIMUM_MIN, default_rename_cbk, NULL, oldloc, + ec_rename(frame, this, -1, EC_MINIMUM_MIN, default_rename_cbk, NULL, oldloc, newloc, xdata); return 0; @@ -1295,7 +1296,7 @@ int32_t ec_gf_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, dict_t *xdata) { - ec_rmdir(frame, this, gf_failure, EC_MINIMUM_MIN, default_rmdir_cbk, NULL, loc, + ec_rmdir(frame, this, -1, EC_MINIMUM_MIN, default_rmdir_cbk, NULL, loc, xflags, xdata); return 0; @@ -1305,7 +1306,7 @@ int32_t ec_gf_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, int32_t valid, dict_t *xdata) { - ec_setattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_setattr_cbk, NULL, loc, + ec_setattr(frame, this, -1, EC_MINIMUM_MIN, default_setattr_cbk, NULL, loc, stbuf, valid, xdata); return 0; @@ -1315,7 +1316,7 @@ int32_t ec_gf_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, int32_t valid, dict_t *xdata) { - ec_fsetattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_fsetattr_cbk, NULL, fd, + ec_fsetattr(frame, this, -1, EC_MINIMUM_MIN, default_fsetattr_cbk, NULL, fd, stbuf, valid, xdata); return 0; @@ -1329,7 +1330,7 @@ ec_gf_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, EC_INTERNAL_XATTR_OR_GOTO("", dict, error, out); - ec_setxattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_setxattr_cbk, NULL, + ec_setxattr(frame, this, -1, EC_MINIMUM_MIN, default_setxattr_cbk, NULL, loc, dict, flags, xdata); return 0; @@ -1346,7 +1347,7 @@ ec_gf_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, EC_INTERNAL_XATTR_OR_GOTO("", dict, error, out); - ec_fsetxattr(frame, this, gf_failure, EC_MINIMUM_MIN, default_fsetxattr_cbk, NULL, + ec_fsetxattr(frame, this, -1, EC_MINIMUM_MIN, default_fsetxattr_cbk, NULL, fd, dict, flags, xdata); return 0; @@ -1358,7 +1359,7 @@ ec_gf_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int32_t ec_gf_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { - ec_stat(frame, this, gf_failure, EC_MINIMUM_MIN, default_stat_cbk, NULL, loc, + ec_stat(frame, this, -1, EC_MINIMUM_MIN, default_stat_cbk, NULL, loc, xdata); return 0; @@ -1367,7 +1368,7 @@ ec_gf_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t ec_gf_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - ec_fstat(frame, this, gf_failure, EC_MINIMUM_MIN, default_fstat_cbk, NULL, fd, + ec_fstat(frame, this, -1, EC_MINIMUM_MIN, default_fstat_cbk, NULL, fd, xdata); return 0; @@ -1376,7 +1377,7 @@ ec_gf_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) int32_t ec_gf_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { - ec_statfs(frame, this, gf_failure, EC_MINIMUM_MIN, default_statfs_cbk, NULL, loc, + ec_statfs(frame, this, -1, EC_MINIMUM_MIN, default_statfs_cbk, NULL, loc, xdata); return 0; @@ -1386,7 +1387,7 @@ int32_t ec_gf_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, loc_t *loc, mode_t umask, dict_t *xdata) { - ec_symlink(frame, this, gf_failure, EC_MINIMUM_MIN, default_symlink_cbk, NULL, + ec_symlink(frame, this, -1, EC_MINIMUM_MIN, default_symlink_cbk, NULL, linkname, loc, umask, xdata); return 0; @@ -1396,7 +1397,7 @@ int32_t ec_gf_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, dict_t *xdata) { - ec_truncate(frame, this, gf_failure, EC_MINIMUM_MIN, default_truncate_cbk, NULL, + ec_truncate(frame, this, -1, EC_MINIMUM_MIN, default_truncate_cbk, NULL, loc, offset, xdata); return 0; @@ -1406,7 +1407,7 @@ int32_t ec_gf_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, dict_t *xdata) { - ec_ftruncate(frame, this, gf_failure, EC_MINIMUM_MIN, default_ftruncate_cbk, NULL, + ec_ftruncate(frame, this, -1, EC_MINIMUM_MIN, default_ftruncate_cbk, NULL, fd, offset, xdata); return 0; @@ -1416,7 +1417,7 @@ int32_t ec_gf_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags, dict_t *xdata) { - ec_unlink(frame, this, gf_failure, EC_MINIMUM_MIN, default_unlink_cbk, NULL, loc, + ec_unlink(frame, this, -1, EC_MINIMUM_MIN, default_unlink_cbk, NULL, loc, xflags, xdata); return 0; @@ -1427,7 +1428,7 @@ ec_gf_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, int32_t count, off_t offset, uint32_t flags, struct iobref *iobref, dict_t *xdata) { - ec_writev(frame, this, gf_failure, EC_MINIMUM_MIN, default_writev_cbk, NULL, fd, + ec_writev(frame, this, -1, EC_MINIMUM_MIN, default_writev_cbk, NULL, fd, vector, count, offset, flags, iobref, xdata); return 0; @@ -1437,7 +1438,7 @@ int32_t ec_gf_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata) { - ec_xattrop(frame, this, gf_failure, EC_MINIMUM_MIN, default_xattrop_cbk, NULL, loc, + ec_xattrop(frame, this, -1, EC_MINIMUM_MIN, default_xattrop_cbk, NULL, loc, optype, xattr, xdata); return 0; @@ -1447,7 +1448,7 @@ int32_t ec_gf_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd, gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata) { - ec_fxattrop(frame, this, gf_failure, EC_MINIMUM_MIN, default_fxattrop_cbk, NULL, fd, + ec_fxattrop(frame, this, -1, EC_MINIMUM_MIN, default_fxattrop_cbk, NULL, fd, optype, xattr, xdata); return 0; @@ -1466,7 +1467,7 @@ int32_t ec_gf_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, gf_seek_what_t what, dict_t *xdata) { - ec_seek(frame, this, gf_failure, EC_MINIMUM_ONE, default_seek_cbk, NULL, fd, offset, + ec_seek(frame, this, -1, EC_MINIMUM_ONE, default_seek_cbk, NULL, fd, offset, what, xdata); return 0; @@ -1475,7 +1476,7 @@ ec_gf_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, int32_t ec_gf_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata) { - ec_ipc(frame, this, gf_failure, EC_MINIMUM_MIN, default_ipc_cbk, NULL, op, xdata); + ec_ipc(frame, this, -1, EC_MINIMUM_MIN, default_ipc_cbk, NULL, op, xdata); return 0; } From 16049ee0b627a9dd319c13895356348af5d9803d Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 17 Sep 2020 09:34:32 +0530 Subject: [PATCH 14/24] posix/: compile complete Change-Id: I4f7dc1490b928f77a00939f26ae777e001bb672d Signed-off-by: Amar Tumballi --- xlators/storage/posix/src/posix-aio.c | 26 +- xlators/storage/posix/src/posix-common.c | 2 +- xlators/storage/posix/src/posix-entry-ops.c | 87 ++++--- xlators/storage/posix/src/posix-handle.h | 2 +- xlators/storage/posix/src/posix-helpers.c | 24 +- .../storage/posix/src/posix-inode-fd-ops.c | 244 +++++++++++------- xlators/storage/posix/src/posix-metadata.c | 4 +- 7 files changed, 233 insertions(+), 156 deletions(-) diff --git a/xlators/storage/posix/src/posix-aio.c b/xlators/storage/posix/src/posix-aio.c index 2df8780ac0..ae225c95a5 100644 --- a/xlators/storage/posix/src/posix-aio.c +++ b/xlators/storage/posix/src/posix-aio.c @@ -76,7 +76,7 @@ posix_aio_readv_complete(struct posix_aio_cb *paiocb, int res, int res2) 0, }; int _fd = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret; int op_errno = 0; struct iovec iov; struct iobref *iobref = NULL; @@ -94,7 +94,7 @@ posix_aio_readv_complete(struct posix_aio_cb *paiocb, int res, int res2) offset = paiocb->offset; if (res < 0) { - op_ret = -1; + ret = -1; op_errno = -res; gf_msg(this->name, GF_LOG_ERROR, op_errno, P_MSG_READV_FAILED, "readv(async) failed fd=%d,size=%lu,offset=%llu (%d)", _fd, @@ -105,19 +105,18 @@ posix_aio_readv_complete(struct posix_aio_cb *paiocb, int res, int res2) ret = posix_fdstat(this, fd->inode, _fd, &postbuf); if (ret != 0) { - op_ret = -1; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, P_MSG_FSTAT_FAILED, "fstat failed on fd=%d", _fd); goto out; } - op_ret = res; + ret = res; op_errno = 0; iobref = iobref_new(); if (!iobref) { - op_ret = -1; + ret = -1; op_errno = ENOMEM; goto out; } @@ -125,15 +124,16 @@ posix_aio_readv_complete(struct posix_aio_cb *paiocb, int res, int res2) iobref_add(iobref, iobuf); iov.iov_base = iobuf_ptr(iobuf); - iov.iov_len = op_ret; + iov.iov_len = ret; /* Hack to notify higher layers of EOF. */ if (!postbuf.ia_size || (offset + iov.iov_len) >= postbuf.ia_size) op_errno = ENOENT; - GF_ATOMIC_ADD(priv->read_value, op_ret); + GF_ATOMIC_ADD(priv->read_value, ret); out: + SET_RET(op_ret, ret); STACK_UNWIND_STRICT(readv, frame, op_ret, op_errno, &iov, 1, &postbuf, iobref, NULL); if (iobuf) @@ -254,14 +254,14 @@ posix_aio_writev_complete(struct posix_aio_cb *paiocb, int res, int res2) 0, }; int _fd = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret; int op_errno = 0; int ret = 0; struct posix_private *priv = NULL; fd_t *fd = NULL; if (!paiocb) { - op_ret = -1; + ret = -1; op_errno = EINVAL; goto out; } @@ -274,7 +274,7 @@ posix_aio_writev_complete(struct posix_aio_cb *paiocb, int res, int res2) _fd = paiocb->_fd; if (res < 0) { - op_ret = -1; + ret = -1; op_errno = -res; gf_msg(this->name, GF_LOG_ERROR, op_errno, P_MSG_WRITEV_FAILED, "writev(async) failed fd=%d,offset=%llu (%d)", _fd, @@ -285,19 +285,19 @@ posix_aio_writev_complete(struct posix_aio_cb *paiocb, int res, int res2) ret = posix_fdstat(this, fd->inode, _fd, &postbuf); if (ret != 0) { - op_ret = -1; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, P_MSG_FSTAT_FAILED, "fstat failed on fd=%d", _fd); goto out; } - op_ret = res; + ret = res; op_errno = 0; - GF_ATOMIC_ADD(priv->write_value, op_ret); + GF_ATOMIC_ADD(priv->write_value, ret); out: + SET_RET(op_ret, ret); STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, &prebuf, &postbuf, NULL); diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c index 00e0d02f85..f10722ec3f 100644 --- a/xlators/storage/posix/src/posix-common.c +++ b/xlators/storage/posix/src/posix-common.c @@ -590,7 +590,7 @@ posix_init(xlator_t *this) }; gf_boolean_t tmp_bool = 0; int ret = 0; - gf_return_t op_ret = -1; + int op_ret = -1; int op_errno = 0; ssize_t size = -1; uuid_t old_uuid = { diff --git a/xlators/storage/posix/src/posix-entry-ops.c b/xlators/storage/posix/src/posix-entry-ops.c index 8ab0c1dbb6..d7ede89c7d 100644 --- a/xlators/storage/posix/src/posix-entry-ops.c +++ b/xlators/storage/posix/src/posix-entry-ops.c @@ -158,7 +158,7 @@ posix_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) struct iatt buf = { 0, }; - gf_return_t op_ret = -1; + int op_ret = -1; int32_t entry_ret = 0; int32_t op_errno = 0; dict_t *xattr = NULL; @@ -175,7 +175,7 @@ posix_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t nlink_samepgfid = 0; struct posix_private *priv = NULL; posix_inode_ctx_t *ctx = NULL; - int ret = 0; + gf_return_t ret; int dfd = -1; VALIDATE_OR_GOTO(frame, out); @@ -227,7 +227,6 @@ posix_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) op_ret = posix_gfid_heal(this, real_path, loc, xdata); if (op_ret < 0) { op_errno = -op_ret; - op_ret = -1; goto out; } MAKE_ENTRY_HANDLE(real_path, par_path, this, loc, &buf); @@ -247,12 +246,14 @@ posix_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) op_errno = ESTALE; loc_gfid(loc, gfid); MAKE_HANDLE_ABSPATH_FD(gfid_path, this, gfid, dfd); - ret = sys_fstatat(dfd, gfid_path, &statbuf, 0); - if (ret == 0 && ((statbuf.st_mode & S_IFMT) == S_IFDIR)) + op_ret = sys_fstatat(dfd, gfid_path, &statbuf, 0); + if (op_ret == 0 && ((statbuf.st_mode & S_IFMT) == S_IFDIR)) { /*Don't unset if it was a symlink to a dir.*/ + op_ret = -1; goto parent; - ret = sys_fstatat(dfd, gfid_path, &statbuf, AT_SYMLINK_NOFOLLOW); - if (ret == 0 && statbuf.st_nlink == 1) { + } + op_ret = sys_fstatat(dfd, gfid_path, &statbuf, AT_SYMLINK_NOFOLLOW); + if (op_ret == 0 && statbuf.st_nlink == 1) { gf_msg(this->name, GF_LOG_WARNING, op_errno, P_MSG_HANDLE_DELETE, "Found stale gfid " @@ -261,6 +262,7 @@ posix_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) posix_handle_unset(this, gfid, NULL); } } + op_ret = -1; goto parent; } @@ -271,8 +273,8 @@ posix_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) &xattr, _gf_true); if (dict_get_sizen(xdata, GF_CLEAN_WRITE_PROTECTION)) { - ret = sys_lremovexattr(real_path, GF_PROTECT_FROM_EXTERNAL_WRITES); - if (ret == -1 && (errno != ENODATA && errno != ENOATTR)) + op_ret = sys_lremovexattr(real_path, GF_PROTECT_FROM_EXTERNAL_WRITES); + if (op_ret == -1 && (errno != ENODATA && errno != ENOATTR)) gf_msg(this->name, GF_LOG_ERROR, P_MSG_XATTR_NOT_REMOVED, errno, "removexattr failed. key %s path %s", GF_PROTECT_FROM_EXTERNAL_WRITES, loc->path); @@ -335,7 +337,9 @@ posix_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) if (op_ret == 0) op_errno = 0; - STACK_UNWIND_STRICT(lookup, frame, op_ret, op_errno, + + SET_RET(ret, op_ret); + STACK_UNWIND_STRICT(lookup, frame, ret, op_errno, (loc) ? loc->inode : NULL, &buf, xattr, &postparent); if (xattr) @@ -381,7 +385,8 @@ posix_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, dev_t dev, mode_t umask, dict_t *xdata) { int tmp_fd = 0; - gf_return_t op_ret = -1; + gf_return_t ret; + int op_ret = -1; int32_t op_errno = 0; char *real_path = 0; char *par_path = 0; @@ -606,7 +611,8 @@ posix_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, posix_gfid_unset(this, xdata); } - STACK_UNWIND_STRICT(mknod, frame, op_ret, op_errno, + SET_RET(ret, op_ret); + STACK_UNWIND_STRICT(mknod, frame, ret, op_errno, (loc) ? loc->inode : NULL, &stbuf, &preparent, &postparent, NULL); @@ -617,7 +623,8 @@ int posix_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata) { - gf_return_t op_ret = -1; + int op_ret = -1; + gf_return_t ret; int32_t op_errno = 0; char *real_path = NULL, *gfid_path = NULL; char *par_path = NULL, *xattr_name = NULL; @@ -958,7 +965,8 @@ posix_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, posix_gfid_unset(this, xdata); } - STACK_UNWIND_STRICT(mkdir, frame, op_ret, op_errno, + SET_RET(ret, op_ret); + STACK_UNWIND_STRICT(mkdir, frame, ret, op_errno, (loc) ? loc->inode : NULL, &stbuf, &preparent, &postparent, xdata_rsp); @@ -1120,7 +1128,7 @@ posix_skip_non_linkto_unlink(dict_t *xdata, loc_t *loc, char *key, gf_boolean_t is_dht_linkto_file = _gf_false; int unlink_if_linkto = 0; ssize_t xattr_size = -1; - gf_return_t op_ret = -1; + int op_ret = -1; op_ret = dict_get_int32n(xdata, key, keylen, &unlink_if_linkto); @@ -1181,12 +1189,12 @@ int32_t posix_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, dict_t *xdata) { - gf_return_t op_ret = -1; + int op_ret = -1; + gf_return_t ret; int32_t op_errno = 0; char *real_path = NULL; char *par_path = NULL; int32_t fd = -1; - int ret = -1; struct iatt stbuf = { 0, }; @@ -1333,9 +1341,9 @@ posix_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, } if (xdata && dict_get_sizen(xdata, GF_GET_FILE_BLOCK_COUNT)) { - ret = dict_set_uint64(unwind_dict, GF_GET_FILE_BLOCK_COUNT, + op_ret = dict_set_uint64(unwind_dict, GF_GET_FILE_BLOCK_COUNT, stbuf.ia_blocks); - if (ret) + if (op_ret) gf_msg(this->name, GF_LOG_WARNING, 0, P_MSG_SET_XDATA_FAIL, "Failed to set %s in rsp dict", GF_GET_FILE_BLOCK_COUNT); } @@ -1383,7 +1391,8 @@ posix_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(unlink, frame, op_ret, op_errno, &preparent, + SET_RET(ret, op_ret); + STACK_UNWIND_STRICT(unlink, frame, ret, op_errno, &preparent, &postparent, unwind_dict); if (fd != -1) { @@ -1402,7 +1411,8 @@ int posix_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t ret; + int op_ret = -1; int32_t op_errno = 0; char *real_path = NULL; char *par_path = NULL; @@ -1531,7 +1541,8 @@ posix_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(rmdir, frame, op_ret, op_errno, &preparent, &postparent, + SET_RET(ret, op_ret); + STACK_UNWIND_STRICT(rmdir, frame, ret, op_errno, &preparent, &postparent, NULL); return 0; @@ -1541,7 +1552,8 @@ int posix_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, loc_t *loc, mode_t umask, dict_t *xdata) { - gf_return_t op_ret = -1; + int op_ret = -1; + gf_return_t ret; int32_t op_errno = 0; char *real_path = 0; char *par_path = 0; @@ -1689,7 +1701,8 @@ posix_symlink(call_frame_t *frame, xlator_t *this, const char *linkname, posix_gfid_unset(this, xdata); } - STACK_UNWIND_STRICT(symlink, frame, op_ret, op_errno, + SET_RET(ret, op_ret); + STACK_UNWIND_STRICT(symlink, frame, ret, op_errno, (loc) ? loc->inode : NULL, &stbuf, &preparent, &postparent, NULL); @@ -1700,7 +1713,8 @@ int posix_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t ret; + int op_ret = -1; int32_t op_errno = 0; char *real_oldpath = NULL; char *real_newpath = NULL; @@ -1981,7 +1995,8 @@ posix_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(rename, frame, op_ret, op_errno, &stbuf, &preoldparent, + SET_RET(ret, op_ret); + STACK_UNWIND_STRICT(rename, frame, ret, op_errno, &stbuf, &preoldparent, &postoldparent, &prenewparent, &postnewparent, unwind_dict); @@ -1995,7 +2010,8 @@ int posix_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { - gf_return_t op_ret = -1; + int op_ret = -1; + gf_return_t ret; int32_t op_errno = 0; char *real_oldpath = 0; char *real_newpath = 0; @@ -2140,7 +2156,8 @@ posix_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(link, frame, op_ret, op_errno, + SET_RET(ret, op_ret); + STACK_UNWIND_STRICT(link, frame, ret, op_errno, (oldloc) ? oldloc->inode : NULL, &stbuf, &preparent, &postparent, NULL); @@ -2156,7 +2173,8 @@ int posix_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata) { - gf_return_t op_ret = -1; + int op_ret = -1; + gf_return_t ret; int32_t op_errno = 0; int32_t _fd = -1; int _flags = 0; @@ -2374,8 +2392,8 @@ posix_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, if (gfid_set) posix_gfid_unset(this, xdata); } - - STACK_UNWIND_STRICT(create, frame, op_ret, op_errno, fd, + SET_RET(ret, op_ret); + STACK_UNWIND_STRICT(create, frame, ret, op_errno, fd, (loc) ? loc->inode : NULL, &stbuf, &preparent, &postparent, xdata_rsp); @@ -2394,7 +2412,8 @@ posix_put(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, mode_t umask, uint32_t flags, struct iovec *vector, int32_t count, off_t offset, struct iobref *iobref, dict_t *xattr, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t ret; + int op_ret = -1; int32_t op_errno = 0; fd_t *fd = NULL; char *real_path = NULL; @@ -2489,7 +2508,9 @@ posix_put(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, goto out; } out: - STACK_UNWIND_STRICT(put, frame, op_ret, op_errno, loc->inode, &stbuf, + + SET_RET(ret, op_ret); + STACK_UNWIND_STRICT(put, frame, ret, op_errno, loc->inode, &stbuf, &preparent, &postparent, NULL); return 0; diff --git a/xlators/storage/posix/src/posix-handle.h b/xlators/storage/posix/src/posix-handle.h index f33ed92620..4bc6b51075 100644 --- a/xlators/storage/posix/src/posix-handle.h +++ b/xlators/storage/posix/src/posix-handle.h @@ -151,7 +151,7 @@ dfd = __priv->arrdfd[findex]; \ } while (0) -#define MAKE_ENTRY_HANDLE(entp, parp, this, loc, ent_p) \ +#define MAKE_ENTRY_HANDLE(entp, parp, this, loc, ent_p) \ do { \ char *__parp; \ \ diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 0d6df6b2df..a4f11db50e 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -2305,7 +2305,7 @@ posix_disk_space_check(xlator_t *this) { struct posix_private *priv = NULL; char *subvol_path = NULL; - gf_return_t op_ret = 0; + int ret; double size = 0; double percent = 0; struct statvfs buf = {0}; @@ -2318,9 +2318,9 @@ posix_disk_space_check(xlator_t *this) subvol_path = priv->base_path; - op_ret = sys_statvfs(subvol_path, &buf); + ret = sys_statvfs(subvol_path, &buf); - if (op_ret == -1) { + if (ret == -1) { gf_msg(this->name, GF_LOG_ERROR, errno, P_MSG_STATVFS_FAILED, "statvfs failed on %s", subvol_path); goto out; @@ -2453,7 +2453,7 @@ posix_fsyncer_process(xlator_t *this, call_stub_t *stub, gf_boolean_t do_fsync) gf_msg(this->name, GF_LOG_ERROR, op_errno, P_MSG_GET_FDCTX_FAILED, "could not get fdctx for fd(%s)", uuid_utoa(stub->args.fd->inode->gfid)); - call_unwind_error(stub, -1, op_errno); + call_unwind_error(stub, gf_failure, op_errno); return; } @@ -2469,11 +2469,11 @@ posix_fsyncer_process(xlator_t *this, call_stub_t *stub, gf_boolean_t do_fsync) if (ret) { gf_msg(this->name, GF_LOG_ERROR, errno, P_MSG_FSTAT_FAILED, "could not fstat fd(%s)", uuid_utoa(stub->args.fd->inode->gfid)); - call_unwind_error(stub, -1, errno); + call_unwind_error(stub, gf_failure, errno); return; } - call_unwind_error(stub, 0, 0); + call_unwind_error(stub, gf_zero_ret, 0); } static void @@ -3570,7 +3570,7 @@ posix_update_iatt_buf(struct iatt *buf, int fd, char *loc, dict_t *xattr_req) gf_boolean_t posix_is_layout_stale(dict_t *xdata, char *par_path, xlator_t *this) { - gf_return_t op_ret = 0; + int ret; ssize_t size = 0; char value_buf[4096] = { 0, @@ -3581,16 +3581,14 @@ posix_is_layout_stale(dict_t *xdata, char *par_path, xlator_t *this) size_t xattr_len = 0; gf_boolean_t is_stale = _gf_false; - op_ret = dict_get_str_sizen(xdata, GF_PREOP_PARENT_KEY, &xattr_name); + ret = dict_get_str_sizen(xdata, GF_PREOP_PARENT_KEY, &xattr_name); if (xattr_name == NULL) { - op_ret = 0; return is_stale; } xattr_len = strlen(xattr_name); arg_data = dict_getn(xdata, xattr_name, xattr_len); if (!arg_data) { - op_ret = 0; dict_del_sizen(xdata, GF_PREOP_PARENT_KEY); return is_stale; } @@ -3609,7 +3607,7 @@ posix_is_layout_stale(dict_t *xdata, char *par_path, xlator_t *this) size = sys_lgetxattr(par_path, xattr_name, NULL, 0); } if (size < 0) { - op_ret = -1; + ret = -1; gf_msg(this->name, GF_LOG_ERROR, errno, P_MSG_PREOP_CHECK_FAILED, "getxattr on key (%s) failed, path : %s", xattr_name, par_path); @@ -3632,14 +3630,14 @@ posix_is_layout_stale(dict_t *xdata, char *par_path, xlator_t *this) "failing preop as on-disk xattr value differs from argument " "value for key %s", xattr_name); - op_ret = -1; + ret = -1; } out: dict_deln(xdata, xattr_name, xattr_len); dict_del_sizen(xdata, GF_PREOP_PARENT_KEY); - if (op_ret == -1) { + if (ret == -1) { is_stale = _gf_true; } diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c index 4f3818f47d..037ec3cbd0 100644 --- a/xlators/storage/posix/src/posix-inode-fd-ops.c +++ b/xlators/storage/posix/src/posix-inode-fd-ops.c @@ -163,7 +163,8 @@ posix_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) struct iatt buf = { 0, }; - gf_return_t op_ret = -1; + int op_ret = -1; + gf_return_t fin_ret; int32_t op_errno = 0; struct posix_private *priv = NULL; char *real_path = NULL; @@ -198,21 +199,23 @@ posix_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) goto out; } if (xdata) { - xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, gf_failure, xdata, + xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, -1, xdata, &buf); posix_cs_maintenance(this, NULL, loc, NULL, &buf, real_path, xdata, &xattr_rsp, _gf_true); - posix_cs_build_xattr_rsp(this, &xattr_rsp, xdata, gf_failure, real_path); + posix_cs_build_xattr_rsp(this, &xattr_rsp, xdata, -1, real_path); } - posix_update_iatt_buf(&buf, gf_failure, real_path, xdata); + posix_update_iatt_buf(&buf, -1, real_path, xdata); op_ret = 0; out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(stat, frame, op_ret, op_errno, &buf, xattr_rsp); + + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(stat, frame, fin_ret, op_errno, &buf, xattr_rsp); if (xattr_rsp) dict_unref(xattr_rsp); @@ -356,7 +359,8 @@ int posix_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, int32_t valid, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; char *real_path = 0; struct iatt statpre = { @@ -421,21 +425,21 @@ posix_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, real_path, loc->path); goto out; } - posix_update_utime_in_mdata(this, real_path, gf_failure, loc->inode, + posix_update_utime_in_mdata(this, real_path, -1, loc->inode, &frame->root->ctime, stbuf, valid); } if ((valid & GF_SET_ATTR_CTIME) && priv->ctime) { - posix_update_ctime_in_mdata(this, real_path, gf_failure, loc->inode, + posix_update_ctime_in_mdata(this, real_path, -1, loc->inode, &frame->root->ctime, stbuf, valid); } if (!valid) { - op_ret = sys_lchown(real_path, gf_failure, -1); + op_ret = sys_lchown(real_path, -1, -1); if (op_ret == -1) { op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, errno, P_MSG_LCHOWN_FAILED, - "lchown (gfid-handle: %s, path: %s, gf_failure, -1) " + "lchown (gfid-handle: %s, path: %s, -1, -1) " "failed", real_path, loc->path); @@ -453,19 +457,20 @@ posix_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, goto out; } - posix_set_ctime(frame, this, real_path, gf_failure, loc->inode, &statpost); + posix_set_ctime(frame, this, real_path, -1,loc->inode, &statpost); if (xdata) - xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, gf_failure, xdata, + xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, -1,xdata, &statpost); - posix_update_iatt_buf(&statpre, gf_failure, real_path, xdata); - posix_update_iatt_buf(&statpost, gf_failure, real_path, xdata); + posix_update_iatt_buf(&statpre, -1,real_path, xdata); + posix_update_iatt_buf(&statpost, -1,real_path, xdata); op_ret = 0; out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(setattr, frame, op_ret, op_errno, &statpre, &statpost, + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(setattr, frame, fin_ret, op_errno, &statpre, &statpost, xattr_rsp); if (xattr_rsp) dict_unref(xattr_rsp); @@ -569,7 +574,8 @@ int posix_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, int32_t valid, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; struct iatt statpre = { 0, @@ -651,11 +657,11 @@ posix_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, } if (!valid) { - op_ret = sys_fchown(pfd->fd, gf_failure, -1); + op_ret = sys_fchown(pfd->fd, -1, -1); if (op_ret == -1) { op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, errno, P_MSG_FCHOWN_FAILED, - "fchown (%d, gf_failure, -1) failed", pfd->fd); + "fchown (%d, -1, -1) failed", pfd->fd); goto out; } @@ -679,7 +685,8 @@ posix_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(fsetattr, frame, op_ret, op_errno, &statpre, &statpost, + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(fsetattr, frame, fin_ret, op_errno, &statpre, &statpost, xattr_rsp); if (xattr_rsp) dict_unref(xattr_rsp); @@ -847,7 +854,7 @@ _posix_do_zerofill(int fd, off_t offset, off_t len, int o_direct) off_t num_vect = 0; off_t num_loop = 1; off_t idx = 0; - gf_return_t op_ret = -1; + int op_ret = -1; int32_t vect_size = VECTOR_SIZE; off_t remain = 0; off_t extra = 0; @@ -1072,7 +1079,7 @@ posix_glfallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, if (ret < 0) goto err; - STACK_UNWIND_STRICT(fallocate, frame, 0, 0, &statpre, &statpost, rsp_xdata); + STACK_UNWIND_STRICT(fallocate, frame, gf_zero_ret, 0, &statpre, &statpost, rsp_xdata); return 0; err: @@ -1103,7 +1110,7 @@ posix_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, if (ret < 0) goto err; - STACK_UNWIND_STRICT(discard, frame, 0, 0, &statpre, &statpost, rsp_xdata); + STACK_UNWIND_STRICT(discard, frame, gf_zero_ret, 0, &statpre, &statpost, rsp_xdata); return 0; err: @@ -1124,7 +1131,8 @@ posix_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, 0, }; struct posix_private *priv = NULL; - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int op_errno = EINVAL; dict_t *rsp_xdata = NULL; gf_boolean_t check_space_error = _gf_false; @@ -1149,7 +1157,7 @@ posix_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, goto unwind; } - STACK_UNWIND_STRICT(zerofill, frame, 0, 0, &statpre, &statpost, rsp_xdata); + STACK_UNWIND_STRICT(zerofill, frame, gf_zero_ret, 0, &statpre, &statpost, rsp_xdata); return 0; out: @@ -1178,7 +1186,8 @@ posix_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, } unwind: - STACK_UNWIND_STRICT(zerofill, frame, op_ret, op_errno, NULL, NULL, + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(zerofill, frame, fin_ret, op_errno, NULL, NULL, rsp_xdata); return 0; } @@ -1270,7 +1279,7 @@ posix_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(seek, frame, (ret == -1 ? -1 : 0), err, + STACK_UNWIND_STRICT(seek, frame, (ret == -1 ? gf_failure : gf_zero_ret), err, (ret == -1 ? -1 : ret), rsp_xdata); #else STACK_UNWIND_STRICT(seek, frame, gf_failure, EINVAL, 0, NULL); @@ -1283,7 +1292,8 @@ posix_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, dict_t *xdata) { char *real_path = NULL; - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = EINVAL; DIR *dir = NULL; struct posix_fd *pfd = NULL; @@ -1357,7 +1367,8 @@ posix_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, } SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(opendir, frame, op_ret, op_errno, fd, NULL); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(opendir, frame, fin_ret, op_errno, fd, NULL); return 0; } @@ -1410,7 +1421,8 @@ posix_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, dict_t *xdata) { char *dest = NULL; - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = EINVAL; char *real_path = NULL; struct iatt stbuf = { @@ -1447,7 +1459,8 @@ posix_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(readlink, frame, op_ret, op_errno, dest, &stbuf, NULL); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(readlink, frame, fin_ret, op_errno, dest, &stbuf, NULL); return 0; } @@ -1456,7 +1469,8 @@ int32_t posix_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; char *real_path = 0; struct posix_private *priv = NULL; @@ -1500,7 +1514,7 @@ posix_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, } } - posix_update_iatt_buf(&prebuf, gf_failure, real_path, xdata); + posix_update_iatt_buf(&prebuf, -1,real_path, xdata); op_ret = sys_truncate(real_path, offset); if (op_ret == -1) { op_errno = errno; @@ -1520,13 +1534,14 @@ posix_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, goto out; } - posix_set_ctime(frame, this, real_path, gf_failure, loc->inode, &postbuf); + posix_set_ctime(frame, this, real_path, -1,loc->inode, &postbuf); op_ret = 0; out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(truncate, frame, op_ret, op_errno, &prebuf, &postbuf, + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(truncate, frame, fin_ret, op_errno, &prebuf, &postbuf, NULL); return 0; @@ -1536,7 +1551,8 @@ int32_t posix_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, fd_t *fd, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; char *real_path = NULL; int32_t _fd = -1; @@ -1602,7 +1618,7 @@ posix_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, goto out; } - posix_set_ctime(frame, this, real_path, gf_failure, loc->inode, &stbuf); + posix_set_ctime(frame, this, real_path, -1,loc->inode, &stbuf); pfd = GF_CALLOC(1, sizeof(*pfd), gf_posix_mt_posix_fd); if (!pfd) { @@ -1643,7 +1659,8 @@ posix_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(open, frame, op_ret, op_errno, fd, rsp_xdata); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(open, frame, fin_ret, op_errno, fd, rsp_xdata); return 0; } @@ -1652,7 +1669,8 @@ int posix_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; int _fd = -1; struct posix_private *priv = NULL; @@ -1773,7 +1791,8 @@ posix_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, out: - STACK_UNWIND_STRICT(readv, frame, op_ret, op_errno, &vec, 1, &stbuf, iobref, + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(readv, frame, fin_ret, op_errno, &vec, 1, &stbuf, iobref, rsp_xdata); if (iobref) @@ -1787,7 +1806,7 @@ posix_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int32_t __posix_pwritev(int fd, struct iovec *vector, int count, off_t offset) { - gf_return_t op_ret = 0; + int op_ret = 0; int idx = 0; int retval = 0; off_t internal_off = 0; @@ -1815,7 +1834,7 @@ int32_t __posix_writev(int fd, struct iovec *vector, int count, off_t startoff, int odirect) { - gf_return_t op_ret = 0; + int op_ret = 0; int idx = 0; int max_buf_size = 0; int retval = 0; @@ -1925,7 +1944,8 @@ posix_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, int32_t count, off_t offset, uint32_t flags, struct iobref *iobref, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; int _fd = -1; struct posix_private *priv = NULL; @@ -2136,7 +2156,8 @@ posix_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, } unwind: - STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, &preop, &postop, + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(writev, frame, fin_ret, op_errno, &preop, &postop, rsp_xdata); if (rsp_xdata) @@ -2149,7 +2170,8 @@ posix_copy_file_range(call_frame_t *frame, xlator_t *this, fd_t *fd_in, off64_t off_in, fd_t *fd_out, off64_t off_out, size_t len, uint32_t flags, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; int _fd_in = -1; int _fd_out = -1; @@ -2400,7 +2422,8 @@ posix_copy_file_range(call_frame_t *frame, xlator_t *this, fd_t *fd_in, locked = _gf_false; } - STACK_UNWIND_STRICT(copy_file_range, frame, op_ret, op_errno, &stbuf, + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(copy_file_range, frame, fin_ret, op_errno, &stbuf, &preop_dst, &postop_dst, rsp_xdata); if (rsp_xdata) @@ -2412,7 +2435,8 @@ int32_t posix_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { char *real_path = NULL; - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; struct statvfs buf = { 0, @@ -2488,14 +2512,16 @@ posix_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) op_ret = 0; out: - STACK_UNWIND_STRICT(statfs, frame, op_ret, op_errno, &buf, NULL); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(statfs, frame, fin_ret, op_errno, &buf, NULL); return 0; } int32_t posix_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; int ret = -1; struct posix_fd *pfd = NULL; @@ -2514,7 +2540,8 @@ posix_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) op_ret = 0; out: - STACK_UNWIND_STRICT(flush, frame, op_ret, op_errno, NULL); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(flush, frame, fin_ret, op_errno, NULL); return 0; } @@ -2578,7 +2605,8 @@ int32_t posix_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; int _fd = -1; struct posix_fd *pfd = NULL; @@ -2664,7 +2692,8 @@ posix_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(fsync, frame, op_ret, op_errno, &preop, &postop, NULL); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(fsync, frame, fin_ret, op_errno, &preop, &postop, NULL); return 0; } @@ -2703,7 +2732,8 @@ int32_t posix_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int flags, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; char *real_path = NULL; char *acl_xattr = NULL; @@ -2932,7 +2962,7 @@ posix_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, goto out; } - subvol_xattrs = posix_xattr_fill(this, real_path, loc, NULL, gf_failure, xdata, + subvol_xattrs = posix_xattr_fill(this, real_path, loc, NULL, -1,xdata, NULL); /* Remove all user xattrs from the file */ @@ -3076,7 +3106,8 @@ posix_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(setxattr, frame, op_ret, op_errno, xattr); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(setxattr, frame, fin_ret, op_errno, xattr); if (xattr) dict_unref(xattr); @@ -3092,7 +3123,7 @@ posix_xattr_get_real_filename(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, dict_t *dict, dict_t *xdata) { int ret = -1; - gf_return_t op_ret = -1; + int op_ret = -1; const char *fname = NULL; char *real_path = NULL; char *found = NULL; @@ -3197,7 +3228,7 @@ posix_links_in_same_directory(char *dirpath, int count, inode_t *leaf_inode, gf_dirent_t *head, char **path, int type, dict_t *xdata, int32_t *op_errno) { - gf_return_t op_ret = -1; + int op_ret = -1; gf_dirent_t *gf_entry = NULL; xlator_t *this = NULL; struct posix_private *priv = NULL; @@ -3269,7 +3300,7 @@ posix_links_in_same_directory(char *dirpath, int count, inode_t *leaf_inode, goto out; } gf_entry->inode = inode_ref(leaf_inode); - gf_entry->dict = posix_xattr_fill(this, temppath, &loc, NULL, gf_failure, + gf_entry->dict = posix_xattr_fill(this, temppath, &loc, NULL, -1, xdata, NULL); iatt_from_stat(&(gf_entry->d_stat), stbuf); @@ -3320,7 +3351,7 @@ posix_get_ancestry_non_directory(xlator_t *this, inode_t *leaf_inode, int32_t *op_errno, dict_t *xdata) { size_t remaining_size = 0; - gf_return_t op_ret = gf_failure, pathlen = -1; + int op_ret = -1, pathlen = -1; ssize_t handle_size = 0; uuid_t pgfid = { 0, @@ -3511,7 +3542,8 @@ posix_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { struct posix_private *priv = NULL; - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; char *value = NULL; char *real_path = NULL; @@ -3573,7 +3605,7 @@ posix_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, } if (loc->inode && name && GF_POSIX_ACL_REQUEST(name)) { - ret = posix_pacl_get(real_path, gf_failure, name, &value); + ret = posix_pacl_get(real_path, -1,name, &value); if (ret || !value) { op_errno = errno; gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_ACL_FAILED, @@ -4005,7 +4037,7 @@ posix_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, op_ret = size; if (xdata && (op_ret >= 0)) { - xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, gf_failure, xdata, + xattr_rsp = posix_xattr_fill(this, real_path, loc, NULL, -1,xdata, &buf); } @@ -4017,7 +4049,8 @@ posix_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(getxattr, frame, op_ret, op_errno, dict, xattr_rsp); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(getxattr, frame, fin_ret, op_errno, dict, xattr_rsp); if (xattr_rsp) dict_unref(xattr_rsp); @@ -4033,7 +4066,8 @@ int32_t posix_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = EINVAL; struct posix_fd *pfd = NULL; int _fd = -1; @@ -4319,7 +4353,8 @@ posix_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(fgetxattr, frame, op_ret, op_errno, dict, xattr_rsp); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(fgetxattr, frame, fin_ret, op_errno, dict, xattr_rsp); if (xattr_rsp) dict_unref(xattr_rsp); @@ -4345,7 +4380,8 @@ int32_t posix_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int flags, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; struct posix_fd *pfd = NULL; int _fd = -1; @@ -4440,7 +4476,8 @@ posix_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(fsetxattr, frame, op_ret, op_errno, xattr); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(fsetxattr, frame, fin_ret, op_errno, xattr); if (xattr) dict_unref(xattr); @@ -4451,7 +4488,7 @@ posix_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int _posix_remove_xattr(dict_t *dict, char *key, data_t *value, void *data) { - gf_return_t op_ret = 0; + int op_ret = 0; xlator_t *this = NULL; posix_xattr_filler_t *filler = NULL; @@ -4511,7 +4548,7 @@ posix_common_removexattr(call_frame_t *frame, loc_t *loc, fd_t *fd, gf_boolean_t disallow = _gf_false; char *real_path = NULL; struct posix_fd *pfd = NULL; - gf_return_t op_ret = 0; + int op_ret = 0; struct iatt preop = { 0, }; @@ -4618,7 +4655,7 @@ posix_common_removexattr(call_frame_t *frame, loc_t *loc, fd_t *fd, } if (loc) { - posix_set_ctime(frame, this, real_path, gf_failure, inode, NULL); + posix_set_ctime(frame, this, real_path, -1,inode, NULL); ret = posix_pstat(this, inode, loc->gfid, real_path, &postop, _gf_false); if (ret) { @@ -4651,7 +4688,8 @@ int32_t posix_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int op_errno = EINVAL; dict_t *xdata_rsp = NULL; @@ -4660,7 +4698,8 @@ posix_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, op_ret = posix_common_removexattr(frame, loc, NULL, name, xdata, &op_errno, &xdata_rsp); out: - STACK_UNWIND_STRICT(removexattr, frame, op_ret, op_errno, xdata_rsp); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(removexattr, frame, fin_ret, op_errno, xdata_rsp); if (xdata_rsp) dict_unref(xdata_rsp); @@ -4672,7 +4711,8 @@ int32_t posix_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = EINVAL; dict_t *xdata_rsp = NULL; @@ -4681,7 +4721,8 @@ posix_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, op_ret = posix_common_removexattr(frame, NULL, fd, name, xdata, &op_errno, &xdata_rsp); out: - STACK_UNWIND_STRICT(fremovexattr, frame, op_ret, op_errno, xdata_rsp); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(fremovexattr, frame, fin_ret, op_errno, xdata_rsp); if (xdata_rsp) dict_unref(xdata_rsp); @@ -4693,7 +4734,8 @@ int32_t posix_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; int ret = -1; struct posix_fd *pfd = NULL; @@ -4712,7 +4754,8 @@ posix_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, op_ret = 0; out: - STACK_UNWIND_STRICT(fsyncdir, frame, op_ret, op_errno, NULL); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(fsyncdir, frame, fin_ret, op_errno, NULL); return 0; } @@ -4845,7 +4888,7 @@ _posix_handle_xattr_keyvalue_pair(dict_t *d, char *k, data_t *v, void *tmp) { int size = 0; int count = 0; - gf_return_t op_ret = 0; + int op_ret = 0; int op_errno = 0; gf_xattrop_flags_t optype = 0; char *array = NULL; @@ -5041,7 +5084,8 @@ int do_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata) { - gf_return_t op_ret = 0; + int op_ret = 0; + gf_return_t fin_ret; int op_errno = 0; int _fd = -1; char *real_path = NULL; @@ -5127,7 +5171,8 @@ do_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, posix_set_mode_in_dict(xdata, xdata_rsp, &stbuf); out: - STACK_UNWIND_STRICT(xattrop, frame, op_ret, op_errno, xattr_rsp, xdata_rsp); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(xattrop, frame, fin_ret, op_errno, xattr_rsp, xdata_rsp); if (xattr_rsp) dict_unref(xattr_rsp); @@ -5157,7 +5202,8 @@ int posix_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; char *real_path = NULL; @@ -5187,7 +5233,8 @@ posix_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(access, frame, op_ret, op_errno, NULL); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(access, frame, fin_ret, op_errno, NULL); return 0; } @@ -5195,7 +5242,8 @@ int32_t posix_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; int _fd = -1; struct iatt preop = { @@ -5272,7 +5320,8 @@ posix_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(ftruncate, frame, op_ret, op_errno, &preop, &postop, + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(ftruncate, frame, fin_ret, op_errno, &preop, &postop, NULL); return 0; @@ -5282,7 +5331,8 @@ int32_t posix_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { int _fd = -1; - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; struct iatt buf = { 0, @@ -5340,7 +5390,8 @@ posix_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) out: SET_TO_OLD_FS_ID(); - STACK_UNWIND_STRICT(fstat, frame, op_ret, op_errno, &buf, xattr_rsp); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(fstat, frame, fin_ret, op_errno, &buf, xattr_rsp); if (xattr_rsp) dict_unref(xattr_rsp); return 0; @@ -5621,7 +5672,7 @@ posix_entry_xattr_fill(xlator_t *this, inode_t *inode, fd_t *fd, /* if we don't send the 'loc', open-fd-count be a problem. */ tmp_loc.inode = inode; - return posix_xattr_fill(this, entry_path, &tmp_loc, NULL, gf_failure, dict, stbuf); + return posix_xattr_fill(this, entry_path, &tmp_loc, NULL, -1,dict, stbuf); } int @@ -5673,7 +5724,7 @@ posix_readdirp_fill(xlator_t *this, fd_t *fd, gf_dirent_t *entries, continue; } - posix_update_iatt_buf(&stbuf, gf_failure, hpath, dict); + posix_update_iatt_buf(&stbuf, -1,hpath, dict); if (!inode) inode = inode_find(itable, stbuf.ia_gfid); @@ -5713,7 +5764,8 @@ posix_do_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, DIR *dir = NULL; int ret = -1; int count = 0; - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; gf_dirent_t entries; int32_t skip_dirs = 0; @@ -5773,10 +5825,12 @@ posix_do_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, posix_readdirp_fill(this, fd, &entries, dict); out: + + SET_RET(fin_ret, op_ret); if (whichop == GF_FOP_READDIR) - STACK_UNWIND_STRICT(readdir, frame, op_ret, op_errno, &entries, NULL); + STACK_UNWIND_STRICT(readdir, frame, fin_ret, op_errno, &entries, NULL); else - STACK_UNWIND_STRICT(readdirp, frame, op_ret, op_errno, &entries, NULL); + STACK_UNWIND_STRICT(readdirp, frame, fin_ret, op_errno, &entries, NULL); gf_dirent_free(&entries); @@ -5795,8 +5849,9 @@ int32_t posix_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t off, dict_t *dict) { + gf_return_t fin_ret; gf_dirent_t entries; - gf_return_t op_ret = gf_failure, op_errno = 0; + int op_ret = -1, op_errno = 0; gf_dirent_t *entry = NULL; if ((dict != NULL) && (dict_get(dict, GET_ANCESTRY_DENTRY_KEY))) { @@ -5810,7 +5865,8 @@ posix_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, list_for_each_entry(entry, &entries.list, list) { op_ret++; } } - STACK_UNWIND_STRICT(readdirp, frame, op_ret, op_errno, &entries, NULL); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(readdirp, frame, fin_ret, op_errno, &entries, NULL); gf_dirent_free(&entries); return 0; @@ -5828,7 +5884,8 @@ posix_rchecksum(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, char *buf = NULL; int _fd = -1; struct posix_fd *pfd = NULL; - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int op_errno = 0; int ret = 0; ssize_t bytes_read = 0; @@ -5947,7 +6004,8 @@ posix_rchecksum(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, posix_set_ctime(frame, this, NULL, _fd, fd->inode, NULL); out: - STACK_UNWIND_STRICT(rchecksum, frame, op_ret, op_errno, weak_checksum, + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(rchecksum, frame, fin_ret, op_errno, weak_checksum, checksum, rsp_xdata); if (rsp_xdata) dict_unref(rsp_xdata); diff --git a/xlators/storage/posix/src/posix-metadata.c b/xlators/storage/posix/src/posix-metadata.c index b61f4cde53..b1889052f1 100644 --- a/xlators/storage/posix/src/posix-metadata.c +++ b/xlators/storage/posix/src/posix-metadata.c @@ -75,7 +75,7 @@ posix_fetch_mdata_xattr(xlator_t *this, const char *real_path_arg, int _fd, inode_t *inode, posix_mdata_t *metadata, int *op_errno) { size_t size = 256; - gf_return_t op_ret = -1; + int op_ret = -1; char *value = NULL; gf_boolean_t fd_based_fop = _gf_false; char gfid_str[64] = {0}; @@ -193,7 +193,7 @@ posix_store_mdata_xattr(xlator_t *this, const char *real_path_arg, int fd, inode_t *inode, posix_mdata_t *metadata) { char *real_path = NULL; - gf_return_t op_ret = 0; + int op_ret = 0; gf_boolean_t fd_based_fop = _gf_false; char *key = GF_XATTR_MDATA_KEY; char gfid_str[64] = {0}; From ae70678db03153f6d7d08acb34b3c9571a685671 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 18 Sep 2020 08:00:03 +0530 Subject: [PATCH 15/24] protocol/client: compile working Change-Id: Id92d341177dae7ccd587a25187c60293c25560ef Signed-off-by: Amar Tumballi --- .../protocol/client/src/client-handshake.c | 2 +- xlators/protocol/client/src/client-rpc-fops.c | 202 ++++++++++++---- .../protocol/client/src/client-rpc-fops_v2.c | 224 +++++++++++++----- xlators/protocol/client/src/client.c | 9 +- 4 files changed, 326 insertions(+), 111 deletions(-) diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index a53c433994..6fcb558f3a 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -697,7 +697,7 @@ client_setvolume_cbk(struct rpc_req *req, struct iovec *iov, int count, 0, }; int ret = 0; - gf_return_t op_ret = 0; + int op_ret = 0; int32_t op_errno = 0; gf_boolean_t auth_fail = _gf_false; glusterfs_ctx_t *ctx = NULL; diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c index 32f098650f..d20f39fb27 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -92,7 +92,9 @@ client3_3_symlink_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(symlink, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(symlink, frame, fin_ret, gf_error_to_errno(rsp.op_errno), inode, &stbuf, &preparent, &postparent, xdata); @@ -161,7 +163,9 @@ client3_3_mknod_cbk(struct rpc_req *req, struct iovec *iov, int count, "path=%s", local->loc.path, NULL); } - CLIENT_STACK_UNWIND(mknod, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(mknod, frame, fin_ret, gf_error_to_errno(rsp.op_errno), inode, &stbuf, &preparent, &postparent, xdata); @@ -229,7 +233,9 @@ client3_3_mkdir_cbk(struct rpc_req *req, struct iovec *iov, int count, "Path=%s", local->loc.path, NULL); } - CLIENT_STACK_UNWIND(mkdir, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(mkdir, frame, fin_ret, gf_error_to_errno(rsp.op_errno), inode, &stbuf, &preparent, &postparent, xdata); @@ -367,7 +373,9 @@ client3_3_open_cbk(struct rpc_req *req, struct iovec *iov, int count, loc_gfid_utoa(&local->loc), NULL); } - CLIENT_STACK_UNWIND(open, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(open, frame, fin_ret, gf_error_to_errno(rsp.op_errno), fd, xdata); free(rsp.xdata.xdata_val); @@ -425,7 +433,9 @@ client3_3_stat_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(stat, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(stat, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &iatt, xdata); free(rsp.xdata.xdata_val); @@ -484,7 +494,9 @@ client3_3_readlink_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(readlink, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(readlink, frame, fin_ret, gf_error_to_errno(rsp.op_errno), rsp.path, &iatt, xdata); @@ -551,7 +563,9 @@ client3_3_unlink_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(unlink, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(unlink, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &preparent, &postparent, xdata); @@ -608,7 +622,9 @@ client3_3_rmdir_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } } - CLIENT_STACK_UNWIND(rmdir, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(rmdir, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &preparent, &postparent, xdata); @@ -663,7 +679,9 @@ client3_3_truncate_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(truncate, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(truncate, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -715,7 +733,9 @@ client3_3_statfs_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(statfs, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(statfs, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &statfs, xdata); free(rsp.xdata.xdata_val); @@ -776,7 +796,9 @@ client3_3_writev_cbk(struct rpc_req *req, struct iovec *iov, int count, if (local->attempt_reopen) client_attempt_reopen(local->fd, this); } - CLIENT_STACK_UNWIND(writev, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(writev, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -836,7 +858,9 @@ client3_3_flush_cbk(struct rpc_req *req, struct iovec *iov, int count, fop_log_level(GF_FOP_FLUSH, gf_error_to_errno(rsp.op_errno)), gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(flush, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(flush, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -893,7 +917,9 @@ client3_3_fsync_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fsync, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fsync, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -955,7 +981,9 @@ client3_3_setxattr_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(setxattr, frame, rsp.op_ret, op_errno, xdata); + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(setxattr, frame, fin_ret, op_errno, xdata); free(rsp.xdata.xdata_val); @@ -1025,7 +1053,9 @@ client3_3_getxattr_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(getxattr, frame, rsp.op_ret, op_errno, dict, xdata); + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(getxattr, frame, fin_ret, op_errno, dict, xdata); /* don't use GF_FREE, this memory was allocated by libc */ free(rsp.dict.dict_val); @@ -1091,7 +1121,9 @@ client3_3_fgetxattr_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(fgetxattr, frame, rsp.op_ret, op_errno, dict, xdata); + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fgetxattr, frame, fin_ret, op_errno, dict, xdata); free(rsp.dict.dict_val); @@ -1155,7 +1187,9 @@ client3_3_removexattr_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(removexattr, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(removexattr, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -1203,7 +1237,9 @@ client3_3_fremovexattr_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fremovexattr, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fremovexattr, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -1251,7 +1287,9 @@ client3_3_fsyncdir_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fsyncdir, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fsyncdir, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -1299,7 +1337,9 @@ client3_3_access_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(access, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(access, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -1353,7 +1393,9 @@ client3_3_ftruncate_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(ftruncate, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(ftruncate, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -1405,7 +1447,9 @@ client3_3_fstat_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fstat, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fstat, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &stat, xdata); free(rsp.xdata.xdata_val); @@ -1453,7 +1497,9 @@ client3_3_inodelk_cbk(struct rpc_req *req, struct iovec *iov, int count, fop_log_level(GF_FOP_INODELK, gf_error_to_errno(rsp.op_errno)), gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(inodelk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(inodelk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -1505,7 +1551,9 @@ client3_3_finodelk_cbk(struct rpc_req *req, struct iovec *iov, int count, if (local->attempt_reopen) client_attempt_reopen(local->fd, this); } - CLIENT_STACK_UNWIND(finodelk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(finodelk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -1554,7 +1602,9 @@ client3_3_entrylk_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(entrylk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(entrylk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -1603,7 +1653,9 @@ client3_3_fentrylk_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fentrylk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fentrylk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -1662,7 +1714,9 @@ client3_3_xattrop_cbk(struct rpc_req *req, struct iovec *iov, int count, loc_gfid_utoa(&local->loc), NULL); } - CLIENT_STACK_UNWIND(xattrop, frame, rsp.op_ret, gf_error_to_errno(op_errno), + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(xattrop, frame, fin_ret, gf_error_to_errno(op_errno), dict, xdata); free(rsp.dict.dict_val); @@ -1728,7 +1782,9 @@ client3_3_fxattrop_cbk(struct rpc_req *req, struct iovec *iov, int count, if (local->attempt_reopen) client_attempt_reopen(local->fd, this); } - CLIENT_STACK_UNWIND(fxattrop, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fxattrop, frame, fin_ret, gf_error_to_errno(op_errno), dict, xdata); free(rsp.dict.dict_val); @@ -1791,7 +1847,9 @@ client3_3_fsetxattr_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(fsetxattr, frame, rsp.op_ret, op_errno, xdata); + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fsetxattr, frame, fin_ret, op_errno, xdata); free(rsp.xdata.xdata_val); @@ -1843,7 +1901,9 @@ client3_3_fsetattr_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fsetattr, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fsetattr, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -1903,7 +1963,9 @@ client3_3_fallocate_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fallocate, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fallocate, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -1958,7 +2020,9 @@ client3_3_discard_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(discard, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(discard, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -2012,7 +2076,9 @@ client3_3_zerofill_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(zerofill, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(zerofill, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -2060,7 +2126,9 @@ client3_3_ipc_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(ipc, frame, rsp.op_ret, gf_error_to_errno(rsp.op_errno), + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(ipc, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -2108,7 +2176,9 @@ client3_3_seek_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(seek, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(seek, frame, fin_ret, gf_error_to_errno(rsp.op_errno), rsp.offset, xdata); free(rsp.xdata.xdata_val); @@ -2163,7 +2233,9 @@ client3_3_setattr_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(setattr, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(setattr, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -2241,7 +2313,9 @@ client3_3_create_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, "Path=%s", local->loc.path, NULL); } - CLIENT_STACK_UNWIND(create, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(create, frame, fin_ret, gf_error_to_errno(rsp.op_errno), fd, inode, &stbuf, &preparent, &postparent, xdata); @@ -2291,7 +2365,9 @@ client3_3_rchecksum_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(rchecksum, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(rchecksum, frame, fin_ret, gf_error_to_errno(rsp.op_errno), rsp.weak_checksum, (uint8_t *)rsp.strong_checksum.strong_checksum_val, xdata); @@ -2354,7 +2430,9 @@ client3_3_lease_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(lease, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(lease, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &lease, xdata); free(rsp.xdata.xdata_val); @@ -2425,7 +2503,9 @@ client3_3_lk_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(lk, frame, rsp.op_ret, gf_error_to_errno(rsp.op_errno), + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(lk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &lock, xdata); free(rsp.xdata.xdata_val); @@ -2481,7 +2561,9 @@ client3_3_readdir_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, "remote_fd=%d", local->cmd, NULL); } - CLIENT_STACK_UNWIND(readdir, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(readdir, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &entries, xdata); if (rsp.op_ret != -1) { @@ -2540,7 +2622,9 @@ client3_3_readdirp_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(readdirp, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(readdirp, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &entries, xdata); if (rsp.op_ret != -1) { @@ -2610,7 +2694,9 @@ client3_3_rename_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(rename, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(rename, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &stbuf, &preoldparent, &postoldparent, &prenewparent, &postnewparent, xdata); @@ -2677,7 +2763,9 @@ client3_3_link_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(link, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(link, frame, fin_ret, gf_error_to_errno(rsp.op_errno), inode, &stbuf, &preparent, &postparent, xdata); @@ -2744,7 +2832,9 @@ client3_3_opendir_cbk(struct rpc_req *req, struct iovec *iov, int count, "Path=%s", local->loc.path, "gfid=%s", loc_gfid_utoa(&local->loc), NULL); } - CLIENT_STACK_UNWIND(opendir, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(opendir, frame, fin_ret, gf_error_to_errno(rsp.op_errno), fd, xdata); free(rsp.xdata.xdata_val); @@ -2843,7 +2933,9 @@ client3_3_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, "node"); } - CLIENT_STACK_UNWIND(lookup, frame, rsp.op_ret, rsp.op_errno, inode, &stbuf, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(lookup, frame, fin_ret, rsp.op_errno, inode, &stbuf, xdata, &postparent); if (xdata) @@ -2906,7 +2998,9 @@ client3_3_readv_cbk(struct rpc_req *req, struct iovec *iov, int count, if (local->attempt_reopen) client_attempt_reopen(local->fd, this); } - CLIENT_STACK_UNWIND(readv, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(readv, frame, fin_ret, gf_error_to_errno(rsp.op_errno), vector, rspcount, &stat, iobref, xdata); @@ -2986,7 +3080,9 @@ client3_3_getactivelk_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(getactivelk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(getactivelk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &locklist, xdata); free(rsp.xdata.xdata_val); @@ -3039,7 +3135,9 @@ client3_3_setactivelk_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(setactivelk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(setactivelk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); free(rsp.xdata.xdata_val); @@ -4614,7 +4712,7 @@ client3_3_getxattr(call_frame_t *frame, xlator_t *this, void *data) }; dict_t *dict = NULL; int ret = 0; - gf_return_t op_ret = -1; + int op_ret = -1; int op_errno = ESTALE; int count = 0; clnt_local_t *local = NULL; @@ -4720,7 +4818,9 @@ client3_3_getxattr(call_frame_t *frame, xlator_t *this, void *data) if (rsp_iobref) iobref_unref(rsp_iobref); - CLIENT_STACK_UNWIND(getxattr, frame, op_ret, op_errno, dict, NULL); + gf_return_t fin_ret; + SET_RET(fin_ret, op_ret); + CLIENT_STACK_UNWIND(getxattr, frame, fin_ret, op_errno, dict, NULL); if (dict) { dict_unref(dict); diff --git a/xlators/protocol/client/src/client-rpc-fops_v2.c b/xlators/protocol/client/src/client-rpc-fops_v2.c index dc1cc3e834..dd36368e08 100644 --- a/xlators/protocol/client/src/client-rpc-fops_v2.c +++ b/xlators/protocol/client/src/client-rpc-fops_v2.c @@ -81,7 +81,9 @@ client4_0_symlink_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(symlink, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(symlink, frame, fin_ret, gf_error_to_errno(rsp.op_errno), inode, &stbuf, &preparent, &postparent, xdata); @@ -148,7 +150,9 @@ client4_0_mknod_cbk(struct rpc_req *req, struct iovec *iov, int count, "path=%s", local->loc.path, NULL); } - CLIENT_STACK_UNWIND(mknod, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(mknod, frame, fin_ret, gf_error_to_errno(rsp.op_errno), inode, &stbuf, &preparent, &postparent, xdata); @@ -214,7 +218,9 @@ client4_0_mkdir_cbk(struct rpc_req *req, struct iovec *iov, int count, "path=%s", local->loc.path, NULL); } - CLIENT_STACK_UNWIND(mkdir, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(mkdir, frame, fin_ret, gf_error_to_errno(rsp.op_errno), inode, &stbuf, &preparent, &postparent, xdata); @@ -279,7 +285,9 @@ client4_0_open_cbk(struct rpc_req *req, struct iovec *iov, int count, loc_gfid_utoa(&local->loc), NULL); } - CLIENT_STACK_UNWIND(open, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(open, frame, fin_ret, gf_error_to_errno(rsp.op_errno), fd, xdata); if (xdata) @@ -335,7 +343,9 @@ client4_0_stat_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(stat, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(stat, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &iatt, xdata); if (xdata) @@ -392,7 +402,9 @@ client4_0_readlink_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(readlink, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(readlink, frame, fin_ret, gf_error_to_errno(rsp.op_errno), rsp.path, &iatt, xdata); @@ -457,7 +469,9 @@ client4_0_unlink_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(unlink, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(unlink, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &preparent, &postparent, xdata); @@ -512,7 +526,9 @@ client4_0_rmdir_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } } - CLIENT_STACK_UNWIND(rmdir, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(rmdir, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &preparent, &postparent, xdata); @@ -565,7 +581,9 @@ client4_0_truncate_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(truncate, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(truncate, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -617,7 +635,9 @@ client4_0_statfs_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(statfs, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(statfs, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &statfs, xdata); if (xdata) @@ -676,7 +696,9 @@ client4_0_writev_cbk(struct rpc_req *req, struct iovec *iov, int count, if (local->attempt_reopen) client_attempt_reopen(local->fd, this); } - CLIENT_STACK_UNWIND(writev, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(writev, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -733,7 +755,9 @@ client4_0_flush_cbk(struct rpc_req *req, struct iovec *iov, int count, fop_log_level(GF_FOP_FLUSH, gf_error_to_errno(rsp.op_errno)), gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(flush, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(flush, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -788,7 +812,9 @@ client4_0_fsync_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fsync, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fsync, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); if (xdata) @@ -844,7 +870,9 @@ client4_0_setxattr_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(setxattr, frame, rsp.op_ret, op_errno, xdata); + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(setxattr, frame, fin_ret, op_errno, xdata); if (xdata) dict_unref(xdata); @@ -918,7 +946,9 @@ client4_0_getxattr_cbk(struct rpc_req *req, struct iovec *iov, int count, rsp.op_ret = 0; } - CLIENT_STACK_UNWIND(getxattr, frame, rsp.op_ret, op_errno, dict, xdata); + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(getxattr, frame, fin_ret, op_errno, dict, xdata); if (xdata) dict_unref(xdata); @@ -985,7 +1015,9 @@ client4_0_fgetxattr_cbk(struct rpc_req *req, struct iovec *iov, int count, rsp.op_ret = 0; } - CLIENT_STACK_UNWIND(fgetxattr, frame, rsp.op_ret, op_errno, dict, xdata); + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fgetxattr, frame, fin_ret, op_errno, dict, xdata); if (xdata) dict_unref(xdata); @@ -1045,7 +1077,9 @@ client4_0_removexattr_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(removexattr, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(removexattr, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -1091,7 +1125,9 @@ client4_0_fremovexattr_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fremovexattr, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fremovexattr, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -1137,7 +1173,9 @@ client4_0_fsyncdir_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fsyncdir, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fsyncdir, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -1183,7 +1221,9 @@ client4_0_access_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(access, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(access, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -1235,7 +1275,9 @@ client4_0_ftruncate_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(ftruncate, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(ftruncate, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -1285,7 +1327,9 @@ client4_0_fstat_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fstat, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fstat, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &stat, xdata); if (xdata) @@ -1331,7 +1375,9 @@ client4_0_inodelk_cbk(struct rpc_req *req, struct iovec *iov, int count, fop_log_level(GF_FOP_INODELK, gf_error_to_errno(rsp.op_errno)), gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(inodelk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(inodelk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -1381,7 +1427,9 @@ client4_0_finodelk_cbk(struct rpc_req *req, struct iovec *iov, int count, if (local->attempt_reopen) client_attempt_reopen(local->fd, this); } - CLIENT_STACK_UNWIND(finodelk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(finodelk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -1428,7 +1476,9 @@ client4_0_entrylk_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(entrylk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(entrylk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -1475,7 +1525,9 @@ client4_0_fentrylk_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fentrylk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fentrylk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -1538,7 +1590,9 @@ client4_0_xattrop_cbk(struct rpc_req *req, struct iovec *iov, int count, rsp.op_ret = 0; } - CLIENT_STACK_UNWIND(xattrop, frame, rsp.op_ret, gf_error_to_errno(op_errno), + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(xattrop, frame, fin_ret, gf_error_to_errno(op_errno), dict, xdata); if (xdata) @@ -1607,7 +1661,9 @@ client4_0_fxattrop_cbk(struct rpc_req *req, struct iovec *iov, int count, client_attempt_reopen(local->fd, this); } - CLIENT_STACK_UNWIND(fxattrop, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fxattrop, frame, fin_ret, gf_error_to_errno(op_errno), dict, xdata); if (xdata) dict_unref(xdata); @@ -1665,7 +1721,9 @@ client4_0_fsetxattr_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(fsetxattr, frame, rsp.op_ret, op_errno, xdata); + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fsetxattr, frame, fin_ret, op_errno, xdata); if (xdata) dict_unref(xdata); @@ -1718,7 +1776,9 @@ client4_0_fallocate_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fallocate, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fallocate, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -1771,7 +1831,9 @@ client4_0_discard_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(discard, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(discard, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); if (xdata) @@ -1822,7 +1884,9 @@ client4_0_zerofill_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(zerofill, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(zerofill, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -1868,7 +1932,9 @@ client4_0_ipc_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(ipc, frame, rsp.op_ret, gf_error_to_errno(rsp.op_errno), + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(ipc, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -1913,7 +1979,9 @@ client4_0_seek_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(seek, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(seek, frame, fin_ret, gf_error_to_errno(rsp.op_errno), rsp.offset, xdata); if (xdata) @@ -1966,7 +2034,9 @@ client4_0_setattr_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(setattr, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(setattr, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -2020,7 +2090,9 @@ client4_0_fsetattr_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(fsetattr, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(fsetattr, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prestat, &poststat, xdata); @@ -2097,7 +2169,9 @@ client4_0_create_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, "path=%s", local->loc.path, NULL); } - CLIENT_STACK_UNWIND(create, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(create, frame, fin_ret, gf_error_to_errno(rsp.op_errno), fd, inode, &stbuf, &preparent, &postparent, xdata); @@ -2151,7 +2225,9 @@ client4_0_lease_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(lease, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(lease, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &lease, xdata); if (xdata) @@ -2220,7 +2296,9 @@ client4_0_lk_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(lk, frame, rsp.op_ret, gf_error_to_errno(rsp.op_errno), + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(lk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &lock, xdata); free(rsp.flock.lk_owner.lk_owner_val); @@ -2274,7 +2352,9 @@ client4_0_readdir_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, "remote_fd=%d", local->cmd, NULL); } - CLIENT_STACK_UNWIND(readdir, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(readdir, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &entries, xdata); if (rsp.op_ret != -1) { @@ -2331,7 +2411,9 @@ client4_0_readdirp_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(readdirp, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(readdirp, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &entries, xdata); if (rsp.op_ret != -1) { @@ -2399,7 +2481,9 @@ client4_0_rename_cbk(struct rpc_req *req, struct iovec *iov, int count, gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(rename, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(rename, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &stbuf, &preoldparent, &postoldparent, &prenewparent, &postnewparent, xdata); @@ -2465,7 +2549,9 @@ client4_0_link_cbk(struct rpc_req *req, struct iovec *iov, int count, } } - CLIENT_STACK_UNWIND(link, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(link, frame, fin_ret, gf_error_to_errno(rsp.op_errno), inode, &stbuf, &preparent, &postparent, xdata); @@ -2532,7 +2618,9 @@ client4_0_opendir_cbk(struct rpc_req *req, struct iovec *iov, int count, "path=%s", local->loc.path, "gfid=%s", loc_gfid_utoa(&local->loc), NULL); } - CLIENT_STACK_UNWIND(opendir, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(opendir, frame, fin_ret, gf_error_to_errno(rsp.op_errno), fd, xdata); if (xdata) @@ -2629,7 +2717,9 @@ client4_0_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, "node"); } - CLIENT_STACK_UNWIND(lookup, frame, rsp.op_ret, rsp.op_errno, inode, &stbuf, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(lookup, frame, fin_ret, rsp.op_errno, inode, &stbuf, xdata, &postparent); if (xdata) @@ -2690,7 +2780,9 @@ client4_0_readv_cbk(struct rpc_req *req, struct iovec *iov, int count, if (local->attempt_reopen) client_attempt_reopen(local->fd, this); } - CLIENT_STACK_UNWIND(readv, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(readv, frame, fin_ret, gf_error_to_errno(rsp.op_errno), vector, rspcount, &stat, iobref, xdata); @@ -2767,7 +2859,9 @@ client4_0_getactivelk_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(getactivelk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(getactivelk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &locklist, xdata); if (xdata) dict_unref(xdata); @@ -2815,7 +2909,9 @@ client4_0_setactivelk_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(setactivelk, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(setactivelk, frame, fin_ret, gf_error_to_errno(rsp.op_errno), xdata); if (xdata) @@ -2880,7 +2976,9 @@ client4_0_copy_file_range_cbk(struct rpc_req *req, struct iovec *iov, int count, if (local->attempt_reopen_out) client_attempt_reopen(local->fd_out, this); } - CLIENT_STACK_UNWIND(copy_file_range, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(copy_file_range, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &stbuf, &prestat, &poststat, xdata); @@ -4379,9 +4477,10 @@ client4_0_getxattr(call_frame_t *frame, xlator_t *this, void *data) }; dict_t *dict = NULL; int ret = 0; - gf_return_t op_ret = -1; + int op_ret = -1; int op_errno = ESTALE; clnt_local_t *local = NULL; + gf_return_t fin_ret; if (!frame || !this || !data) { op_errno = 0; @@ -4445,8 +4544,11 @@ client4_0_getxattr(call_frame_t *frame, xlator_t *this, void *data) GF_FREE(req.xdata.pairs.pairs_val); return 0; -unwind: - CLIENT_STACK_UNWIND(getxattr, frame, op_ret, op_errno, dict, NULL); + + unwind: + + SET_RET(fin_ret, op_ret); + CLIENT_STACK_UNWIND(getxattr, frame, fin_ret, op_errno, dict, NULL); if (dict) { dict_unref(dict); @@ -5552,7 +5654,9 @@ client4_rchecksum_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(rchecksum, frame, rsp.op_ret, + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(rchecksum, frame, fin_ret, gf_error_to_errno(rsp.op_errno), rsp.weak_checksum, (uint8_t *)rsp.strong_checksum.strong_checksum_val, xdata); @@ -5580,6 +5684,7 @@ client4_namelink_cbk(struct rpc_req *req, struct iovec *iov, int count, struct iatt postbuf = { 0, }; + gf_return_t fin_ret; dict_t *xdata = NULL; call_frame_t *frame = NULL; gfx_common_2iatt_rsp rsp = { @@ -5608,7 +5713,9 @@ client4_namelink_cbk(struct rpc_req *req, struct iovec *iov, int count, xdr_to_dict(&rsp.xdata, &xdata); out: - CLIENT_STACK_UNWIND(namelink, frame, rsp.op_ret, + + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(namelink, frame, fin_ret, gf_error_to_errno(rsp.op_errno), &prebuf, &postbuf, xdata); if (xdata) @@ -5626,6 +5733,7 @@ client4_icreate_cbk(struct rpc_req *req, struct iovec *iov, int count, struct iatt stbuf = { 0, }; + gf_return_t fin_ret; dict_t *xdata = NULL; call_frame_t *frame = NULL; gfx_common_iatt_rsp rsp = { @@ -5655,7 +5763,9 @@ client4_icreate_cbk(struct rpc_req *req, struct iovec *iov, int count, xdr_to_dict(&rsp.xdata, &xdata); out: - CLIENT_STACK_UNWIND(icreate, frame, rsp.op_ret, + + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(icreate, frame, fin_ret, gf_error_to_errno(rsp.op_errno), inode, &stbuf, xdata); if (xdata) dict_unref(xdata); @@ -5718,7 +5828,9 @@ client4_0_put_cbk(struct rpc_req *req, struct iovec *iov, int count, PC_MSG_REMOTE_OP_FAILED, NULL); } - CLIENT_STACK_UNWIND(put, frame, rsp.op_ret, gf_error_to_errno(rsp.op_errno), + gf_return_t fin_ret; + SET_RET(fin_ret, rsp.op_ret); + CLIENT_STACK_UNWIND(put, frame, fin_ret, gf_error_to_errno(rsp.op_errno), inode, &stbuf, &preparent, &postparent, xdata); if (xdata) diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index f16dd7d7e5..4553aa1f27 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -1195,9 +1195,10 @@ client_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int32_t flags, dict_t *xdata) { int ret = -1; - gf_return_t op_ret = -1; + int op_ret = -1; int op_errno = ENOTCONN; int need_unwind = 0; + gf_return_t fin_ret; clnt_conf_t *conf = NULL; rpc_clnt_procedure_t *proc = NULL; clnt_args_t args = { @@ -1247,8 +1248,10 @@ client_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, } } out: - if (need_unwind) - STACK_UNWIND_STRICT(setxattr, frame, op_ret, op_errno, NULL); + if (need_unwind) { + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(setxattr, frame, fin_ret, op_errno, NULL); + } return 0; } From 787c3056aeeeaf80470af13c4129753ec45aa604 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 18 Sep 2020 08:19:30 +0530 Subject: [PATCH 16/24] protocol/server: compiles Change-Id: I474bc957884bc69acaf21b8861ad372845c9f092 Signed-off-by: Amar Tumballi --- xlators/protocol/server/src/server-common.c | 4 +- .../protocol/server/src/server-handshake.c | 2 +- xlators/protocol/server/src/server-resolve.c | 28 +- xlators/protocol/server/src/server-rpc-fops.c | 359 +++++++++-------- .../protocol/server/src/server-rpc-fops_v2.c | 377 +++++++++--------- 5 files changed, 391 insertions(+), 379 deletions(-) diff --git a/xlators/protocol/server/src/server-common.c b/xlators/protocol/server/src/server-common.c index 4f60942b0f..86ecef7031 100644 --- a/xlators/protocol/server/src/server-common.c +++ b/xlators/protocol/server/src/server-common.c @@ -356,7 +356,7 @@ void server_post_readv(gfs3_read_rsp *rsp, struct iatt *stbuf, gf_return_t op_ret) { gf_stat_from_iatt(&rsp->stat, stbuf); - rsp->size = op_ret; + rsp->size = GET_RET(op_ret); } int @@ -719,7 +719,7 @@ void server4_post_readv(gfx_read_rsp *rsp, struct iatt *stbuf, gf_return_t op_ret) { gfx_stat_from_iattx(&rsp->stat, stbuf); - rsp->size = op_ret; + rsp->size = GET_RET(op_ret); } int diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index aa64bda82d..25673e9152 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -238,7 +238,7 @@ server_setvolume(rpcsvc_request_t *req) char *msg = NULL; xlator_t *this = NULL; int32_t ret = -1; - gf_return_t op_ret = -1; + int op_ret = -1; int32_t op_errno = EINVAL; uint32_t opversion = 0; rpc_transport_t *xprt = NULL; diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c index 55b31894f3..ad55bc8b72 100644 --- a/xlators/protocol/server/src/server-resolve.c +++ b/xlators/protocol/server/src/server-resolve.c @@ -53,7 +53,7 @@ resolve_gfid_entry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, resolve = state->resolve_now; resolve_loc = &resolve->resolve_loc; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { if (op_errno == ENOENT) { gf_msg_debug(this->name, 0, "%s/%s: failed to resolve (%s)", uuid_utoa(resolve_loc->pargfid), resolve_loc->name, @@ -116,7 +116,7 @@ resolve_gfid_cbk(call_frame_t *frame, void *cookie, xlator_t *this, resolve = state->resolve_now; resolve_loc = &resolve->resolve_loc; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { if (op_errno == ENOENT) { gf_msg_debug(this->name, GF_LOG_DEBUG, "%s: failed to resolve (%s)", uuid_utoa(resolve_loc->gfid), strerror(op_errno)); @@ -240,7 +240,7 @@ resolve_continue(call_frame_t *frame) this = frame->this; resolve = state->resolve_now; - resolve->op_ret = 0; + SET_RET(resolve->op_ret, 0); resolve->op_errno = 0; if (resolve->fd_no != -1) { @@ -288,7 +288,7 @@ resolve_entry_simple(call_frame_t *frame) if (!parent) { /* simple resolution is indecisive. need to perform deep resolution */ - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = ESTALE; ret = 1; goto out; @@ -299,7 +299,7 @@ resolve_entry_simple(call_frame_t *frame) gf_msg(this->name, GF_LOG_ERROR, EPERM, PS_MSG_GFID_RESOLVE_FAILED, "%s: parent type not directory (%d)", uuid_utoa(parent->gfid), parent->ia_type); - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = EPERM; ret = 1; goto out; @@ -314,7 +314,7 @@ resolve_entry_simple(call_frame_t *frame) resolving outside the parent's tree, which is not allowed */ gf_msg(this->name, GF_LOG_ERROR, EPERM, PS_MSG_GFID_RESOLVE_FAILED, "%s: basename sent by client not allowed", resolve->bname); - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = EPERM; ret = 1; goto out; @@ -333,7 +333,7 @@ resolve_entry_simple(call_frame_t *frame) ret = 1; break; default: - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = ENOENT; ret = 1; break; @@ -349,7 +349,7 @@ resolve_entry_simple(call_frame_t *frame) "Performing lookup on backend to rule out any " "possible stale dentries in inode table", inode, uuid_utoa(inode->gfid), resolve->path); - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = EEXIST; ret = 1; goto out; @@ -409,7 +409,7 @@ resolve_inode_simple(call_frame_t *frame) inode = inode_find(state->itable, resolve->gfid); if (!inode) { - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = ESTALE; ret = 1; goto out; @@ -467,7 +467,7 @@ resolve_anonfd_simple(call_frame_t *frame) inode = inode_find(state->itable, resolve->gfid); if (!inode) { - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = ENOENT; ret = 1; goto out; @@ -540,7 +540,7 @@ server_resolve_fd(call_frame_t *frame) if (serv_ctx == NULL) { gf_msg("", GF_LOG_INFO, ENOMEM, PS_MSG_NO_MEMORY, "server_ctx_get() failed"); - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = ENOMEM; return 0; } @@ -566,7 +566,7 @@ server_resolve_fd(call_frame_t *frame) gf_msg("", GF_LOG_INFO, EBADF, PS_MSG_FD_NOT_FOUND, "fd not " "found in context"); - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = EBADF; } } else { @@ -575,7 +575,7 @@ server_resolve_fd(call_frame_t *frame) gf_msg("", GF_LOG_INFO, EBADF, PS_MSG_FD_NOT_FOUND, "fd not " "found in context"); - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = EBADF; } } @@ -609,7 +609,7 @@ server_resolve(call_frame_t *frame) "no resolution type for %s (%s)", resolve->path, gf_fop_list[frame->root->op]); - resolve->op_ret = -1; + resolve->op_ret = gf_failure; resolve->op_errno = EINVAL; server_resolve_all(frame); diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c index 33563a21cb..63efa1ae11 100644 --- a/xlators/protocol/server/src/server-rpc-fops.c +++ b/xlators/protocol/server/src/server-rpc-fops.c @@ -68,7 +68,7 @@ server_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, op_errno, PS_MSG_STATFS, "%" PRId64 ": STATFS, client: %s, error-xlator: %s", frame->root->unique, STACK_CLIENT_NAME(frame->root), @@ -79,7 +79,7 @@ server_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_statfs(&rsp, buf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -107,7 +107,7 @@ server_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (state->is_revalidate == 1 && op_ret == -1) { + if (state->is_revalidate == 1 && IS_ERROR(op_ret)) { state->is_revalidate = 2; loc_copy(&fresh_loc, &state->loc); inode_unref(fresh_loc.inode); @@ -126,7 +126,7 @@ server_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { if (state->is_revalidate && op_errno == ENOENT) { if (!__is_root_gfid(state->resolve.gfid)) { inode_unlink(state->loc.inode, state->loc.parent, @@ -155,10 +155,10 @@ server_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_lookup(&rsp, frame, state, inode, stbuf, postparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); - if (op_ret) { + if (IS_ERROR(op_ret)) { if (state->resolve.bname) { gf_msg(this->name, fop_log_level(GF_FOP_LOOKUP, op_errno), op_errno, PS_MSG_LOOKUP_INFO, @@ -205,7 +205,7 @@ server_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_LEASE, op_errno), op_errno, PS_MSG_LK_INFO, @@ -218,7 +218,7 @@ server_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_lease(&rsp, lease); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -244,7 +244,7 @@ server_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_LK, op_errno), op_errno, PS_MSG_LK_INFO, @@ -259,7 +259,7 @@ server_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_lk(this, &rsp, lock); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -286,7 +286,7 @@ server_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_INODELK, op_errno), op_errno, PS_MSG_INODELK_INFO, "%" PRId64 @@ -299,7 +299,7 @@ server_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -326,7 +326,7 @@ server_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_FINODELK, op_errno), op_errno, PS_MSG_INODELK_INFO, "%" PRId64 ": FINODELK %" PRId64 @@ -339,7 +339,7 @@ server_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -366,7 +366,7 @@ server_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_ENTRYLK, op_errno), op_errno, PS_MSG_ENTRYLK_INFO, "%" PRId64 @@ -379,7 +379,7 @@ server_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -406,7 +406,7 @@ server_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_FENTRYLK, op_errno), op_errno, PS_MSG_ENTRYLK_INFO, "%" PRId64 ": FENTRYLK %" PRId64 @@ -419,7 +419,7 @@ server_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -444,7 +444,7 @@ server_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_ACCESS_INFO, "%" PRId64 @@ -457,7 +457,7 @@ server_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -485,7 +485,7 @@ server_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_DIR_INFO, "%" PRId64 ": RMDIR %s (%s/%s), client: %s, " @@ -499,7 +499,7 @@ server_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_rmdir(state, &rsp, preparent, postparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -528,7 +528,7 @@ server_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_MKDIR, op_errno), op_errno, PS_MSG_DIR_INFO, "%" PRId64 @@ -542,7 +542,7 @@ server_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_mkdir(state, &rsp, inode, stbuf, preparent, postparent, xdata); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -571,7 +571,7 @@ server_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_MKNOD, op_errno), op_errno, PS_MSG_MKNOD_INFO, "%" PRId64 @@ -585,7 +585,7 @@ server_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_mknod(state, &rsp, stbuf, preparent, postparent, inode); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -610,7 +610,7 @@ server_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_FSYNCDIR, op_errno), op_errno, PS_MSG_DIR_INFO, @@ -624,7 +624,7 @@ server_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -651,7 +651,7 @@ server_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_READDIR, op_errno), op_errno, PS_MSG_DIR_INFO, @@ -665,17 +665,17 @@ server_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } /* (op_ret == 0) is valid, and means EOF */ - if (op_ret) { + if (IS_ERROR(op_ret)) { ret = server_post_readdir(&rsp, entries); if (ret == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -694,6 +694,7 @@ server_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { + int ret; server_state_t *state = NULL; rpcsvc_request_t *req = NULL; gfs3_opendir_rsp rsp = { @@ -704,7 +705,7 @@ server_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_OPENDIR, op_errno), op_errno, PS_MSG_DIR_INFO, @@ -717,13 +718,15 @@ server_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - op_ret = server_post_opendir(frame, this, &rsp, fd); - if (op_ret) + ret = server_post_opendir(frame, this, &rsp, fd); + if (ret < 0) { + op_ret = gf_failure; goto out; + } out: - if (op_ret) + if (IS_ERROR(op_ret)) rsp.fd = fd_no; - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -748,14 +751,14 @@ server_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (gf_replace_old_iatt_in_dict(xdata)) { op_errno = errno; - op_ret = -1; + op_ret = gf_failure; goto out; } GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); if (ENODATA == op_errno || ENOATTR == op_errno) loglevel = GF_LOG_DEBUG; @@ -773,7 +776,7 @@ server_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -797,14 +800,14 @@ server_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (gf_replace_old_iatt_in_dict(xdata)) { op_errno = errno; - op_ret = -1; + op_ret = gf_failure; goto out; } GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_FREMOVEXATTR, op_errno), op_errno, PS_MSG_REMOVEXATTR_INFO, @@ -818,7 +821,7 @@ server_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -844,7 +847,7 @@ server_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_GETXATTR, op_errno), op_errno, PS_MSG_GETXATTR_INFO, @@ -861,7 +864,7 @@ server_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, rsp.dict.dict_len, op_errno, out); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -889,7 +892,7 @@ server_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_FGETXATTR, op_errno), op_errno, PS_MSG_GETXATTR_INFO, @@ -907,7 +910,7 @@ server_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -952,14 +955,14 @@ server_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (gf_replace_old_iatt_in_dict(xdata)) { op_errno = errno; - op_ret = -1; + op_ret = gf_failure; goto out; } GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); if (op_errno != ENOTSUP) dict_foreach(state->dict, _gf_server_log_setxattr_failure, frame); @@ -977,7 +980,7 @@ server_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1022,14 +1025,14 @@ server_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (gf_replace_old_iatt_in_dict(xdata)) { op_errno = errno; - op_ret = -1; + op_ret = gf_failure; goto out; } GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); if (op_errno != ENOTSUP) { dict_foreach(state->dict, _gf_server_log_fsetxattr_failure, frame); @@ -1047,7 +1050,7 @@ server_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1083,7 +1086,7 @@ server_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { uuid_utoa_r(state->resolve.pargfid, oldpar_str); uuid_utoa_r(state->resolve2.pargfid, newpar_str); gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_RENAME_INFO, @@ -1100,7 +1103,7 @@ server_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_rename(frame, state, &rsp, stbuf, preoldparent, postoldparent, prenewparent, postnewparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1125,7 +1128,7 @@ server_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (gf_replace_old_iatt_in_dict(xdata)) { op_errno = errno; - op_ret = -1; + op_ret = gf_failure; goto out; } @@ -1134,7 +1137,7 @@ server_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_UNLINK, op_errno), op_errno, PS_MSG_LINK_INFO, "%" PRId64 @@ -1156,7 +1159,7 @@ server_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_unlink(state, &rsp, preparent, postparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1185,7 +1188,7 @@ server_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO, "%" PRId64 ": SYMLINK %s (%s/%s), client: %s, " @@ -1200,7 +1203,7 @@ server_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, xdata); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1235,7 +1238,7 @@ server_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret) { + if (IS_ERROR(op_ret)) { uuid_utoa_r(state->resolve.gfid, gfid_str); uuid_utoa_r(state->resolve2.pargfid, newpar_str); @@ -1252,7 +1255,7 @@ server_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_link(state, &rsp, inode, stbuf, preparent, postparent, xdata); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1278,7 +1281,7 @@ server_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_TRUNCATE_INFO, "%" PRId64 @@ -1293,7 +1296,7 @@ server_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_truncate(&rsp, prebuf, postbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1320,7 +1323,7 @@ server_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, rsp.xdata.xdata_len, op_errno, out); state = CALL_STATE(frame); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_FSTAT, op_errno), op_errno, PS_MSG_STAT_INFO, "%" PRId64 ": FSTAT %" PRId64 @@ -1335,7 +1338,7 @@ server_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_fstat(state, &rsp, stbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1359,7 +1362,7 @@ server_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_FTRUNCATE, op_errno), op_errno, PS_MSG_TRUNCATE_INFO, @@ -1375,7 +1378,7 @@ server_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_ftruncate(&rsp, prebuf, postbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1400,7 +1403,7 @@ server_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_FLUSH, op_errno), op_errno, PS_MSG_FLUSH_INFO, @@ -1414,7 +1417,7 @@ server_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1440,7 +1443,7 @@ server_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_FSYNC, op_errno), op_errno, PS_MSG_SYNC_INFO, @@ -1456,7 +1459,7 @@ server_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_fsync(&rsp, prebuf, postbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1482,7 +1485,7 @@ server_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_WRITE, op_errno), op_errno, PS_MSG_WRITE_INFO, @@ -1498,7 +1501,7 @@ server_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_writev(&rsp, prebuf, postbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1535,7 +1538,7 @@ server_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_READ, op_errno), op_errno, PS_MSG_READ_INFO, @@ -1551,7 +1554,7 @@ server_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_readv(&rsp, stbuf, op_ret); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1578,7 +1581,7 @@ server_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_RCHECKSUM, op_errno), op_errno, PS_MSG_CHKSUM_INFO, @@ -1593,7 +1596,7 @@ server_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_rchecksum(&rsp, weak_checksum, strong_checksum); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1609,6 +1612,7 @@ int server_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { + int ret; server_state_t *state = NULL; rpcsvc_request_t *req = NULL; gfs3_open_rsp rsp = { @@ -1618,7 +1622,7 @@ server_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_OPEN, op_errno), op_errno, PS_MSG_OPEN_INFO, @@ -1629,11 +1633,13 @@ server_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - op_ret = server_post_open(frame, this, &rsp, fd); - if (op_ret) + ret = server_post_open(frame, this, &rsp, fd); + if (ret < 0) { + op_ret = gf_failure; goto out; + } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1650,6 +1656,7 @@ server_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { + int ret; server_state_t *state = NULL; rpcsvc_request_t *req = NULL; uint64_t fd_no = 0; @@ -1662,7 +1669,7 @@ server_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO, "%" PRId64 ": CREATE %s (%s/%s), client: %s, " @@ -1681,18 +1688,18 @@ server_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, frame->root->unique, state->loc.name, uuid_utoa(stbuf->ia_gfid)); - op_ret = server_post_create(frame, &rsp, state, this, fd, inode, stbuf, + ret = server_post_create(frame, &rsp, state, this, fd, inode, stbuf, preparent, postparent); - if (op_ret) { - op_errno = -op_ret; - op_ret = -1; + if (ret < 0) { + op_errno = -ret; + op_ret = gf_failure; goto out; } out: - if (op_ret) + if (IS_ERROR(op_ret)) rsp.fd = fd_no; - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1718,7 +1725,7 @@ server_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO, "%" PRId64 @@ -1732,7 +1739,7 @@ server_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_readlink(&rsp, stbuf, buf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); if (!rsp.path) rsp.path = ""; @@ -1761,7 +1768,7 @@ server_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, rsp.xdata.xdata_len, op_errno, out); state = CALL_STATE(frame); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_STAT, op_errno), op_errno, PS_MSG_STAT_INFO, "%" PRId64 ": STAT %s (%s), client: %s, error-xlator: %s", @@ -1773,7 +1780,7 @@ server_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_stat(state, &rsp, stbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1799,7 +1806,7 @@ server_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SETATTR_INFO, "%" PRId64 @@ -1814,7 +1821,7 @@ server_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_setattr(&rsp, statpre, statpost); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1840,7 +1847,7 @@ server_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_FSETATTR, op_errno), op_errno, PS_MSG_SETATTR_INFO, @@ -1856,7 +1863,7 @@ server_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_fsetattr(&rsp, statpre, statpost); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1882,7 +1889,7 @@ server_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_XATTROP, op_errno), op_errno, PS_MSG_XATTROP_INFO, @@ -1899,7 +1906,7 @@ server_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, rsp.dict.dict_len, op_errno, out); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1927,7 +1934,7 @@ server_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_FXATTROP, op_errno), op_errno, PS_MSG_XATTROP_INFO, @@ -1944,7 +1951,7 @@ server_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, rsp.dict.dict_len, op_errno, out); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1975,7 +1982,7 @@ server_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_READDIRP, op_errno), op_errno, PS_MSG_DIR_INFO, @@ -1989,10 +1996,10 @@ server_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } /* (op_ret == 0) is valid, and means EOF */ - if (op_ret) { + if (IS_ERROR(op_ret)) { ret = server_post_readdirp(&rsp, entries); if (ret == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } @@ -2001,7 +2008,7 @@ server_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_link_inodes_from_dirent(this, state->fd->inode, entries); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -2029,7 +2036,7 @@ server_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_FALLOCATE, op_errno), op_errno, PS_MSG_ALLOC_INFO, @@ -2045,7 +2052,7 @@ server_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_fallocate(&rsp, statpre, statpost); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -2071,7 +2078,7 @@ server_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, fop_log_level(GF_FOP_DISCARD, op_errno), op_errno, PS_MSG_DISCARD_INFO, @@ -2087,7 +2094,7 @@ server_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_discard(&rsp, statpre, statpost); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -2116,7 +2123,7 @@ server_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, (&rsp.xdata.xdata_val), rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_ZEROFILL, op_errno), op_errno, PS_MSG_ZEROFILL_INFO, "%" PRId64 ": ZEROFILL%" PRId64 @@ -2131,7 +2138,7 @@ server_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_zerofill(&rsp, statpre, statpost); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); server_submit_reply(frame, req, &rsp, NULL, 0, NULL, @@ -2158,7 +2165,7 @@ server_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, (&rsp.xdata.xdata_val), rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SERVER_IPC_INFO, "%" PRId64 ": IPC%" PRId64 " (%s), client: %s, " @@ -2170,7 +2177,7 @@ server_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); server_submit_reply(frame, req, &rsp, NULL, 0, NULL, @@ -2198,7 +2205,7 @@ server_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, (&rsp.xdata.xdata_val), rsp.xdata.xdata_len, op_errno, out); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, fop_log_level(GF_FOP_SEEK, op_errno), op_errno, PS_MSG_SEEK_INFO, "%" PRId64 ": SEEK%" PRId64 @@ -2212,7 +2219,7 @@ server_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server_post_seek(&rsp, offset); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); server_submit_reply(frame, req, &rsp, NULL, 0, NULL, @@ -2238,7 +2245,7 @@ server_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, GF_LOG_INFO, op_errno, 0, "%" PRId64 @@ -2251,7 +2258,7 @@ server_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -2270,12 +2277,12 @@ int server_rchecksum_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int op_errno = EINVAL; state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) { + if (IS_ERROR(state->resolve.op_ret)) { op_ret = state->resolve.op_ret; op_errno = state->resolve.op_errno; goto err; @@ -2299,7 +2306,7 @@ server_lease_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_lease_cbk, bound_xl, bound_xl->fops->lease, @@ -2320,7 +2327,7 @@ server_lk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_lk_cbk, bound_xl, bound_xl->fops->lk, state->fd, @@ -2338,18 +2345,18 @@ int server_rename_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int op_errno = 0; state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) { + if (IS_ERROR(state->resolve.op_ret)) { op_ret = state->resolve.op_ret; op_errno = state->resolve.op_errno; goto err; } - if (state->resolve2.op_ret != 0) { + if (IS_ERROR(state->resolve2.op_ret)) { op_ret = state->resolve2.op_ret; op_errno = state->resolve2.op_errno; goto err; @@ -2368,18 +2375,18 @@ int server_link_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int op_errno = 0; state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) { + if (IS_ERROR(state->resolve.op_ret)) { op_ret = state->resolve.op_ret; op_errno = state->resolve.op_errno; goto err; } - if (state->resolve2.op_ret != 0) { + if (IS_ERROR(state->resolve2.op_ret)) { op_ret = state->resolve2.op_ret; op_errno = state->resolve2.op_errno; goto err; @@ -2404,7 +2411,7 @@ server_symlink_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -2426,7 +2433,7 @@ server_access_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_access_cbk, bound_xl, bound_xl->fops->access, @@ -2446,7 +2453,7 @@ server_fentrylk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; if (!state->xdata) @@ -2475,7 +2482,7 @@ server_entrylk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; if (!state->xdata) @@ -2505,7 +2512,7 @@ server_finodelk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; if (!state->xdata) @@ -2537,7 +2544,7 @@ server_inodelk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; if (!state->xdata) @@ -2564,7 +2571,7 @@ server_rmdir_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_rmdir_cbk, bound_xl, bound_xl->fops->rmdir, @@ -2584,7 +2591,7 @@ server_mkdir_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -2606,7 +2613,7 @@ server_mknod_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -2629,7 +2636,7 @@ server_fsyncdir_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_fsyncdir_cbk, bound_xl, bound_xl->fops->fsyncdir, @@ -2649,7 +2656,7 @@ server_readdir_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; GF_ASSERT(state->fd); @@ -2671,7 +2678,7 @@ server_readdirp_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_readdirp_cbk, bound_xl, bound_xl->fops->readdirp, @@ -2691,7 +2698,7 @@ server_opendir_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->fd = fd_create(state->loc.inode, frame->root->pid); @@ -2717,7 +2724,7 @@ server_statfs_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_statfs_cbk, bound_xl, bound_xl->fops->statfs, @@ -2737,7 +2744,7 @@ server_removexattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_removexattr_cbk, bound_xl, @@ -2757,7 +2764,7 @@ server_fremovexattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_fremovexattr_cbk, bound_xl, @@ -2777,7 +2784,7 @@ server_fgetxattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_fgetxattr_cbk, bound_xl, bound_xl->fops->fgetxattr, @@ -2796,7 +2803,7 @@ server_xattrop_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_xattrop_cbk, bound_xl, bound_xl->fops->xattrop, @@ -2815,7 +2822,7 @@ server_fxattrop_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_fxattrop_cbk, bound_xl, bound_xl->fops->fxattrop, @@ -2834,7 +2841,7 @@ server_fsetxattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_setxattr_cbk, bound_xl, bound_xl->fops->fsetxattr, @@ -2854,7 +2861,7 @@ server_unlink_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_unlink_cbk, bound_xl, bound_xl->fops->unlink, @@ -2873,7 +2880,7 @@ server_truncate_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_truncate_cbk, bound_xl, bound_xl->fops->truncate, @@ -2892,7 +2899,7 @@ server_fstat_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_fstat_cbk, bound_xl, bound_xl->fops->fstat, @@ -2911,7 +2918,7 @@ server_setxattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_setxattr_cbk, bound_xl, bound_xl->fops->setxattr, @@ -2931,7 +2938,7 @@ server_getxattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_getxattr_cbk, bound_xl, bound_xl->fops->getxattr, @@ -2950,7 +2957,7 @@ server_ftruncate_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_ftruncate_cbk, bound_xl, bound_xl->fops->ftruncate, @@ -2970,7 +2977,7 @@ server_flush_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_flush_cbk, bound_xl, bound_xl->fops->flush, @@ -2990,7 +2997,7 @@ server_fsync_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_fsync_cbk, bound_xl, bound_xl->fops->fsync, @@ -3010,7 +3017,7 @@ server_writev_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_writev_cbk, bound_xl, bound_xl->fops->writev, @@ -3031,7 +3038,7 @@ server_readv_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_readv_cbk, bound_xl, bound_xl->fops->readv, @@ -3052,7 +3059,7 @@ server_create_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -3062,7 +3069,7 @@ server_create_resume(call_frame_t *frame, xlator_t *bound_xl) gf_msg("server", GF_LOG_ERROR, 0, PS_MSG_FD_CREATE_FAILED, "fd creation for the inode %s failed", state->loc.inode ? uuid_utoa(state->loc.inode->gfid) : NULL); - state->resolve.op_ret = -1; + state->resolve.op_ret = gf_failure; state->resolve.op_errno = ENOMEM; goto err; } @@ -3087,7 +3094,7 @@ server_open_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->fd = fd_create(state->loc.inode, frame->root->pid); @@ -3110,7 +3117,7 @@ server_readlink_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_readlink_cbk, bound_xl, bound_xl->fops->readlink, @@ -3129,7 +3136,7 @@ server_fsetattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_fsetattr_cbk, bound_xl, bound_xl->fops->fsetattr, @@ -3149,7 +3156,7 @@ server_setattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_setattr_cbk, bound_xl, bound_xl->fops->setattr, @@ -3169,7 +3176,7 @@ server_stat_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_stat_cbk, bound_xl, bound_xl->fops->stat, @@ -3188,7 +3195,7 @@ server_lookup_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; if (!state->loc.inode) @@ -3214,7 +3221,7 @@ server_fallocate_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_fallocate_cbk, bound_xl, bound_xl->fops->fallocate, @@ -3235,7 +3242,7 @@ server_discard_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_discard_cbk, bound_xl, bound_xl->fops->discard, @@ -3255,7 +3262,7 @@ server_zerofill_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_zerofill_cbk, bound_xl, bound_xl->fops->zerofill, @@ -3275,7 +3282,7 @@ server_seek_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_seek_cbk, bound_xl, bound_xl->fops->seek, @@ -3305,7 +3312,7 @@ server_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_PROTOCOL_DICT_SERIALIZE(this, xdata, &rsp.xdata.xdata_val, rsp.xdata.xdata_len, op_errno, out); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_msg(this->name, GF_LOG_INFO, op_errno, 0, @@ -3320,17 +3327,17 @@ server_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } /* (op_ret == 0) means there are no locks on the file*/ - if (op_ret > 0) { + if (IS_SUCCESS(op_ret)) { ret = serialize_rsp_locklist(locklist, &rsp); if (ret == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -3352,7 +3359,7 @@ server_getactivelk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_getactivelk_cbk, bound_xl, @@ -3371,7 +3378,7 @@ server_setactivelk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server_setactivelk_cbk, bound_xl, @@ -5828,7 +5835,7 @@ server3_3_lookup(rpcsvc_request_t *req) free(args.bname); free(args.xdata.xdata_val); - server_lookup_cbk(frame, NULL, frame->this, -1, EINVAL, NULL, NULL, NULL, + server_lookup_cbk(frame, NULL, frame->this, gf_failure, EINVAL, NULL, NULL, NULL, NULL); ret = 0; diff --git a/xlators/protocol/server/src/server-rpc-fops_v2.c b/xlators/protocol/server/src/server-rpc-fops_v2.c index abf66b924a..0e3d8973a0 100644 --- a/xlators/protocol/server/src/server-rpc-fops_v2.c +++ b/xlators/protocol/server/src/server-rpc-fops_v2.c @@ -55,7 +55,7 @@ server4_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, GF_LOG_WARNING, op_errno, PS_MSG_STATFS, "frame=%" PRId64, frame->root->unique, "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s", @@ -66,7 +66,7 @@ server4_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_statfs(&rsp, buf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -94,7 +94,7 @@ server4_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (state->is_revalidate == 1 && op_ret == -1) { + if (state->is_revalidate == 1 && IS_ERROR(op_ret)) { state->is_revalidate = 2; loc_copy(&fresh_loc, &state->loc); inode_unref(fresh_loc.inode); @@ -112,7 +112,7 @@ server4_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { if (state->is_revalidate && op_errno == ENOENT) { if (!__is_root_gfid(state->resolve.gfid)) { inode_unlink(state->loc.inode, state->loc.parent, @@ -141,10 +141,10 @@ server4_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_lookup(&rsp, frame, state, inode, stbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); - if (op_ret) { + if (IS_ERROR(op_ret)) { if (state->resolve.bname) { gf_smsg(this->name, fop_log_level(GF_FOP_LOOKUP, op_errno), op_errno, PS_MSG_LOOKUP_INFO, "frame=%" PRId64, @@ -185,7 +185,7 @@ server4_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_LEASE, op_errno), op_errno, PS_MSG_LK_INFO, "frame=%" PRId64, frame->root->unique, @@ -196,7 +196,7 @@ server4_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } server4_post_lease(&rsp, lease); - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -221,7 +221,7 @@ server4_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_LK, op_errno), op_errno, PS_MSG_LK_INFO, "frame=%" PRId64, frame->root->unique, @@ -234,7 +234,7 @@ server4_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_lk(this, &rsp, lock); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -260,7 +260,7 @@ server4_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_INODELK, op_errno), op_errno, PS_MSG_INODELK_INFO, "frame=%" PRId64, frame->root->unique, "path=%s", state->loc.path, "uuuid_utoa=%s", @@ -271,7 +271,7 @@ server4_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -297,7 +297,7 @@ server4_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_FINODELK, op_errno), op_errno, PS_MSG_INODELK_INFO, "frame=%" PRId64, frame->root->unique, "FINODELK_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s", @@ -308,7 +308,7 @@ server4_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -334,7 +334,7 @@ server4_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_ENTRYLK, op_errno), op_errno, PS_MSG_ENTRYLK_INFO, "frame=%" PRId64, frame->root->unique, "path=%s", state->loc.path, "uuid_utoa=%s", @@ -345,7 +345,7 @@ server4_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -371,7 +371,7 @@ server4_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_FENTRYLK, op_errno), op_errno, PS_MSG_ENTRYLK_INFO, "frame=%" PRId64, frame->root->unique, "FENTRYLK_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s", @@ -382,7 +382,7 @@ server4_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -406,7 +406,7 @@ server4_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_ACCESS_INFO, "frame=%" PRId64, frame->root->unique, "path=%s", @@ -418,7 +418,7 @@ server4_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -445,7 +445,7 @@ server4_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique, "RMDIR_pat=%s", (state->loc.path) ? state->loc.path : "", "uuid_utoa=%s", @@ -459,7 +459,7 @@ server4_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_entry_remove(state, &rsp, preparent, postparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -487,7 +487,7 @@ server4_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_MKDIR, op_errno), op_errno, PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique, "MKDIR_path=%s", (state->loc.path) ? state->loc.path : "", @@ -500,7 +500,7 @@ server4_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_3iatt(state, &rsp, inode, stbuf, preparent, postparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -528,7 +528,7 @@ server4_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_MKNOD, op_errno), op_errno, PS_MSG_MKNOD_INFO, "frame=%" PRId64, frame->root->unique, "path=%s", state->loc.path, "uuid_utoa=%s", @@ -541,7 +541,7 @@ server4_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_3iatt(state, &rsp, inode, stbuf, preparent, postparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -565,7 +565,7 @@ server4_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_FSYNCDIR, op_errno), op_errno, PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique, @@ -577,7 +577,7 @@ server4_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -603,7 +603,7 @@ server4_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_READDIR, op_errno), op_errno, PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique, @@ -615,17 +615,17 @@ server4_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } /* (op_ret == 0) is valid, and means EOF */ - if (op_ret) { + if (IS_ERROR(op_ret)) { ret = server4_post_readdir(&rsp, entries); if (ret == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -644,6 +644,7 @@ server4_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { + int ret; server_state_t *state = NULL; rpcsvc_request_t *req = NULL; gfx_open_rsp rsp = { @@ -653,7 +654,7 @@ server4_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_OPENDIR, op_errno), op_errno, PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique, @@ -664,13 +665,15 @@ server4_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - op_ret = server4_post_open(frame, this, &rsp, fd); - if (op_ret) + ret = server4_post_open(frame, this, &rsp, fd); + if (ret < 0) { + op_ret = gf_failure; goto out; + } out: - if (op_ret) + if (IS_ERROR(op_ret)) rsp.fd = fd_no; - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -695,7 +698,7 @@ server4_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); if (ENODATA == op_errno || ENOATTR == op_errno) loglevel = GF_LOG_DEBUG; @@ -712,7 +715,7 @@ server4_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -736,7 +739,7 @@ server4_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_FREMOVEXATTR, op_errno), op_errno, PS_MSG_REMOVEXATTR_INFO, "frame=%" PRId64, @@ -749,7 +752,7 @@ server4_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -774,7 +777,7 @@ server4_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_GETXATTR, op_errno), op_errno, PS_MSG_GETXATTR_INFO, "frame=%" PRId64, frame->root->unique, @@ -787,7 +790,7 @@ server4_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(dict, &rsp.dict); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -814,7 +817,7 @@ server4_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_FGETXATTR, op_errno), op_errno, PS_MSG_GETXATTR_INFO, "frame=%" PRId64, frame->root->unique, @@ -827,7 +830,7 @@ server4_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(dict, &rsp.dict); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -853,7 +856,7 @@ server4_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); if (op_errno != ENOTSUP) dict_foreach(state->dict, _gf_server_log_setxattr_failure, frame); @@ -869,7 +872,7 @@ server4_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -893,7 +896,7 @@ server4_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); if (op_errno != ENOTSUP) { dict_foreach(state->dict, _gf_server_log_setxattr_failure, frame); @@ -909,7 +912,7 @@ server4_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -944,7 +947,7 @@ server4_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { uuid_utoa_r(state->resolve.pargfid, oldpar_str); uuid_utoa_r(state->resolve2.pargfid, newpar_str); gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_RENAME_INFO, @@ -961,7 +964,7 @@ server4_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_rename(frame, state, &rsp, stbuf, preoldparent, postoldparent, prenewparent, postnewparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -988,7 +991,7 @@ server4_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_UNLINK, op_errno), op_errno, PS_MSG_LINK_INFO, "frame=%" PRId64, frame->root->unique, "UNLINK_path=%s", state->loc.path, "uuid_utoa=%s", @@ -1009,7 +1012,7 @@ server4_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_entry_remove(state, &rsp, preparent, postparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1037,7 +1040,7 @@ server4_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO, "frame=%" PRId64, frame->root->unique, "SYMLINK_path= %s", (state->loc.path) ? state->loc.path : "", "uuid_utoa=%s", @@ -1051,7 +1054,7 @@ server4_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_3iatt(state, &rsp, inode, stbuf, preparent, postparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1085,7 +1088,7 @@ server4_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret) { + if (IS_ERROR(op_ret)) { uuid_utoa_r(state->resolve.gfid, gfid_str); uuid_utoa_r(state->resolve2.pargfid, newpar_str); @@ -1101,7 +1104,7 @@ server4_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_link(state, &rsp, inode, stbuf, preparent, postparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1126,7 +1129,7 @@ server4_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_TRUNCATE_INFO, "frame=%" PRId64, frame->root->unique, "TRUNCATE_path=%s", @@ -1139,7 +1142,7 @@ server4_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_2iatt(&rsp, prebuf, postbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1165,7 +1168,7 @@ server4_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); state = CALL_STATE(frame); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_FSTAT, op_errno), op_errno, PS_MSG_STAT_INFO, "frame=%" PRId64, frame->root->unique, "FSTAT_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s", @@ -1178,7 +1181,7 @@ server4_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_iatt(state, &rsp, stbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1201,7 +1204,7 @@ server4_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_FTRUNCATE, op_errno), op_errno, PS_MSG_TRUNCATE_INFO, "frame=%" PRId64, frame->root->unique, @@ -1215,7 +1218,7 @@ server4_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_2iatt(&rsp, prebuf, postbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1239,7 +1242,7 @@ server4_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_FLUSH, op_errno), op_errno, PS_MSG_FLUSH_INFO, "frame=%" PRId64, frame->root->unique, @@ -1251,7 +1254,7 @@ server4_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1276,7 +1279,7 @@ server4_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_FSYNC, op_errno), op_errno, PS_MSG_SYNC_INFO, "frame=%" PRId64, frame->root->unique, @@ -1290,7 +1293,7 @@ server4_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_2iatt(&rsp, prebuf, postbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1315,7 +1318,7 @@ server4_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_WRITE, op_errno), op_errno, PS_MSG_WRITE_INFO, "frame=%" PRId64, frame->root->unique, @@ -1329,7 +1332,7 @@ server4_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_2iatt(&rsp, prebuf, postbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1365,7 +1368,7 @@ server4_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, #endif dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_READ, op_errno), op_errno, PS_MSG_READ_INFO, "frame=%" PRId64, frame->root->unique, @@ -1379,7 +1382,7 @@ server4_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_readv(&rsp, stbuf, op_ret); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1405,7 +1408,7 @@ server4_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_RCHECKSUM, op_errno), op_errno, PS_MSG_CHKSUM_INFO, "frame=%" PRId64, frame->root->unique, @@ -1418,7 +1421,7 @@ server4_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_rchecksum(&rsp, weak_checksum, strong_checksum); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1434,6 +1437,7 @@ int server4_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { + int ret; server_state_t *state = NULL; rpcsvc_request_t *req = NULL; gfx_open_rsp rsp = { @@ -1442,7 +1446,7 @@ server4_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_OPEN, op_errno), op_errno, PS_MSG_OPEN_INFO, "frame=%" PRId64, frame->root->unique, @@ -1453,11 +1457,13 @@ server4_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - op_ret = server4_post_open(frame, this, &rsp, fd); - if (op_ret) + ret = server4_post_open(frame, this, &rsp, fd); + if (ret < 0) { + op_ret = gf_failure; goto out; + } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1474,6 +1480,7 @@ server4_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, inode_t *inode, struct iatt *stbuf, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { + int ret; server_state_t *state = NULL; rpcsvc_request_t *req = NULL; uint64_t fd_no = 0; @@ -1485,7 +1492,7 @@ server4_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg( this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO, "frame=%" PRId64, frame->root->unique, "path=%s", state->loc.path, @@ -1497,24 +1504,22 @@ server4_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* TODO: log gfid too */ gf_msg_trace(frame->root->client->bound_xl->name, 0, - "%" PRId64 - ": " - "CREATE %s (%s)", + "%" PRId64 ": CREATE %s (%s)", frame->root->unique, state->loc.name, uuid_utoa(stbuf->ia_gfid)); - op_ret = server4_post_create(frame, &rsp, state, this, fd, inode, stbuf, + ret = server4_post_create(frame, &rsp, state, this, fd, inode, stbuf, preparent, postparent); - if (op_ret) { - op_errno = -op_ret; - op_ret = -1; + if (ret < 0) { + op_errno = -ret; + op_ret = gf_failure; goto out; } out: - if (op_ret) + if (IS_ERROR(op_ret)) rsp.fd = fd_no; - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1539,7 +1544,7 @@ server4_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO, "frame=%" PRId64, frame->root->unique, "READLINK_path=%s", @@ -1551,7 +1556,7 @@ server4_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_readlink(&rsp, stbuf, buf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); if (!rsp.path) rsp.path = ""; @@ -1579,7 +1584,7 @@ server4_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); state = CALL_STATE(frame); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_STAT, op_errno), op_errno, PS_MSG_STAT_INFO, "frame=%" PRId64, frame->root->unique, "path=%s", (state->loc.path) ? state->loc.path : "", @@ -1591,7 +1596,7 @@ server4_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_iatt(state, &rsp, stbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1616,7 +1621,7 @@ server4_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SETATTR_INFO, "frame=%" PRId64, frame->root->unique, "path=%s", @@ -1630,7 +1635,7 @@ server4_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_2iatt(&rsp, statpre, statpost); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1655,7 +1660,7 @@ server4_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_FSETATTR, op_errno), op_errno, PS_MSG_SETATTR_INFO, "frame=%" PRId64, @@ -1669,7 +1674,7 @@ server4_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_2iatt(&rsp, statpre, statpost); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1694,7 +1699,7 @@ server4_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_XATTROP, op_errno), op_errno, PS_MSG_XATTROP_INFO, "frame=%" PRId64, frame->root->unique, @@ -1707,7 +1712,7 @@ server4_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(dict, &rsp.dict); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1734,7 +1739,7 @@ server4_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_FXATTROP, op_errno), op_errno, PS_MSG_XATTROP_INFO, "frame=%" PRId64, frame->root->unique, @@ -1748,7 +1753,7 @@ server4_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(dict, &rsp.dict); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1778,7 +1783,7 @@ server4_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_READDIRP, op_errno), op_errno, PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique, @@ -1790,10 +1795,10 @@ server4_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } /* (op_ret == 0) is valid, and means EOF */ - if (op_ret) { + if (IS_ERROR(op_ret)) { ret = server4_post_readdirp(&rsp, entries); if (ret == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } @@ -1802,7 +1807,7 @@ server4_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_link_inodes_from_dirent(this, state->fd->inode, entries); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1830,7 +1835,7 @@ server4_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_FALLOCATE, op_errno), op_errno, PS_MSG_ALLOC_INFO, "frame=%" PRId64, frame->root->unique, @@ -1844,7 +1849,7 @@ server4_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_2iatt(&rsp, statpre, statpost); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1869,7 +1874,7 @@ server4_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, fop_log_level(GF_FOP_DISCARD, op_errno), op_errno, PS_MSG_DISCARD_INFO, "frame=%" PRId64, frame->root->unique, @@ -1883,7 +1888,7 @@ server4_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_2iatt(&rsp, statpre, statpost); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -1911,7 +1916,7 @@ server4_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_ZEROFILL, op_errno), op_errno, PS_MSG_ZEROFILL_INFO, "frame=%" PRId64, frame->root->unique, "fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s", @@ -1924,7 +1929,7 @@ server4_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_2iatt(&rsp, statpre, statpost); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); server_submit_reply(frame, req, &rsp, NULL, 0, NULL, @@ -1950,7 +1955,7 @@ server4_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SERVER_IPC_INFO, "frame=%" PRId64, frame->root->unique, "IPC=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s", @@ -1961,7 +1966,7 @@ server4_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); server_submit_reply(frame, req, &rsp, NULL, 0, NULL, @@ -1988,7 +1993,7 @@ server4_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, fop_log_level(GF_FOP_SEEK, op_errno), op_errno, PS_MSG_SEEK_INFO, "frame=%" PRId64, frame->root->unique, "fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s", @@ -2000,7 +2005,7 @@ server4_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_seek(&rsp, offset); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); server_submit_reply(frame, req, &rsp, NULL, 0, NULL, @@ -2025,7 +2030,7 @@ server4_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SETACTIVELK_INFO, "frame=%" PRId64, frame->root->unique, "path==%s", @@ -2036,7 +2041,7 @@ server4_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -2060,7 +2065,7 @@ server4_namelink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, rpcsvc_request_t *req = NULL; dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; gfx_stat_from_iattx(&rsp.prestat, prebuf); @@ -2072,7 +2077,7 @@ server4_namelink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, */ out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -2099,7 +2104,7 @@ server4_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO, "frame=%" PRId64, uuid_utoa(state->resolve.gfid), "ICREATE_gfid=%s", uuid_utoa(state->resolve.gfid), @@ -2116,7 +2121,7 @@ server4_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, link_inode = inode_link(inode, state->loc.parent, state->loc.name, stbuf); if (!link_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOENT; goto out; } @@ -2127,7 +2132,7 @@ server4_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gfx_stat_from_iattx(&rsp.stat, stbuf); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -2155,7 +2160,7 @@ server4_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this, state = CALL_STATE(frame); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_smsg( this->name, GF_LOG_INFO, op_errno, PS_MSG_PUT_INFO, "frame=%" PRId64, frame->root->unique, "path=%s", state->loc.path, @@ -2175,7 +2180,7 @@ server4_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_3iatt(state, &rsp, inode, stbuf, preparent, postparent); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -2203,7 +2208,7 @@ server4_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); uuid_utoa_r(state->resolve.gfid, in_gfid); @@ -2232,7 +2237,7 @@ server4_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this, server4_post_common_3iatt_noinode(&rsp, stbuf, prebuf_dst, postbuf_dst); out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -2250,12 +2255,12 @@ int server4_rchecksum_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret;; int op_errno = EINVAL; state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) { + if (IS_ERROR(state->resolve.op_ret)) { op_ret = state->resolve.op_ret; op_errno = state->resolve.op_errno; goto err; @@ -2280,7 +2285,7 @@ server4_lease_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_lease_cbk, bound_xl, bound_xl->fops->lease, @@ -2301,7 +2306,7 @@ server4_put_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -2325,7 +2330,7 @@ server4_lk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_lk_cbk, bound_xl, bound_xl->fops->lk, state->fd, @@ -2343,18 +2348,18 @@ int server4_rename_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret; int op_errno = 0; state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) { + if (IS_ERROR(state->resolve.op_ret)) { op_ret = state->resolve.op_ret; op_errno = state->resolve.op_errno; goto err; } - if (state->resolve2.op_ret != 0) { + if (IS_ERROR(state->resolve2.op_ret)) { op_ret = state->resolve2.op_ret; op_errno = state->resolve2.op_errno; goto err; @@ -2373,18 +2378,18 @@ int server4_link_resume(call_frame_t *frame, xlator_t *bound_xl) { server_state_t *state = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret; int op_errno = 0; state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) { + if (IS_ERROR(state->resolve.op_ret)) { op_ret = state->resolve.op_ret; op_errno = state->resolve.op_errno; goto err; } - if (state->resolve2.op_ret != 0) { + if (IS_ERROR(state->resolve2.op_ret)) { op_ret = state->resolve2.op_ret; op_errno = state->resolve2.op_errno; goto err; @@ -2409,7 +2414,7 @@ server4_symlink_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -2431,7 +2436,7 @@ server4_access_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_access_cbk, bound_xl, bound_xl->fops->access, @@ -2451,7 +2456,7 @@ server4_fentrylk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; if (!state->xdata) @@ -2480,7 +2485,7 @@ server4_entrylk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; if (!state->xdata) @@ -2510,7 +2515,7 @@ server4_finodelk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; if (!state->xdata) @@ -2542,7 +2547,7 @@ server4_inodelk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; if (!state->xdata) @@ -2569,7 +2574,7 @@ server4_rmdir_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_rmdir_cbk, bound_xl, bound_xl->fops->rmdir, @@ -2589,7 +2594,7 @@ server4_mkdir_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -2611,7 +2616,7 @@ server4_mknod_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -2634,7 +2639,7 @@ server4_fsyncdir_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_fsyncdir_cbk, bound_xl, bound_xl->fops->fsyncdir, @@ -2654,7 +2659,7 @@ server4_readdir_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; GF_ASSERT(state->fd); @@ -2676,7 +2681,7 @@ server4_readdirp_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_readdirp_cbk, bound_xl, bound_xl->fops->readdirp, @@ -2696,7 +2701,7 @@ server4_opendir_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->fd = fd_create(state->loc.inode, frame->root->pid); @@ -2721,7 +2726,7 @@ server4_statfs_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_statfs_cbk, bound_xl, bound_xl->fops->statfs, @@ -2741,7 +2746,7 @@ server4_removexattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_removexattr_cbk, bound_xl, @@ -2761,7 +2766,7 @@ server4_fremovexattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_fremovexattr_cbk, bound_xl, @@ -2781,7 +2786,7 @@ server4_fgetxattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_fgetxattr_cbk, bound_xl, @@ -2800,7 +2805,7 @@ server4_xattrop_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_xattrop_cbk, bound_xl, bound_xl->fops->xattrop, @@ -2819,7 +2824,7 @@ server4_fxattrop_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_fxattrop_cbk, bound_xl, bound_xl->fops->fxattrop, @@ -2838,7 +2843,7 @@ server4_fsetxattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_setxattr_cbk, bound_xl, bound_xl->fops->fsetxattr, @@ -2858,7 +2863,7 @@ server4_unlink_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_unlink_cbk, bound_xl, bound_xl->fops->unlink, @@ -2877,7 +2882,7 @@ server4_truncate_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_truncate_cbk, bound_xl, bound_xl->fops->truncate, @@ -2896,7 +2901,7 @@ server4_fstat_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_fstat_cbk, bound_xl, bound_xl->fops->fstat, @@ -2915,7 +2920,7 @@ server4_setxattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_setxattr_cbk, bound_xl, bound_xl->fops->setxattr, @@ -2935,7 +2940,7 @@ server4_getxattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_getxattr_cbk, bound_xl, bound_xl->fops->getxattr, @@ -2954,7 +2959,7 @@ server4_ftruncate_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_ftruncate_cbk, bound_xl, @@ -2975,7 +2980,7 @@ server4_flush_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_flush_cbk, bound_xl, bound_xl->fops->flush, @@ -2995,7 +3000,7 @@ server4_fsync_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_fsync_cbk, bound_xl, bound_xl->fops->fsync, @@ -3015,7 +3020,7 @@ server4_writev_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_writev_cbk, bound_xl, bound_xl->fops->writev, @@ -3036,7 +3041,7 @@ server4_readv_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_readv_cbk, bound_xl, bound_xl->fops->readv, @@ -3057,7 +3062,7 @@ server4_create_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -3067,7 +3072,7 @@ server4_create_resume(call_frame_t *frame, xlator_t *bound_xl) gf_smsg("server", GF_LOG_ERROR, 0, PS_MSG_FD_CREATE_FAILED, "inode=%s", state->loc.inode ? uuid_utoa(state->loc.inode->gfid) : NULL, NULL); - state->resolve.op_ret = -1; + state->resolve.op_ret = gf_failure; state->resolve.op_errno = ENOMEM; goto err; } @@ -3092,7 +3097,7 @@ server4_open_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->fd = fd_create(state->loc.inode, frame->root->pid); @@ -3115,7 +3120,7 @@ server4_readlink_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_readlink_cbk, bound_xl, bound_xl->fops->readlink, @@ -3134,7 +3139,7 @@ server4_fsetattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_fsetattr_cbk, bound_xl, bound_xl->fops->fsetattr, @@ -3154,7 +3159,7 @@ server4_setattr_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_setattr_cbk, bound_xl, bound_xl->fops->setattr, @@ -3174,7 +3179,7 @@ server4_stat_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_stat_cbk, bound_xl, bound_xl->fops->stat, @@ -3193,7 +3198,7 @@ server4_lookup_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; if (!state->loc.inode) @@ -3219,7 +3224,7 @@ server4_fallocate_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_fallocate_cbk, bound_xl, @@ -3240,7 +3245,7 @@ server4_discard_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_discard_cbk, bound_xl, bound_xl->fops->discard, @@ -3260,7 +3265,7 @@ server4_zerofill_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_zerofill_cbk, bound_xl, bound_xl->fops->zerofill, @@ -3280,7 +3285,7 @@ server4_seek_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_seek_cbk, bound_xl, bound_xl->fops->seek, @@ -3309,7 +3314,7 @@ server4_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_to_xdr(xdata, &rsp.xdata); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { state = CALL_STATE(frame); gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_GETACTIVELK_INFO, @@ -3322,17 +3327,17 @@ server4_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } /* (op_ret == 0) means there are no locks on the file*/ - if (op_ret > 0) { + if (IS_SUCCESS(op_ret)) { ret = serialize_rsp_locklist_v2(locklist, &rsp); if (ret == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } } out: - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = gf_errno_to_error(op_errno); req = frame->local; @@ -3354,7 +3359,7 @@ server4_getactivelk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_getactivelk_cbk, bound_xl, @@ -3373,7 +3378,7 @@ server4_setactivelk_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_setactivelk_cbk, bound_xl, @@ -3392,7 +3397,7 @@ server4_namelink_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -3414,7 +3419,7 @@ server4_icreate_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; state->loc.inode = inode_new(state->itable); @@ -3436,7 +3441,7 @@ server4_copy_file_range_resume(call_frame_t *frame, xlator_t *bound_xl) state = CALL_STATE(frame); - if (state->resolve.op_ret != 0) + if (IS_ERROR(state->resolve.op_ret)) goto err; STACK_WIND(frame, server4_copy_file_range_cbk, bound_xl, From 937cbfa0084908caa9ac07c35e847efbdb39f235 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 18 Sep 2020 08:33:32 +0530 Subject: [PATCH 17/24] write-behind/read-ahead: compiles Change-Id: I40a35403b56b5e5c294c927c73418059629bafdc Signed-off-by: Amar Tumballi --- xlators/performance/read-ahead/src/page.c | 37 ++++++++++--------- .../performance/read-ahead/src/read-ahead.c | 16 ++++---- .../write-behind/src/write-behind.c | 36 +++++++++--------- 3 files changed, 45 insertions(+), 44 deletions(-) diff --git a/xlators/performance/read-ahead/src/page.c b/xlators/performance/read-ahead/src/page.c index 736627e6ef..12e1bc8432 100644 --- a/xlators/performance/read-ahead/src/page.c +++ b/xlators/performance/read-ahead/src/page.c @@ -85,7 +85,7 @@ ra_wait_on_page(ra_page_t *page, call_frame_t *frame) waitq = GF_CALLOC(1, sizeof(*waitq), gf_ra_mt_ra_waitq_t); if (!waitq) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto out; } @@ -151,14 +151,14 @@ ra_fault_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg(this->name, GF_LOG_WARNING, EBADF, READ_AHEAD_MSG_FD_CONTEXT_NOT_SET, "read-ahead context not set in fd (%p)", fd); - op_ret = -1; + op_ret = gf_failure; op_errno = EBADF; goto out; } ra_file_lock(file); { - if (op_ret >= 0) + if (IS_SUCCESS(op_ret)) file->stbuf = *stbuf; page = ra_page_get(file, pending_offset); @@ -192,11 +192,11 @@ ra_fault_cbk(call_frame_t *frame, void *cookie, xlator_t *this, * we're trying to indicate. */ if (page->dirty && page->poisoned) { - op_ret = -1; + op_ret = gf_failure; op_errno = ECANCELED; } - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { waitq = ra_page_error(page, op_ret, op_errno); goto unlock; } @@ -208,7 +208,7 @@ ra_fault_cbk(call_frame_t *frame, void *cookie, xlator_t *this, page->vector = iov_dup(vector, count); if (page->vector == NULL) { - waitq = ra_page_error(page, -1, ENOMEM); + waitq = ra_page_error(page, gf_failure, ENOMEM); goto unlock; } @@ -250,14 +250,15 @@ ra_page_fault(ra_file_t *file, call_frame_t *frame, off_t offset) ra_local_t *fault_local = NULL; ra_page_t *page = NULL; ra_waitq_t *waitq = NULL; - gf_return_t op_ret = -1, op_errno = -1; + gf_return_t op_ret = gf_failure; + int op_errno = -1; GF_VALIDATE_OR_GOTO("read-ahead", frame, out); GF_VALIDATE_OR_GOTO(frame->this->name, file, out); fault_frame = copy_frame(frame); if (fault_frame == NULL) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto err; } @@ -265,7 +266,7 @@ ra_page_fault(ra_file_t *file, call_frame_t *frame, off_t offset) fault_local = mem_get0(THIS->local_pool); if (fault_local == NULL) { STACK_DESTROY(fault_frame->root); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto err; } @@ -315,7 +316,7 @@ ra_frame_fill(ra_page_t *page, call_frame_t *frame) local = frame->local; fill = &local->fill; - if (local->op_ret != -1 && page->size) { + if (IS_SUCCESS(local->op_ret) && page->size) { if (local->offset > page->offset) src_offset = local->offset - page->offset; else @@ -339,7 +340,7 @@ ra_frame_fill(ra_page_t *page, call_frame_t *frame) new = GF_CALLOC(1, sizeof(*new), gf_ra_mt_ra_fill_t); if (new == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto out; } @@ -350,7 +351,7 @@ ra_frame_fill(ra_page_t *page, call_frame_t *frame) new->count = iov_subset(page->vector, page->count, src_offset, copy_size, &new->vector, 0); if (new->count < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; iobref_unref(new->iobref); GF_FREE(new); @@ -362,7 +363,7 @@ ra_frame_fill(ra_page_t *page, call_frame_t *frame) new->next->prev = new; new->prev->next = new; - local->op_ret += copy_size; + SET_RET(local->op_ret, (GET_RET(local->op_ret) + copy_size)); } out: @@ -390,7 +391,7 @@ ra_frame_unwind(call_frame_t *frame) iobref = iobref_new(); if (iobref == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; } @@ -403,7 +404,7 @@ ra_frame_unwind(call_frame_t *frame) vector = GF_CALLOC(count, sizeof(*vector), gf_ra_mt_iovec); if (vector == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; iobref_unref(iobref); iobref = NULL; @@ -420,7 +421,7 @@ ra_frame_unwind(call_frame_t *frame) copied += (fill->count * sizeof(*vector)); if (iobref_merge(iobref, fill->iobref)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; iobref_unref(iobref); iobref = NULL; @@ -558,7 +559,7 @@ ra_page_error(ra_page_t *page, gf_return_t op_ret, int32_t op_errno) frame = trav->data; local = frame->local; - if (local->op_ret != -1) { + if (IS_SUCCESS(local->op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; } @@ -594,7 +595,7 @@ ra_file_destroy(ra_file_t *file) trav = file->pages.next; while (trav != &file->pages) { - ra_page_error(trav, -1, EINVAL); + ra_page_error(trav, gf_failure, EINVAL); trav = file->pages.next; } diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index 6e17bce04a..a6dad5a7d3 100644 --- a/xlators/performance/read-ahead/src/read-ahead.c +++ b/xlators/performance/read-ahead/src/read-ahead.c @@ -41,13 +41,13 @@ ra_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, conf = this->private; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { goto unwind; } file = GF_CALLOC(1, sizeof(*file), gf_ra_mt_ra_file_t); if (!file) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -89,7 +89,7 @@ ra_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "information in fd (%p)", fd); ra_file_destroy(file); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } @@ -116,13 +116,13 @@ ra_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, conf = this->private; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { goto unwind; } file = GF_CALLOC(1, sizeof(*file), gf_ra_mt_ra_file_t); if (!file) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -161,7 +161,7 @@ ra_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "information in fd (%p)", fd); ra_file_destroy(file); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } @@ -369,7 +369,7 @@ dispatch_requests(call_frame_t *frame, ra_file_t *file) if (!trav) { trav = ra_page_create(file, trav_offset); if (!trav) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unlock; } @@ -394,7 +394,7 @@ dispatch_requests(call_frame_t *frame, ra_file_t *file) unlock: ra_file_unlock(file); - if (local->op_ret == -1) { + if (IS_ERROR(local->op_ret)) { goto out; } diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index a3bacf1d55..6923154233 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -552,7 +552,7 @@ wb_enqueue_common(wb_inode_t *wb_inode, call_stub_t *stub, int tempted) /* Let's be optimistic that we can lie about it */ - req->op_ret = req->write_size; + SET_RET(req->op_ret, req->write_size); req->op_errno = 0; if (stub->args.fd && (stub->args.fd->flags & O_APPEND)) @@ -867,7 +867,7 @@ __wb_fulfill_request_err(wb_request_t *req, int32_t op_errno) conf = wb_inode->this->private; - req->op_ret = -1; + req->op_ret = gf_failure; req->op_errno = op_errno; if (req->ordering.lied) @@ -882,7 +882,7 @@ __wb_fulfill_request_err(wb_request_t *req, int32_t op_errno) /* response was sent, store the error in a * waiter (either an fsync or flush). */ - waiter->op_ret = -1; + waiter->op_ret = gf_failure; waiter->op_errno = op_errno; } @@ -1097,10 +1097,10 @@ wb_fulfill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, * */ wb_set_invalidate(wb_inode); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { wb_fulfill_err(head, op_errno); - } else if (op_ret < head->total_size) { - wb_fulfill_short_write(head, op_ret); + } else if (GET_RET(op_ret) < head->total_size) { + wb_fulfill_short_write(head, GET_RET(op_ret)); } else { wb_head_done(head); } @@ -1520,7 +1520,7 @@ __wb_handle_failed_conflict(wb_request_t *req, wb_request_t *conflict, * 3. So, skip the request for now. * 4. Otherwise, resume (unwind) it with error. */ - req->op_ret = -1; + req->op_ret = gf_failure; req->op_errno = conflict->op_errno; if ((req->stub->fop == GF_FOP_TRUNCATE) || (req->stub->fop == GF_FOP_FTRUNCATE)) { @@ -1643,10 +1643,10 @@ __wb_pick_winds(wb_inode_t *wb_inode, list_head_t *tasks, req->unique, gf_fop_list[req->fop], req->gen, req_gfid, conflict->unique, gf_fop_list[conflict->fop], conflict->gen, conflict_gfid, - (conflict->op_ret == 1) ? "yes" : "no", + (GET_RET(conflict->op_ret) == 1) ? "yes" : "no", strerror(conflict->op_errno)); - if (conflict->op_ret == -1) { + if (IS_ERROR(conflict->op_ret)) { /* There is a conflicting liability which failed * to sync in previous attempts, resume the req * and fail, unless its an fsync/flush. @@ -1738,7 +1738,7 @@ wb_do_winds(wb_inode_t *wb_inode, list_head_t *tasks) { list_del_init(&req->winds); - if (req->op_ret == -1) { + if (IS_ERROR(req->op_ret)) { call_unwind_error_keep_stub(req->stub, req->op_ret, req->op_errno); } else { call_resume_keep_stub(req->stub); @@ -1967,13 +1967,13 @@ wb_flush_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) wb_inode_t *wb_inode = NULL; call_frame_t *bg_frame = NULL; int32_t op_errno = 0; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; conf = this->private; wb_inode = wb_inode_ctx_get(this, fd->inode); if (!wb_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto unwind; } @@ -1988,7 +1988,7 @@ wb_flush_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) flushbehind: bg_frame = copy_frame(frame); if (!bg_frame) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -2173,7 +2173,7 @@ wb_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { GF_ASSERT(frame->local); - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) wb_set_inode_size(frame->local, postbuf); frame->local = NULL; @@ -2232,7 +2232,7 @@ wb_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { GF_ASSERT(frame->local); - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) wb_set_inode_size(frame->local, postbuf); frame->local = NULL; @@ -2429,7 +2429,7 @@ wb_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *xdata, struct iatt *postparent) { - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { wb_inode_t *wb_inode = wb_inode_ctx_get(this, inode); if (wb_inode) wb_set_inode_size(wb_inode, buf); @@ -2546,7 +2546,7 @@ wb_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fd = frame->local; frame->local = NULL; - if (op_ret <= 0) + if (IS_ERROR(op_ret)) goto unwind; list_for_each_entry(entry, &entries->list, list) @@ -2904,7 +2904,7 @@ __wb_dump_requests(struct list_head *head, char *prefix) gf_proc_dump_write("generation-number", "%" PRIu64, req->gen); - gf_proc_dump_write("req->op_ret", "%d", req->op_ret); + gf_proc_dump_write("req->op_ret", "%d", GET_RET(req->op_ret)); gf_proc_dump_write("req->op_errno", "%d", req->op_errno); gf_proc_dump_write("sync-attempts", "%d", req->wind_count); From 313db177ba3ba0301e322242d80ed2babf0d04b2 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 18 Sep 2020 09:59:25 +0530 Subject: [PATCH 18/24] performance/*: compile fixes Change-Id: I8881133b22dd22be2391976ea954354238f84731 Signed-off-by: Amar Tumballi --- xlators/performance/io-cache/src/io-cache.c | 48 +++++----- xlators/performance/io-cache/src/ioc-inode.c | 2 +- xlators/performance/io-cache/src/page.c | 56 +++++------ .../performance/io-threads/src/io-threads.c | 4 +- xlators/performance/md-cache/src/md-cache.c | 96 ++++++++++--------- xlators/performance/nl-cache/src/nl-cache.c | 14 +-- .../performance/open-behind/src/open-behind.c | 8 +- .../performance/quick-read/src/quick-read.c | 24 ++--- .../readdir-ahead/src/readdir-ahead.c | 37 +++---- 9 files changed, 151 insertions(+), 138 deletions(-) diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 7002307c39..8f05d40267 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -90,7 +90,7 @@ ioc_update_pages(call_frame_t *frame, ioc_inode_t *ioc_inode, ioc_page_t *trav = NULL; size = iov_length(vector, count); - size = min(size, op_ret); + size = min(size, GET_RET(op_ret)); rounded_offset = gf_floor(offset, ioc_inode->table->page_size); rounded_end = gf_roof(offset + size, ioc_inode->table->page_size); @@ -285,18 +285,18 @@ ioc_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { ioc_local_t *local = NULL; - if (op_ret != 0) + if (IS_ERROR(op_ret)) goto out; local = frame->local; if (local == NULL) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } if (!this || !this->private) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -318,7 +318,7 @@ int32_t ioc_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { ioc_local_t *local = NULL; - int32_t op_errno = gf_failure, ret = -1; + int32_t op_errno = -1, ret = -1; local = mem_get0(this->local_pool); if (local == NULL) { @@ -411,8 +411,8 @@ ioc_cache_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ioc_inode = local->inode; local_stbuf = stbuf; - if ((op_ret == -1) || - ((op_ret >= 0) && !ioc_cache_still_valid(ioc_inode, stbuf))) { + if ((IS_ERROR(op_ret)) || + ((IS_SUCCESS(op_ret)) && !ioc_cache_still_valid(ioc_inode, stbuf))) { gf_msg_debug(ioc_inode->table->xl->name, 0, "cache for inode(%p) is invalid. flushing all pages", ioc_inode); @@ -423,7 +423,7 @@ ioc_cache_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ioc_inode_lock(ioc_inode); { destroy_size = __ioc_inode_flush(ioc_inode); - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { ioc_inode->cache.mtime = stbuf->ia_mtime; ioc_inode->cache.mtime_nsec = stbuf->ia_mtime_nsec; } @@ -440,7 +440,7 @@ ioc_cache_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ioc_table_unlock(ioc_inode->table); } - if (op_ret < 0) + if (IS_ERROR(op_ret)) local_stbuf = NULL; ioc_inode_lock(ioc_inode); @@ -518,7 +518,7 @@ ioc_cache_validate(call_frame_t *frame, ioc_inode_t *ioc_inode, fd_t *fd, validate_local = mem_get0(THIS->local_pool); if (validate_local == NULL) { ret = -1; - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; gf_smsg(ioc_inode->table->xl->name, GF_LOG_ERROR, 0, IO_CACHE_MSG_NO_MEMORY, NULL); @@ -528,7 +528,7 @@ ioc_cache_validate(call_frame_t *frame, ioc_inode_t *ioc_inode, fd_t *fd, validate_frame = copy_frame(frame); if (validate_frame == NULL) { ret = -1; - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; mem_put(validate_local); gf_smsg(ioc_inode->table->xl->name, GF_LOG_ERROR, 0, @@ -601,14 +601,14 @@ ioc_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; if (!this || !this->private) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } table = this->private; - if (op_ret != -1) { + if (IS_SUCCESS(op_ret)) { inode_ctx_get(fd->inode, this, &tmp_ioc_inode); ioc_inode = (ioc_inode_t *)(long)tmp_ioc_inode; @@ -683,7 +683,7 @@ ioc_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; if (!this || !this->private) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -691,7 +691,7 @@ ioc_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, table = this->private; path = local->file_loc.path; - if (op_ret != -1) { + if (IS_SUCCESS(op_ret)) { /* assign weight */ weight = ioc_get_priority(table, path); @@ -764,7 +764,7 @@ ioc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; if (!this || !this->private) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -772,7 +772,7 @@ ioc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, table = this->private; path = local->file_loc.path; - if (op_ret != -1) { + if (IS_SUCCESS(op_ret)) { /* assign weight */ weight = ioc_get_priority(table, path); @@ -805,7 +805,7 @@ ioc_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, dev_t rdev, mode_t umask, dict_t *xdata) { ioc_local_t *local = NULL; - int32_t op_errno = gf_failure, ret = -1; + int32_t op_errno = -1, ret = -1; local = mem_get0(this->local_pool); if (local == NULL) { @@ -1003,7 +1003,7 @@ ioc_dispatch_requests(call_frame_t *frame, ioc_inode_t *ioc_inode, fd_t *fd, if (!trav) { gf_smsg(frame->this->name, GF_LOG_CRITICAL, ENOMEM, IO_CACHE_MSG_NO_MEMORY, NULL); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; ioc_inode_unlock(ioc_inode); goto out; @@ -1034,7 +1034,7 @@ ioc_dispatch_requests(call_frame_t *frame, ioc_inode_t *ioc_inode, fd_t *fd, ret = ioc_wait_on_inode(ioc_inode, trav); if (ret < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = -ret; need_validate = 0; @@ -1229,9 +1229,9 @@ ioc_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, frame->local = NULL; inode_ctx_get(local->fd->inode, this, &ioc_inode); - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { ioc_update_pages(frame, (ioc_inode_t *)(long)ioc_inode, local->vector, - local->op_ret, op_ret, local->offset); + GET_RET(local->op_ret), op_ret, local->offset); } STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, prebuf, postbuf, @@ -1280,8 +1280,8 @@ ioc_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, if (ioc_inode) { local->iobref = iobref_ref(iobref); local->vector = iov_dup(vector, count); - local->op_ret = count; local->offset = offset; + SET_RET(local->op_ret, count); } STACK_WIND(frame, ioc_writev_cbk, FIRST_CHILD(this), @@ -1432,7 +1432,7 @@ ioc_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fd = frame->local; frame->local = NULL; - if (op_ret <= 0) + if (IS_ERROR(op_ret)) goto unwind; list_for_each_entry(entry, &entries->list, list) diff --git a/xlators/performance/io-cache/src/ioc-inode.c b/xlators/performance/io-cache/src/ioc-inode.c index 97767d8528..065b9de8e9 100644 --- a/xlators/performance/io-cache/src/ioc-inode.c +++ b/xlators/performance/io-cache/src/ioc-inode.c @@ -73,7 +73,7 @@ ioc_inode_wakeup(call_frame_t *frame, ioc_inode_t *ioc_inode, GF_VALIDATE_OR_GOTO(frame->this->name, local, out); if (ioc_inode == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; gf_smsg(frame->this->name, GF_LOG_WARNING, 0, IO_CACHE_MSG_INODE_NULL, NULL); diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c index 805560186f..d7cdb30d13 100644 --- a/xlators/performance/io-cache/src/page.c +++ b/xlators/performance/io-cache/src/page.c @@ -305,7 +305,7 @@ __ioc_wait_on_page(ioc_page_t *page, call_frame_t *frame, off_t offset, GF_VALIDATE_OR_GOTO(frame->this->name, local, out); if (page == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; gf_smsg(frame->this->name, GF_LOG_WARNING, 0, IO_CACHE_MSG_NULL_PAGE_WAIT, NULL); @@ -314,7 +314,7 @@ __ioc_wait_on_page(ioc_page_t *page, call_frame_t *frame, off_t offset, waitq = GF_CALLOC(1, sizeof(*waitq), gf_ioc_mt_ioc_waitq_t); if (waitq == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto out; } @@ -427,11 +427,11 @@ ioc_fault_cbk(call_frame_t *frame, void *cookie, xlator_t *this, table = ioc_inode->table; GF_ASSERT(table); - zero_filled = ((op_ret >= 0) && (stbuf->ia_mtime == 0)); + zero_filled = (IS_SUCCESS(op_ret) && (stbuf->ia_mtime == 0)); ioc_inode_lock(ioc_inode); { - if (op_ret == -1 || + if (IS_ERROR(op_ret) || !(zero_filled || ioc_cache_still_valid(ioc_inode, stbuf))) { gf_msg_trace(ioc_inode->table->xl->name, 0, "cache for inode(%p) is invalid. flushing " @@ -440,20 +440,20 @@ ioc_fault_cbk(call_frame_t *frame, void *cookie, xlator_t *this, destroy_size = __ioc_inode_flush(ioc_inode); } - if ((op_ret >= 0) && !zero_filled) { + if (IS_SUCCESS(op_ret) && !zero_filled) { ioc_inode->cache.mtime = stbuf->ia_mtime; ioc_inode->cache.mtime_nsec = stbuf->ia_mtime_nsec; } ioc_inode->cache.last_revalidate = gf_time(); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { /* error, readv returned -1 */ page = __ioc_page_get(ioc_inode, offset); if (page) waitq = __ioc_page_error(page, op_ret, op_errno); } else { - gf_msg_trace(ioc_inode->table->xl->name, 0, "op_ret = %d", op_ret); + gf_msg_trace(ioc_inode->table->xl->name, 0, "op_ret = %d", GET_RET(op_ret)); page = __ioc_page_get(ioc_inode, offset); if (!page) { /* page was flushed */ @@ -475,7 +475,7 @@ ioc_fault_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (page->vector == NULL) { page = __ioc_page_get(ioc_inode, offset); if (page != NULL) - waitq = __ioc_page_error(page, -1, ENOMEM); + waitq = __ioc_page_error(page, gf_failure, ENOMEM); goto unlock; } @@ -564,13 +564,14 @@ ioc_page_fault(ioc_inode_t *ioc_inode, call_frame_t *frame, fd_t *fd, call_frame_t *fault_frame = NULL; ioc_local_t *fault_local = NULL; ioc_local_t *local = NULL; - gf_return_t op_ret = -1, op_errno = -1; + gf_return_t op_ret = gf_failure; + int op_errno = -1; ioc_waitq_t *waitq = NULL; ioc_page_t *page = NULL; GF_ASSERT(ioc_inode); if (frame == NULL) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg("io-cache", GF_LOG_WARNING, EINVAL, IO_CACHE_MSG_PAGE_FAULT, NULL); @@ -580,7 +581,7 @@ ioc_page_fault(ioc_inode_t *ioc_inode, call_frame_t *frame, fd_t *fd, table = ioc_inode->table; fault_frame = copy_frame(frame); if (fault_frame == NULL) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto err; } @@ -588,7 +589,7 @@ ioc_page_fault(ioc_inode_t *ioc_inode, call_frame_t *frame, fd_t *fd, local = frame->local; fault_local = mem_get0(THIS->local_pool); if (fault_local == NULL) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; STACK_DESTROY(fault_frame->root); goto err; @@ -658,7 +659,7 @@ __ioc_frame_fill(ioc_page_t *page, call_frame_t *frame, off_t offset, if (page == NULL) { gf_smsg(frame->this->name, GF_LOG_WARNING, 0, IO_CACHE_MSG_SERVE_READ_REQUEST, NULL); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; goto out; } @@ -674,7 +675,7 @@ __ioc_frame_fill(ioc_page_t *page, call_frame_t *frame, off_t offset, /* immediately move this page to the end of the page_lru list */ list_move_tail(&page->page_lru, &ioc_inode->cache.page_lru); /* fill local->pending_size bytes from local->pending_offset */ - if (local->op_ret != -1) { + if (IS_SUCCESS(local->op_ret)) { local->op_errno = op_errno; if (page->size == 0) { @@ -711,7 +712,7 @@ __ioc_frame_fill(ioc_page_t *page, call_frame_t *frame, off_t offset, { new = GF_CALLOC(1, sizeof(*new), gf_ioc_mt_ioc_fill_t); if (new == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto out; } @@ -722,7 +723,7 @@ __ioc_frame_fill(ioc_page_t *page, call_frame_t *frame, off_t offset, new->count = iov_subset(page->vector, page->count, src_offset, copy_size, &new->vector, 0); if (new->count < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; iobref_unref(new->iobref); @@ -756,7 +757,7 @@ __ioc_frame_fill(ioc_page_t *page, call_frame_t *frame, off_t offset, } } - local->op_ret += copy_size; + SET_RET(local->op_ret, (GET_RET(local->op_ret) + copy_size)); } done: @@ -786,7 +787,8 @@ ioc_frame_unwind(call_frame_t *frame) struct iatt stbuf = { 0, }; - gf_return_t op_ret = 0, op_errno = 0; + gf_return_t op_ret = {0}; + int op_errno = 0; GF_ASSERT(frame); @@ -794,12 +796,12 @@ ioc_frame_unwind(call_frame_t *frame) if (local == NULL) { gf_smsg(frame->this->name, GF_LOG_WARNING, ENOMEM, IO_CACHE_MSG_LOCAL_NULL, NULL); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } - if (local->op_ret < 0) { + if (IS_ERROR(local->op_ret)) { op_ret = local->op_ret; op_errno = local->op_errno; goto unwind; @@ -808,7 +810,7 @@ ioc_frame_unwind(call_frame_t *frame) // ioc_local_lock (local); iobref = iobref_new(); if (iobref == NULL) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } @@ -823,7 +825,7 @@ ioc_frame_unwind(call_frame_t *frame) vector = GF_CALLOC(count, sizeof(*vector), gf_ioc_mt_iovec); if (vector == NULL) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } @@ -837,7 +839,7 @@ ioc_frame_unwind(call_frame_t *frame) copied += (fill->count * sizeof(*vector)); if (iobref_merge(iobref, fill->iobref)) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } } @@ -848,13 +850,13 @@ ioc_frame_unwind(call_frame_t *frame) GF_FREE(fill); } - if (op_ret != -1) { - op_ret = iov_length(vector, count); + if (IS_SUCCESS(op_ret)) { + SET_RET(op_ret, iov_length(vector, count)); } unwind: gf_msg_trace(frame->this->name, 0, "frame(%p) unwinding with op_ret=%d", - frame, op_ret); + frame, GET_RET(op_ret)); // ioc_local_unlock (local); @@ -980,7 +982,7 @@ __ioc_page_error(ioc_page_t *page, gf_return_t op_ret, int32_t op_errno) local = frame->local; ioc_local_lock(local); { - if (local->op_ret != -1) { + if (IS_SUCCESS(local->op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; } diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index ce844ae239..c32ebb220f 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -609,7 +609,7 @@ iot_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, iot_conf_t *conf = NULL; dict_t *depths = NULL; int i = 0; - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; int32_t op_errno = 0; conf = this->private; @@ -621,7 +621,7 @@ iot_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, */ depths = dict_new(); if (!depths) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind_special_getxattr; } diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index b90fb3cca8..718819871d 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -1142,7 +1142,7 @@ mdc_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) { mdc_inode_iatt_invalidate(this, local->loc.inode); } @@ -1163,14 +1163,15 @@ mdc_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int mdc_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { - int ret = 0, op_ret = 0, op_errno = 0; + int ret = 0, op_errno = 0; + gf_return_t op_ret = {0}; struct statvfs *buf = NULL; mdc_local_t *local = NULL; struct mdc_conf *conf = this->private; local = mdc_local_get(frame, loc->inode); if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } @@ -1187,7 +1188,6 @@ mdc_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) ret = mdc_load_statfs_info_from_cache(this, &buf); if (ret == 0 && buf) { - op_ret = 0; op_errno = 0; goto out; } @@ -1215,7 +1215,7 @@ mdc_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if (op_errno == ENOENT) GF_ATOMIC_INC(conf->mdc_counter.negative_lookup); @@ -1301,7 +1301,7 @@ mdc_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } GF_ATOMIC_INC(conf->mdc_counter.stat_hit); - MDC_STACK_UNWIND(lookup, frame, 0, 0, loc->inode, &stbuf, xattr_rsp, + MDC_STACK_UNWIND(lookup, frame, gf_zero_ret, 0, loc->inode, &stbuf, xattr_rsp, &postparent); if (xattr_rsp) @@ -1336,7 +1336,7 @@ mdc_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ESTALE) || (op_errno == ENOENT)) { mdc_inode_iatt_invalidate(this, local->loc.inode); } @@ -1379,7 +1379,7 @@ mdc_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) goto uncached; GF_ATOMIC_INC(conf->mdc_counter.stat_hit); - MDC_STACK_UNWIND(stat, frame, 0, 0, &stbuf, xdata); + MDC_STACK_UNWIND(stat, frame, gf_zero_ret, 0, &stbuf, xdata); return 0; @@ -1408,7 +1408,7 @@ mdc_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) { mdc_inode_iatt_invalidate(this, local->fd->inode); } @@ -1446,7 +1446,7 @@ mdc_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) goto uncached; GF_ATOMIC_INC(conf->mdc_counter.stat_hit); - MDC_STACK_UNWIND(fstat, frame, 0, 0, &stbuf, xdata); + MDC_STACK_UNWIND(fstat, frame, gf_zero_ret, 0, &stbuf, xdata); return 0; @@ -1476,7 +1476,7 @@ mdc_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ESTALE) || (op_errno == ENOENT)) mdc_inode_iatt_invalidate(this, local->loc.inode); @@ -1520,7 +1520,7 @@ mdc_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->fd->inode); @@ -1566,7 +1566,7 @@ mdc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ESTALE) || (op_errno == ENOENT)) { mdc_inode_iatt_invalidate(this, local->loc.parent); } @@ -1618,7 +1618,7 @@ mdc_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ESTALE) || (op_errno == ENOENT)) { mdc_inode_iatt_invalidate(this, local->loc.parent); } @@ -1669,7 +1669,7 @@ mdc_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { /* if errno is ESTALE, parent is not present, which implies even * child is not present. Also, man 2 unlink states unlink can * return ENOENT if a component in pathname does not @@ -1728,7 +1728,7 @@ mdc_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { /* if errno is ESTALE, parent is not present, which implies even * child is not present. Also, man 2 rmdir states rmdir can * return ENOENT if a directory component in pathname does not @@ -1784,7 +1784,7 @@ mdc_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ESTALE) || (op_errno == ENOENT)) { mdc_inode_iatt_invalidate(this, local->loc.parent); } @@ -1845,7 +1845,7 @@ mdc_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ESTALE) || (op_errno == ENOENT)) { mdc_inode_iatt_invalidate(this, local->loc.inode); mdc_inode_iatt_invalidate(this, local->loc2.parent); @@ -1907,7 +1907,7 @@ mdc_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) { mdc_inode_iatt_invalidate(this, local->loc.inode); mdc_inode_iatt_invalidate(this, local->loc2.parent); @@ -1960,7 +1960,7 @@ mdc_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ESTALE) || (op_errno == ENOENT)) { mdc_inode_iatt_invalidate(this, local->loc.parent); } @@ -2011,7 +2011,7 @@ mdc_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ESTALE) || (op_errno == ENOENT)) mdc_inode_iatt_invalidate(this, local->loc.inode); goto out; @@ -2061,7 +2061,7 @@ mdc_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->fd->inode); goto out; @@ -2103,7 +2103,7 @@ mdc_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->fd->inode); goto out; @@ -2147,7 +2147,7 @@ mdc_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { mdc_inode_iatt_set(this, local->loc.inode, NULL, local->incident_time); goto out; } @@ -2222,7 +2222,7 @@ mdc_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ESTALE) || (op_errno == ENOENT)) mdc_inode_iatt_invalidate(this, local->fd->inode); goto out; @@ -2298,7 +2298,7 @@ mdc_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->fd->inode); goto out; @@ -2346,7 +2346,7 @@ mdc_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->loc.inode); goto out; @@ -2405,7 +2405,7 @@ mdc_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ESTALE) || (op_errno == ENOENT)) mdc_inode_iatt_invalidate(this, local->fd->inode); goto out; @@ -2458,7 +2458,7 @@ mdc_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->loc.inode); goto out; @@ -2485,6 +2485,7 @@ mdc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, dict_t *xdata) { int ret; + gf_return_t op_ret; int op_errno = ENODATA; mdc_local_t *local = NULL; dict_t *xattr = NULL; @@ -2513,7 +2514,8 @@ mdc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, } GF_ATOMIC_INC(conf->mdc_counter.xattr_hit); - MDC_STACK_UNWIND(getxattr, frame, ret, op_errno, xattr, xdata); + SET_RET(op_ret, ret); + MDC_STACK_UNWIND(getxattr, frame, op_ret, op_errno, xattr, xdata); if (xattr) dict_unref(xattr); @@ -2547,7 +2549,7 @@ mdc_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->fd->inode); goto out; @@ -2574,6 +2576,7 @@ mdc_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *key, dict_t *xdata) { int ret; + gf_return_t op_ret; mdc_local_t *local = NULL; dict_t *xattr = NULL; int op_errno = ENODATA; @@ -2601,7 +2604,8 @@ mdc_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *key, } GF_ATOMIC_INC(conf->mdc_counter.xattr_hit); - MDC_STACK_UNWIND(fgetxattr, frame, ret, op_errno, xattr, xdata); + SET_RET(op_ret, ret); + MDC_STACK_UNWIND(fgetxattr, frame, op_ret, op_errno, xattr, xdata); if (xattr) dict_unref(xattr); @@ -2641,7 +2645,7 @@ mdc_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->loc.inode); goto out; @@ -2705,7 +2709,7 @@ mdc_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, ret = -1; op_errno = ENODATA; - MDC_STACK_UNWIND(removexattr, frame, ret, op_errno, xdata); + MDC_STACK_UNWIND(removexattr, frame, gf_failure, op_errno, xdata); } else { STACK_WIND(frame, mdc_removexattr_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->removexattr, loc, name, xdata); @@ -2740,7 +2744,7 @@ mdc_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->fd->inode); goto out; @@ -2805,7 +2809,7 @@ mdc_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, ret = -1; op_errno = ENODATA; - MDC_STACK_UNWIND(fremovexattr, frame, ret, op_errno, xdata); + MDC_STACK_UNWIND(fremovexattr, frame, gf_failure, op_errno, xdata); } else { STACK_WIND(frame, mdc_fremovexattr_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fremovexattr, fd, name, xdata); @@ -2833,7 +2837,7 @@ mdc_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) goto out; if ((op_errno == ESTALE) || (op_errno == ENOENT)) @@ -2881,8 +2885,8 @@ mdc_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto unwind; - if (op_ret <= 0) { - if ((op_ret == -1) && ((op_errno == ENOENT) || (op_errno == ESTALE))) + if (GET_RET(op_ret) <= 0) { + if (IS_ERROR(op_ret) && ((op_errno == ENOENT) || (op_errno == ESTALE))) mdc_inode_iatt_invalidate(this, local->fd->inode); goto unwind; } @@ -2941,7 +2945,7 @@ mdc_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) goto out; if ((op_errno == ESTALE) || (op_errno == ENOENT)) @@ -2996,7 +3000,7 @@ mdc_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->fd->inode); goto out; @@ -3041,7 +3045,7 @@ mdc_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->fd->inode); goto out; @@ -3084,7 +3088,7 @@ mdc_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { if ((op_errno == ENOENT) || (op_errno == ESTALE)) mdc_inode_iatt_invalidate(this, local->fd->inode); goto out; @@ -3127,7 +3131,7 @@ mdc_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) goto out; if ((op_errno == ENOENT) || (op_errno == ESTALE)) @@ -3169,7 +3173,7 @@ mdc_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) goto out; if ((op_errno == ESTALE) || (op_errno == ENOENT)) @@ -3211,7 +3215,7 @@ mdc_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - if (op_ret == 0) + if (IS_SUCCESS(op_ret)) goto out; if ((op_errno == ESTALE) || (op_errno == ENOENT)) diff --git a/xlators/performance/nl-cache/src/nl-cache.c b/xlators/performance/nl-cache/src/nl-cache.c index e6cc72677d..33eb15cb3a 100644 --- a/xlators/performance/nl-cache/src/nl-cache.c +++ b/xlators/performance/nl-cache/src/nl-cache.c @@ -87,12 +87,12 @@ nlc_dentry_op(call_frame_t *frame, xlator_t *this, gf_boolean_t multilink) do { \ nlc_conf_t *conf = NULL; \ \ - if (op_ret != 0) \ + if (IS_ERROR(op_ret)) \ goto out; \ \ conf = this->private; \ \ - if (op_ret < 0 || !IS_PEC_ENABLED(conf)) \ + if (IS_ERROR(op_ret) || !IS_PEC_ENABLED(conf)) \ goto out; \ nlc_dentry_op(frame, this, multilink); \ out: \ @@ -197,7 +197,7 @@ nlc_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* Donot add to pe, this may lead to duplicate entry and * requires search before adding if list of strings */ - if (op_ret < 0 && op_errno == ENOENT) { + if (IS_ERROR(op_ret) && op_errno == ENOENT) { nlc_dir_add_ne(this, local->loc.parent, local->loc.name); GF_ATOMIC_INC(conf->nlc_counter.nlc_miss); } @@ -282,7 +282,7 @@ nlc_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!IS_PEC_ENABLED(conf)) goto out; - if (op_ret < 0 && op_errno == ENOENT) { + if (IS_ERROR(op_ret) && op_errno == ENOENT) { GF_ATOMIC_INC(conf->nlc_counter.getrealfilename_miss); } @@ -295,7 +295,8 @@ static int32_t nlc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t fin_ret; + int op_ret = -1; int32_t op_errno = 0; dict_t *dict = NULL; nlc_local_t *local = NULL; @@ -339,7 +340,8 @@ nlc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, return 0; unwind: GF_ATOMIC_INC(conf->nlc_counter.getrealfilename_hit); - NLC_STACK_UNWIND(getxattr, frame, op_ret, op_errno, dict, NULL); + SET_RET(fin_ret, op_ret); + NLC_STACK_UNWIND(getxattr, frame, fin_ret, op_errno, dict, NULL); dict_unref(dict); return 0; err: diff --git a/xlators/performance/open-behind/src/open-behind.c b/xlators/performance/open-behind/src/open-behind.c index 472998ee23..cc2a3bd241 100644 --- a/xlators/performance/open-behind/src/open-behind.c +++ b/xlators/performance/open-behind/src/open-behind.c @@ -151,7 +151,7 @@ typedef struct ob_inode { _xl, _fd, 0, true, false, &__ob_inode, &__first_fd); \ switch (__ob_state) { \ case OB_STATE_OPEN_PENDING: \ - default_flush_cbk(_frame, NULL, _xl, 0, 0, NULL); \ + default_flush_cbk(_frame, NULL, _xl, gf_zero_ret, 0, NULL); \ break; \ OB_POST_COMMON(flush, _xl, _frame, __first_fd, ##_args); \ } \ @@ -394,7 +394,7 @@ ob_open_completed(xlator_t *xl, ob_inode_t *ob_inode, fd_t *fd, INIT_LIST_HEAD(&list); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { fd_ctx_set(fd, xl, op_errno <= 0 ? EIO : op_errno); } @@ -486,7 +486,7 @@ ob_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, fd_t *fd, * probably this doesn't make sense since it won't contain * any requested data. I think it would be better to pass * NULL for xdata. */ - default_open_cbk(frame, NULL, this, 0, 0, fd, xdata); + default_open_cbk(frame, NULL, this, gf_zero_ret, 0, fd, xdata); return ob_open_dispatch(this, ob_inode, first_fd, stub); } @@ -496,7 +496,7 @@ ob_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, fd_t *fd, /* In case of error, simulate a regular completion but with an error * code. */ - ob_open_completed(this, ob_inode, first_fd, -1, ENOMEM); + ob_open_completed(this, ob_inode, first_fd, gf_failure, ENOMEM); state = -ENOMEM; } diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 13b239ccce..72f4279718 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -577,7 +577,7 @@ qr_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; inode = local->inode; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { qr_inode_prune(this, inode, local->incident_gen); goto out; } @@ -674,7 +674,7 @@ qr_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret <= 0) + if (IS_ERROR(op_ret)) goto unwind; list_for_each_entry(entry, &entries->list, list) @@ -716,7 +716,8 @@ qr_readv_cached(call_frame_t *frame, qr_inode_t *qr_inode, size_t size, xlator_t *this = NULL; qr_private_t *priv = NULL; qr_inode_table_t *table = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = {-1}; + int ret = -1; struct iobuf *iobuf = NULL; struct iobref *iobref = NULL; struct iovec iov = { @@ -741,23 +742,23 @@ qr_readv_cached(call_frame_t *frame, qr_inode_t *qr_inode, size_t size, if (!__qr_cache_is_fresh(this, qr_inode)) goto unlock; - op_ret = min(size, (qr_inode->size - offset)); + ret = min(size, (qr_inode->size - offset)); - iobuf = iobuf_get2(this->ctx->iobuf_pool, op_ret); + iobuf = iobuf_get2(this->ctx->iobuf_pool, ret); if (!iobuf) { - op_ret = -1; + op_ret = gf_failure; goto unlock; } iobref = iobref_new(); if (!iobref) { - op_ret = -1; + op_ret = gf_failure; goto unlock; } iobref_add(iobref, iobuf); - memcpy(iobuf->ptr, qr_inode->data + offset, op_ret); + memcpy(iobuf->ptr, qr_inode->data + offset, ret); buf = qr_inode->buf; @@ -767,9 +768,10 @@ qr_readv_cached(call_frame_t *frame, qr_inode_t *qr_inode, size_t size, unlock: UNLOCK(&table->lock); - if (op_ret >= 0) { + SET_RET(op_ret, ret); + if (IS_SUCCESS(op_ret)) { iov.iov_base = iobuf->ptr; - iov.iov_len = op_ret; + iov.iov_len = ret; GF_ATOMIC_INC(priv->qr_counter.cache_hit); STACK_UNWIND_STRICT(readv, frame, op_ret, 0, &iov, 1, &buf, iobref, @@ -784,7 +786,7 @@ qr_readv_cached(call_frame_t *frame, qr_inode_t *qr_inode, size_t size, if (iobref) iobref_unref(iobref); - return op_ret; + return ret; } int diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.c b/xlators/performance/readdir-ahead/src/readdir-ahead.c index 7acfef8079..5f9832509f 100644 --- a/xlators/performance/readdir-ahead/src/readdir-ahead.c +++ b/xlators/performance/readdir-ahead/src/readdir-ahead.c @@ -383,6 +383,7 @@ rda_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, gf_dirent_t entries; int ret = 0; int op_errno = 0; + gf_return_t op_ret; gf_boolean_t serve = _gf_false; ctx = get_rda_fd_ctx(fd, this); @@ -459,7 +460,8 @@ rda_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, UNLOCK(&ctx->lock); if (serve) { - STACK_UNWIND_STRICT(readdirp, frame, ret, op_errno, &entries, xdata); + SET_RET(op_ret, ret); + STACK_UNWIND_STRICT(readdirp, frame, op_ret, op_errno, &entries, xdata); gf_dirent_free(&entries); } @@ -564,12 +566,12 @@ rda_fill_fd_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (ctx->cur_size >= priv->rda_high_wmark) ctx->state &= ~RDA_FD_PLUGGED; - if (!op_ret || op_errno == ENOENT) { + if (IS_SUCCESS(op_ret) || op_errno == ENOENT) { /* we've hit eod */ ctx->state &= ~RDA_FD_RUNNING; ctx->state |= RDA_FD_EOD; ctx->op_errno = op_errno; - } else if (op_ret == -1) { + } else if (IS_ERROR(op_ret)) { /* kill the preload and pend the error */ ctx->state &= ~RDA_FD_RUNNING; ctx->state |= RDA_FD_ERROR; @@ -624,7 +626,8 @@ rda_fill_fd_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } if (serve) { - STACK_UNWIND_STRICT(readdirp, stub->frame, ret, op_errno, + SET_RET(op_ret, ret); + STACK_UNWIND_STRICT(readdirp, stub->frame, op_ret, op_errno, &serve_entries, xdata); gf_dirent_free(&serve_entries); call_stub_destroy(stub); @@ -716,7 +719,7 @@ static int32_t rda_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) { - if (!op_ret) + if (IS_SUCCESS(op_ret)) rda_fill_fd(frame, this, fd); RDA_STACK_UNWIND(opendir, frame, op_ret, op_errno, fd, xdata); @@ -764,7 +767,7 @@ rda_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -800,7 +803,7 @@ rda_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -833,7 +836,7 @@ rda_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -866,7 +869,7 @@ rda_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -899,7 +902,7 @@ rda_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -932,7 +935,7 @@ rda_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -961,7 +964,7 @@ rda_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { struct rda_local *local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -988,7 +991,7 @@ rda_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { struct rda_local *local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -1019,7 +1022,7 @@ rda_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -1052,7 +1055,7 @@ rda_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -1081,7 +1084,7 @@ rda_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { struct rda_local *local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -1108,7 +1111,7 @@ rda_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { struct rda_local *local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; From cf2e132f84fb5b4f8593ff21bdb60e8c8183709b Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sat, 19 Sep 2020 00:17:17 +0530 Subject: [PATCH 19/24] debug/*: compile fixes Change-Id: I329c666c14222968babf04f5ad774f907098c0b0 Signed-off-by: Amar Tumballi --- xlators/debug/io-stats/src/io-stats.c | 12 +- xlators/debug/sink/src/sink.c | 2 +- xlators/debug/trace/src/trace.c | 172 +++++++++++++------------- 3 files changed, 93 insertions(+), 93 deletions(-) diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index dd7b662d98..afa04baee1 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -293,7 +293,7 @@ is_fop_latency_started(call_frame_t *frame) end = &frame->end; \ \ elapsed = gf_tsdiff(begin, end) / 1000.0; \ - throughput = op_ret / elapsed; \ + throughput = GET_RET(op_ret) / elapsed; \ \ conf = this->private; \ gettimeofday(&tv, NULL); \ @@ -1929,7 +1929,7 @@ io_stats_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!path) goto unwind; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { GF_FREE(path); goto unwind; } @@ -1982,7 +1982,7 @@ io_stats_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!path) goto unwind; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { GF_FREE(path); goto unwind; } @@ -2052,7 +2052,7 @@ io_stats_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, fd = frame->local; frame->local = NULL; - if (op_ret > 0) { + if (IS_SUCCESS(op_ret)) { len = iov_length(vector, count); ios_bump_read(this, fd, len); } @@ -2245,7 +2245,7 @@ io_stats_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto unwind; UPDATE_PROFILE_STATS(frame, MKDIR); - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; /* allocate a struct ios_stat and set the inode ctx */ @@ -2290,7 +2290,7 @@ io_stats_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int ret = -1; UPDATE_PROFILE_STATS(frame, OPENDIR); - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; ios_fd_ctx_set(fd, this, 0); diff --git a/xlators/debug/sink/src/sink.c b/xlators/debug/sink/src/sink.c index 9822bbb732..8bea42081c 100644 --- a/xlators/debug/sink/src/sink.c +++ b/xlators/debug/sink/src/sink.c @@ -65,7 +65,7 @@ sink_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) /* the root of the volume always need to be a directory */ stbuf.ia_type = IA_IFDIR; - STACK_UNWIND_STRICT(lookup, frame, 0, 0, loc ? loc->inode : NULL, &stbuf, + STACK_UNWIND_STRICT(lookup, frame, gf_zero_ret, 0, loc ? loc->inode : NULL, &stbuf, xdata, &postparent); return 0; diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c index b1b06ec54d..5e787cf2a9 100644 --- a/xlators/debug/trace/src/trace.c +++ b/xlators/debug/trace/src/trace.c @@ -105,7 +105,7 @@ trace_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(buf, statstr); TRACE_STAT_TO_STR(preparent, preparentstr); TRACE_STAT_TO_STR(postparent, postparentstr); @@ -115,7 +115,7 @@ trace_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ": gfid=%s (op_ret=%d, fd=%p" "*stbuf {%s}, *preparent {%s}, " "*postparent = {%s})", - frame->root->unique, uuid_utoa(inode->gfid), op_ret, fd, + frame->root->unique, uuid_utoa(inode->gfid), GET_RET(op_ret), fd, statstr, preparentstr, postparentstr); /* for 'release' log */ @@ -123,7 +123,7 @@ trace_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } else { snprintf(string, sizeof(string), "%" PRId64 ": (op_ret=%d, op_errno=%d)", - frame->root->unique, op_ret, op_errno); + frame->root->unique, GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); } @@ -151,7 +151,7 @@ trace_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d, " "*fd=%p", - frame->root->unique, uuid_utoa(frame->local), op_ret, op_errno, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno, fd); LOG_ELEMENT(conf, string); @@ -159,7 +159,7 @@ trace_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, out: /* for 'release' log */ - if (op_ret >= 0) + if (IS_SUCCESS(op_ret)) fd_ctx_set(fd, this, 0); TRACE_STACK_UNWIND(open, frame, op_ret, op_errno, fd, xdata); @@ -184,17 +184,17 @@ trace_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(buf, statstr); (void)snprintf( string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d buf=%s", - frame->root->unique, uuid_utoa(frame->local), op_ret, statstr); + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), statstr); } else { (void)snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d)", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -223,17 +223,17 @@ trace_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(buf, statstr); snprintf( string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d buf=%s", - frame->root->unique, uuid_utoa(frame->local), op_ret, statstr); + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), statstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d)", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -265,7 +265,7 @@ trace_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(prebuf, preopstr); TRACE_STAT_TO_STR(postbuf, postopstr); @@ -273,13 +273,13 @@ trace_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": (op_ret=%d, " "*prebuf = {%s}, *postbuf = {%s})", - frame->root->unique, op_ret, preopstr, postopstr); + frame->root->unique, GET_RET(op_ret), preopstr, postopstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -306,7 +306,7 @@ trace_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 " : gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -339,12 +339,12 @@ trace_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (trace_fop_names[GF_FOP_READDIRP].enabled) { snprintf(string, sizeof(string), "%" PRId64 " : gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); } - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; list_for_each_entry(entry, &buf->list, list) @@ -384,7 +384,7 @@ trace_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(prebuf, preopstr); TRACE_STAT_TO_STR(postbuf, postopstr); @@ -392,13 +392,13 @@ trace_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": (op_ret=%d, " "*prebuf = {%s}, *postbuf = {%s}", - frame->root->unique, op_ret, preopstr, postopstr); + frame->root->unique, GET_RET(op_ret), preopstr, postopstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -430,7 +430,7 @@ trace_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(statpre, preopstr); TRACE_STAT_TO_STR(statpost, postopstr); @@ -438,13 +438,13 @@ trace_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": (op_ret=%d, " "*prebuf = {%s}, *postbuf = {%s})", - frame->root->unique, op_ret, preopstr, postopstr); + frame->root->unique, GET_RET(op_ret), preopstr, postopstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d)", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -476,7 +476,7 @@ trace_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(statpre, preopstr); TRACE_STAT_TO_STR(statpost, postopstr); @@ -484,11 +484,11 @@ trace_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": (op_ret=%d, " "*prebuf = {%s}, *postbuf = {%s})", - frame->root->unique, op_ret, preopstr, postopstr); + frame->root->unique, GET_RET(op_ret), preopstr, postopstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d)", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -520,7 +520,7 @@ trace_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(preparent, preparentstr); TRACE_STAT_TO_STR(postparent, postparentstr); @@ -529,14 +529,14 @@ trace_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ": gfid=%s op_ret=%d, " " *preparent = {%s}, " "*postparent = {%s})", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), preparentstr, postparentstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d)", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -579,7 +579,7 @@ trace_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[6044] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(buf, statstr); TRACE_STAT_TO_STR(preoldparent, preoldparentstr); TRACE_STAT_TO_STR(postoldparent, postoldparentstr); @@ -593,14 +593,14 @@ trace_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, " *postoldparent = {%s}" " *prenewparent = {%s}, " "*postnewparent = {%s})", - frame->root->unique, op_ret, statstr, preoldparentstr, + frame->root->unique, GET_RET(op_ret), statstr, preoldparentstr, postoldparentstr, prenewparentstr, postnewparentstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -629,19 +629,19 @@ trace_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(stbuf, statstr); snprintf(string, sizeof(string), "%" PRId64 ": (op_ret=%d, op_errno=%d," "buf=%s, stbuf = { %s })", - frame->root->unique, op_ret, op_errno, buf, statstr); + frame->root->unique, GET_RET(op_ret), op_errno, buf, statstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } @@ -673,7 +673,7 @@ trace_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(buf, statstr); TRACE_STAT_TO_STR(postparent, postparentstr); /* print buf->ia_gfid instead of inode->gfid, @@ -685,7 +685,7 @@ trace_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": gfid=%s (op_ret=%d " "*buf {%s}, *postparent {%s}", - frame->root->unique, uuid_utoa(buf->ia_gfid), op_ret, + frame->root->unique, uuid_utoa(buf->ia_gfid), GET_RET(op_ret), statstr, postparentstr); /* For 'forget' */ @@ -695,7 +695,7 @@ trace_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d)", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -731,7 +731,7 @@ trace_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(buf, statstr); TRACE_STAT_TO_STR(preparent, preparentstr); TRACE_STAT_TO_STR(postparent, postparentstr); @@ -741,12 +741,12 @@ trace_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ": gfid=%s (op_ret=%d " "*stbuf = {%s}, *preparent = {%s}, " "*postparent = {%s})", - frame->root->unique, uuid_utoa(inode->gfid), op_ret, + frame->root->unique, uuid_utoa(inode->gfid), GET_RET(op_ret), statstr, preparentstr, postparentstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": op_ret=%d, op_errno=%d", frame->root->unique, - op_ret, op_errno); + GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); } @@ -781,7 +781,7 @@ trace_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; if (trace_fop_names[GF_FOP_MKNOD].enabled) { - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(buf, statstr); TRACE_STAT_TO_STR(preparent, preparentstr); TRACE_STAT_TO_STR(postparent, postparentstr); @@ -791,12 +791,12 @@ trace_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ": gfid=%s (op_ret=%d " "*stbuf = {%s}, *preparent = {%s}, " "*postparent = {%s})", - frame->root->unique, uuid_utoa(inode->gfid), op_ret, + frame->root->unique, uuid_utoa(inode->gfid), GET_RET(op_ret), statstr, preparentstr, postparentstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": (op_ret=%d, op_errno=%d)", - frame->root->unique, op_ret, op_errno); + frame->root->unique, GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); } @@ -831,7 +831,7 @@ trace_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(buf, statstr); TRACE_STAT_TO_STR(preparent, preparentstr); TRACE_STAT_TO_STR(postparent, postparentstr); @@ -841,12 +841,12 @@ trace_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ": gfid=%s (op_ret=%d " ", *stbuf = {%s}, *prebuf = {%s}, " "*postbuf = {%s} )", - frame->root->unique, uuid_utoa(inode->gfid), op_ret, + frame->root->unique, uuid_utoa(inode->gfid), GET_RET(op_ret), statstr, preparentstr, postparentstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": (op_ret=%d, op_errno=%d)", - frame->root->unique, op_ret, op_errno); + frame->root->unique, GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); } @@ -881,7 +881,7 @@ trace_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; if (trace_fop_names[GF_FOP_LINK].enabled) { - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(buf, statstr); TRACE_STAT_TO_STR(preparent, preparentstr); TRACE_STAT_TO_STR(postparent, postparentstr); @@ -891,14 +891,14 @@ trace_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ": (op_ret=%d, " "*stbuf = {%s}, *prebuf = {%s}," " *postbuf = {%s})", - frame->root->unique, op_ret, statstr, preparentstr, + frame->root->unique, GET_RET(op_ret), statstr, preparentstr, postparentstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -925,7 +925,7 @@ trace_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (trace_fop_names[GF_FOP_FLUSH].enabled) { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -953,14 +953,14 @@ trace_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d," " fd=%p", - frame->root->unique, uuid_utoa(frame->local), op_ret, op_errno, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno, fd); LOG_ELEMENT(conf, string); } out: /* for 'releasedir' log */ - if (op_ret >= 0) + if (IS_SUCCESS(op_ret)) fd_ctx_set(fd, this, 0); TRACE_STACK_UNWIND(opendir, frame, op_ret, op_errno, fd, xdata); @@ -988,7 +988,7 @@ trace_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(preparent, preparentstr); TRACE_STAT_TO_STR(postparent, postparentstr); @@ -996,14 +996,14 @@ trace_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": gfid=%s op_ret=%d, " "*prebuf={%s}, *postbuf={%s}", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), preparentstr, postparentstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -1035,7 +1035,7 @@ trace_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(prebuf, preopstr); TRACE_STAT_TO_STR(postbuf, postopstr); @@ -1043,13 +1043,13 @@ trace_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": (op_ret=%d, " "*prebuf = {%s}, *postbuf = {%s} )", - frame->root->unique, op_ret, preopstr, postopstr); + frame->root->unique, GET_RET(op_ret), preopstr, postopstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -1075,7 +1075,7 @@ trace_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { snprintf(string, sizeof(string), "%" PRId64 ": ({f_bsize=%lu, " @@ -1095,13 +1095,13 @@ trace_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, frame->root->unique, buf->f_bsize, buf->f_frsize, buf->f_blocks, buf->f_bfree, buf->f_bavail, buf->f_files, buf->f_ffree, buf->f_favail, buf->f_fsid, buf->f_flag, - buf->f_namemax, op_ret); + buf->f_namemax, GET_RET(op_ret)); } else { snprintf(string, sizeof(string), "%" PRId64 ": (op_ret=%d, " "op_errno=%d)", - frame->root->unique, op_ret, op_errno); + frame->root->unique, GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); } @@ -1126,7 +1126,7 @@ trace_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1155,7 +1155,7 @@ trace_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d," " dict=%p", - frame->root->unique, uuid_utoa(frame->local), op_ret, op_errno, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno, dict); LOG_ELEMENT(conf, string); @@ -1182,7 +1182,7 @@ trace_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1211,7 +1211,7 @@ trace_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d," " dict=%p", - frame->root->unique, uuid_utoa(frame->local), op_ret, op_errno, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno, dict); LOG_ELEMENT(conf, string); @@ -1238,7 +1238,7 @@ trace_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1265,7 +1265,7 @@ trace_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1293,7 +1293,7 @@ trace_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d)", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1324,7 +1324,7 @@ trace_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(prebuf, prebufstr); TRACE_STAT_TO_STR(postbuf, postbufstr); @@ -1332,13 +1332,13 @@ trace_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": op_ret=%d, " "*prebuf = {%s}, *postbuf = {%s} )", - frame->root->unique, op_ret, prebufstr, postbufstr); + frame->root->unique, GET_RET(op_ret), prebufstr, postbufstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -1365,20 +1365,20 @@ trace_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; if (trace_fop_names[GF_FOP_FSTAT].enabled) { char string[4096] = {0.}; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { TRACE_STAT_TO_STR(buf, statstr); snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d " "buf=%s", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), statstr); } else { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } LOG_ELEMENT(conf, string); @@ -1403,7 +1403,7 @@ trace_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char string[4096] = { 0, }; - if (op_ret == 0) { + if (IS_SUCCESS(op_ret)) { snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, " @@ -1411,7 +1411,7 @@ trace_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "l_start=%" PRId64 ", " "l_len=%" PRId64 ", l_pid=%u})", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), lock->l_type, lock->l_whence, lock->l_start, lock->l_len, lock->l_pid); } else { @@ -1419,7 +1419,7 @@ trace_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": gfid=%s op_ret=%d, " "op_errno=%d)", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); } @@ -1446,7 +1446,7 @@ trace_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1472,7 +1472,7 @@ trace_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1499,7 +1499,7 @@ trace_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1526,7 +1526,7 @@ trace_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1552,7 +1552,7 @@ trace_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1578,7 +1578,7 @@ trace_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d, op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -1606,7 +1606,7 @@ trace_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, }; snprintf(string, sizeof(string), "%" PRId64 ": gfid=%s op_ret=%d op_errno=%d", - frame->root->unique, uuid_utoa(frame->local), op_ret, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno); LOG_ELEMENT(conf, string); @@ -2361,7 +2361,7 @@ trace_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "%" PRId64 ": gfid=%s op_ret=%d op_errno=%d, " "offset=%" PRId64 "", - frame->root->unique, uuid_utoa(frame->local), op_ret, op_errno, + frame->root->unique, uuid_utoa(frame->local), GET_RET(op_ret), op_errno, offset); LOG_ELEMENT(conf, string); } From 0bef6b7043175843f6972ac4fb43362a80a32ff0 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sat, 19 Sep 2020 19:04:06 +0530 Subject: [PATCH 20/24] features/locks: compiles Change-Id: Ib56bd92f675f708729d69b05beca05184068c9bf Signed-off-by: Amar Tumballi --- xlators/features/arbiter/src/arbiter.c | 28 +- .../bit-rot/src/stub/bit-rot-stub-helpers.c | 6 +- .../features/bit-rot/src/stub/bit-rot-stub.c | 108 ++++---- .../changelog/lib/src/gf-changelog-reborp.c | 4 +- .../features/changelog/src/changelog-rpc.c | 4 +- xlators/features/changelog/src/changelog.c | 38 +-- .../cloudsync/src/cloudsync-fops-c.py | 4 +- .../src/cloudsyncs3/src/libcloudsyncs3.c | 2 +- .../cloudsync-plugins/src/cvlt/src/libcvlt.c | 34 +-- xlators/features/cloudsync/src/cloudsync.c | 46 ++-- .../features/gfid-access/src/gfid-access.c | 4 +- xlators/features/index/src/index.c | 34 +-- xlators/features/leases/src/leases.c | 6 +- xlators/features/locks/src/common.c | 18 +- xlators/features/locks/src/common.h | 2 +- xlators/features/locks/src/entrylk.c | 18 +- xlators/features/locks/src/inodelk.c | 10 +- xlators/features/locks/src/posix.c | 251 +++++++++--------- xlators/features/locks/src/reservelk.c | 2 +- xlators/features/marker/src/marker.c | 86 +++--- .../features/metadisp/src/metadisp-create.c | 2 +- .../features/metadisp/src/metadisp-fsync.c | 2 +- .../features/metadisp/src/metadisp-lookup.c | 4 +- xlators/features/metadisp/src/metadisp-open.c | 2 +- .../features/metadisp/src/metadisp-setattr.c | 4 +- xlators/features/metadisp/src/metadisp-stat.c | 2 +- .../features/metadisp/src/metadisp-unlink.c | 8 +- xlators/features/quiesce/src/quiesce.c | 58 ++-- .../quota/src/quota-enforcer-client.c | 14 +- xlators/features/quota/src/quota.c | 128 ++++----- .../features/quota/src/quotad-aggregator.c | 6 +- xlators/features/quota/src/quotad.c | 2 +- xlators/features/read-only/src/worm.c | 2 +- xlators/features/sdfs/src/sdfs.c | 26 +- xlators/features/selinux/src/selinux.c | 8 +- xlators/features/shard/src/shard.c | 198 +++++++------- xlators/features/shard/src/shard.h | 2 +- .../snapview-client/src/snapview-client.c | 140 +++++----- .../snapview-client/src/snapview-client.h | 6 +- .../src/snapview-server-mgmt.c | 2 +- .../snapview-server/src/snapview-server.c | 222 ++++++++-------- .../features/thin-arbiter/src/thin-arbiter.h | 2 +- xlators/features/trash/src/trash.c | 44 +-- xlators/features/upcall/src/upcall.c | 66 ++--- 44 files changed, 829 insertions(+), 826 deletions(-) diff --git a/xlators/features/arbiter/src/arbiter.c b/xlators/features/arbiter/src/arbiter.c index 65c7f1a7c3..344b39687c 100644 --- a/xlators/features/arbiter/src/arbiter.c +++ b/xlators/features/arbiter/src/arbiter.c @@ -64,11 +64,11 @@ arbiter_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { arbiter_inode_ctx_t *ctx = NULL; - if (op_ret != 0) + if (IS_ERROR(op_ret)) goto unwind; ctx = arbiter_inode_ctx_get(inode, this); if (!ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -94,12 +94,12 @@ arbiter_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, { arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int32_t op_errno = 0; ctx = arbiter_inode_ctx_get(loc->inode, this); if (!ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -116,12 +116,12 @@ arbiter_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, { arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int32_t op_errno = 0; ctx = arbiter_inode_ctx_get(fd->inode, this); if (!ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -178,12 +178,12 @@ arbiter_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; dict_t *rsp_xdata = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int op_errno = 0; ctx = arbiter_inode_ctx_get(fd->inode, this); if (!ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -203,12 +203,12 @@ arbiter_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, { arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int op_errno = 0; ctx = arbiter_inode_ctx_get(fd->inode, this); if (!ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -224,12 +224,12 @@ arbiter_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, { arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int op_errno = 0; ctx = arbiter_inode_ctx_get(fd->inode, this); if (!ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -245,12 +245,12 @@ arbiter_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, { arbiter_inode_ctx_t *ctx = NULL; struct iatt *buf = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int op_errno = 0; ctx = arbiter_inode_ctx_get(fd->inode, this); if (!ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c b/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c index 8a22a2521c..3af4baddea 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub-helpers.c @@ -352,7 +352,7 @@ br_stub_lookup_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, struct stat lstatbuf = {0}; int ret = 0; int32_t op_errno = EINVAL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; struct iatt stbuf = { 0, }; @@ -391,7 +391,7 @@ br_stub_lookup_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, op_ret = op_errno = 0; xattr = dict_new(); if (!xattr) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } @@ -561,7 +561,7 @@ br_stub_readdir_wrapper(call_frame_t *frame, xlator_t *this, fd_t *fd, br_stub_fd_t *fctx = NULL; DIR *dir = NULL; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = 0; int count = 0; gf_dirent_t entries; diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c index 9e33073935..16c4e0714a 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c @@ -707,7 +707,7 @@ br_stub_check_bad_object(xlator_t *this, inode_t *inode, int32_t *op_ret, if (ret == -2) { gf_smsg(this->name, GF_LOG_ERROR, 0, BRS_MSG_BAD_OBJECT_ACCESS, "gfid=%s", uuid_utoa(inode->gfid), NULL); - *op_ret = -1; + *op_ret = gf_failure; *op_errno = EIO; } @@ -718,7 +718,7 @@ br_stub_check_bad_object(xlator_t *this, inode_t *inode, int32_t *op_ret, gf_smsg(this->name, GF_LOG_ERROR, 0, BRS_MSG_GET_INODE_CONTEXT_FAILED, "gfid=%s", uuid_utoa(inode->gfid), NULL); - *op_ret = -1; + *op_ret = gf_failure; *op_errno = EINVAL; } } @@ -739,18 +739,18 @@ br_stub_fd_incversioning_cbk(call_frame_t *frame, void *cookie, xlator_t *this, br_stub_local_t *local = NULL; local = (br_stub_local_t *)frame->local; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto done; fd = local->u.context.fd; inode = local->u.context.inode; version = local->u.context.version; op_ret = br_stub_mod_inode_versions(this, fd, inode, version); - if (op_ret < 0) + if (IS_ERROR(op_ret)) op_errno = EINVAL; done: - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { frame->local = NULL; call_unwind_error(local->fopstub, gf_failure, op_errno); br_stub_cleanup_local(local); @@ -1058,7 +1058,7 @@ br_stub_handle_object_signature(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { int32_t ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; int fakesuccess = 0; br_stub_private_t *priv = NULL; @@ -1139,7 +1139,7 @@ br_stub_fsetxattr_resume(call_frame_t *frame, void *cookie, xlator_t *this, ret = br_stub_mark_inode_modified(this, local); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; } @@ -1190,7 +1190,7 @@ br_stub_handle_object_reopen(call_frame_t *frame, xlator_t *this, fd_t *fd, uint32_t val) { int32_t ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; call_stub_t *stub = NULL; gf_boolean_t inc_version = _gf_false; @@ -1262,7 +1262,7 @@ br_stub_fsetxattr_bad_object_cbk(call_frame_t *frame, void *cookie, local = frame->local; frame->local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; /* @@ -1299,7 +1299,7 @@ br_stub_handle_bad_object_key(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int flags, dict_t *xdata) { br_stub_local_t *local = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; if (frame->root->pid != GF_CLIENT_PID_SCRUB) { @@ -1312,7 +1312,7 @@ br_stub_handle_bad_object_key(call_frame_t *frame, xlator_t *this, fd_t *fd, if (!local) { gf_smsg(this->name, GF_LOG_ERROR, 0, BRS_MSG_ALLOC_MEM_FAILED, "fsetxattr gfid=%s", uuid_utoa(fd->inode->gfid), NULL); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -1347,7 +1347,7 @@ static int32_t br_stub_handle_internal_xattr(call_frame_t *frame, xlator_t *this, fd_t *fd, char *key) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, 0, BRS_MSG_SET_INTERNAL_XATTR, @@ -1387,7 +1387,7 @@ br_stub_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, uint32_t val = 0; br_isignature_t *sign = NULL; br_stub_private_t *priv = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; priv = this->private; @@ -1470,7 +1470,7 @@ int br_stub_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int flags, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; if (br_stub_internal_xattr(dict)) { @@ -1496,7 +1496,7 @@ int32_t br_stub_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; if (!strcmp(BITROT_OBJECT_BAD_KEY, name) || @@ -1519,7 +1519,7 @@ int32_t br_stub_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; if (!strcmp(BITROT_OBJECT_BAD_KEY, name) || @@ -1550,7 +1550,7 @@ br_stub_listxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int op_errno, dict_t *xattr, dict_t *xdata) { - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; br_stub_remove_vxattrs(xattr, _gf_true); @@ -1655,7 +1655,7 @@ br_stub_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, BR_STUB_VER_ENABLED_IN_CALLPATH(frame, ver_enabled); priv = this->private; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; BR_STUB_VER_COND_GOTO(priv, (!ver_enabled), delkeys); @@ -1665,13 +1665,13 @@ br_stub_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto unwind; } inode = local->u.context.inode; - op_ret = -1; + op_ret = gf_failure; status = br_version_xattr_state(xattr, &obuf, &sbuf, &bad_object); op_errno = EIO; @@ -1743,7 +1743,7 @@ br_stub_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, static void br_stub_send_stub_init_time(call_frame_t *frame, xlator_t *this) { - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int op_errno = 0; dict_t *xattr = NULL; br_stub_init_t stub = { @@ -1757,7 +1757,7 @@ br_stub_send_stub_init_time(call_frame_t *frame, xlator_t *this) xattr = dict_new(); if (!xattr) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -1768,7 +1768,7 @@ br_stub_send_stub_init_time(call_frame_t *frame, xlator_t *this) op_ret = dict_set_static_bin(xattr, GLUSTERFS_GET_BR_STUB_INIT_TIME, (void *)&stub, sizeof(br_stub_init_t)); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { op_errno = EINVAL; goto unwind; } @@ -1789,7 +1789,7 @@ br_stub_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, void *cookie = NULL; static uuid_t rootgfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; fop_getxattr_cbk_t cbk = br_stub_getxattr_cbk; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; br_stub_local_t *local = NULL; br_stub_private_t *priv = NULL; @@ -1843,7 +1843,7 @@ br_stub_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, local = br_stub_alloc_local(this); if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -1870,7 +1870,7 @@ br_stub_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, void *cookie = NULL; static uuid_t rootgfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; fop_fgetxattr_cbk_t cbk = br_stub_getxattr_cbk; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; br_stub_local_t *local = NULL; br_stub_private_t *priv = NULL; @@ -1919,7 +1919,7 @@ br_stub_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, local = br_stub_alloc_local(this); if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -1943,7 +1943,7 @@ int32_t br_stub_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; int32_t ret = -1; br_stub_private_t *priv = NULL; @@ -1991,12 +1991,12 @@ br_stub_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; ret = br_stub_mark_inode_modified(this, local); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; } @@ -2037,7 +2037,7 @@ br_stub_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, uint32_t flags, struct iobref *iobref, dict_t *xdata) { call_stub_t *stub = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; gf_boolean_t inc_version = _gf_false; gf_boolean_t modified = _gf_false; @@ -2129,12 +2129,12 @@ br_stub_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; ret = br_stub_mark_inode_modified(this, local); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; } @@ -2164,7 +2164,7 @@ br_stub_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, { br_stub_local_t *local = NULL; call_stub_t *stub = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; gf_boolean_t inc_version = _gf_false; gf_boolean_t modified = _gf_false; @@ -2242,12 +2242,12 @@ br_stub_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; ret = br_stub_mark_inode_modified(this, local); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; } @@ -2291,7 +2291,7 @@ br_stub_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, { br_stub_local_t *local = NULL; call_stub_t *stub = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; gf_boolean_t inc_version = _gf_false; gf_boolean_t modified = _gf_false; @@ -2397,7 +2397,7 @@ br_stub_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int32_t ret = -1; br_stub_inode_ctx_t *ctx = NULL; uint64_t ctx_addr = 0; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; br_stub_private_t *priv = NULL; unsigned long version = BITROT_DEFAULT_CURRENT_VERSION; @@ -2502,7 +2502,7 @@ br_stub_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; if (!priv->do_versioning) @@ -2513,7 +2513,7 @@ br_stub_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = br_stub_init_inode_versions(this, fd, inode, version, _gf_true, _gf_false, &ctx_addr); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; } } else { @@ -2559,7 +2559,7 @@ br_stub_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; if (!priv->do_versioning) @@ -2571,7 +2571,7 @@ br_stub_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, * Like lookup, if init_inode_versions fail, return EINVAL */ if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; } @@ -2667,7 +2667,7 @@ br_stub_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, { br_stub_private_t *priv = NULL; br_stub_fd_t *fd_ctx = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; priv = this->private; @@ -2747,7 +2747,7 @@ br_stub_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; BR_STUB_VER_COND_GOTO(priv, (!ver_enabled), unwind); - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; list_for_each_entry(entry, &entries->list, list) @@ -2800,7 +2800,7 @@ br_stub_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; } @@ -2930,7 +2930,7 @@ br_stub_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, BR_STUB_VER_ENABLED_IN_CALLPATH(frame, ver_enabled); priv = this->private; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { (void)br_stub_handle_lookup_error(this, inode, op_errno); /* @@ -2959,7 +2959,7 @@ br_stub_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (cookie != (void *)BR_STUB_REQUEST_COOKIE) { ret = br_stub_mark_xdata_bad_object(this, inode, xattr); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = EIO; /* * This flag ensures that in the label @delkey below, @@ -2974,7 +2974,7 @@ br_stub_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = br_stub_lookup_version(this, stbuf->ia_gfid, inode, xattr); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto delkey; } @@ -2989,7 +2989,7 @@ br_stub_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, * aaha! bad object, but sorry we would not * satisfy the request on allocation failures. */ - op_ret = -1; + op_ret = gf_failure; op_errno = EIO; goto delkey; } @@ -3094,7 +3094,7 @@ int br_stub_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { int32_t ret = 0; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; br_stub_private_t *priv = NULL; @@ -3125,7 +3125,7 @@ int br_stub_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { int32_t ret = 0; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; br_stub_private_t *priv = NULL; @@ -3177,7 +3177,7 @@ br_stub_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; if (!local) { @@ -3232,7 +3232,7 @@ br_stub_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, dict_t *xdata) { br_stub_local_t *local = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = 0; br_stub_private_t *priv = NULL; @@ -3241,7 +3241,7 @@ br_stub_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, local = br_stub_alloc_local(this); if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_smsg(this->name, GF_LOG_ERROR, ENOMEM, BRS_MSG_ALLOC_MEM_FAILED, "local path=%s", loc->path, "gfid=%s", diff --git a/xlators/features/changelog/lib/src/gf-changelog-reborp.c b/xlators/features/changelog/lib/src/gf-changelog-reborp.c index 56b11cbb70..8dd92e836d 100644 --- a/xlators/features/changelog/lib/src/gf-changelog-reborp.c +++ b/xlators/features/changelog/lib/src/gf-changelog-reborp.c @@ -358,13 +358,13 @@ gf_changelog_event_handler(rpcsvc_request_t *req, xlator_t *this, entry->queueevent(ev, event); /* ack sequence number */ - rpc_rsp.op_ret = 0; + rpc_rsp.op_ret = gf_zero_ret; rpc_rsp.seq = rpc_req.seq; goto submit_rpc; handle_xdr_error: - rpc_rsp.op_ret = -1; + rpc_rsp.op_ret = gf_failure; rpc_rsp.seq = 0; /* invalid */ submit_rpc: return changelog_rpc_sumbit_reply(req, &rpc_rsp, NULL, 0, NULL, diff --git a/xlators/features/changelog/src/changelog-rpc.c b/xlators/features/changelog/src/changelog-rpc.c index 440b88091a..f071e82f55 100644 --- a/xlators/features/changelog/src/changelog-rpc.c +++ b/xlators/features/changelog/src/changelog-rpc.c @@ -403,12 +403,12 @@ changelog_handle_probe(rpcsvc_request_t *req) goto handle_xdr_error; changelog_ev_queue_connection(c_clnt, crpc); - rpc_rsp.op_ret = 0; + rpc_rsp.op_ret = gf_zero_ret; goto submit_rpc; handle_xdr_error: - rpc_rsp.op_ret = -1; + rpc_rsp.op_ret = gf_failure; submit_rpc: (void)changelog_rpc_sumbit_reply(req, &rpc_rsp, NULL, 0, NULL, (xdrproc_t)xdr_changelog_probe_rsp); diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c index 1f24daa3d8..7ee4b480ee 100644 --- a/xlators/features/changelog/src/changelog.c +++ b/xlators/features/changelog/src/changelog.c @@ -62,7 +62,7 @@ changelog_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_ENTRY); @@ -184,7 +184,7 @@ changelog_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_ENTRY); @@ -333,7 +333,7 @@ changelog_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_ENTRY); unwind: changelog_dec_fop_cnt(this, priv, local); @@ -451,7 +451,7 @@ changelog_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_ENTRY); @@ -561,7 +561,7 @@ changelog_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_ENTRY); @@ -690,7 +690,7 @@ changelog_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_ENTRY); @@ -811,7 +811,7 @@ changelog_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_ENTRY); @@ -961,7 +961,7 @@ changelog_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); /* fill the event structure.. similar to open() */ ev.ev_type = CHANGELOG_OP_TYPE_CREATE; @@ -1117,7 +1117,7 @@ changelog_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_METADATA); @@ -1173,7 +1173,7 @@ changelog_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_METADATA); @@ -1240,7 +1240,7 @@ changelog_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_METADATA_XATTR); @@ -1291,7 +1291,7 @@ changelog_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_METADATA_XATTR); @@ -1344,7 +1344,7 @@ changelog_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_METADATA_XATTR); @@ -1457,7 +1457,7 @@ changelog_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_METADATA_XATTR); @@ -1510,7 +1510,7 @@ changelog_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_METADATA); @@ -1567,7 +1567,7 @@ changelog_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_METADATA_XATTR); @@ -1631,7 +1631,7 @@ changelog_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_DATA); @@ -1680,7 +1680,7 @@ changelog_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; local = frame->local; - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !local), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !local), unwind); changelog_update(this, priv, local, CHANGELOG_TYPE_DATA); @@ -1792,7 +1792,7 @@ changelog_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, logopen = _gf_true; } - CHANGELOG_COND_GOTO(priv, ((op_ret < 0) || !logopen), unwind); + CHANGELOG_COND_GOTO(priv, (IS_ERROR((op_ret)) || !logopen), unwind); /* fill the event structure */ ev.ev_type = CHANGELOG_OP_TYPE_OPEN; diff --git a/xlators/features/cloudsync/src/cloudsync-fops-c.py b/xlators/features/cloudsync/src/cloudsync-fops-c.py index 6f3f1a283f..97f5ce1159 100755 --- a/xlators/features/cloudsync/src/cloudsync-fops-c.py +++ b/xlators/features/cloudsync/src/cloudsync-fops-c.py @@ -133,13 +133,13 @@ /* Do we need lock here? */ local->call_cnt++; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { ret = dict_get_uint64 (xdata, GF_CS_OBJECT_STATUS, &val); if (ret == 0) { if (val == GF_CS_ERROR) { gf_msg (this->name, GF_LOG_ERROR, 0, 0, "could not get file state, unwinding"); - op_ret = -1; + op_ret = gf_failure; op_errno = EIO; goto unwind; } else { diff --git a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c index 7a15428c9b..73f84100da 100644 --- a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c +++ b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c @@ -337,7 +337,7 @@ aws_dlwritev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { aws_private_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, op_errno, "write failed " ". Aborting Download"); diff --git a/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.c b/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.c index b31879f39c..2a28db669a 100644 --- a/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.c +++ b/xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/libcvlt.c @@ -66,7 +66,7 @@ cvlt_free_resources(archive_t *arch) static int32_t cvlt_extract_store_fops(xlator_t *this, archive_t *arch) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; get_archstore_methods_t get_archstore_methods; /* @@ -406,7 +406,7 @@ cvlt_readv_complete(archstore_desc_t *desc, app_callback_info_t *cbkinfo, priv = (archive_t *)cspriv->stores->config; if (strcmp(priv->trailer, CVLT_TRAILER)) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -416,13 +416,13 @@ cvlt_readv_complete(archstore_desc_t *desc, app_callback_info_t *cbkinfo, " op : %d ret : %" PRId64 " errno : %d", req->offset, req->bytes, req->op_type, op_ret, op_errno); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } req->iobref = iobref_new(); if (!req->iobref) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } @@ -571,7 +571,7 @@ cvlt_download(call_frame_t *frame, void *config) parch = (archive_t *)config; if (strcmp(parch->trailer, CVLT_TRAILER)) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto err; } @@ -609,7 +609,7 @@ cvlt_download(call_frame_t *frame, void *config) * about data management store. */ op_ret = cvlt_init_store_info(parch, &(req->store_info)); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(plugin, GF_LOG_ERROR, 0, CVLT_EXTRACTION_FAILED, " failed to extract store info for gfid=%s", uuid_utoa(locxattr->gfid)); @@ -617,7 +617,7 @@ cvlt_download(call_frame_t *frame, void *config) } op_ret = cvlt_init_file_info(locxattr, &(req->file_info)); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(plugin, GF_LOG_ERROR, 0, CVLT_EXTRACTION_FAILED, " failed to extract file info for gfid=%s", uuid_utoa(locxattr->gfid)); @@ -629,7 +629,7 @@ cvlt_download(call_frame_t *frame, void *config) * store to gusterfs volume. */ op_ret = cvlt_init_gluster_store_info(locxattr, &dest_storeinfo); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(plugin, GF_LOG_ERROR, 0, CVLT_EXTRACTION_FAILED, " failed to extract destination store info for gfid=%s", uuid_utoa(locxattr->gfid)); @@ -637,7 +637,7 @@ cvlt_download(call_frame_t *frame, void *config) } op_ret = cvlt_init_gluster_file_info(locxattr, &dest_fileinfo); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(plugin, GF_LOG_ERROR, 0, CVLT_EXTRACTION_FAILED, " failed to extract file info for gfid=%s", uuid_utoa(locxattr->gfid)); @@ -651,7 +651,7 @@ cvlt_download(call_frame_t *frame, void *config) &(req->file_info), &dest_storeinfo, &dest_fileinfo, &op_errno, cvlt_download_complete, req); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(plugin, GF_LOG_ERROR, 0, CVLT_RESTORE_FAILED, " failed to restore file gfid=%s from data management store", uuid_utoa(locxattr->gfid)); @@ -663,7 +663,7 @@ cvlt_download(call_frame_t *frame, void *config) */ sem_wait(&(req->sem)); - if (req->op_ret < 0) { + if IS_ERROR((req->op_ret)) { gf_msg(plugin, GF_LOG_ERROR, 0, CVLT_RESTORE_FAILED, " restored failed for gfid=%s", uuid_utoa(locxattr->gfid)); goto err; @@ -687,7 +687,7 @@ cvlt_download(call_frame_t *frame, void *config) int cvlt_read(call_frame_t *frame, void *config) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = 0; archive_t *parch = NULL; cvlt_request_t *req = NULL; @@ -707,7 +707,7 @@ cvlt_read(call_frame_t *frame, void *config) parch = (archive_t *)config; if (strcmp(parch->trailer, CVLT_TRAILER)) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto err; } @@ -723,7 +723,7 @@ cvlt_read(call_frame_t *frame, void *config) */ op_errno = ENOENT; - op_ret = 0; + op_ret = gf_zero_ret; gf_msg(plugin, GF_LOG_ERROR, 0, CVLT_READ_FAILED, " reporting end-of-file for gfid=%s", uuid_utoa(locxattr->gfid)); @@ -781,7 +781,7 @@ cvlt_read(call_frame_t *frame, void *config) * about data management store. */ op_ret = cvlt_init_store_info(parch, &(req->store_info)); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(plugin, GF_LOG_ERROR, 0, CVLT_EXTRACTION_FAILED, " failed to extract store info for gfid=%s" " offset=%" PRIu64 " size=%" GF_PRI_SIZET @@ -792,7 +792,7 @@ cvlt_read(call_frame_t *frame, void *config) } op_ret = cvlt_init_file_info(locxattr, &(req->file_info)); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(plugin, GF_LOG_ERROR, 0, CVLT_EXTRACTION_FAILED, " failed to extract file info for gfid=%s" " offset=%" PRIu64 " size=%" GF_PRI_SIZET @@ -809,7 +809,7 @@ cvlt_read(call_frame_t *frame, void *config) &(req->file_info), off, req->iobuf->ptr, size, &op_errno, cvlt_readv_complete, req); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(plugin, GF_LOG_ERROR, 0, CVLT_EXTRACTION_FAILED, " read failed on gfid=%s" " offset=%" PRIu64 " size=%" GF_PRI_SIZET diff --git a/xlators/features/cloudsync/src/cloudsync.c b/xlators/features/cloudsync/src/cloudsync.c index 7c3ad0b126..839cc88862 100644 --- a/xlators/features/cloudsync/src/cloudsync.c +++ b/xlators/features/cloudsync/src/cloudsync.c @@ -328,14 +328,14 @@ cs_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->call_cnt++; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, 0, "truncate failed"); ret = dict_get_uint64(xdata, GF_CS_OBJECT_STATUS, &val); if (ret == 0) { if (val == GF_CS_ERROR) { gf_msg(this->name, GF_LOG_ERROR, 0, 0, "could not get file state, unwinding"); - op_ret = -1; + op_ret = gf_failure; op_errno = EIO; goto unwind; } else { @@ -754,7 +754,7 @@ cs_local_init(xlator_t *this, call_frame_t *frame, loc_t *loc, fd_t *fd, local->fd = fd_ref(fd); } - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EUCLEAN; local->fop = fop; local->dloffset = 0; @@ -1048,7 +1048,7 @@ cs_update_xattrs(call_frame_t *frame, dict_t *xdata) local->xattrinfo.lxattr = GF_CALLOC(1, sizeof(cs_loc_xattr_t), gf_cs_mt_cs_lxattr_t); if (!local->xattrinfo.lxattr) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -1058,7 +1058,7 @@ cs_update_xattrs(call_frame_t *frame, dict_t *xdata) if (local->remotepath) { local->xattrinfo.lxattr->file_path = gf_strdup(local->remotepath); if (!local->xattrinfo.lxattr->file_path) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -1073,7 +1073,7 @@ cs_update_xattrs(call_frame_t *frame, dict_t *xdata) size = strlen(this->name) - strlen("-cloudsync") + 1; local->xattrinfo.lxattr->volname = GF_CALLOC(1, size, gf_common_mt_char); if (!local->xattrinfo.lxattr->volname) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -1174,13 +1174,13 @@ cs_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->call_cnt++; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { ret = dict_get_uint64(xdata, GF_CS_OBJECT_STATUS, &val); if (ret == 0) { if (val == GF_CS_ERROR) { gf_msg(this->name, GF_LOG_ERROR, 0, 0, "could not get file state, unwinding"); - op_ret = -1; + op_ret = gf_failure; op_errno = EIO; goto unwind; } else { @@ -1279,7 +1279,7 @@ cs_resume_remote_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, gf_msg(this->name, GF_LOG_ERROR, 0, 0, "status is GF_CS_ERROR." " Aborting readv"); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EREMOTE; ret = -1; goto unwind; @@ -1302,7 +1302,7 @@ cs_resume_remote_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size, flags); /* Failed to submit the remote readv fop to plugin */ if (ret) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EREMOTE; goto unwind; } @@ -1310,7 +1310,7 @@ cs_resume_remote_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, * we should not perform remote reads. */ } else { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; goto unwind; } @@ -1422,7 +1422,7 @@ cs_stat_check_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; gf_msg(this->name, GF_LOG_ERROR, 0, op_errno, "stat check failed"); @@ -1434,7 +1434,7 @@ cs_stat_check_cbk(call_frame_t *frame, void *cookie, xlator_t *this, inode = local->loc.inode; if (!inode) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; gf_msg(this->name, GF_LOG_ERROR, 0, 0, "null inode " @@ -1446,7 +1446,7 @@ cs_stat_check_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (ret == 0) { if (val == GF_CS_ERROR) { cs_inode_ctx_reset(this, inode); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EIO; gf_msg(this->name, GF_LOG_ERROR, 0, 0, "status = GF_CS_ERROR. failed to get " @@ -1457,14 +1457,14 @@ cs_stat_check_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg_debug(this->name, 0, "status : %" PRIu64, val); if (ret) { gf_msg(this->name, GF_LOG_ERROR, 0, 0, "ctx update failed"); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } } } else { gf_msg_debug(this->name, 0, "status not found in dict"); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -1474,7 +1474,7 @@ cs_stat_check_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_msg_debug(this->name, 0, "filepath returned %s", filepath); local->remotepath = gf_strdup(filepath); if (!local->remotepath) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -1486,7 +1486,7 @@ cs_stat_check_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (ret) goto err; - local->op_ret = 0; + local->op_ret = gf_zero_ret; local->xattr_rsp = dict_ref(xdata); memcpy(&local->stbuf, stbuf, sizeof(struct iatt)); } @@ -1763,7 +1763,7 @@ cs_resume_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, if (state == GF_CS_ERROR) { /* file is already remote */ - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; gf_msg(this->name, GF_LOG_WARNING, 0, 0, "file %s , could not figure file state", loc->path); @@ -1772,7 +1772,7 @@ cs_resume_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, if (state == GF_CS_REMOTE) { /* file is already remote */ - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; gf_msg(this->name, GF_LOG_WARNING, 0, EINVAL, "file %s is already remote", loc->path); @@ -1782,7 +1782,7 @@ cs_resume_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, if (state == GF_CS_DOWNLOADING) { gf_msg(this->name, GF_LOG_WARNING, 0, 0, " file is in downloading state."); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; goto unwind; } @@ -1915,7 +1915,7 @@ cs_resume_postprocess(xlator_t *this, call_frame_t *frame, inode_t *inode) gf_msg(this->name, GF_LOG_ERROR, 0, 0, "status is GF_CS_ERROR." " Aborting write"); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EREMOTE; ret = -1; goto out; @@ -1929,7 +1929,7 @@ cs_resume_postprocess(xlator_t *this, call_frame_t *frame, inode_t *inode) } else { gf_msg(this->name, GF_LOG_ERROR, 0, 0, " download failed, unwinding writev"); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EREMOTE; ret = -1; } diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index d021c6874b..890c9fd461 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -411,7 +411,7 @@ ga_newentry_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if ((op_ret < 0) && ((op_errno != ENOENT) && (op_errno != ESTALE))) + if (IS_ERROR((op_ret)) && ((op_errno != ENOENT) && (op_errno != ESTALE))) goto err; STACK_WIND(frame, ga_newentry_cbk, FIRST_CHILD(this), @@ -668,7 +668,7 @@ ga_virtual_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, cbk_inode = inode_new(inode->table); if (!cbk_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 2d2ec642bc..65f215f1c9 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -1231,7 +1231,7 @@ xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; inode = inode_ref(local->inode); - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; xattrop_index_action(this, local, xattr, match, matchdata); @@ -1560,7 +1560,7 @@ index_lookup_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, struct stat lstatbuf = {0}; int ret = 0; int32_t op_errno = EINVAL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; uint64_t val = IA_INVAL; char path[PATH_MAX] = {0}; struct iatt stbuf = { @@ -1590,7 +1590,7 @@ index_lookup_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, if ((ret < 0) || (ret > (PATH_MAX - strlen(path)))) { op_errno = EINVAL; - op_ret = -1; + op_ret = gf_failure; goto done; } @@ -1638,7 +1638,7 @@ index_lookup_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, if (val != IA_INVAL) { ret = dict_set_uint64(xattr, GF_INDEX_IA_TYPE_GET_RSP, val); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = -ret; goto done; } @@ -1652,13 +1652,13 @@ index_lookup_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, ret = index_save_pargfid_for_entry_changes(this, &iloc, path); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = -ret; goto done; } stbuf.ia_ino = -1; - op_ret = 0; + op_ret = gf_zero_ret; done: STACK_UNWIND_STRICT(lookup, frame, op_ret, op_errno, loc ? loc->inode : NULL, &stbuf, xattr, &postparent); @@ -1718,7 +1718,7 @@ index_readdir_wrapper(call_frame_t *frame, xlator_t *this, fd_t *fd, index_priv_t *priv = NULL; DIR *dir = NULL; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = 0; int count = 0; gf_dirent_t entries; @@ -1805,7 +1805,7 @@ index_get_parent_iatt(struct iatt *parent, char *path, loc_t *loc, ret = sys_lstat(path, &lstatbuf); if (ret < 0) { - *op_ret = -1; + *op_ret = gf_failure; *op_errno = errno; return; } @@ -1822,7 +1822,7 @@ index_rmdir_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, dict_t *xdata) { int ret = 0; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int32_t op_errno = 0; char *subdir = NULL; char index_dir[PATH_MAX] = {0}; @@ -1844,7 +1844,7 @@ index_rmdir_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, sizeof(index_dir)); index_get_parent_iatt(&preparent, index_dir, loc, &op_ret, &op_errno); - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto done; gf_uuid_parse(loc->name, gfid); @@ -1854,7 +1854,7 @@ index_rmdir_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, if (flag == 0) { ret = index_del(this, gfid, subdir, type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = -ret; goto done; } @@ -1865,7 +1865,7 @@ index_rmdir_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, } index_get_parent_iatt(&postparent, index_dir, loc, &op_ret, &op_errno); - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto done; done: @@ -1880,7 +1880,7 @@ index_unlink_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, { index_priv_t *priv = NULL; index_inode_ctx_t *ictx = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int32_t op_errno = 0; int ret = 0; index_xattrop_type_t type = XATTROP_TYPE_UNSET; @@ -1895,13 +1895,13 @@ index_unlink_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, type = index_get_type_from_vgfid(priv, loc->pargfid); ret = index_inode_path(this, loc->parent, index_dir, sizeof(index_dir)); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = -ret; goto done; } index_get_parent_iatt(&preparent, index_dir, loc, &op_ret, &op_errno); - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto done; if (type <= XATTROP_TYPE_UNSET) { @@ -1923,13 +1923,13 @@ index_unlink_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flag, ret = index_del(this, gfid, subdir, type); } if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = -ret; goto done; } index_get_parent_iatt(&postparent, index_dir, loc, &op_ret, &op_errno); - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto done; done: INDEX_STACK_UNWIND(unlink, frame, op_ret, op_errno, &preparent, &postparent, diff --git a/xlators/features/leases/src/leases.c b/xlators/features/leases/src/leases.c index 87ec18a883..fd3ecf8b24 100644 --- a/xlators/features/leases/src/leases.c +++ b/xlators/features/leases/src/leases.c @@ -243,7 +243,7 @@ leases_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, struct gf_lease nullease = { 0, }; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; EXIT_IF_LEASES_OFF(this, out); EXIT_IF_INTERNAL_FOP(frame, xdata, out); @@ -251,7 +251,7 @@ leases_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, ret = process_lease_req(frame, this, loc->inode, lease); if (ret < 0) { op_errno = -ret; - op_ret = -1; + op_ret = gf_failure; } goto unwind; @@ -261,7 +261,7 @@ leases_lease(call_frame_t *frame, xlator_t *this, loc_t *loc, "You need to enable it for proper functioning of your " "application"); op_errno = ENOSYS; - op_ret = -1; + op_ret = gf_failure; unwind: STACK_UNWIND_STRICT(lease, frame, op_ret, op_errno, diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c index 1a98656db2..bd59ee0dd8 100644 --- a/xlators/features/locks/src/common.c +++ b/xlators/features/locks/src/common.c @@ -233,7 +233,7 @@ pl_trace_in(xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, int cmd, } void -pl_print_verdict(char *str, int size, gf_return_t op_ret, int op_errno) +pl_print_verdict(char *str, int size, int32_t op_ret, int op_errno) { char *verdict = NULL; @@ -276,7 +276,7 @@ pl_trace_out(xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, int cmd, else pl_print_lock(pl_lock, 256, cmd, flock, &frame->root->lk_owner); - pl_print_verdict(verdict, 32, op_ret, op_errno); + pl_print_verdict(verdict, 32, GET_RET(op_ret), op_errno); gf_log(this->name, GF_LOG_INFO, "[%s] Locker = {%s} Lockee = {%s} Lock = {%s}", verdict, pl_locker, @@ -391,7 +391,7 @@ pl_fetch_mlock_info_from_disk(xlator_t *this, pl_inode_t *pl_inode, { dict_t *xdata_rsp = NULL; int ret = 0; - gf_return_t op_ret = 0; + int32_t op_ret = 0; if (!local) { return -1; @@ -979,9 +979,9 @@ grant_blocked_locks(xlator_t *this, pl_inode_t *pl_inode) list_del_init(&lock->list); pl_trace_out(this, lock->frame, NULL, NULL, F_SETLKW, &lock->user_flock, - 0, 0, NULL); + gf_zero_ret, 0, NULL); local = lock->frame->local; - PL_STACK_UNWIND_AND_FREE(local, lk, lock->frame, 0, 0, + PL_STACK_UNWIND_AND_FREE(local, lk, lock->frame, gf_zero_ret, 0, &lock->user_flock, NULL); __destroy_lock(lock); } @@ -1029,9 +1029,9 @@ pl_send_prelock_unlock(xlator_t *this, pl_inode_t *pl_inode, list_del_init(&lock->list); pl_trace_out(this, lock->frame, NULL, NULL, F_SETLKW, &lock->user_flock, - 0, 0, NULL); + gf_zero_ret, 0, NULL); local = lock->frame->local; - PL_STACK_UNWIND_AND_FREE(local, lk, lock->frame, 0, 0, + PL_STACK_UNWIND_AND_FREE(local, lk, lock->frame, gf_zero_ret, 0, &lock->user_flock, NULL); __destroy_lock(lock); } @@ -1204,7 +1204,7 @@ pl_lock_preempt(pl_inode_t *pl_inode, posix_lock_t *reqlock) list_for_each_entry_safe(lock, i, &unwind_blist, list) { PL_STACK_UNWIND_AND_FREE(((pl_local_t *)lock->frame->local), lk, - lock->frame, -1, EBUSY, &lock->user_flock, + lock->frame, gf_failure, EBUSY, &lock->user_flock, NULL); __destroy_lock(lock); } @@ -1213,7 +1213,7 @@ pl_lock_preempt(pl_inode_t *pl_inode, posix_lock_t *reqlock) list_for_each_entry_safe(rw, itr, &unwind_rw_list, list) { pl_clean_local(rw->stub->frame->local); - call_unwind_error(rw->stub, -1, EBUSY); + call_unwind_error(rw->stub, gf_failure, EBUSY); } return ret; diff --git a/xlators/features/locks/src/common.h b/xlators/features/locks/src/common.h index 205b7f55ba..9eb12711bc 100644 --- a/xlators/features/locks/src/common.h +++ b/xlators/features/locks/src/common.h @@ -166,7 +166,7 @@ entrylk_trace_block(xlator_t *this, call_frame_t *frame, const char *volume, entrylk_type type); void -pl_print_verdict(char *str, int size, gf_return_t op_ret, int op_errno); +pl_print_verdict(char *str, int size, int32_t op_ret, int op_errno); void pl_print_lockee(char *str, int size, fd_t *fd, loc_t *loc); diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c index 2de66f1ee9..bc3dfa5fc1 100644 --- a/xlators/features/locks/src/entrylk.c +++ b/xlators/features/locks/src/entrylk.c @@ -462,7 +462,7 @@ entrylk_trace_out(xlator_t *this, call_frame_t *frame, const char *domain, pl_print_locker(pl_locker, 256, this, frame); pl_print_lockee(pl_lockee, 256, fd, loc); pl_print_entrylk(pl_entrylk, 256, cmd, type, basename, domain); - pl_print_verdict(verdict, 32, op_ret, op_errno); + pl_print_verdict(verdict, 32, GET_RET(op_ret), op_errno); gf_log(this->name, GF_LOG_INFO, "[%s] Locker = {%s} Lockee = {%s} Lock = {%s}", verdict, pl_locker, @@ -716,9 +716,9 @@ grant_blocked_entry_locks(xlator_t *this, pl_inode_t *pl_inode, list_for_each_entry_safe(lock, tmp, &granted_list, blocked_locks) { entrylk_trace_out(this, lock->frame, NULL, NULL, NULL, lock->basename, - ENTRYLK_LOCK, lock->type, 0, 0); + ENTRYLK_LOCK, lock->type, gf_zero_ret, 0); - STACK_UNWIND_STRICT(entrylk, lock->frame, 0, 0, NULL); + STACK_UNWIND_STRICT(entrylk, lock->frame, gf_zero_ret, 0, NULL); lock->frame = NULL; } @@ -740,7 +740,7 @@ pl_common_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, entrylk_type type, loc_t *loc, fd_t *fd, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = {-1}; int32_t op_errno = 0; int ret = -1; char unwind = 1; @@ -795,7 +795,7 @@ pl_common_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, reqlock = new_entrylk_lock(pinode, basename, type, dom->domain, frame, conn_id, &op_errno); if (!reqlock) { - op_ret = -1; + op_ret = gf_failure; goto unwind; } @@ -824,7 +824,7 @@ pl_common_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, if (pl_does_monkey_want_stuck_lock()) { gf_log(this->name, GF_LOG_WARNING, "MONKEY LOCKING (forcing stuck lock)!"); - op_ret = 0; + op_ret = gf_zero_ret; need_inode_unref = _gf_true; pthread_mutex_lock(&pinode->mutex); { @@ -851,7 +851,7 @@ pl_common_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, pcontend); if (ret == 0) { reqlock->frame = NULL; - op_ret = 0; + op_ret = gf_zero_ret; } else { op_errno = -ret; } @@ -893,7 +893,7 @@ pl_common_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, if (unlocked) { list_del_init(&unlocked->client_list); __pl_entrylk_unref(unlocked); - op_ret = 0; + op_ret = gf_zero_ret; } else { op_errno = EINVAL; } @@ -918,7 +918,7 @@ pl_common_entrylk(call_frame_t *frame, xlator_t *this, const char *volume, /* The following (extra) unref corresponds to the ref that * was done at the time the lock was granted. */ - if ((cmd == ENTRYLK_UNLOCK) && (op_ret == 0)) + if ((cmd == ENTRYLK_UNLOCK) && IS_SUCCESS(op_ret)) inode_unref(pinode->inode); out: diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c index 6f2c9266c3..6e16343c03 100644 --- a/xlators/features/locks/src/inodelk.c +++ b/xlators/features/locks/src/inodelk.c @@ -557,7 +557,7 @@ unwind_granted_inodes(xlator_t *this, pl_inode_t *pl_inode, list_for_each_entry_safe(lock, tmp, granted, blocked_locks) { if (lock->status == 0) { - op_ret = 0; + op_ret = gf_zero_ret; op_errno = 0; gf_log(this->name, GF_LOG_TRACE, "%s (pid=%d) (lk-owner=%s) %" PRId64 " - %" PRId64 @@ -566,7 +566,7 @@ unwind_granted_inodes(xlator_t *this, pl_inode_t *pl_inode, lock->client_pid, lkowner_utoa(&lock->owner), lock->user_flock.l_start, lock->user_flock.l_len); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = -lock->status; } pl_trace_out(this, lock->frame, NULL, NULL, F_SETLKW, &lock->user_flock, @@ -975,7 +975,7 @@ pl_common_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, inode_t *inode, int32_t cmd, struct gf_flock *flock, loc_t *loc, fd_t *fd, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = {-1}; int32_t op_errno = 0; int ret = -1; GF_UNUSED int dict_ret = -1; @@ -1034,7 +1034,7 @@ pl_common_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, frame, this, dom->domain, conn_id, &op_errno); if (!reqlock) { - op_ret = -1; + op_ret = gf_failure; goto unwind; } @@ -1073,7 +1073,7 @@ pl_common_inodelk(call_frame_t *frame, xlator_t *this, const char *volume, goto unwind; } - op_ret = 0; + op_ret = gf_zero_ret; unwind: if (flock != NULL) diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index fc85e96a14..f74f4228d5 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -70,7 +70,7 @@ fetch_pathinfo(xlator_t *, inode_t *, int32_t *, char **); dict_t *__unref = NULL; \ int __i = 0; \ __local = frame->local; \ - if (op_ret >= 0 && pl_needs_xdata_response(frame->local)) { \ + if (IS_SUCCESS(op_ret) && pl_needs_xdata_response(frame->local)) { \ if (xdata) \ dict_ref(xdata); \ else \ @@ -122,13 +122,13 @@ fetch_pathinfo(xlator_t *, inode_t *, int32_t *, char **); inode_t *__inode = (loc ? loc->inode : fd->inode); \ pl_inode_t *__pl_inode = pl_inode_get(this, __inode, NULL); \ if (__pl_inode == NULL) { \ - op_ret = -1; \ + op_ret = gf_failure; \ op_errno = ENOMEM; \ goto unwind; \ } \ if (!pl_is_mandatory_locking_enabled(__pl_inode) || \ !priv->mlock_enforced) { \ - op_ret = -1; \ + op_ret = gf_failure; \ gf_msg(this->name, GF_LOG_DEBUG, EINVAL, 0, \ "option %s would need mandatory lock to be enabled " \ "and feature.enforce-mandatory-lock option to be set " \ @@ -137,10 +137,10 @@ fetch_pathinfo(xlator_t *, inode_t *, int32_t *, char **); op_errno = EINVAL; \ goto unwind; \ } \ - \ - op_ret = pl_local_init(frame, this, loc, fd); \ - if (op_ret) { \ - op_errno = ENOMEM; \ + \ + if (pl_local_init(frame, this, loc, fd)) { \ + op_ret = gf_failure; \ + op_errno = ENOMEM; \ goto unwind; \ } \ \ @@ -674,7 +674,7 @@ pl_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, }; gf_boolean_t enabled = _gf_false; gf_boolean_t can_block = _gf_true; - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; int op_errno = 0; int allowed = 1; @@ -682,7 +682,7 @@ pl_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, local = mem_get0(this->local_pool); if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -693,7 +693,7 @@ pl_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, pl_inode = pl_inode_get(this, fd->inode, local); if (!pl_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -723,14 +723,14 @@ pl_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, goto unlock; } else if (!can_block) { op_errno = EAGAIN; - op_ret = -1; + op_ret = gf_failure; goto unlock; } rw = GF_MALLOC(sizeof(*rw), gf_locks_mt_pl_rw_req_t); if (!rw) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; goto unlock; } @@ -738,7 +738,7 @@ pl_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, xdata); if (!rw->stub) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; GF_FREE(rw); goto unlock; } @@ -755,7 +755,7 @@ pl_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, STACK_WIND(frame, pl_discard_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->discard, fd, offset, len, xdata); unwind: - if (op_ret == -1) + if (IS_ERROR(op_ret)) PL_STACK_UNWIND(discard, xdata, frame, op_ret, op_errno, NULL, NULL, NULL); @@ -800,7 +800,7 @@ pl_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, }; gf_boolean_t enabled = _gf_false; gf_boolean_t can_block = _gf_true; - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; int op_errno = 0; int allowed = 1; @@ -808,7 +808,7 @@ pl_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, local = mem_get0(this->local_pool); if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -819,7 +819,7 @@ pl_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, pl_inode = pl_inode_get(this, fd->inode, local); if (!pl_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -849,14 +849,14 @@ pl_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, goto unlock; } else if (!can_block) { op_errno = EAGAIN; - op_ret = -1; + op_ret = gf_failure; goto unlock; } rw = GF_MALLOC(sizeof(*rw), gf_locks_mt_pl_rw_req_t); if (!rw) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; goto unlock; } @@ -864,7 +864,7 @@ pl_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, len, xdata); if (!rw->stub) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; GF_FREE(rw); goto unlock; } @@ -881,7 +881,7 @@ pl_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, STACK_WIND(frame, pl_zerofill_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->zerofill, fd, offset, len, xdata); unwind: - if (op_ret == -1) + if (IS_ERROR(op_ret)) PL_STACK_UNWIND(zerofill, xdata, frame, op_ret, op_errno, NULL, NULL, NULL); @@ -949,7 +949,7 @@ truncate_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_VALIDATE_OR_GOTO("locks", this, unwind); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_ERROR, "got error (errno=%d, stderror=%s) from child", op_errno, strerror(op_errno)); @@ -965,7 +965,7 @@ truncate_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, pl_inode = pl_inode_get(this, inode, local); if (!pl_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -995,14 +995,14 @@ truncate_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto unlock; } else if (!can_block) { op_errno = EAGAIN; - op_ret = -1; + op_ret = gf_failure; goto unlock; } rw = GF_MALLOC(sizeof(*rw), gf_locks_mt_pl_rw_req_t); if (!rw) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; goto unlock; } @@ -1016,7 +1016,7 @@ truncate_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->xdata); if (!rw->stub) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; GF_FREE(rw); goto unlock; } @@ -1046,11 +1046,11 @@ truncate_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } unwind: - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this ? this->name : "locks", GF_LOG_ERROR, "truncate failed with " "ret: %d, error: %s", - op_ret, strerror(op_errno)); + GET_RET(op_ret), strerror(op_errno)); switch (local->op) { case GF_FOP_TRUNCATE: @@ -1097,7 +1097,7 @@ pl_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, gf_log(this ? this->name : "locks", GF_LOG_ERROR, "truncate on %s failed with" " ret: %d, error: %s", - loc->path, gf_failure, strerror(ENOMEM)); + loc->path, -1, strerror(ENOMEM)); STACK_UNWIND_STRICT(truncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); } return 0; @@ -1128,9 +1128,8 @@ pl_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, unwind: if (ret == -1) { gf_log(this ? this->name : "locks", GF_LOG_ERROR, - "ftruncate failed with" - " ret: %d, error: %s", - gf_failure, strerror(ENOMEM)); + "ftruncate failed with ret: %d, error: %s", + -1, strerror(ENOMEM)); STACK_UNWIND_STRICT(ftruncate, frame, gf_failure, ENOMEM, NULL, NULL, NULL); } return 0; @@ -1246,7 +1245,7 @@ pl_getxattr_clrlk(xlator_t *this, const char *name, inode_t *inode, 0, }; char *brickname = NULL; - gf_return_t op_ret = -1; + int ret = -1; *op_errno = EINVAL; @@ -1270,18 +1269,18 @@ pl_getxattr_clrlk(xlator_t *this, const char *name, inode_t *inode, switch (args.type) { case CLRLK_INODE: case CLRLK_ENTRY: - op_ret = clrlk_clear_lks_in_all_domains(this, pl_inode, &args, + ret = clrlk_clear_lks_in_all_domains(this, pl_inode, &args, &bcount, &gcount, op_errno); break; case CLRLK_POSIX: - op_ret = clrlk_clear_posixlk(this, pl_inode, &args, &bcount, + ret = clrlk_clear_posixlk(this, pl_inode, &args, &bcount, &gcount, op_errno); break; default: - op_ret = -1; + ret = -1; *op_errno = EINVAL; } - if (op_ret) { + if (ret) { if (args.type >= CLRLK_TYPE_MAX) { gf_log(this->name, GF_LOG_ERROR, "clear locks: invalid lock type %d", args.type); @@ -1294,12 +1293,12 @@ pl_getxattr_clrlk(xlator_t *this, const char *name, inode_t *inode, goto out; } - op_ret = fetch_pathinfo(this, inode, op_errno, &brickname); - if (op_ret) { + ret = fetch_pathinfo(this, inode, op_errno, &brickname); + if (ret) { gf_log(this->name, GF_LOG_WARNING, "Couldn't get brickname"); } else { - op_ret = format_brickname(brickname); - if (op_ret) { + ret = format_brickname(brickname); + if (ret) { gf_log(this->name, GF_LOG_WARNING, "Couldn't format brickname"); GF_FREE(brickname); brickname = NULL; @@ -1308,7 +1307,7 @@ pl_getxattr_clrlk(xlator_t *this, const char *name, inode_t *inode, if (!gcount && !bcount) { if (gf_asprintf(&lk_summary, "No locks cleared.") == -1) { - op_ret = -1; + ret = -1; *op_errno = ENOMEM; goto out; } @@ -1317,7 +1316,7 @@ pl_getxattr_clrlk(xlator_t *this, const char *name, inode_t *inode, "granted locks=%d", (brickname == NULL) ? this->name : brickname, clrlk_type_names[args.type], bcount, gcount) == -1) { - op_ret = -1; + ret = -1; *op_errno = ENOMEM; goto out; } @@ -1325,26 +1324,26 @@ pl_getxattr_clrlk(xlator_t *this, const char *name, inode_t *inode, key = gf_strdup(name); if (!key) { - op_ret = -1; + ret = -1; goto out; } if (dict_set_dynstr(*dict, key, lk_summary)) { - op_ret = -1; + ret = -1; *op_errno = ENOMEM; goto out; } - op_ret = 0; + ret = 0; out: GF_FREE(brickname); GF_FREE(args.opts); GF_FREE(key); - if (op_ret) { + if (ret) { GF_FREE(lk_summary); } - return op_ret; + return ret; } int32_t @@ -1352,7 +1351,8 @@ pl_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { int32_t op_errno = EINVAL; - gf_return_t op_ret = -1; + gf_return_t op_ret; + int ret; dict_t *dict = NULL; if (!name) @@ -1361,8 +1361,9 @@ pl_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, if (strncmp(name, GF_XATTR_CLRLK_CMD, SLEN(GF_XATTR_CLRLK_CMD))) goto usual; - op_ret = pl_getxattr_clrlk(this, name, loc->inode, &dict, &op_errno); + ret = pl_getxattr_clrlk(this, name, loc->inode, &dict, &op_errno); + SET_RET(op_ret, ret); STACK_UNWIND_STRICT(getxattr, frame, op_ret, op_errno, dict, xdata); if (dict) @@ -1508,7 +1509,7 @@ pl_fgetxattr_handle_lockinfo(xlator_t *this, fd_t *fd, dict_t *dict, int32_t *op_errno) { char *key = NULL, *buf = NULL; - gf_return_t op_ret = 0; + int32_t op_ret = 0; unsigned long fdnum = 0; int32_t len = 0; dict_t *tmp = NULL; @@ -1531,13 +1532,13 @@ pl_fgetxattr_handle_lockinfo(xlator_t *this, fd_t *fd, dict_t *dict, key = pl_lockinfo_key(this, fd->inode, op_errno); if (key == NULL) { - op_ret = -1; + op_ret = -1; goto out; } tmp = dict_new(); if (tmp == NULL) { - op_ret = -1; + op_ret = -1; *op_errno = ENOMEM; goto out; } @@ -1593,8 +1594,9 @@ int32_t pl_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { - gf_return_t op_ret = 0, op_errno = 0; + int32_t op_ret = 0, op_errno = 0; dict_t *dict = NULL; + gf_return_t fin_ret; if (!name) { goto usual; @@ -1627,7 +1629,8 @@ pl_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, } unwind: - STACK_UNWIND_STRICT(fgetxattr, frame, op_ret, op_errno, dict, NULL); + SET_RET(fin_ret, op_ret); + STACK_UNWIND_STRICT(fgetxattr, frame, fin_ret, op_errno, dict, NULL); if (dict != NULL) { dict_unref(dict); } @@ -1645,12 +1648,12 @@ pl_migrate_locks(call_frame_t *frame, fd_t *newfd, uint64_t oldfd_num, int32_t *op_errno) { posix_lock_t *l = NULL; - gf_return_t op_ret = 0; + int32_t op_ret = 0; uint64_t newfd_num = fd_to_fdnum(newfd); pl_inode_t *pl_inode = pl_inode_get(frame->this, newfd->inode, NULL); if (pl_inode == NULL) { - op_ret = -1; + op_ret = -1; *op_errno = EBADFD; goto out; } @@ -1676,7 +1679,7 @@ int32_t pl_fsetxattr_handle_lockinfo(call_frame_t *frame, fd_t *fd, char *lockinfo_buf, int len, int32_t *op_errno) { - gf_return_t op_ret = -1; + int32_t op_ret = -1; uint64_t oldfd_num = 0; char *key = NULL; @@ -1730,10 +1733,10 @@ pl_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, pl_inode_t *pl_inode = NULL; local = frame->local; - if (local && local->update_mlock_enforced_flag && op_ret != -1) { + if (local && local->update_mlock_enforced_flag && IS_SUCCESS(op_ret)) { pl_inode = pl_inode_get(this, local->inode, NULL); if (!pl_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -1761,16 +1764,16 @@ pl_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int len = 0; char *name = NULL; posix_locks_private_t *priv = this->private; - - gf_return_t op_ret = dict_get_ptr_and_len(dict, GF_XATTR_LOCKINFO_KEY, + gf_return_t op_ret = {0}; + int32_t ret = dict_get_ptr_and_len(dict, GF_XATTR_LOCKINFO_KEY, &lockinfo_buf, &len); if (lockinfo_buf == NULL) { goto usual; } - op_ret = pl_fsetxattr_handle_lockinfo(frame, fd, lockinfo_buf, len, + ret = pl_fsetxattr_handle_lockinfo(frame, fd, lockinfo_buf, len, &op_errno); - if (op_ret < 0) { + if (ret < 0) { goto unwind; } @@ -1785,6 +1788,7 @@ pl_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, return 0; unwind: + SET_RET(op_ret, ret); PL_STACK_UNWIND_FOR_CLIENT(fsetxattr, xdata, frame, op_ret, op_errno, NULL); return 0; @@ -1796,13 +1800,13 @@ pl_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { pl_fdctx_t *fdctx = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; fdctx = pl_check_n_create_fdctx(this, fd); if (!fdctx) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; goto unwind; } @@ -1886,13 +1890,13 @@ pl_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { pl_fdctx_t *fdctx = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; fdctx = pl_check_n_create_fdctx(this, fd); if (!fdctx) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; goto unwind; } @@ -1906,19 +1910,17 @@ int pl_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, fd_t *fd, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = {0}; int op_errno = EINVAL; pl_inode_t *pl_inode = NULL; posix_lock_t *l = NULL; posix_locks_private_t *priv = this->private; - GF_VALIDATE_OR_GOTO("locks", this, unwind); - - op_ret = 0, op_errno = 0; + op_errno = 0; pl_inode = pl_inode_get(this, fd->inode, NULL); if (!pl_inode) { gf_msg(this->name, GF_LOG_ERROR, 0, ENOMEM, "Could not get inode"); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -1936,7 +1938,7 @@ pl_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, pthread_mutex_lock(&pl_inode->mutex); { if (!list_empty(&pl_inode->ext_list)) { - op_ret = -1; + op_ret = gf_failure; op_errno = EAGAIN; } } @@ -1949,7 +1951,7 @@ pl_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, list_for_each_entry(l, &pl_inode->ext_list, list) { if ((l->lk_flags & GF_LK_MANDATORY)) { - op_ret = -1; + op_ret = gf_failure; op_errno = EAGAIN; break; } @@ -1960,7 +1962,7 @@ pl_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } unwind: - if (op_ret == -1) + if (IS_ERROR(op_ret)) STACK_UNWIND_STRICT(open, frame, op_ret, op_errno, NULL, NULL); else STACK_WIND(frame, pl_open_cbk, FIRST_CHILD(this), @@ -1976,13 +1978,13 @@ pl_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { pl_fdctx_t *fdctx = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; fdctx = pl_check_n_create_fdctx(this, fd); if (!fdctx) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; goto unwind; } @@ -2175,7 +2177,7 @@ pl_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, }; gf_boolean_t enabled = _gf_false; gf_boolean_t can_block = _gf_true; - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; int op_errno = 0; int allowed = 1; @@ -2192,7 +2194,7 @@ pl_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, pl_inode = pl_inode_get(this, fd->inode, local); if (!pl_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -2222,14 +2224,14 @@ pl_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, goto unlock; } else if (!can_block) { op_errno = EAGAIN; - op_ret = -1; + op_ret = gf_failure; goto unlock; } rw = GF_MALLOC(sizeof(*rw), gf_locks_mt_pl_rw_req_t); if (!rw) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; goto unlock; } @@ -2237,7 +2239,7 @@ pl_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, flags, xdata); if (!rw->stub) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; GF_FREE(rw); goto unlock; } @@ -2256,7 +2258,7 @@ pl_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, xdata); } unwind: - if (op_ret == -1) + if (IS_ERROR(op_ret)) PL_STACK_UNWIND(readv, xdata, frame, op_ret, op_errno, NULL, 0, NULL, NULL, NULL); @@ -2293,7 +2295,7 @@ pl_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, }; gf_boolean_t enabled = _gf_false; gf_boolean_t can_block = _gf_true; - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; int op_errno = 0; int allowed = 1; @@ -2310,7 +2312,7 @@ pl_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, pl_inode = pl_inode_get(this, fd->inode, local); if (!pl_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -2345,14 +2347,14 @@ pl_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, op_errno = EAGAIN; } - op_ret = -1; + op_ret = gf_failure; goto unlock; } rw = GF_MALLOC(sizeof(*rw), gf_locks_mt_pl_rw_req_t); if (!rw) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; goto unlock; } @@ -2360,7 +2362,7 @@ pl_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, offset, flags, iobref, xdata); if (!rw->stub) { op_errno = ENOMEM; - op_ret = -1; + op_ret = gf_failure; GF_FREE(rw); goto unlock; } @@ -2379,7 +2381,7 @@ pl_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, flags, iobref, xdata); } unwind: - if (op_ret == -1) + if (IS_ERROR(op_ret)) PL_STACK_UNWIND(writev, xdata, frame, op_ret, op_errno, NULL, NULL, NULL); @@ -2568,7 +2570,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, struct gf_flock *flock, dict_t *xdata) { pl_inode_t *pl_inode = NULL; - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; int op_errno = 0; int can_block = 0; posix_lock_t *reqlock = NULL; @@ -2592,7 +2594,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, } if ((flock->l_start < 0) || ((flock->l_start + flock->l_len) < 0)) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto unwind; } @@ -2609,7 +2611,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, local = mem_get0(this->local_pool); if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } else { @@ -2619,7 +2621,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, pl_inode = pl_inode_get(this, fd->inode, local); if (!pl_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -2629,7 +2631,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, &op_errno); if (!reqlock) { - op_ret = -1; + op_ret = gf_failure; goto unwind; } @@ -2649,7 +2651,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, if (can_block) goto out; - op_ret = -1; + op_ret = gf_failure; op_errno = -ret; __destroy_lock(reqlock); goto unwind; @@ -2665,7 +2667,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, reqlock->this = this; ret = pl_reserve_unlock(this, pl_inode, reqlock); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = -ret; } __destroy_lock(reqlock); @@ -2682,7 +2684,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, ret = pl_getlk_fd(this, pl_inode, fd, reqlock); if (ret < 0) { gf_log(this->name, GF_LOG_DEBUG, "getting locks on fd failed"); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOLCK; goto unwind; } @@ -2747,7 +2749,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, ret = pl_lock_preempt(pl_inode, reqlock); if (ret == -1) { gf_log(this->name, GF_LOG_ERROR, "lock preempt failed"); - op_ret = -1; + op_ret = gf_failure; op_errno = EAGAIN; __destroy_lock(reqlock); goto out; @@ -2763,7 +2765,7 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, goto out; } gf_log(this->name, GF_LOG_DEBUG, "returning EAGAIN"); - op_ret = -1; + op_ret = gf_failure; op_errno = EAGAIN; __destroy_lock(reqlock); } else if (ret == -2) { @@ -3041,7 +3043,7 @@ pl_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { pl_inode_t *pl_inode; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { pl_inode = pl_inode_get(this, inode, NULL); if (pl_inode == NULL) { PL_STACK_UNWIND(lookup, xdata, frame, gf_failure, ENOMEM, NULL, NULL, NULL, @@ -3115,7 +3117,7 @@ pl_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, pl_local_t *local = NULL; gf_dirent_t *entry = NULL; - if (op_ret <= 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -3210,7 +3212,7 @@ pl_getactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) { pl_inode_t *pl_inode = NULL; lock_migration_info_t locks; - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; int op_errno = 0; int count = 0; @@ -3220,14 +3222,14 @@ pl_getactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) if (!pl_inode) { gf_msg(this->name, GF_LOG_ERROR, 0, 0, "pl_inode_get failed"); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } count = pl_fill_active_locks(pl_inode, &locks); - op_ret = count; + SET_RET(op_ret, count); out: STACK_UNWIND_STRICT(getactivelk, frame, op_ret, op_errno, &locks, NULL); @@ -3538,10 +3540,10 @@ pl_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, pl_local_t *local = NULL; pl_inode_t *pl_inode = NULL; local = frame->local; - if (local && local->update_mlock_enforced_flag && op_ret != -1) { + if (local && local->update_mlock_enforced_flag && IS_SUCCESS(op_ret)) { pl_inode = pl_inode_get(this, local->inode, NULL); if (!pl_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -3571,7 +3573,8 @@ int32_t pl_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int flags, dict_t *xdata) { - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; + int ret; int op_errno = EINVAL; dict_t *xdata_rsp = NULL; char *name = NULL; @@ -3580,14 +3583,14 @@ pl_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, PL_LOCAL_GET_REQUESTS(frame, this, xdata, ((fd_t *)NULL), loc, NULL); if (dict_get_sizen(dict, GF_META_LOCK_KEY)) { - op_ret = pl_metalk(frame, this, loc->inode); + ret = pl_metalk(frame, this, loc->inode); } else if (dict_get_sizen(dict, GF_META_UNLOCK_KEY)) { - op_ret = pl_metaunlock(frame, this, loc->inode, dict); + ret = pl_metaunlock(frame, this, loc->inode, dict); } else { goto usual; } - + SET_RET(op_ret, ret); PL_STACK_UNWIND_FOR_CLIENT(setxattr, xdata_rsp, frame, op_ret, op_errno, xdata_rsp); return 0; @@ -4251,7 +4254,7 @@ pl_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, struct iatt *prenewparent, struct iatt *postnewparent, dict_t *xdata) { - pl_inode_remove_cbk(this, cookie, op_ret < 0 ? op_errno : 0); + pl_inode_remove_cbk(this, cookie, IS_ERROR(op_ret) ? op_errno : 0); PL_STACK_UNWIND(rename, xdata, frame, op_ret, op_errno, buf, preoldparent, postoldparent, prenewparent, postnewparent, xdata); @@ -4368,7 +4371,7 @@ static int pl_setactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc, lock_migration_info_t *locklist, dict_t *xdata) { - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; int op_errno = 0; int ret = 0; @@ -4376,13 +4379,13 @@ pl_setactivelk(call_frame_t *frame, xlator_t *this, loc_t *loc, if (!pl_inode) { gf_msg(this->name, GF_LOG_ERROR, 0, 0, "pl_inode_get failed"); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto out; } ret = pl_write_active_locks(frame, pl_inode, locklist); - op_ret = ret; + SET_RET(op_ret, ret); out: STACK_UNWIND_STRICT(setactivelk, frame, op_ret, op_errno, NULL); @@ -4395,7 +4398,7 @@ pl_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { - pl_inode_remove_cbk(this, cookie, op_ret < 0 ? op_errno : 0); + pl_inode_remove_cbk(this, cookie, IS_ERROR(op_ret) ? op_errno : 0); PL_STACK_UNWIND(unlink, xdata, frame, op_ret, op_errno, preparent, postparent, xdata); @@ -4484,7 +4487,7 @@ pl_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, dict_t *xdata) { - pl_inode_remove_cbk(this, cookie, op_ret < 0 ? op_errno : 0); + pl_inode_remove_cbk(this, cookie, IS_ERROR(op_ret) ? op_errno : 0); PL_STACK_UNWIND_FOR_CLIENT(rmdir, xdata, frame, op_ret, op_errno, preparent, postparent, xdata); @@ -4536,7 +4539,7 @@ pl_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { pl_inode_t *pl_inode = (pl_inode_t *)cookie; - if (op_ret >= 0) { + if (IS_SUCCESS(op_ret)) { pthread_mutex_lock(&pl_inode->mutex); /* TODO: can happen pl_inode->links == 0 ? */ @@ -4656,10 +4659,10 @@ pl_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, pl_inode_t *pl_inode = NULL; local = frame->local; - if (local && local->update_mlock_enforced_flag && op_ret != -1) { + if (local && local->update_mlock_enforced_flag && IS_SUCCESS(op_ret)) { pl_inode = pl_inode_get(this, local->inode, NULL); if (!pl_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -4683,7 +4686,7 @@ int pl_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { - gf_return_t op_ret = 0; + gf_return_t op_ret = {0}; int op_errno = EINVAL; posix_locks_private_t *priv = this->private; @@ -4711,10 +4714,10 @@ pl_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, pl_inode_t *pl_inode = NULL; local = frame->local; - if (local && local->update_mlock_enforced_flag && op_ret != -1) { + if (local && local->update_mlock_enforced_flag && IS_SUCCESS(op_ret)) { pl_inode = pl_inode_get(this, local->inode, NULL); if (!pl_inode) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -4737,7 +4740,7 @@ int pl_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; posix_locks_private_t *priv = this->private; diff --git a/xlators/features/locks/src/reservelk.c b/xlators/features/locks/src/reservelk.c index 6bfce016f5..9742dcb9b0 100644 --- a/xlators/features/locks/src/reservelk.c +++ b/xlators/features/locks/src/reservelk.c @@ -245,7 +245,7 @@ grant_blocked_reserve_locks(xlator_t *this, pl_inode_t *pl_inode) lkowner_utoa(&lock->owner), lock->user_flock.l_start, lock->user_flock.l_len); - STACK_UNWIND_STRICT(lk, lock->frame, 0, 0, &lock->user_flock, NULL); + STACK_UNWIND_STRICT(lk, lock->frame, gf_zero_ret, 0, &lock->user_flock, NULL); } } diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 5b4f8b5c9d..70528b18db 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -434,12 +434,12 @@ marker_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, dict_t *xdata) { int32_t ret = -1; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; ret = marker_key_set_ver(this, dict); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -711,7 +711,7 @@ marker_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "error occurred " "while creating directory %s", @@ -730,7 +730,7 @@ marker_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "mq_inode_ctx_new " "failed for %s", uuid_utoa(inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } } @@ -798,7 +798,7 @@ marker_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_conf_t *priv = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "error occurred " "while creating file %s", @@ -817,7 +817,7 @@ marker_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "mq_inode_ctx_new " "failed for %s", uuid_utoa(inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } } @@ -884,7 +884,7 @@ marker_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_conf_t *priv = NULL; marker_local_t *local = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "error occurred " "while write, %s", @@ -957,7 +957,7 @@ marker_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; call_stub_t *stub = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "error occurred " "rmdir %s", @@ -1047,7 +1047,7 @@ marker_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_UNUSED int32_t ret = 0; call_stub_t *stub = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred in unlink", strerror(op_errno)); } @@ -1166,7 +1166,7 @@ marker_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; marker_conf_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred while " "linking a file ", @@ -1249,7 +1249,7 @@ marker_rename_done(call_frame_t *frame, void *cookie, xlator_t *this, frame->local = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_WARNING, "inodelk (UNLOCK) failed on path:%s (gfid:%s) (%s)", oplocal->parent_loc.path, @@ -1346,7 +1346,7 @@ marker_rename_unwind(call_frame_t *frame, void *cookie, xlator_t *this, if (cookie == (void *)_GF_UID_GID_CHANGED) MARKER_RESET_UID_GID(frame, frame->root, local); - if (op_ret < 0) + if (IS_ERROR(op_ret)) local->err = op_errno ? op_errno : EINVAL; if (local->stub != NULL) { @@ -1413,7 +1413,7 @@ marker_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { if (local != NULL) { local->err = op_errno; } @@ -1425,7 +1425,7 @@ marker_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } if (priv->feature_enabled & GF_QUOTA) { - if ((op_ret < 0) || (local == NULL)) { + if (IS_ERROR((op_ret)) || (local == NULL)) { goto quota_err; } @@ -1475,7 +1475,7 @@ marker_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(rename, frame, op_ret, op_errno, buf, preoldparent, postoldparent, prenewparent, postnewparent, xdata); - if ((op_ret < 0) || (local == NULL)) { + if (IS_ERROR((op_ret)) || (local == NULL)) { goto out; } @@ -1524,7 +1524,7 @@ marker_do_rename(call_frame_t *frame, void *cookie, xlator_t *this, if (cookie == (void *)_GF_UID_GID_CHANGED) MARKER_RESET_UID_GID(frame, frame->root, local); - if ((op_ret < 0) && (op_errno != ENOATTR) && (op_errno != ENODATA)) { + if (IS_ERROR((op_ret)) && (op_errno != ENOATTR) && (op_errno != ENODATA)) { local->err = op_errno ? op_errno : EINVAL; gf_log(this->name, GF_LOG_WARNING, "fetching contribution values from %s (gfid:%s) " @@ -1570,7 +1570,7 @@ marker_get_oldpath_contribution(call_frame_t *lk_frame, void *cookie, oplocal = local->oplocal; frame = local->frame; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->err = op_errno ? op_errno : EINVAL; gf_log(this->name, GF_LOG_WARNING, "cannot hold inodelk on %s (gfid:%s) (%s)", oplocal->loc.path, @@ -1789,7 +1789,7 @@ marker_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; marker_conf_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred while " "truncating a file ", @@ -1874,7 +1874,7 @@ marker_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; marker_conf_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred while " "truncating a file ", @@ -1949,7 +1949,7 @@ marker_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred while " "creating symlinks ", @@ -1968,7 +1968,7 @@ marker_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "mq_inode_ctx_new " "failed for %s", uuid_utoa(inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } } @@ -2036,7 +2036,7 @@ marker_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_conf_t *priv = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred with " "mknod ", @@ -2055,7 +2055,7 @@ marker_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "mq_inode_ctx_new " "failed for %s", uuid_utoa(inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } } @@ -2122,7 +2122,7 @@ marker_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; marker_conf_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred while " "fallocating a file ", @@ -2192,7 +2192,7 @@ marker_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; marker_conf_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred during discard", strerror(op_errno)); } @@ -2259,7 +2259,7 @@ marker_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; marker_conf_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred during zerofill", strerror(op_errno)); } @@ -2329,7 +2329,7 @@ call_from_sp_client_to_reset_tmfile(call_frame_t *frame, xlator_t *this, dict_t *dict) { int32_t fd = 0; - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int32_t op_errno = 0; data_t *data = NULL; marker_conf_t *priv = NULL; @@ -2344,7 +2344,7 @@ call_from_sp_client_to_reset_tmfile(call_frame_t *frame, xlator_t *this, return -1; if (frame->root->pid != GF_CLIENT_PID_GSYNCD) { - op_ret = -1; + op_ret = gf_failure; op_errno = EPERM; goto out; @@ -2361,14 +2361,14 @@ call_from_sp_client_to_reset_tmfile(call_frame_t *frame, xlator_t *this, } if (fd != -1 || errno == ENOENT) { - op_ret = 0; + op_ret = gf_zero_ret; op_errno = 0; } else { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; } } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; } out: @@ -2384,7 +2384,7 @@ marker_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; marker_conf_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred in " "setxattr ", @@ -2454,7 +2454,7 @@ int quota_xattr_cleaner_cbk(int ret, call_frame_t *frame, void *args) { dict_t *xdata = args; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = 0; op_ret = (ret < 0) ? -1 : 0; @@ -2607,7 +2607,7 @@ marker_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; marker_conf_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred in " "fsetxattr", @@ -2676,7 +2676,7 @@ marker_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; marker_conf_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred in " "fsetattr ", @@ -2746,7 +2746,7 @@ marker_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, frame->local = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred during setattr of %s", strerror(op_errno), (local ? local->loc.path : "")); } @@ -2805,7 +2805,7 @@ marker_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, marker_local_t *local = NULL; marker_conf_t *priv = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "%s occurred while " "removing extended attribute", @@ -2904,7 +2904,7 @@ marker_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = (marker_local_t *)frame->local; frame->local = NULL; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_TRACE, "lookup failed with %s", strerror(op_errno)); goto unwind; @@ -2912,7 +2912,7 @@ marker_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = marker_key_set_ver(this, dict); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -2920,7 +2920,7 @@ marker_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (dict && __has_quota_xattrs(dict)) { xattrs = dict_copy_with_ref(dict, NULL); if (!xattrs) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } else { marker_filter_internal_xattrs(this, xattrs); @@ -2936,7 +2936,7 @@ marker_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "mq_inode_ctx_new " "failed for %s", uuid_utoa(inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } } @@ -3038,7 +3038,7 @@ marker_build_ancestry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = marker_key_set_ver(this, entry->dict); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; break; } @@ -3114,7 +3114,7 @@ marker_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = marker_key_set_ver(this, entry->dict); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } diff --git a/xlators/features/metadisp/src/metadisp-create.c b/xlators/features/metadisp/src/metadisp-create.c index cfc24b9514..6e5bd7ed61 100644 --- a/xlators/features/metadisp/src/metadisp-create.c +++ b/xlators/features/metadisp/src/metadisp-create.c @@ -40,7 +40,7 @@ metadisp_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { METADISP_TRACE("%d %d", op_ret, op_errno); call_stub_t *stub = cookie; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { STACK_UNWIND_STRICT(create, frame, op_ret, op_errno, fd, inode, buf, preparent, postparent, xdata); return 0; diff --git a/xlators/features/metadisp/src/metadisp-fsync.c b/xlators/features/metadisp/src/metadisp-fsync.c index 1c28a9b49c..e5bdf12e0b 100644 --- a/xlators/features/metadisp/src/metadisp-fsync.c +++ b/xlators/features/metadisp/src/metadisp-fsync.c @@ -21,7 +21,7 @@ metadisp_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = cookie; } - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto unwind; } diff --git a/xlators/features/metadisp/src/metadisp-lookup.c b/xlators/features/metadisp/src/metadisp-lookup.c index ffdcb13afc..29f1d6e3b9 100644 --- a/xlators/features/metadisp/src/metadisp-lookup.c +++ b/xlators/features/metadisp/src/metadisp-lookup.c @@ -15,7 +15,7 @@ metadisp_backend_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, METADISP_TRACE("backend_lookup_cbk"); if (op_errno == ENOENT) { op_errno = ENODATA; - op_ret = -1; + op_ret = gf_failure; } STACK_UNWIND_STRICT(lookup, frame, op_ret, op_errno, inode, buf, xdata, postparent); @@ -52,7 +52,7 @@ metadisp_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, call_stub_t *stub = NULL; stub = cookie; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto unwind; } diff --git a/xlators/features/metadisp/src/metadisp-open.c b/xlators/features/metadisp/src/metadisp-open.c index d009e53297..3a9286ae75 100644 --- a/xlators/features/metadisp/src/metadisp-open.c +++ b/xlators/features/metadisp/src/metadisp-open.c @@ -12,7 +12,7 @@ metadisp_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = cookie; } - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto unwind; } diff --git a/xlators/features/metadisp/src/metadisp-setattr.c b/xlators/features/metadisp/src/metadisp-setattr.c index 6478e3f397..65b0d7e0d7 100644 --- a/xlators/features/metadisp/src/metadisp-setattr.c +++ b/xlators/features/metadisp/src/metadisp-setattr.c @@ -11,7 +11,7 @@ metadisp_backend_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, METADISP_TRACE("backend_setattr_cbk"); if (op_errno == ENOENT) { op_errno = ENODATA; - op_ret = -1; + op_ret = gf_failure; } STACK_UNWIND_STRICT(setattr, frame, op_ret, op_errno, statpre, statpost, xdata); @@ -51,7 +51,7 @@ metadisp_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, call_stub_t *stub = NULL; stub = cookie; - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto unwind; } diff --git a/xlators/features/metadisp/src/metadisp-stat.c b/xlators/features/metadisp/src/metadisp-stat.c index d7139e3c47..4cb1e90fc9 100644 --- a/xlators/features/metadisp/src/metadisp-stat.c +++ b/xlators/features/metadisp/src/metadisp-stat.c @@ -59,7 +59,7 @@ metadisp_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = cookie; } - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto unwind; } diff --git a/xlators/features/metadisp/src/metadisp-unlink.c b/xlators/features/metadisp/src/metadisp-unlink.c index 83980d1ae0..368eac2f75 100644 --- a/xlators/features/metadisp/src/metadisp-unlink.c +++ b/xlators/features/metadisp/src/metadisp-unlink.c @@ -34,7 +34,7 @@ metadisp_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = cookie; } - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto unwind; } @@ -47,7 +47,7 @@ metadisp_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = dict_get_uint32(xdata, GF_RESPONSE_LINK_COUNT_XDATA, &nlink); if (ret != 0) { op_errno = EINVAL; - op_ret = -1; + op_ret = gf_failure; goto unwind; } METADISP_TRACE("frontend hardlink count %d %d", ret, nlink); @@ -79,13 +79,13 @@ metadisp_unlink_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, stub = cookie; } - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto unwind; } // fail fast on empty gfid so we don't loop forever if (gf_uuid_is_null(buf->ia_gfid)) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENODATA; goto unwind; } diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c index c506d2e737..f158b965bd 100644 --- a/xlators/features/quiesce/src/quiesce.c +++ b/xlators/features/quiesce/src/quiesce.c @@ -123,7 +123,7 @@ gf_quiesce_failover_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { quiesce_priv_t *priv = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { /* Failure here doesn't mean the failover to another host didn't * succeed, we will know if failover succeeds or not by the * CHILD_UP/CHILD_DOWN event. A failure here indicates something @@ -317,7 +317,7 @@ quiesce_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_lookup_stub(frame, default_lookup_resume, &local->loc, local->dict); @@ -349,7 +349,7 @@ quiesce_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_stat_stub(frame, default_stat_resume, &local->loc, xdata); if (!stub) { @@ -377,7 +377,7 @@ quiesce_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_access_stub(frame, default_access_resume, &local->loc, local->flag, xdata); @@ -407,7 +407,7 @@ quiesce_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_readlink_stub(frame, default_readlink_resume, &local->loc, local->size, xdata); @@ -436,7 +436,7 @@ quiesce_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_open_stub(frame, default_open_resume, &local->loc, local->flag, local->fd, xdata); @@ -467,7 +467,7 @@ quiesce_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_readv_stub(frame, default_readv_resume, local->fd, local->size, local->offset, local->io_flag, @@ -499,7 +499,7 @@ quiesce_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_flush_stub(frame, default_flush_resume, local->fd, xdata); if (!stub) { @@ -528,7 +528,7 @@ quiesce_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_fsync_stub(frame, default_fsync_resume, local->fd, local->flag, xdata); @@ -558,7 +558,7 @@ quiesce_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_fstat_stub(frame, default_fstat_resume, local->fd, xdata); if (!stub) { @@ -587,7 +587,7 @@ quiesce_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_opendir_stub(frame, default_opendir_resume, &local->loc, local->fd, xdata); @@ -616,7 +616,7 @@ quiesce_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_fsyncdir_stub(frame, default_fsyncdir_resume, local->fd, local->flag, xdata); @@ -646,7 +646,7 @@ quiesce_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_statfs_stub(frame, default_statfs_resume, &local->loc, xdata); @@ -676,7 +676,7 @@ quiesce_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_fgetxattr_stub(frame, default_fgetxattr_resume, local->fd, local->name, xdata); @@ -706,7 +706,7 @@ quiesce_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_getxattr_stub(frame, default_getxattr_resume, &local->loc, local->name, xdata); @@ -737,7 +737,7 @@ quiesce_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_rchecksum_stub(frame, default_rchecksum_resume, local->fd, local->offset, local->flag, xdata); @@ -768,7 +768,7 @@ quiesce_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_readdir_stub(frame, default_readdir_resume, local->fd, local->size, local->offset, xdata); @@ -798,7 +798,7 @@ quiesce_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_readdirp_stub(frame, default_readdirp_resume, local->fd, local->size, local->offset, local->dict); @@ -833,7 +833,7 @@ quiesce_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_writev_stub (frame, default_writev_resume, local->fd, local->vector, local->flag, @@ -868,7 +868,7 @@ quiesce_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_xattrop_stub (frame, default_xattrop_resume, &local->loc, local->xattrop_flags, @@ -902,7 +902,7 @@ quiesce_fxattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_fxattrop_stub (frame, default_fxattrop_resume, local->fd, local->xattrop_flags, @@ -936,7 +936,7 @@ quiesce_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_lk_stub (frame, default_lk_resume, local->fd, local->flag, &local->flock, xdata); @@ -969,7 +969,7 @@ quiesce_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_inodelk_stub (frame, default_inodelk_resume, local->volname, &local->loc, @@ -1003,7 +1003,7 @@ quiesce_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_finodelk_stub (frame, default_finodelk_resume, local->volname, local->fd, @@ -1036,7 +1036,7 @@ quiesce_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_entrylk_stub (frame, default_entrylk_resume, local->volname, &local->loc, @@ -1069,7 +1069,7 @@ quiesce_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_fentrylk_stub (frame, default_fentrylk_resume, local->volname, local->fd, @@ -1103,7 +1103,7 @@ quiesce_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_setattr_stub (frame, default_setattr_resume, &local->loc, &local->stbuf, local->flag, xdata); @@ -1139,7 +1139,7 @@ quiesce_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_fsetattr_stub (frame, default_fsetattr_resume, local->fd, &local->stbuf, local->flag, xdata); @@ -2426,7 +2426,7 @@ quiesce_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if ((op_ret == -1) && (op_errno == ENOTCONN)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTCONN)) { /* Re-transmit (by putting in the queue) */ stub = fop_seek_stub(frame, default_seek_resume, local->fd, local->offset, local->what, xdata); diff --git a/xlators/features/quota/src/quota-enforcer-client.c b/xlators/features/quota/src/quota-enforcer-client.c index ff9bcafb69..ec79771473 100644 --- a/xlators/features/quota/src/quota-enforcer-client.c +++ b/xlators/features/quota/src/quota-enforcer-client.c @@ -140,7 +140,7 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, priv = this->private; if (-1 == req->rpc_status) { - rsp.op_ret = -1; + rsp.op_ret = gf_failure; op_errno = ENOTCONN; goto out; } @@ -149,7 +149,7 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, if (ret < 0) { gf_msg(this->name, GF_LOG_ERROR, 0, Q_MSG_XDR_DECODING_FAILED, "XDR decoding failed"); - rsp.op_ret = -1; + rsp.op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -157,10 +157,10 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, op_errno = gf_error_to_errno(rsp.op_errno); gf_stat_to_iatt(&rsp.postparent, &postparent); - if (rsp.op_ret == -1) + if IS_ERROR((rsp.op_ret)) goto out; - rsp.op_ret = -1; + rsp.op_ret = gf_failure; gf_stat_to_iatt(&rsp.stat, &stbuf); GF_PROTOCOL_DICT_UNSERIALIZE(frame->this, xdata, (rsp.xdata.xdata_val), @@ -171,12 +171,12 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, (gf_uuid_compare(stbuf.ia_gfid, inode->gfid) != 0)) { gf_msg_debug(frame->this->name, ESTALE, "gfid changed for %s", local->validate_loc.path); - rsp.op_ret = -1; + rsp.op_ret = gf_failure; op_errno = ESTALE; goto out; } - rsp.op_ret = 0; + rsp.op_ret = gf_zero_ret; out: rsp.op_errno = op_errno; @@ -224,7 +224,7 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, priv->quotad_conn_status = 0; } - if (rsp.op_ret == -1) { + if IS_ERROR((rsp.op_ret)) { /* any error other than ENOENT */ if (rsp.op_errno != ENOENT) gf_msg( diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 8e2fae9736..5df118c04d 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -381,13 +381,13 @@ check_ancestory_continue(struct list_head *parents, inode_t *inode, "Hence, failing fop with EIO", uuid_utoa(inode->gfid)); op_errno = EIO; - op_ret = -1; + op_ret = gf_failure; } LOCK(&local->lock); { link_count = --local->link_count; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; } @@ -433,7 +433,7 @@ check_ancestory_2_cbk(struct list_head *parents, inode_t *inode, this_inode = data; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; if (parents == NULL || list_empty(parents)) { @@ -560,7 +560,7 @@ quota_handle_validate_error(call_frame_t *frame, gf_return_t op_ret, if (local == NULL) goto out; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { LOCK(&local->lock); { local->op_ret = op_ret; @@ -589,7 +589,7 @@ quota_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto unwind; } @@ -738,10 +738,10 @@ quota_build_ancestry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; frame->local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto err; - if ((op_ret > 0) && (entries != NULL)) { +if (IS_SUCCESS(op_ret) && (entries != NULL)) { list_for_each_entry(entry, &entries->list, list) { if (__is_root_gfid(entry->inode->gfid)) { @@ -865,7 +865,7 @@ quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk, quota_local_t *local = NULL; call_frame_t *new_frame = NULL; int op_errno = ENOMEM; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; xlator_t *this = NULL; dict_t *xdata_req = NULL; @@ -894,19 +894,19 @@ quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk, local->loc.inode = inode_ref(inode); op_ret = dict_set_int8(xdata_req, QUOTA_LIMIT_KEY, 1); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { op_errno = -op_ret; goto err; } op_ret = dict_set_int8(xdata_req, QUOTA_LIMIT_OBJECTS_KEY, 1); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { op_errno = -op_ret; goto err; } op_ret = dict_set_int8(xdata_req, GET_ANCESTRY_DENTRY_KEY, 1); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { op_errno = -op_ret; goto err; } @@ -920,7 +920,7 @@ quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk, STACK_WIND(new_frame, quota_build_ancestry_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->readdirp, fd, 0, 0, xdata_req); - op_ret = 0; + op_ret = gf_zero_ret; err: if (fd) @@ -929,7 +929,7 @@ quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk, if (xdata_req) dict_unref(xdata_req); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { ancestry_cbk(NULL, NULL, gf_failure, op_errno, data); if (new_frame) { @@ -1033,8 +1033,8 @@ quota_check_limit_continuation(struct list_head *parents, inode_t *inode, else par_local = local; - if ((op_ret < 0) || list_empty(parents)) { - if (op_ret >= 0) { + if (IS_ERROR((op_ret)) || list_empty(parents)) { + if (IS_SUCCESS(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, EIO, Q_MSG_ANCESTRY_BUILD_FAILED, "Couldn't build ancestry for inode (gfid:%s). " "Without knowing ancestors till root, quota" @@ -1126,7 +1126,7 @@ quota_check_object_limit(call_frame_t *frame, quota_inode_ctx_t *ctx, } if (hard_limit_exceeded) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EDQUOT; *op_errno = EDQUOT; goto out; @@ -1193,7 +1193,7 @@ quota_check_size_limit(call_frame_t *frame, quota_inode_ctx_t *ctx, } if (hard_limit_exceeded) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EDQUOT; space_available = ctx->hard_lim - ctx->size; @@ -1596,7 +1596,7 @@ quota_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, op_ret = quota_fill_inodectx(this, inode, dict, &local->loc, buf, &op_errno); - if (op_ret < 0) + if (IS_ERROR(op_ret)) op_errno = ENOMEM; } @@ -1688,7 +1688,7 @@ quota_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if ((op_ret < 0) || (local == NULL) || (postbuf == NULL)) { + if (IS_ERROR((op_ret)) || (local == NULL) || (postbuf == NULL)) { goto out; } @@ -1738,14 +1738,14 @@ quota_writev_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, GF_VALIDATE_OR_GOTO("quota", local, unwind); - if (local->op_ret == -1) { + if IS_ERROR((local->op_ret)) { op_errno = local->op_errno; if ((op_errno == EDQUOT) && (local->space_available > 0)) { new_count = iov_subset(vector, count, 0, local->space_available, &new_vector, 0); if (new_count < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unwind; } @@ -1952,7 +1952,7 @@ quota_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, op_errno = local->op_errno; - if (local->op_ret == -1) { + if IS_ERROR((local->op_ret)) { goto unwind; } @@ -2044,7 +2044,7 @@ quota_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_dentry_t *dentry = NULL; local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto unwind; } @@ -2054,7 +2054,7 @@ quota_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "cannot create quota " "context in inode(gfid:%s)", uuid_utoa(inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -2070,7 +2070,7 @@ quota_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "cannot create a new dentry " "(name:%s) for inode(gfid:%s)", local->loc.name, uuid_utoa(local->loc.inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unlock; } @@ -2096,7 +2096,7 @@ quota_create_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, GF_VALIDATE_OR_GOTO("quota", local, unwind); - if (local->op_ret == -1) { + if IS_ERROR((local->op_ret)) { op_errno = local->op_errno; goto unwind; } @@ -2181,7 +2181,7 @@ quota_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_inode_ctx_t *ctx = NULL; uint64_t value = 0; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -2261,7 +2261,7 @@ quota_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_dentry_t *dentry = NULL; char found = 0; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -2303,7 +2303,7 @@ quota_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "cannot create a new dentry (name:%s)" "for inode(gfid:%s)", local->loc.name, uuid_utoa(local->loc.inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unlock; } @@ -2334,7 +2334,7 @@ quota_link_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, op_errno = local->op_errno; - if (local->op_ret == -1) { + if IS_ERROR((local->op_ret)) { goto unwind; } @@ -2362,7 +2362,7 @@ quota_link_continue(call_frame_t *frame) local = frame->local; this = THIS; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { op_errno = local->op_errno; goto err; } @@ -2543,7 +2543,7 @@ quota_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_dentry_t *old_dentry = NULL, *dentry = NULL; char new_dentry_found = 0; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -2608,7 +2608,7 @@ quota_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "for inode(gfid:%s)", local->newloc.name, uuid_utoa(local->newloc.inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unlock; } @@ -2639,7 +2639,7 @@ quota_rename_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, op_errno = local->op_errno; - if (local->op_ret == -1) { + if IS_ERROR((local->op_ret)) { goto unwind; } @@ -2671,7 +2671,7 @@ quota_rename_get_size_cbk(call_frame_t *frame, void *cookie, xlator_t *this, GF_ASSERT(local); local->link_count = 1; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; ret = dict_get_bin(xdata, QUOTA_SIZE_KEY, (void **)&size); @@ -2704,7 +2704,7 @@ quota_rename_continue(call_frame_t *frame) local = frame->local; this = THIS; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { op_errno = local->op_errno; goto err; } @@ -2866,7 +2866,7 @@ quota_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_dentry_t *dentry = NULL; int32_t ret = -1; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -2894,7 +2894,7 @@ quota_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "cannot create " "a new dentry (name:%s) for inode(gfid:%s)", local->loc.name, uuid_utoa(local->loc.inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; } } @@ -2918,7 +2918,7 @@ quota_symlink_helper(call_frame_t *frame, xlator_t *this, const char *linkpath, GF_VALIDATE_OR_GOTO("quota", local, unwind); - if (local->op_ret == -1) { + if IS_ERROR((local->op_ret)) { op_errno = local->op_errno; goto unwind; } @@ -2999,7 +2999,7 @@ quota_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3078,7 +3078,7 @@ quota_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3241,7 +3241,7 @@ quota_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3319,7 +3319,7 @@ quota_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3392,7 +3392,7 @@ quota_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3470,7 +3470,7 @@ quota_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3542,7 +3542,7 @@ quota_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3613,7 +3613,7 @@ quota_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3694,7 +3694,7 @@ quota_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3773,7 +3773,7 @@ quota_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_dentry_t *dentry = NULL; local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto unwind; } @@ -3783,7 +3783,7 @@ quota_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "cannot create quota context in " "inode(gfid:%s)", uuid_utoa(inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unwind; } @@ -3799,7 +3799,7 @@ quota_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "cannot create a new dentry " "(name:%s) for inode(gfid:%s)", local->loc.name, uuid_utoa(local->loc.inode->gfid)); - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; goto unlock; } @@ -3824,7 +3824,7 @@ quota_mknod_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, GF_VALIDATE_OR_GOTO("quota", local, unwind); - if (local->op_ret == -1) { + if IS_ERROR((local->op_ret)) { op_errno = local->op_errno; goto unwind; } @@ -3904,7 +3904,7 @@ quota_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_inode_ctx_t *ctx = NULL; int ret = 0; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -3938,7 +3938,7 @@ quota_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, { quota_priv_t *priv = NULL; int op_errno = EINVAL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int64_t hard_lim = -1; int64_t soft_lim = -1; int64_t object_hard_limit = -1; @@ -4006,7 +4006,7 @@ quota_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_inode_ctx_t *ctx = NULL; quota_local_t *local = NULL; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; local = frame->local; @@ -4014,7 +4014,7 @@ quota_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; op_ret = quota_inode_ctx_get(local->loc.inode, this, &ctx, 1); - if ((op_ret < 0) || (ctx == NULL)) { + if (IS_ERROR((op_ret)) || (ctx == NULL)) { op_errno = ENOMEM; goto out; } @@ -4038,7 +4038,7 @@ quota_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int flags, dict_t *xdata) { quota_priv_t *priv = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; quota_local_t *local = NULL; int64_t hard_lim = -1; @@ -4156,7 +4156,7 @@ quota_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { quota_priv_t *priv = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; priv = this->private; @@ -4202,7 +4202,7 @@ quota_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* This fop will fail mostly in case of client disconnect, * which is already logged. Hence, not logging here */ - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto unwind; /* * We should never get here unless quota_statfs (below) sent us a @@ -4296,7 +4296,7 @@ quota_statfs_validate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto resume; GF_ASSERT(local); @@ -4352,8 +4352,8 @@ quota_get_limit_dir_continuation(struct list_head *parents, inode_t *inode, frame = data; this = THIS; - if ((op_ret < 0) || list_empty(parents)) { - if (op_ret >= 0) { + if (IS_ERROR((op_ret)) || list_empty(parents)) { + if (IS_SUCCESS(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, EIO, Q_MSG_ANCESTRY_BUILD_FAILED, "Couldn't build ancestry for inode (gfid:%s). " "Without knowing ancestors till root, quota " @@ -4652,7 +4652,7 @@ quota_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if ((op_ret < 0) || (local == NULL)) { + if (IS_ERROR((op_ret)) || (local == NULL)) { goto out; } @@ -4696,7 +4696,7 @@ quota_fallocate_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, GF_VALIDATE_OR_GOTO("quota", local, unwind); - if (local->op_ret == -1) { + if IS_ERROR((local->op_ret)) { op_errno = local->op_errno; if (op_errno == ENOENT || op_errno == ESTALE) { /* We may get ENOENT/ESTALE in case of below scenario diff --git a/xlators/features/quota/src/quotad-aggregator.c b/xlators/features/quota/src/quotad-aggregator.c index 75d47867b5..50a8c3c1cf 100644 --- a/xlators/features/quota/src/quotad-aggregator.c +++ b/xlators/features/quota/src/quotad-aggregator.c @@ -139,7 +139,7 @@ quotad_aggregator_getlimit_cbk(xlator_t *this, call_frame_t *frame, int ret = -1; int type = 0; - if (!rsp || (rsp->op_ret == -1)) + if (!rsp || IS_ERROR((rsp->op_ret))) goto reply; GF_PROTOCOL_DICT_UNSERIALIZE(frame->this, xdata, (rsp->xdata.xdata_val), @@ -281,7 +281,7 @@ quotad_aggregator_getlimit(rpcsvc_request_t *req) err: cli_rsp.op_errno = op_errno; errx: - cli_rsp.op_ret = -1; + cli_rsp.op_ret = gf_failure; cli_rsp.op_errstr = ""; quotad_aggregator_getlimit_cbk(this, frame, &cli_rsp); @@ -370,7 +370,7 @@ quotad_aggregator_lookup(rpcsvc_request_t *req) return ret; err: - rsp.op_ret = -1; + rsp.op_ret = gf_failure; rsp.op_errno = op_errno; quotad_aggregator_lookup_cbk(this, frame, &rsp); diff --git a/xlators/features/quota/src/quotad.c b/xlators/features/quota/src/quotad.c index 9fcc384cb0..bb721527bb 100644 --- a/xlators/features/quota/src/quotad.c +++ b/xlators/features/quota/src/quotad.c @@ -148,7 +148,7 @@ qd_nameless_lookup(xlator_t *this, call_frame_t *frame, char *gfid, return 0; out: - rsp.op_ret = -1; + rsp.op_ret = gf_failure; rsp.op_errno = op_errno; lookup_cbk(this, frame, &rsp); diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c index 67250aadfc..31be87ab8f 100644 --- a/xlators/features/read-only/src/worm.c +++ b/xlators/features/read-only/src/worm.c @@ -443,7 +443,7 @@ worm_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, // In case of an error exit because fd can be NULL and this would // cause an segfault when performing fsetxattr . We explicitly // unwind to avoid future problems - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { goto out; } diff --git a/xlators/features/sdfs/src/sdfs.c b/xlators/features/sdfs/src/sdfs.c index 46ff3913a4..8778c1d889 100644 --- a/xlators/features/sdfs/src/sdfs.c +++ b/xlators/features/sdfs/src/sdfs.c @@ -224,7 +224,7 @@ sdfs_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->stub = NULL; call_resume(stub); } else { - if (op_ret < 0) + if (IS_ERROR(op_ret)) gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Unlocking entry lock failed for %s", local->loc.name); @@ -266,7 +266,7 @@ sdfs_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, gf_uuid_unparse(loc->pargfid, gfid); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Acquiring entry lock failed for directory %s " "with parent gfid %s", @@ -357,7 +357,7 @@ sdfs_rmdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, gf_uuid_unparse(loc->pargfid, gfid); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Acquiring entry lock failed for directory %s " "with parent gfid %s", @@ -447,7 +447,7 @@ sdfs_create_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, gf_uuid_unparse(loc->pargfid, gfid); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Acquiring entry lock failed for directory %s " "with parent gfid %s", @@ -538,7 +538,7 @@ sdfs_unlink_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, gf_uuid_unparse(loc->pargfid, gfid); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Acquiring entry lock failed for directory %s " "with parent gfid %s", @@ -627,7 +627,7 @@ sdfs_symlink_helper(call_frame_t *frame, xlator_t *this, const char *linkname, gf_uuid_unparse(loc->pargfid, gfid); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Acquiring entry lock failed for directory %s " "with parent gfid %s", @@ -701,7 +701,7 @@ sdfs_common_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, locks = local->lock; lk_index = (long)cookie; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; } else { @@ -721,7 +721,7 @@ sdfs_common_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->stub = NULL; call_resume(stub); } else { - if (local->op_ret < 0) + if IS_ERROR((local->op_ret)) gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "unlocking entry lock failed "); SDFS_STACK_DESTROY(frame); @@ -773,7 +773,7 @@ sdfs_link_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, local = frame->local; locks = local->lock; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Acquiring entry lock failed"); goto err; @@ -962,7 +962,7 @@ sdfs_mknod_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, gf_uuid_unparse(loc->pargfid, gfid); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Acquiring entry lock failed for directory %s " "with parent gfid %s", @@ -1069,7 +1069,7 @@ sdfs_rename_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, local = frame->local; lock = local->lock; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Acquiring entry lock failed "); goto err; @@ -1233,7 +1233,7 @@ sdfs_lookup_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, gf_uuid_unparse(loc->pargfid, gfid); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Acquiring entry lock failed for directory %s " "with parent gfid %s", @@ -1332,7 +1332,7 @@ sdfs_readdirp_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, gf_uuid_unparse(fd->inode->gfid, gfid); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { gf_msg(this->name, GF_LOG_ERROR, 0, SDFS_MSG_ENTRYLK_ERROR, "Acquiring entry lock failed for directory %s " "with parent gfid %s", diff --git a/xlators/features/selinux/src/selinux.c b/xlators/features/selinux/src/selinux.c index a378f7ff54..d2b732a874 100644 --- a/xlators/features/selinux/src/selinux.c +++ b/xlators/features/selinux/src/selinux.c @@ -41,7 +41,7 @@ selinux_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { selinux_priv_t *priv = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; char *xattr_name = (char *)name; @@ -94,7 +94,7 @@ selinux_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { selinux_priv_t *priv = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; char *xattr_name = (char *)name; @@ -132,7 +132,7 @@ selinux_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, int flags, dict_t *xdata) { selinux_priv_t *priv = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; int32_t ret = -1; @@ -170,7 +170,7 @@ selinux_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int flags, dict_t *xdata) { selinux_priv_t *priv = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; int32_t ret = -1; diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 28f61ea4b9..ca95df9a28 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -941,7 +941,7 @@ shard_evicted_inode_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; - if (anon_fd == NULL || op_ret < 0) { + if (anon_fd == NULL || IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, op_errno, SHARD_MSG_MEMALLOC_FAILED, "fsync failed on shard"); goto out; @@ -1032,7 +1032,7 @@ shard_common_resolve_shards(call_frame_t *frame, xlator_t *this, shard_idx_iter = local->first_block; res_inode = local->resolver_base_inode; - if ((local->op_ret < 0) || (local->resolve_not)) + if IS_ERROR(((local->op_ret)) || (local->resolve_not)) goto out; /* If this prealloc FOP is for fresh file creation, then the size of the @@ -1122,7 +1122,7 @@ shard_update_file_size_cbk(call_frame_t *frame, void *cookie, xlator_t *this, else if (local->loc.inode) inode = local->loc.inode; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, op_errno, SHARD_MSG_UPDATE_FILE_SIZE_FAILED, "Update to file size" @@ -1134,7 +1134,7 @@ shard_update_file_size_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } if (shard_modify_size_and_block_count(&local->postbuf, dict)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -1187,7 +1187,7 @@ shard_update_file_size(call_frame_t *frame, xlator_t *this, fd_t *fd, xattr_req = dict_new(); if (!xattr_req) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto out; } @@ -1209,7 +1209,7 @@ shard_update_file_size(call_frame_t *frame, xlator_t *this, fd_t *fd, if (ret) { gf_msg(this->name, GF_LOG_ERROR, 0, SHARD_MSG_SIZE_SET_FAILED, "Failed to set size attrs for %s", uuid_utoa(inode->gfid)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto out; } @@ -1220,7 +1220,7 @@ shard_update_file_size(call_frame_t *frame, xlator_t *this, fd_t *fd, "Failed to set key %s into dict. gfid=%s", GF_XATTR_SHARD_FILE_SIZE, uuid_utoa(inode->gfid)); GF_FREE(size_attr); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto out; } @@ -1337,7 +1337,7 @@ shard_refresh_internal_dir(call_frame_t *frame, xlator_t *this, inode = inode_find(this->itable, gfid); if (!shard_inode_ctx_needs_lookup(inode, this)) { - local->op_ret = 0; + local->op_ret = gf_zero_ret; goto out; } @@ -1383,7 +1383,7 @@ shard_lookup_internal_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, "is not a directory. Please remove it from all bricks " "and try again", shard_internal_dir_string(type)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EIO; goto unwind; } @@ -1425,7 +1425,7 @@ shard_lookup_internal_dir(call_frame_t *frame, xlator_t *this, xattr_req = dict_new(); if (!xattr_req) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -1449,7 +1449,7 @@ shard_lookup_internal_dir(call_frame_t *frame, xlator_t *this, gf_msg(this->name, GF_LOG_ERROR, 0, SHARD_MSG_DICT_OP_FAILED, "Failed to set gfid of %s into dict", shard_internal_dir_string(type)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } else { @@ -1581,7 +1581,7 @@ shard_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; if (IA_ISDIR(buf->ia_type)) @@ -1705,7 +1705,7 @@ shard_set_iattr_invoke_post_handler(call_frame_t *frame, xlator_t *this, 0, }; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, op_errno, SHARD_MSG_BASE_FILE_LOOKUP_FAILED, "Lookup on base file" @@ -1718,7 +1718,7 @@ shard_set_iattr_invoke_post_handler(call_frame_t *frame, xlator_t *this, local->prebuf = *buf; if (shard_modify_size_and_block_count(&local->prebuf, xdata)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; goto unwind; } @@ -1733,7 +1733,7 @@ shard_set_iattr_invoke_post_handler(call_frame_t *frame, xlator_t *this, "Failed to set inode" " write params into inode ctx for %s", uuid_utoa(buf->ia_gfid)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto unwind; } @@ -1809,7 +1809,7 @@ shard_refresh_base_file(call_frame_t *frame, xlator_t *this, loc_t *loc, xattr_req = dict_new(); if (!xattr_req) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto out; } @@ -1840,7 +1840,7 @@ shard_post_fstat_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret >= 0) + if IS_SUCCESS((local->op_ret)) shard_inode_ctx_set(local->fd->inode, this, &local->prebuf, 0, SHARD_LOOKUP_MASK); @@ -1856,7 +1856,7 @@ shard_post_stat_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret >= 0) + if IS_SUCCESS((local->op_ret)) shard_inode_ctx_set(local->loc.inode, this, &local->prebuf, 0, SHARD_LOOKUP_MASK); @@ -1875,7 +1875,7 @@ shard_common_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, op_errno, SHARD_MSG_STAT_FAILED, "stat failed: %s", local->fd ? uuid_utoa(local->fd->inode->gfid) @@ -1887,7 +1887,7 @@ shard_common_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->prebuf = *buf; if (shard_modify_size_and_block_count(&local->prebuf, xdata)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; goto unwind; } @@ -2042,7 +2042,7 @@ shard_truncate_last_shard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, inode = (local->fop == GF_FOP_TRUNCATE) ? local->loc.inode : local->fd->inode; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, op_errno, SHARD_MSG_TRUNCATE_LAST_SHARD_FAILED, "truncate on last" @@ -2129,7 +2129,7 @@ shard_truncate_htol_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; goto done; @@ -2248,7 +2248,7 @@ shard_truncate_htol(call_frame_t *frame, xlator_t *this, inode_t *inode) "Inode path failed" " on %s. Base file gfid = %s", bname, uuid_utoa(inode->gfid)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; loc_wipe(&loc); wind_failed = _gf_true; @@ -2302,7 +2302,7 @@ shard_post_lookup_shards_truncate_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, local->op_ret, local->op_errno); return 0; @@ -2379,7 +2379,7 @@ shard_common_lookup_shards_cbk(call_frame_t *frame, void *cookie, else gf_uuid_copy(gfid, local->base_gfid); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { /* Ignore absence of shards in the backend in truncate fop. */ switch (local->fop) { case GF_FOP_TRUNCATE: @@ -2531,7 +2531,7 @@ shard_common_lookup_shards(call_frame_t *frame, xlator_t *this, inode_t *inode, "Inode path failed" " on %s, base file gfid = %s", bname, uuid_utoa(gfid)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; loc_wipe(&loc); wind_failed = _gf_true; @@ -2547,7 +2547,7 @@ shard_common_lookup_shards(call_frame_t *frame, xlator_t *this, inode_t *inode, xattr_req = shard_create_gfid_dict(local->xattr_req); if (!xattr_req) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; wind_failed = _gf_true; loc_wipe(&loc); @@ -2583,7 +2583,7 @@ shard_post_resolve_truncate_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { if (local->op_errno == ENOENT) { /* If lookup on /.shard fails with ENOENT, it means that * the file was 0-byte in size but truncated sometime in @@ -2595,7 +2595,7 @@ shard_post_resolve_truncate_handler(call_frame_t *frame, xlator_t *this) local->first_block = local->last_block = 0; local->num_blocks = 1; local->call_count = 0; - local->op_ret = 0; + local->op_ret = gf_zero_ret; local->postbuf.ia_size = local->offset; shard_update_file_size(frame, this, local->fd, &local->loc, shard_post_update_size_truncate_handler); @@ -2702,7 +2702,7 @@ shard_post_lookup_truncate_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, local->op_ret, local->op_errno); return 0; @@ -2875,7 +2875,7 @@ shard_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto unwind; ret = shard_inode_ctx_set(inode, this, buf, local->block_size, @@ -2928,7 +2928,7 @@ shard_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, shard_local_t *local = NULL; local = frame->local; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto err; shard_inode_ctx_set(inode, this, buf, 0, @@ -2951,7 +2951,7 @@ shard_post_lookup_link_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { SHARD_STACK_UNWIND(link, frame, local->op_ret, local->op_errno, NULL, NULL, NULL, NULL, NULL); return 0; @@ -3027,12 +3027,12 @@ shard_post_lookup_shards_unlink_handler(call_frame_t *frame, xlator_t *this) else gf_uuid_copy(gfid, local->base_gfid); - if ((local->op_ret < 0) && (local->op_errno != ENOENT)) { + if IS_ERROR(((local->op_ret)) && (local->op_errno != ENOENT)) { gf_msg(this->name, GF_LOG_ERROR, local->op_errno, SHARD_MSG_FOP_FAILED, "failed to delete shards of %s", uuid_utoa(gfid)); return 0; } - local->op_ret = 0; + local->op_ret = gf_zero_ret; local->op_errno = 0; shard_unlink_shards_do(frame, this, local->resolver_base_inode); @@ -3158,7 +3158,7 @@ shard_unlink_shards_do_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; goto done; @@ -3241,7 +3241,7 @@ shard_unlink_shards_do(call_frame_t *frame, xlator_t *this, inode_t *inode) "Inode path failed" " on %s, base file gfid = %s", bname, uuid_utoa(gfid)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; loc_wipe(&loc); wind_failed = _gf_true; @@ -3849,7 +3849,7 @@ shard_rename_src_base_file(call_frame_t *frame, xlator_t *this) "Inode path failed" " on pargfid=%s bname=%s", uuid_utoa(tmp_loc.parent->gfid), local->loc2.name); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -3889,7 +3889,7 @@ shard_set_size_attrs_on_marker_file_cbk(call_frame_t *frame, void *cookie, priv = this->private; local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, op_errno, SHARD_MSG_FOP_FAILED, "Xattrop on marker file failed " "while performing %s; entry gfid=%s", @@ -3954,7 +3954,7 @@ shard_lookup_marker_file_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; priv = this->private; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { gf_msg(this->name, GF_LOG_ERROR, op_errno, SHARD_MSG_FOP_FAILED, "Lookup on marker file failed " "while performing %s; entry gfid=%s", @@ -4009,7 +4009,7 @@ shard_create_marker_file_under_remove_me_cbk( priv = this->private; SHARD_UNSET_ROOT_FS_ID(frame, local); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { if ((op_errno != EEXIST) && (op_errno != ENODATA)) { local->op_ret = op_ret; local->op_errno = op_errno; @@ -4117,7 +4117,7 @@ shard_unlink_base_file_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; } else { @@ -4133,14 +4133,14 @@ shard_unlink_base_file_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (local->entrylk_frame) { ret = shard_unlock_entrylk(frame, this); if (ret < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = -ret; } } ret = shard_unlock_inodelk(frame, this); if (ret < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = -ret; } @@ -4230,7 +4230,7 @@ shard_acquire_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, main_frame = local->main_frame; main_local = main_frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(main_local->fop, main_frame, op_ret, op_errno); return 0; @@ -4295,7 +4295,7 @@ shard_post_lookup_base_shard_rm_handler(call_frame_t *frame, xlator_t *this) priv = this->private; local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, gf_failure, local->op_errno); return 0; } @@ -4355,7 +4355,7 @@ shard_acquire_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, main_frame = local->main_frame; main_local = main_frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(main_local->fop, main_frame, op_ret, op_errno); return 0; @@ -4416,7 +4416,7 @@ shard_post_mkdir_rm_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, gf_failure, local->op_errno); return 0; } @@ -4439,7 +4439,7 @@ shard_pre_mkdir_rm_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, gf_failure, local->op_errno); return 0; } @@ -4542,7 +4542,7 @@ shard_rename_src_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; goto err; @@ -4567,14 +4567,14 @@ shard_rename_src_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (local->entrylk_frame) { ret = shard_unlock_entrylk(frame, this); if (ret < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = -ret; } } ret = shard_unlock_inodelk(frame, this); if (ret < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = -ret; goto err; } @@ -4606,7 +4606,7 @@ shard_post_lookup_dst_base_file_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, local->op_ret, local->op_errno); return 0; @@ -4711,7 +4711,7 @@ shard_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret == -1) + if (IS_ERROR(op_ret)) goto unwind; ret = shard_inode_ctx_set(inode, this, stbuf, local->block_size, @@ -4797,16 +4797,16 @@ shard_readv_do_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* If shard has already seen a failure here before, there is no point * in aggregating subsequent reads, so just go to out. */ - if (local->op_ret < 0) + if IS_ERROR((local->op_ret)) goto out; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; goto out; } - if (local->op_ret >= 0) + if IS_SUCCESS((local->op_ret)) local->op_ret += op_ret; shard_inode_ctx_get(anon_fd->inode, this, &ctx); @@ -4838,7 +4838,7 @@ shard_readv_do_cbk(call_frame_t *frame, void *cookie, xlator_t *this, call_count = shard_call_count_return(frame); if (call_count == 0) { SHARD_UNSET_ROOT_FS_ID(frame, local); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(GF_FOP_READ, frame, local->op_ret, local->op_errno); } else { @@ -4908,7 +4908,7 @@ shard_readv_do(call_frame_t *frame, xlator_t *this) } else { anon_fd = fd_anonymous(local->inode_list[i]); if (!anon_fd) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; wind_failed = _gf_true; shard_readv_do_cbk(frame, (void *)(long)anon_fd, this, gf_failure, @@ -4942,7 +4942,7 @@ shard_common_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { if (op_errno == EEXIST) { LOCK(&frame->lock); { @@ -5015,7 +5015,7 @@ shard_common_resume_mknod(call_frame_t *frame, xlator_t *this, "Failed to get inode " "ctx for %s", uuid_utoa(fd->inode->gfid)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -5039,7 +5039,7 @@ shard_common_resume_mknod(call_frame_t *frame, xlator_t *this, xattr_req = shard_create_gfid_dict(local->xattr_req); if (!xattr_req) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; wind_failed = _gf_true; shard_common_mknod_cbk(frame, (void *)(long)shard_idx_iter, this, @@ -5056,7 +5056,7 @@ shard_common_resume_mknod(call_frame_t *frame, xlator_t *this, "Inode path failed" "on %s, base file gfid = %s", bname, uuid_utoa(fd->inode->gfid)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; wind_failed = _gf_true; loc_wipe(&loc); @@ -5105,7 +5105,7 @@ shard_post_lookup_shards_readv_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(GF_FOP_READ, frame, local->op_ret, local->op_errno); return 0; @@ -5127,7 +5127,7 @@ shard_post_mknod_readv_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(GF_FOP_READ, frame, local->op_ret, local->op_errno); return 0; @@ -5150,7 +5150,7 @@ shard_post_resolve_readv_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { if (local->op_errno != ENOENT) { shard_common_failure_unwind(GF_FOP_READ, frame, local->op_ret, local->op_errno); @@ -5190,7 +5190,7 @@ shard_post_lookup_readv_handler(call_frame_t *frame, xlator_t *this) priv = this->private; local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(GF_FOP_READ, frame, local->op_ret, local->op_errno); return 0; @@ -5340,7 +5340,7 @@ shard_common_inode_write_post_update_size_handler(call_frame_t *frame, local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, local->op_ret, local->op_errno); } else { @@ -5421,7 +5421,7 @@ shard_common_inode_write_do_cbk(call_frame_t *frame, void *cookie, LOCK(&frame->lock); { - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; } else { @@ -5444,7 +5444,7 @@ shard_common_inode_write_do_cbk(call_frame_t *frame, void *cookie, call_count = shard_call_count_return(frame); if (call_count == 0) { SHARD_UNSET_ROOT_FS_ID(frame, local); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(fop, frame, local->op_ret, local->op_errno); } else { @@ -5540,7 +5540,7 @@ shard_common_inode_write_do(call_frame_t *frame, xlator_t *this) " into " "dict: %s", uuid_utoa(fd->inode->gfid)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; local->call_count = 1; shard_common_inode_write_do_cbk(frame, (void *)(long)0, this, gf_failure, @@ -5570,7 +5570,7 @@ shard_common_inode_write_do(call_frame_t *frame, xlator_t *this) count = iov_subset(local->vector, local->count, vec_offset, shard_write_size, &vec, 0); if (count < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; wind_failed = _gf_true; shard_common_inode_write_do_cbk(frame, (void *)(long)0, this, @@ -5584,7 +5584,7 @@ shard_common_inode_write_do(call_frame_t *frame, xlator_t *this) } else { anon_fd = fd_anonymous(local->inode_list[i]); if (!anon_fd) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; wind_failed = _gf_true; GF_FREE(vec); @@ -5629,7 +5629,7 @@ shard_common_inode_write_post_lookup_shards_handler(call_frame_t *frame, local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, local->op_ret, local->op_errno); return 0; @@ -5652,7 +5652,7 @@ shard_common_inode_write_post_mknod_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, local->op_ret, local->op_errno); return 0; @@ -5678,7 +5678,7 @@ shard_common_inode_write_post_resolve_handler(call_frame_t *frame, local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, local->op_ret, local->op_errno); return 0; @@ -5704,7 +5704,7 @@ shard_common_inode_write_post_lookup_handler(call_frame_t *frame, shard_local_t *local = frame->local; shard_priv_t *priv = this->private; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, local->op_ret, local->op_errno); return 0; @@ -5768,7 +5768,7 @@ shard_mkdir_internal_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, SHARD_UNSET_ROOT_FS_ID(frame, local); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { if (op_errno != EEXIST) { local->op_ret = op_ret; local->op_errno = op_errno; @@ -5861,7 +5861,7 @@ shard_mkdir_internal_dir(call_frame_t *frame, xlator_t *this, err: if (xattr_req) dict_unref(xattr_req); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; if (free_gfid) GF_FREE(gfid); @@ -5942,12 +5942,12 @@ shard_fsync_shards_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; base_inode = local->fd->inode; - if (local->op_ret < 0) + if IS_ERROR((local->op_ret)) goto out; LOCK(&frame->lock); { - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; UNLOCK(&frame->lock); @@ -5988,7 +5988,7 @@ shard_fsync_shards_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (call_count != 0) return 0; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(GF_FOP_FSYNC, frame, local->op_ret, local->op_errno); } else { @@ -6020,7 +6020,7 @@ shard_post_lookup_fsync_handler(call_frame_t *frame, xlator_t *this) local->postbuf = local->prebuf; INIT_LIST_HEAD(©); - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(GF_FOP_FSYNC, frame, local->op_ret, local->op_errno); return 0; @@ -6053,7 +6053,7 @@ shard_post_lookup_fsync_handler(call_frame_t *frame, xlator_t *this) GF_ASSERT(fsync_count > 0); anon_fd = fd_anonymous(iter->inode); if (!anon_fd) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; gf_msg(this->name, GF_LOG_WARNING, ENOMEM, SHARD_MSG_MEMALLOC_FAILED, @@ -6070,7 +6070,7 @@ shard_post_lookup_fsync_handler(call_frame_t *frame, xlator_t *this) "Failed to set fd " "ctx for shard inode gfid=%s", uuid_utoa(iter->inode->gfid)); - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; shard_fsync_shards_cbk(frame, (void *)(long)anon_fd, this, gf_failure, ENOMEM, NULL, NULL, NULL); @@ -6147,7 +6147,7 @@ shard_readdir_past_dot_shard_cbk(call_frame_t *frame, void *cookie, local = frame->local; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; list_for_each_entry_safe(entry, tmp, (&orig_entries->list), list) @@ -6194,7 +6194,7 @@ shard_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; fd = local->fd; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; list_for_each_entry_safe(entry, tmp, (&orig_entries->list), list) @@ -6338,7 +6338,7 @@ shard_modify_and_set_iatt_in_dict(dict_t *xdata, shard_local_t *local, tmpbuf = data_to_iatt(data, key); stbuf = GF_MALLOC(sizeof(struct iatt), gf_common_mt_char); if (stbuf == NULL) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -6347,7 +6347,7 @@ shard_modify_and_set_iatt_in_dict(dict_t *xdata, shard_local_t *local, stbuf->ia_blocks = local->prebuf.ia_blocks; ret = dict_set_iatt(xdata, key, stbuf, false); if (ret < 0) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = ENOMEM; goto err; } @@ -6368,7 +6368,7 @@ shard_common_remove_xattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; goto err; @@ -6403,7 +6403,7 @@ shard_post_lookup_remove_xattr_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, local->op_ret, local->op_errno); return 0; @@ -6533,7 +6533,7 @@ shard_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; if (dict && (frame->root->pid != GF_CLIENT_PID_GSYNCD)) { @@ -6571,7 +6571,7 @@ shard_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto unwind; if (dict && (frame->root->pid != GF_CLIENT_PID_GSYNCD)) { @@ -6613,7 +6613,7 @@ shard_common_set_xattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; goto err; @@ -6648,7 +6648,7 @@ shard_post_lookup_set_xattr_handler(call_frame_t *frame, xlator_t *this) local = frame->local; - if (local->op_ret < 0) { + if IS_ERROR((local->op_ret)) { shard_common_failure_unwind(local->fop, frame, local->op_ret, local->op_errno); return 0; @@ -6774,13 +6774,13 @@ shard_post_setattr_handler(call_frame_t *frame, xlator_t *this) local = frame->local; if (local->fop == GF_FOP_SETATTR) { - if (local->op_ret >= 0) + if IS_SUCCESS((local->op_ret)) shard_inode_ctx_set(local->loc.inode, this, &local->postbuf, 0, SHARD_LOOKUP_MASK); SHARD_STACK_UNWIND(setattr, frame, local->op_ret, local->op_errno, &local->prebuf, &local->postbuf, local->xattr_rsp); } else if (local->fop == GF_FOP_FSETATTR) { - if (local->op_ret >= 0) + if IS_SUCCESS((local->op_ret)) shard_inode_ctx_set(local->fd->inode, this, &local->postbuf, 0, SHARD_LOOKUP_MASK); SHARD_STACK_UNWIND(fsetattr, frame, local->op_ret, local->op_errno, @@ -6800,7 +6800,7 @@ shard_common_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { local->op_ret = op_ret; local->op_errno = op_errno; goto unwind; @@ -6808,7 +6808,7 @@ shard_common_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local->prebuf = *prebuf; if (shard_modify_size_and_block_count(&local->prebuf, xdata)) { - local->op_ret = -1; + local->op_ret = gf_failure; local->op_errno = EINVAL; goto unwind; } diff --git a/xlators/features/shard/src/shard.h b/xlators/features/shard/src/shard.h index e52a14216f..5aaf1e76ac 100644 --- a/xlators/features/shard/src/shard.h +++ b/xlators/features/shard/src/shard.h @@ -156,7 +156,7 @@ shard_unlock_entrylk(call_frame_t *frame, xlator_t *this); \ __ret = dict_set_uint64(dict, GF_XATTR_SHARD_FILE_SIZE, 8 * 4); \ if (__ret) { \ - local->op_ret = -1; \ + local->op_ret = gf_failure; \ local->op_errno = ENOMEM; \ gf_msg(this->name, GF_LOG_WARNING, 0, SHARD_MSG_DICT_OP_FAILED, \ "Failed to set dict value:" \ diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c index 6c9ebb442f..471eabf471 100644 --- a/xlators/features/snapview-client/src/snapview-client.c +++ b/xlators/features/snapview-client/src/snapview-client.c @@ -377,7 +377,7 @@ gf_svc_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t ret = -1; svc_local_t *local = NULL; xlator_t *subvolume = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; inode_t *parent = NULL; dict_t *new_xdata = NULL; @@ -407,7 +407,7 @@ gf_svc_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) local = mem_get0(this->local_pool); if (!local) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_NO_MEMORY, NULL); goto out; @@ -501,7 +501,7 @@ gf_svc_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) xlator_t *subvolume = NULL; int32_t ret = -1; int inode_type = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; gf_boolean_t wind = _gf_false; svc_private_t *priv = NULL; @@ -600,7 +600,7 @@ gf_svc_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) int32_t ret = -1; int inode_type = -1; xlator_t *subvolume = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -629,7 +629,7 @@ gf_svc_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) int32_t ret = -1; int inode_type = -1; xlator_t *subvolume = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -726,7 +726,7 @@ gf_svc_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, int32_t ret = -1; int inode_type = -1; xlator_t *subvolume = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; svc_local_t *local = NULL; @@ -770,7 +770,7 @@ gf_svc_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, { int32_t ret = -1; int inode_type = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -781,7 +781,7 @@ gf_svc_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, ret = svc_inode_ctx_get(this, loc->inode, &inode_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "path=%s", loc->path, @@ -794,7 +794,7 @@ gf_svc_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, FIRST_CHILD(this)->fops->setattr, loc, stbuf, valid, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -826,7 +826,7 @@ gf_svc_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, ret = svc_inode_ctx_get (this, fd->inode, &inode_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_msg (this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "failed to " @@ -840,7 +840,7 @@ gf_svc_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, FIRST_CHILD (this)->fops->fsetattr, fd, stbuf, valid, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -862,7 +862,7 @@ gf_svc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t ret = -1; int inode_type = -1; xlator_t *subvolume = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; svc_private_t *priv = NULL; @@ -980,7 +980,7 @@ gf_svc_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, { int32_t ret = -1; int inode_type = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -991,7 +991,7 @@ gf_svc_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, ret = svc_inode_ctx_get(this, loc->inode, &inode_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "name=%s", loc->name, @@ -1004,7 +1004,7 @@ gf_svc_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, FIRST_CHILD(this)->fops->setxattr, loc, dict, flags, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -1024,7 +1024,7 @@ gf_svc_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, { int32_t ret = -1; int inode_type = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1035,7 +1035,7 @@ gf_svc_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, ret = svc_inode_ctx_get(this, fd->inode, &inode_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "gfid=%s", @@ -1048,7 +1048,7 @@ gf_svc_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, FIRST_CHILD(this)->fops->fsetxattr, fd, dict, flags, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -1068,7 +1068,7 @@ gf_svc_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, { int inode_type = -1; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1079,7 +1079,7 @@ gf_svc_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, ret = svc_inode_ctx_get(this, loc->inode, &inode_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "name=%s", loc->name, @@ -1091,7 +1091,7 @@ gf_svc_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->rmdir, loc, flags, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -1113,7 +1113,7 @@ gf_svc_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int inode_type = -1; int ret = -1; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; inode_type = NORMAL_INODE; @@ -1134,7 +1134,7 @@ gf_svc_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, { int parent_type = -1; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; char entry_point[NAME_MAX + 1] = { @@ -1148,7 +1148,7 @@ gf_svc_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, ret = svc_inode_ctx_get(this, loc->parent, &parent_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "gfid=%s", @@ -1166,7 +1166,7 @@ gf_svc_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, STACK_WIND(frame, gf_svc_mkdir_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->mkdir, loc, mode, umask, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -1189,7 +1189,7 @@ gf_svc_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int inode_type = -1; int ret = -1; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; inode_type = NORMAL_INODE; @@ -1210,7 +1210,7 @@ gf_svc_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, { int parent_type = -1; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; char entry_point[NAME_MAX + 1] = { @@ -1224,7 +1224,7 @@ gf_svc_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, ret = svc_inode_ctx_get(this, loc->parent, &parent_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "gfid=%s", @@ -1243,7 +1243,7 @@ gf_svc_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, FIRST_CHILD(this)->fops->mknod, loc, mode, rdev, umask, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -1267,7 +1267,7 @@ gf_svc_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, { xlator_t *subvolume = NULL; int inode_type = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; int ret = -1; gf_boolean_t wind = _gf_false; @@ -1287,7 +1287,7 @@ gf_svc_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, if (((flags & O_ACCMODE) == O_WRONLY) || ((flags & O_ACCMODE) == O_RDWR)) { if (subvolume != FIRST_CHILD(this)) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } @@ -1313,7 +1313,7 @@ gf_svc_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int inode_type = -1; int ret = -1; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; inode_type = NORMAL_INODE; @@ -1335,7 +1335,7 @@ gf_svc_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, { int parent_type = -1; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; char entry_point[NAME_MAX + 1] = { @@ -1350,7 +1350,7 @@ gf_svc_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, ret = svc_inode_ctx_get(this, loc->parent, &parent_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "gfid=%s", @@ -1369,7 +1369,7 @@ gf_svc_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, FIRST_CHILD(this)->fops->create, loc, flags, mode, umask, fd, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -1392,7 +1392,7 @@ gf_svc_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int inode_type = -1; int ret = -1; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; inode_type = NORMAL_INODE; @@ -1413,7 +1413,7 @@ gf_svc_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, loc_t *loc, mode_t umask, dict_t *xdata) { int parent_type = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; int ret = -1; gf_boolean_t wind = _gf_false; @@ -1428,7 +1428,7 @@ gf_svc_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, ret = svc_inode_ctx_get(this, loc->parent, &parent_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "gfid=%s", @@ -1447,7 +1447,7 @@ gf_svc_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath, FIRST_CHILD(this)->fops->symlink, linkpath, loc, umask, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -1466,7 +1466,7 @@ gf_svc_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, dict_t *xdata) { int inode_type = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; int ret = -1; gf_boolean_t wind = _gf_false; @@ -1478,7 +1478,7 @@ gf_svc_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, ret = svc_inode_ctx_get(this, loc->inode, &inode_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "gfid=%s", @@ -1490,7 +1490,7 @@ gf_svc_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->unlink, loc, flags, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -1510,7 +1510,7 @@ gf_svc_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int inode_type = -1; xlator_t *subvolume = NULL; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1541,7 +1541,7 @@ gf_svc_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, int inode_type = -1; xlator_t *subvolume = NULL; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1572,7 +1572,7 @@ gf_svc_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask, int ret = -1; int inode_type = -1; xlator_t *subvolume = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -1608,7 +1608,7 @@ gf_svc_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; local = frame->local; @@ -1654,7 +1654,7 @@ gf_svc_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, xlator_t *subvolume = NULL; svc_local_t *local = NULL; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; svc_fd_t *svc_fd = NULL; @@ -1673,7 +1673,7 @@ gf_svc_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, "gfid=%s", uuid_utoa(fd->inode->gfid), NULL); else { if (svc_fd->entry_point_handled && off == svc_fd->last_offset) { - op_ret = 0; + op_ret = gf_zero_ret; op_errno = ENOENT; goto out; } @@ -1759,7 +1759,7 @@ gf_svc_readdirp_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!ret) return 0; } - op_ret = 0; + op_ret = gf_zero_ret; op_errno = ENOENT; goto out; } @@ -1768,7 +1768,7 @@ gf_svc_readdirp_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!svc_fd) { gf_smsg(this->name, GF_LOG_ERROR, 0, SVC_MSG_GET_FD_CONTEXT_FAILED, "gfid=%s", uuid_utoa(local->fd->inode->gfid), NULL); - op_ret = 0; + op_ret = gf_zero_ret; op_errno = ENOENT; goto out; } @@ -1776,7 +1776,7 @@ gf_svc_readdirp_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (gf_svc_get_entry_point(this, entry_point, sizeof(entry_point))) { gf_smsg(this->name, GF_LOG_WARNING, 0, SVC_MSG_COPY_ENTRY_POINT_FAILED, NULL); - op_ret = 0; + op_ret = gf_zero_ret; op_errno = ENOENT; goto out; } @@ -1785,7 +1785,7 @@ gf_svc_readdirp_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!entry) { gf_smsg(this->name, GF_LOG_ERROR, 0, SVC_MSG_NO_MEMORY, "entry-point=%s", entry_point, NULL); - op_ret = 0; + op_ret = gf_zero_ret; op_errno = ENOMEM; goto out; } @@ -2024,7 +2024,7 @@ gf_svc_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret < 0) + if (IS_ERROR(op_ret)) goto out; GF_VALIDATE_OR_GOTO("snapview-client", this, out); @@ -2096,7 +2096,7 @@ gf_svc_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, xlator_t *subvolume = NULL; svc_local_t *local = NULL; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; svc_fd_t *svc_fd = NULL; @@ -2131,7 +2131,7 @@ gf_svc_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, "gfid=%s", uuid_utoa(fd->inode->gfid), NULL); else { if (svc_fd->entry_point_handled && off == svc_fd->last_offset) { - op_ret = 0; + op_ret = gf_zero_ret; op_errno = ENOENT; goto out; } @@ -2168,7 +2168,7 @@ gf_svc_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, int src_inode_type = -1; int dst_inode_type = -1; int dst_parent_type = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = 0; int32_t ret = -1; gf_boolean_t wind = _gf_false; @@ -2181,7 +2181,7 @@ gf_svc_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, ret = svc_inode_ctx_get(this, oldloc->inode, &src_inode_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "gfid=%s", @@ -2190,7 +2190,7 @@ gf_svc_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, } if (src_inode_type == VIRTUAL_INODE) { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_RENAME_SNAPSHOT_ENTRY, "name=%s", oldloc->name, NULL); @@ -2200,7 +2200,7 @@ gf_svc_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, if (newloc->inode) { ret = svc_inode_ctx_get(this, newloc->inode, &dst_inode_type); if (!ret && dst_inode_type == VIRTUAL_INODE) { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_RENAME_SNAPSHOT_ENTRY, "oldloc-name=%s", @@ -2212,7 +2212,7 @@ gf_svc_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, if (dst_inode_type < 0) { ret = svc_inode_ctx_get(this, newloc->parent, &dst_parent_type); if (!ret && dst_parent_type == VIRTUAL_INODE) { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_RENAME_SNAPSHOT_ENTRY, "oldloc-name=%s", @@ -2243,7 +2243,7 @@ gf_svc_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, { int src_inode_type = -1; int dst_parent_type = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = 0; int32_t ret = -1; gf_boolean_t wind = _gf_false; @@ -2256,7 +2256,7 @@ gf_svc_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, ret = svc_inode_ctx_get(this, oldloc->inode, &src_inode_type); if (!ret && src_inode_type == VIRTUAL_INODE) { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_LINK_SNAPSHOT_ENTRY, "oldloc-name=%s", oldloc->name, NULL); @@ -2265,7 +2265,7 @@ gf_svc_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, ret = svc_inode_ctx_get(this, newloc->parent, &dst_parent_type); if (!ret && dst_parent_type == VIRTUAL_INODE) { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_LINK_SNAPSHOT_ENTRY, "oldloc-name=%s", oldloc->name, "newloc-name=%s", newloc->name, @@ -2291,7 +2291,7 @@ gf_svc_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, { int ret = -1; int inode_type = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -2302,7 +2302,7 @@ gf_svc_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, ret = svc_inode_ctx_get(this, loc->inode, &inode_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "path=%s", loc->path, @@ -2314,7 +2314,7 @@ gf_svc_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->removexattr, loc, name, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -2334,7 +2334,7 @@ gf_svc_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, { int inode_type = -1; int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; gf_boolean_t wind = _gf_false; @@ -2345,7 +2345,7 @@ gf_svc_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, ret = svc_inode_ctx_get(this, fd->inode, &inode_type); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_smsg(this->name, GF_LOG_ERROR, op_errno, SVC_MSG_GET_INODE_CONTEXT_FAILED, "gfid=%s", @@ -2357,7 +2357,7 @@ gf_svc_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, STACK_WIND_TAIL(frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fsync, fd, datasync, xdata); } else { - op_ret = -1; + op_ret = gf_failure; op_errno = EROFS; goto out; } @@ -2374,7 +2374,7 @@ gf_svc_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync, static int32_t gf_svc_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = 0; int ret = -1; int inode_type = -1; diff --git a/xlators/features/snapview-client/src/snapview-client.h b/xlators/features/snapview-client/src/snapview-client.h index 166116a439..d0e03eab39 100644 --- a/xlators/features/snapview-client/src/snapview-client.h +++ b/xlators/features/snapview-client/src/snapview-client.h @@ -47,7 +47,7 @@ typedef struct __svc_local svc_local_t; if (!new_xdata) { \ gf_log(this->name, GF_LOG_ERROR, \ "failed to allocate new dict"); \ - op_ret = -1; \ + op_ret = gf_failure; \ op_errno = ENOMEM; \ goto label; \ } \ @@ -55,7 +55,7 @@ typedef struct __svc_local svc_local_t; ret = dict_set_str(xdata, "entry-point", "true"); \ if (ret) { \ gf_log(this->name, GF_LOG_ERROR, "failed to set dict"); \ - op_ret = -1; \ + op_ret = gf_failure; \ op_errno = ENOMEM; \ goto label; \ } \ @@ -69,7 +69,7 @@ typedef struct __svc_local svc_local_t; gf_log(this->name, GF_LOG_ERROR, \ "inode context not found for gfid %s", \ uuid_utoa(inode->gfid)); \ - op_ret = -1; \ + op_ret = gf_failure; \ op_errno = EINVAL; \ goto label; \ } \ diff --git a/xlators/features/snapview-server/src/snapview-server-mgmt.c b/xlators/features/snapview-server/src/snapview-server-mgmt.c index ecf31c3b88..c23cbc235f 100644 --- a/xlators/features/snapview-server/src/snapview-server-mgmt.c +++ b/xlators/features/snapview-server/src/snapview-server-mgmt.c @@ -279,7 +279,7 @@ mgmt_get_snapinfo_cbk(struct rpc_req *req, struct iovec *iov, int count, goto out; } - if (rsp.op_ret == -1) { + if IS_ERROR((rsp.op_ret)) { errno = rsp.op_errno; ret = -1; goto out; diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c index 0436b69a30..f6cd4b24aa 100644 --- a/xlators/features/snapview-server/src/snapview-server.c +++ b/xlators/features/snapview-server/src/snapview-server.c @@ -65,7 +65,7 @@ svs_lookup_entry_point(xlator_t *this, loc_t *loc, inode_t *parent, { uuid_t gfid; svs_inode_t *inode_ctx = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; GF_VALIDATE_OR_GOTO("snapview-server", this, out); GF_VALIDATE_OR_GOTO(this->name, loc, out); @@ -90,7 +90,7 @@ svs_lookup_entry_point(xlator_t *this, loc_t *loc, inode_t *parent, inode_ctx = svs_inode_ctx_get_or_new(this, loc->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; *op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, *op_errno, SVS_MSG_NEW_INODE_CTX_FAILED, @@ -118,7 +118,7 @@ svs_lookup_entry_point(xlator_t *this, loc_t *loc, inode_t *parent, } } - op_ret = 0; + op_ret = gf_zero_ret; out: return op_ret; @@ -147,7 +147,7 @@ int32_t svs_lookup_gfid(xlator_t *this, loc_t *loc, struct iatt *buf, struct iatt *postparent, int32_t *op_errno) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; unsigned char handle_obj[GFAPI_HANDLE_LENGTH] = { 0, }; @@ -176,7 +176,7 @@ svs_lookup_gfid(xlator_t *this, loc_t *loc, struct iatt *buf, fs = svs_get_latest_snapshot(this); if (!fs) { - op_ret = -1; + op_ret = gf_failure; *op_errno = EINVAL; gf_msg(this->name, GF_LOG_ERROR, *op_errno, SVS_MSG_GET_LATEST_SNAP_FAILED, @@ -188,7 +188,7 @@ svs_lookup_gfid(xlator_t *this, loc_t *loc, struct iatt *buf, object = glfs_h_create_from_handle(fs, handle_obj, GFAPI_HANDLE_LENGTH, &statbuf); if (!object) { - op_ret = -1; + op_ret = gf_failure; *op_errno = ESTALE; gf_msg(this->name, GF_LOG_ERROR, *op_errno, SVS_MSG_GET_GLFS_H_OBJECT_FAILED, @@ -200,7 +200,7 @@ svs_lookup_gfid(xlator_t *this, loc_t *loc, struct iatt *buf, inode_ctx = svs_inode_ctx_get_or_new(this, loc->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; *op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, *op_errno, SVS_MSG_NEW_INODE_CTX_FAILED, @@ -221,7 +221,7 @@ svs_lookup_gfid(xlator_t *this, loc_t *loc, struct iatt *buf, memcpy(&inode_ctx->buf, buf, sizeof(*buf)); svs_iatt_fill(buf->ia_gfid, postparent); - op_ret = 0; + op_ret = gf_zero_ret; out: return op_ret; @@ -239,7 +239,7 @@ svs_lookup_snapshot(xlator_t *this, loc_t *loc, struct iatt *buf, struct iatt *postparent, inode_t *parent, svs_inode_t *parent_ctx, int32_t *op_errno) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; unsigned char handle_obj[GFAPI_HANDLE_LENGTH] = { 0, }; @@ -266,7 +266,7 @@ svs_lookup_snapshot(xlator_t *this, loc_t *loc, struct iatt *buf, "the fs instance for snap %s", loc->name); *op_errno = ENOENT; - op_ret = -1; + op_ret = gf_failure; goto out; } @@ -274,7 +274,7 @@ svs_lookup_snapshot(xlator_t *this, loc_t *loc, struct iatt *buf, object = glfs_h_create_from_handle(fs, handle_obj, GFAPI_HANDLE_LENGTH, &statbuf); if (!object) { - op_ret = -1; + op_ret = gf_failure; *op_errno = errno; /* Should this be in warning or error mode? */ gf_msg_debug(this->name, 0, @@ -286,7 +286,7 @@ svs_lookup_snapshot(xlator_t *this, loc_t *loc, struct iatt *buf, inode_ctx = svs_inode_ctx_get_or_new(this, loc->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; *op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, *op_errno, SVS_MSG_NEW_INODE_CTX_FAILED, @@ -314,11 +314,11 @@ svs_lookup_snapshot(xlator_t *this, loc_t *loc, struct iatt *buf, SVS_STRDUP(inode_ctx->snapname, loc->name); if (!inode_ctx->snapname) { - op_ret = -1; + op_ret = gf_failure; *op_errno = ENOMEM; goto out; } - op_ret = 0; + op_ret = gf_zero_ret; out: if (op_ret) { @@ -338,7 +338,7 @@ svs_lookup_entry(xlator_t *this, loc_t *loc, struct iatt *buf, struct iatt *postparent, inode_t *parent, svs_inode_t *parent_ctx, int32_t *op_errno) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; glfs_t *fs = NULL; glfs_object_t *object = NULL; struct stat statbuf = { @@ -368,7 +368,7 @@ svs_lookup_entry(xlator_t *this, loc_t *loc, struct iatt *buf, "failed to do lookup and " "get the handle for entry %s (path: %s)", loc->name, loc->path); - op_ret = -1; + op_ret = gf_failure; *op_errno = errno; goto out; } @@ -379,14 +379,14 @@ svs_lookup_entry(xlator_t *this, loc_t *loc, struct iatt *buf, "gfid from glfs handle is " "NULL for entry %s (path: %s)", loc->name, loc->path); - op_ret = -1; + op_ret = gf_failure; *op_errno = errno; goto out; } inode_ctx = svs_inode_ctx_get_or_new(this, loc->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; *op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, *op_errno, SVS_MSG_NEW_INODE_CTX_FAILED, @@ -401,7 +401,7 @@ svs_lookup_entry(xlator_t *this, loc_t *loc, struct iatt *buf, * should op_errno be something else such as * EINVAL or ESTALE? */ - op_ret = -1; + op_ret = gf_failure; *op_errno = EIO; goto out; } @@ -424,13 +424,13 @@ svs_lookup_entry(xlator_t *this, loc_t *loc, struct iatt *buf, if (IA_ISDIR(buf->ia_type)) { SVS_STRDUP(inode_ctx->snapname, parent_ctx->snapname); if (!inode_ctx->snapname) { - op_ret = -1; + op_ret = gf_failure; *op_errno = ENOMEM; goto out; } } - op_ret = 0; + op_ret = gf_zero_ret; out: if (op_ret) { @@ -474,7 +474,7 @@ svs_revalidate(xlator_t *this, loc_t *loc, inode_t *parent, svs_inode_t *inode_ctx, svs_inode_t *parent_ctx, struct iatt *buf, struct iatt *postparent, int32_t *op_errno) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int ret = -1; char tmp_uuid[64] = { 0, @@ -492,7 +492,7 @@ svs_revalidate(xlator_t *this, loc_t *loc, inode_t *parent, svs_iatt_fill(parent->gfid, postparent); else svs_iatt_fill(loc->inode->gfid, postparent); - op_ret = 0; + op_ret = gf_zero_ret; goto out; } else { /* Though fs and object are present in the inode context, its @@ -525,7 +525,7 @@ svs_revalidate(xlator_t *this, loc_t *loc, inode_t *parent, svs_iatt_fill(parent->gfid, postparent); else svs_iatt_fill(buf->ia_gfid, postparent); - op_ret = 0; + op_ret = gf_zero_ret; goto out; } else { inode_ctx->fs = NULL; @@ -537,7 +537,7 @@ svs_revalidate(xlator_t *this, loc_t *loc, inode_t *parent, "failed to get the handle for " "%s (gfid %s)", loc->path, uuid_utoa_r(loc->inode->gfid, tmp_uuid)); - op_ret = -1; + op_ret = gf_failure; goto out; } } @@ -574,7 +574,7 @@ svs_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) struct iatt buf = { 0, }; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; struct iatt postparent = { 0, @@ -596,7 +596,7 @@ svs_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -680,7 +680,7 @@ svs_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) */ if (!inode_ctx && !parent_ctx) { if (gf_uuid_is_null(loc->gfid) && gf_uuid_is_null(loc->inode->gfid)) { - op_ret = -1; + op_ret = gf_failure; op_errno = ESTALE; gf_msg_debug(this->name, 0, "gfid is NULL. Either the lookup " @@ -694,7 +694,7 @@ svs_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) * snapview-server might have restarted or * graph change might have happened */ - op_ret = -1; + op_ret = gf_failure; op_errno = ESTALE; goto out; } @@ -711,7 +711,7 @@ svs_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) svs_iatt_fill(buf.ia_gfid, &buf); svs_iatt_fill(buf.ia_gfid, &postparent); - op_ret = 0; + op_ret = gf_zero_ret; goto out; } @@ -740,7 +740,7 @@ svs_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, dict_t *xdata) { svs_inode_t *inode_ctx = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; svs_fd_t *svs_fd = NULL; glfs_fd_t *glfd = NULL; @@ -757,13 +757,13 @@ svs_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } inode_ctx = svs_inode_ctx_get(this, loc->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = ESTALE; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -777,7 +777,7 @@ svs_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, or the inode is SNAP_VIEW_ENTRY_POINT_INODE */ if (inode_ctx->type == SNAP_VIEW_ENTRY_POINT_INODE) { - op_ret = 0; + op_ret = gf_zero_ret; op_errno = 0; goto out; } else { @@ -786,7 +786,7 @@ svs_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, glfd = glfs_h_opendir(fs, object); if (!glfd) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_OPENDIR_FAILED, "opendir on %s failed " @@ -796,7 +796,7 @@ svs_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, } svs_fd = svs_fd_ctx_get_or_new(this, fd); if (!svs_fd) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_NEW_FD_CTX_FAILED, @@ -808,7 +808,7 @@ svs_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, } svs_fd->fd = glfd; - op_ret = 0; + op_ret = gf_zero_ret; op_errno = 0; } @@ -892,7 +892,7 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) { svs_inode_t *inode_ctx = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; glfs_t *fs = NULL; glfs_object_t *object = NULL; @@ -909,13 +909,13 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } inode_ctx = svs_inode_ctx_get(this, loc->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = ESTALE; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -932,7 +932,7 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, for the name of the xattr has to be sent which we don't have. */ if (inode_ctx->type == SNAP_VIEW_ENTRY_POINT_INODE) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENODATA; goto out; } else { @@ -941,7 +941,7 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict = dict_new(); if (!dict) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_NO_MEMORY, "failed to allocate dict"); @@ -950,7 +950,7 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, size = glfs_h_getxattrs(fs, object, name, NULL, 0); if (size == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; if (errno == ENODATA) { gf_msg_debug(this->name, 0, @@ -967,7 +967,7 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, } value = GF_CALLOC(size + 1, sizeof(char), gf_common_mt_char); if (!value) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_NO_MEMORY, "failed to allocate memory for getxattr " @@ -978,7 +978,7 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, size = glfs_h_getxattrs(fs, object, name, value, size); if (size == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GETXATTR_FAILED, "failed to get the xattr %s for " @@ -990,7 +990,7 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, if (name) { op_ret = dict_set_dynptr(dict, (char *)name, value, size); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { op_errno = -op_ret; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_DICT_SET_FAILED, @@ -1003,7 +1003,7 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, } } else { op_ret = svs_add_xattrs_to_dict(this, dict, value, size); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_NO_MEMORY, "failed to add xattrs from the list to " @@ -1033,7 +1033,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, dict_t *xdata) { svs_inode_t *inode_ctx = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; char *value = 0; ssize_t size = 0; @@ -1048,7 +1048,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, inode_ctx = svs_inode_ctx_get(this, fd->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = ESTALE; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -1059,7 +1059,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, } if (!(svs_inode_ctx_glfs_mapping(this, inode_ctx))) { - op_ret = -1; + op_ret = gf_failure; op_errno = EBADF; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_FS_INSTANCE_INVALID, "glfs instance %p to which the inode %s " @@ -1072,7 +1072,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, sfd = svs_fd_ctx_get_or_new(this, fd); if (!sfd) { - op_ret = -1; + op_ret = gf_failure; op_errno = EBADFD; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_FD_CONTEXT_FAILED, @@ -1090,13 +1090,13 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, for the name of the xattr has to be sent which we don't have. */ if (inode_ctx->type == SNAP_VIEW_ENTRY_POINT_INODE) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; goto out; } else { dict = dict_new(); if (!dict) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_NO_MEMORY, "failed to allocate dict " @@ -1108,7 +1108,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, if (name) { size = glfs_fgetxattr(glfd, name, NULL, 0); if (size == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GETXATTR_FAILED, @@ -1119,7 +1119,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, } value = GF_CALLOC(size + 1, sizeof(char), gf_common_mt_char); if (!value) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_NO_MEMORY, "failed to " @@ -1131,7 +1131,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, size = glfs_fgetxattr(glfd, name, value, size); if (size == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GETXATTR_FAILED, @@ -1143,7 +1143,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, value[size] = '\0'; op_ret = dict_set_dynptr(dict, (char *)name, value, size); - if (op_ret < 0) { + if (IS_ERROR(op_ret)) { op_errno = -op_ret; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_DICT_SET_FAILED, @@ -1164,7 +1164,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, value = GF_CALLOC(size + 1, sizeof(char), gf_common_mt_char); if (!value) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_NO_MEMORY, "failed to " @@ -1176,7 +1176,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, size = glfs_flistxattr(glfd, value, size); if (size == -1) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_LISTXATTR_FAILED, "listxattr on %s failed", @@ -1185,7 +1185,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, } op_ret = svs_add_xattrs_to_dict(this, dict, value, size); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_NO_MEMORY, "failed to add xattrs from the list " @@ -1196,7 +1196,7 @@ svs_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, GF_FREE(value); } - op_ret = 0; + op_ret = gf_zero_ret; op_errno = 0; } @@ -1260,7 +1260,7 @@ svs_releasedir(xlator_t *this, fd_t *fd) int32_t svs_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = 0; int ret = -1; uint64_t value = 0; @@ -1274,13 +1274,13 @@ svs_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } inode_ctx = svs_inode_ctx_get(this, fd->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -1298,7 +1298,7 @@ svs_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) goto out; } - op_ret = 0; + op_ret = gf_zero_ret; out: STACK_UNWIND_STRICT(flush, frame, op_ret, op_errno, NULL); @@ -1673,7 +1673,7 @@ svs_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, 0, }; int count = 0; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; svs_inode_t *parent_ctx = NULL; svs_fd_t *svs_fd = NULL; @@ -1689,13 +1689,13 @@ svs_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto unwind; } parent_ctx = svs_inode_ctx_get(this, fd->inode); if (!parent_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -1723,7 +1723,7 @@ svs_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } else { svs_fd = svs_fd_ctx_get_or_new(this, fd); if (!svs_fd) { - op_ret = -1; + op_ret = gf_failure; op_errno = EBADFD; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_FD_CONTEXT_FAILED, @@ -1774,7 +1774,7 @@ svs_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int count = 0; svs_inode_t *inode_ctx = NULL; int op_errno = EINVAL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; svs_fd_t *svs_fd = NULL; glfs_fd_t *glfd = NULL; @@ -1787,7 +1787,7 @@ svs_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, inode_ctx = svs_inode_ctx_get(this, fd->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -1806,7 +1806,7 @@ svs_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } else { svs_fd = svs_fd_ctx_get_or_new(this, fd); if (!svs_fd) { - op_ret = -1; + op_ret = gf_failure; op_errno = EBADFD; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_FD_CONTEXT_FAILED, @@ -1959,7 +1959,7 @@ svs_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) 0, }; int32_t op_errno = EINVAL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; svs_inode_t *inode_ctx = NULL; glfs_t *fs = NULL; glfs_object_t *object = NULL; @@ -1977,7 +1977,7 @@ svs_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -1988,7 +1988,7 @@ svs_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) inode_ctx = svs_inode_ctx_get(this, loc->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -1998,14 +1998,14 @@ svs_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) if (inode_ctx->type == SNAP_VIEW_ENTRY_POINT_INODE) { svs_iatt_fill(loc->inode->gfid, &buf); - op_ret = 0; + op_ret = gf_zero_ret; } else { SVS_GET_INODE_CTX_INFO(inode_ctx, fs, object, this, loc, op_ret, op_errno, out); ret = glfs_h_stat(fs, object, &stat); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_STAT_FAILED, "glfs_h_stat on %s (gfid: %s) " @@ -2034,7 +2034,7 @@ svs_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) 0, }; int32_t op_errno = EINVAL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; svs_inode_t *inode_ctx = NULL; struct stat stat = { 0, @@ -2057,13 +2057,13 @@ svs_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } inode_ctx = svs_inode_ctx_get(this, fd->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -2075,10 +2075,10 @@ svs_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) if (inode_ctx->type == SNAP_VIEW_ENTRY_POINT_INODE) { svs_iatt_fill(fd->inode->gfid, &buf); - op_ret = 0; + op_ret = gf_zero_ret; } else { if (!(svs_inode_ctx_glfs_mapping(this, inode_ctx))) { - op_ret = -1; + op_ret = gf_failure; op_errno = EBADF; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_FS_INSTANCE_INVALID, @@ -2092,7 +2092,7 @@ svs_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) sfd = svs_fd_ctx_get_or_new(this, fd); if (!sfd) { - op_ret = -1; + op_ret = gf_failure; op_errno = EBADFD; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_FD_CONTEXT_FAILED, @@ -2105,7 +2105,7 @@ svs_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) glfd = sfd->fd; ret = glfs_fstat(glfd, &stat); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_STAT_FAILED, "glfs_fstat on gfid: %s failed", uuid_utoa(fd->inode->gfid)); @@ -2130,7 +2130,7 @@ svs_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) 0, }; int32_t op_errno = EINVAL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; svs_inode_t *inode_ctx = NULL; glfs_t *fs = NULL; glfs_object_t *object = NULL; @@ -2145,7 +2145,7 @@ svs_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } @@ -2155,7 +2155,7 @@ svs_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) */ inode_ctx = svs_inode_ctx_get(this, loc->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -2168,7 +2168,7 @@ svs_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) ret = glfs_h_statfs(fs, object, &buf); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_STATFS_FAILED, "glfs_h_statvfs on %s (gfid: %s) " @@ -2189,7 +2189,7 @@ svs_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, { svs_inode_t *inode_ctx = NULL; svs_fd_t *sfd = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; glfs_fd_t *glfd = NULL; glfs_t *fs = NULL; @@ -2222,13 +2222,13 @@ svs_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } glfd = glfs_h_open(fs, object, flags); if (!glfd) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_OPEN_FAILED, "glfs_h_open on %s failed (gfid: %s)", loc->name, @@ -2238,7 +2238,7 @@ svs_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, sfd = svs_fd_ctx_get_or_new(this, fd); if (!sfd) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_NO_MEMORY, "failed to allocate fd context " @@ -2249,7 +2249,7 @@ svs_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } sfd->fd = glfd; - op_ret = 0; + op_ret = gf_zero_ret; out: STACK_UNWIND_STRICT(open, frame, op_ret, op_errno, fd, NULL); @@ -2260,7 +2260,7 @@ int32_t svs_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t offset, uint32_t flags, dict_t *xdata) { - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = 0; svs_private_t *priv = NULL; struct iobuf *iobuf = NULL; @@ -2290,12 +2290,12 @@ svs_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } if (!svs_inode_glfs_mapping(this, fd->inode)) { - op_ret = -1; + op_ret = gf_failure; op_errno = EBADF; /* should this be some other error? */ gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_FS_INSTANCE_INVALID, "glfs instance to which the inode " @@ -2307,7 +2307,7 @@ svs_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, sfd = svs_fd_ctx_get_or_new(this, fd); if (!sfd) { - op_ret = -1; + op_ret = gf_failure; op_errno = EBADFD; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -2321,7 +2321,7 @@ svs_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, iobuf = iobuf_get2(this->ctx->iobuf_pool, size); if (!iobuf) { - op_ret = -1; + op_ret = gf_failure; op_errno = ENOMEM; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_NO_MEMORY, "failed to " @@ -2333,7 +2333,7 @@ svs_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, ret = glfs_pread(glfd, iobuf->ptr, size, offset, 0, &fstatbuf); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_READ_FAILED, "glfs_read failed on %s (%s)", uuid_utoa(fd->inode->gfid), @@ -2377,7 +2377,7 @@ svs_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, svs_inode_t *inode_ctx = NULL; glfs_t *fs = NULL; glfs_object_t *object = NULL; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int op_errno = EINVAL; char *buf = NULL; struct iatt stbuf = { @@ -2397,13 +2397,13 @@ svs_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } inode_ctx = svs_inode_ctx_get(this, loc->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -2418,7 +2418,7 @@ svs_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, ret = glfs_h_stat(fs, object, &stat); if (ret) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_STAT_FAILED, "glfs_h_stat on %s (gfid: %s) " @@ -2433,7 +2433,7 @@ svs_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size, buf = alloca(size + 1); op_ret = glfs_h_readlink(fs, object, buf, size); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_READLINK_FAILED, "readlink on %s failed (gfid: %s)", loc->name, @@ -2454,7 +2454,7 @@ svs_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, dict_t *xdata) { int ret = -1; - gf_return_t op_ret = -1; + gf_return_t op_ret = gf_failure; int32_t op_errno = EINVAL; glfs_t *fs = NULL; glfs_object_t *object = NULL; @@ -2472,13 +2472,13 @@ svs_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, root = frame->root; op_ret = gf_setcredentials(&root->uid, &root->gid, root->ngrps, root->groups); - if (op_ret != 0) { + if (IS_ERROR(op_ret)) { goto out; } inode_ctx = svs_inode_ctx_get(this, loc->inode); if (!inode_ctx) { - op_ret = -1; + op_ret = gf_failure; op_errno = EINVAL; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_GET_INODE_CONTEXT_FAILED, @@ -2494,10 +2494,10 @@ svs_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, */ if (inode_ctx->type == SNAP_VIEW_ENTRY_POINT_INODE) { if (is_fuse_call) { - op_ret = 0; + op_ret = gf_zero_ret; op_errno = 0; } else { - op_ret = 0; + op_ret = gf_zero_ret; mode |= POSIX_ACL_READ; mode |= POSIX_ACL_EXECUTE; op_errno = mode; @@ -2521,7 +2521,7 @@ svs_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, ret = glfs_h_access(fs, object, mask); if (ret < 0) { - op_ret = -1; + op_ret = gf_failure; op_errno = errno; gf_msg(this->name, GF_LOG_ERROR, op_errno, SVS_MSG_ACCESS_FAILED, "failed to access %s (gfid: %s)", loc->path, @@ -2529,7 +2529,7 @@ svs_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, goto out; } - op_ret = 0; + op_ret = gf_zero_ret; op_errno = ret; out: diff --git a/xlators/features/thin-arbiter/src/thin-arbiter.h b/xlators/features/thin-arbiter/src/thin-arbiter.h index e5f914b84b..468527a2df 100644 --- a/xlators/features/thin-arbiter/src/thin-arbiter.h +++ b/xlators/features/thin-arbiter/src/thin-arbiter.h @@ -29,7 +29,7 @@ #define TA_STACK_UNWIND(fop, frame, op_ret, op_errno, params...) \ do { \ ta_fop_t *__local = NULL; \ - int32_t __op_ret = 0; \ + int32_t __op_ret = gf_zero_ret; \ int32_t __op_errno = 0; \ \ __local = frame->local; \ diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index c14805b0e9..38aa03fa42 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -309,7 +309,7 @@ trash_dir_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_ERROR, "rename trash directory " "failed: %s", @@ -895,7 +895,7 @@ trash_unlink_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, loop_count = local->loop_count; /* The directory is not present , need to create it */ - if ((op_ret == -1) && (op_errno == ENOENT)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOENT)) { tmp_dirname = strchr(tmp_str, '/'); while (tmp_dirname) { count = tmp_dirname - tmp_str; @@ -960,7 +960,7 @@ trash_unlink_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } - if ((op_ret == -1) && (op_errno != EEXIST)) { + if (IS_ERROR((op_ret)) && (op_errno != EEXIST)) { gf_log(this->name, GF_LOG_ERROR, "Directory creation failed [%s]. " "Therefore unlinking %s without moving to trash " @@ -1066,7 +1066,7 @@ trash_unlink_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; GF_VALIDATE_OR_GOTO("trash", local, out); - if ((op_ret == -1) && (op_errno == ENOENT)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOENT)) { /* the file path does not exist we want to create path * for the file */ @@ -1109,7 +1109,7 @@ trash_unlink_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - if ((op_ret == -1) && (op_errno == ENOTDIR)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOTDIR)) { /* if entry is already present in trash directory, * new one is not copied*/ gf_log(this->name, GF_LOG_DEBUG, @@ -1122,7 +1122,7 @@ trash_unlink_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - if ((op_ret == -1) && (op_errno == EISDIR)) { + if (IS_ERROR((op_ret)) && (op_errno == EISDIR)) { /* if entry is directory,we remove directly */ gf_log(this->name, GF_LOG_DEBUG, "target(%s) exists as directory, cannot keep copy, " @@ -1227,7 +1227,7 @@ trash_unlink_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; GF_VALIDATE_OR_GOTO("trash", local, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_DEBUG, "%s: %s", local->loc.path, strerror(op_errno)); TRASH_STACK_UNWIND(unlink, frame, op_ret, op_errno, buf, NULL, xdata); @@ -1402,7 +1402,7 @@ trash_truncate_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; GF_VALIDATE_OR_GOTO("trash", local, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_DEBUG, "deleting the newly created file: %s", strerror(op_errno)); } @@ -1429,7 +1429,7 @@ trash_truncate_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; GF_VALIDATE_OR_GOTO("trash", local, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_DEBUG, "readv on the existing file failed: %s", strerror(op_errno)); @@ -1461,7 +1461,7 @@ trash_truncate_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; GF_VALIDATE_OR_GOTO("trash", local, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { /* Let truncate work, but previous copy is not preserved. */ gf_log(this->name, GF_LOG_DEBUG, "writev on the existing file failed: %s", strerror(op_errno)); @@ -1502,7 +1502,7 @@ trash_truncate_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; GF_VALIDATE_OR_GOTO("trash", local, out); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { /* Let truncate work, but previous copy is not preserved. */ gf_log(this->name, GF_LOG_DEBUG, "open on the existing file failed: %s", strerror(op_errno)); @@ -1559,7 +1559,7 @@ trash_truncate_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* Checks whether path is present in trash directory or not */ - if ((op_ret == -1) && (op_errno == ENOENT)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOENT)) { /* Creating the directory structure here. */ tmp_str = gf_strdup(local->newpath); if (!tmp_str) { @@ -1596,7 +1596,7 @@ trash_truncate_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { /* Let truncate work, but previous copy is not preserved. * Deleting the newly created copy. */ @@ -1676,7 +1676,7 @@ trash_truncate_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - if ((op_ret == -1) && (op_errno == ENOENT)) { + if (IS_ERROR((op_ret)) && (op_errno == ENOENT)) { tmp_dirname = strchr(tmp_str, '/'); while (tmp_dirname) { count = tmp_dirname - tmp_str; @@ -1746,7 +1746,7 @@ trash_truncate_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } } - if ((op_ret == -1) && (op_errno != EEXIST)) { + if (IS_ERROR((op_ret)) && (op_errno != EEXIST)) { gf_log(this->name, GF_LOG_ERROR, "Directory creation failed [%s]. " "Therefore truncating %s without moving the " @@ -1847,7 +1847,7 @@ trash_truncate_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, } pthread_mutex_unlock(&table->lock); - if (op_ret == -1) { + if (IS_ERROR(op_ret)) { gf_log(this->name, GF_LOG_DEBUG, "fstat on the file failed: %s", strerror(op_errno)); @@ -2134,7 +2134,7 @@ int32_t trash_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, mode_t umask, dict_t *xdata) { - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int32_t op_errno = 0; trash_private_t *priv = NULL; @@ -2146,7 +2146,7 @@ trash_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, "mkdir issued on %s, which is not permitted", priv->newtrash_dir); op_errno = EPERM; - op_ret = -1; + op_ret = gf_failure; STACK_UNWIND_STRICT(mkdir, frame, op_ret, op_errno, NULL, NULL, NULL, NULL, xdata); @@ -2167,7 +2167,7 @@ int trash_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, dict_t *xdata) { - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int32_t op_errno = 0; trash_private_t *priv = NULL; @@ -2179,7 +2179,7 @@ trash_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, "rename issued on %s, which is not permitted", priv->newtrash_dir); op_errno = EPERM; - op_ret = -1; + op_ret = gf_failure; STACK_UNWIND_STRICT(rename, frame, op_ret, op_errno, NULL, NULL, NULL, NULL, NULL, xdata); @@ -2200,7 +2200,7 @@ int32_t trash_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, dict_t *xdata) { - gf_return_t op_ret = 0; + gf_return_t op_ret = gf_zero_ret; int32_t op_errno = 0; trash_private_t *priv = NULL; @@ -2212,7 +2212,7 @@ trash_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, "rmdir issued on %s, which is not permitted", priv->newtrash_dir); op_errno = EPERM; - op_ret = -1; + op_ret = gf_failure; STACK_UNWIND_STRICT(rmdir, frame, op_ret, op_errno, NULL, NULL, xdata); } else { diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c index 59c025c820..16b0c05a95 100644 --- a/xlators/features/upcall/src/upcall.c +++ b/xlators/features/upcall/src/upcall.c @@ -40,7 +40,7 @@ up_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -91,7 +91,7 @@ up_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_WRITE_FLAGS; @@ -147,7 +147,7 @@ up_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -200,7 +200,7 @@ up_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this, gf_return_t op_ret, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -252,7 +252,7 @@ up_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_WRITE_FLAGS; @@ -306,7 +306,7 @@ up_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } /* XXX: setattr -> UP_SIZE or UP_OWN or UP_MODE or UP_TIMES @@ -376,7 +376,7 @@ up_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = (UP_RENAME_FLAGS | UP_PARENT_DENTRY_FLAGS); @@ -444,7 +444,7 @@ up_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = (UP_NLINK_FLAGS | UP_PARENT_DENTRY_FLAGS); @@ -503,7 +503,7 @@ up_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = (UP_NLINK_FLAGS | UP_PARENT_DENTRY_FLAGS); @@ -562,7 +562,7 @@ up_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } @@ -622,7 +622,7 @@ up_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } @@ -684,7 +684,7 @@ up_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } @@ -748,7 +748,7 @@ up_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -801,7 +801,7 @@ up_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -903,7 +903,7 @@ up_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -956,7 +956,7 @@ up_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -1010,7 +1010,7 @@ up_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } @@ -1072,7 +1072,7 @@ up_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } @@ -1132,7 +1132,7 @@ up_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -1185,7 +1185,7 @@ up_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -1237,7 +1237,7 @@ up_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -1291,7 +1291,7 @@ up_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -1379,7 +1379,7 @@ up_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_WRITE_FLAGS; @@ -1433,7 +1433,7 @@ up_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_WRITE_FLAGS; @@ -1486,7 +1486,7 @@ up_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_WRITE_FLAGS; @@ -1538,7 +1538,7 @@ up_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -1598,7 +1598,7 @@ up_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } @@ -1672,7 +1672,7 @@ up_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } @@ -1746,7 +1746,7 @@ up_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_XATTR_RM; @@ -1829,7 +1829,7 @@ up_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } flags = UP_XATTR_RM; @@ -1905,7 +1905,7 @@ up_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } @@ -1955,7 +1955,7 @@ up_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } @@ -2031,7 +2031,7 @@ up_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if ((op_ret < 0) || !local) { + if (IS_ERROR((op_ret)) || !local) { goto out; } From 30b4137cac645fb3e6bfccb15e414cd8b699e1bb Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sat, 19 Sep 2020 19:31:07 +0530 Subject: [PATCH 21/24] quota/: compiles Change-Id: Iac764320109b294905fc8081d109c3a80ca2a2ed Signed-off-by: Amar Tumballi --- .../quota/src/quota-enforcer-client.c | 22 ++--- xlators/features/quota/src/quota.c | 85 ++++++++++--------- .../features/quota/src/quotad-aggregator.c | 6 +- xlators/features/quota/src/quotad.c | 4 +- 4 files changed, 63 insertions(+), 54 deletions(-) diff --git a/xlators/features/quota/src/quota-enforcer-client.c b/xlators/features/quota/src/quota-enforcer-client.c index ec79771473..950e9a73c3 100644 --- a/xlators/features/quota/src/quota-enforcer-client.c +++ b/xlators/features/quota/src/quota-enforcer-client.c @@ -140,7 +140,7 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, priv = this->private; if (-1 == req->rpc_status) { - rsp.op_ret = gf_failure; + rsp.op_ret = -1; op_errno = ENOTCONN; goto out; } @@ -149,7 +149,7 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, if (ret < 0) { gf_msg(this->name, GF_LOG_ERROR, 0, Q_MSG_XDR_DECODING_FAILED, "XDR decoding failed"); - rsp.op_ret = gf_failure; + rsp.op_ret = -1; op_errno = EINVAL; goto out; } @@ -157,10 +157,10 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, op_errno = gf_error_to_errno(rsp.op_errno); gf_stat_to_iatt(&rsp.postparent, &postparent); - if IS_ERROR((rsp.op_ret)) + if (rsp.op_ret < 0) goto out; - rsp.op_ret = gf_failure; + rsp.op_ret = -1; gf_stat_to_iatt(&rsp.stat, &stbuf); GF_PROTOCOL_DICT_UNSERIALIZE(frame->this, xdata, (rsp.xdata.xdata_val), @@ -171,12 +171,12 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, (gf_uuid_compare(stbuf.ia_gfid, inode->gfid) != 0)) { gf_msg_debug(frame->this->name, ESTALE, "gfid changed for %s", local->validate_loc.path); - rsp.op_ret = gf_failure; + rsp.op_ret = -1; op_errno = ESTALE; goto out; } - rsp.op_ret = gf_zero_ret; + rsp.op_ret = 0; out: rsp.op_errno = op_errno; @@ -224,7 +224,7 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, priv->quotad_conn_status = 0; } - if IS_ERROR((rsp.op_ret)) { + if (rsp.op_ret < 0) { /* any error other than ENOENT */ if (rsp.op_errno != ENOENT) gf_msg( @@ -242,7 +242,9 @@ quota_enforcer_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count, local->quotad_conn_retry); } - local->validate_cbk(frame, NULL, this, rsp.op_ret, rsp.op_errno, inode, + gf_return_t op_ret; + SET_RET(op_ret, rsp.op_ret); + local->validate_cbk(frame, NULL, this, op_ret, rsp.op_errno, inode, &stbuf, xdata, &postparent); clean: @@ -318,7 +320,7 @@ _quota_enforcer_lookup(void *data) return; unwind: - local->validate_cbk(frame, NULL, this, -1, op_errno, NULL, NULL, NULL, + local->validate_cbk(frame, NULL, this, gf_failure, op_errno, NULL, NULL, NULL, NULL); GF_FREE(req.xdata.xdata_val); @@ -345,7 +347,7 @@ quota_enforcer_lookup(call_frame_t *frame, xlator_t *this, dict_t *xdata, return 0; unwind: - validate_cbk(frame, NULL, this, -1, ESTALE, NULL, NULL, NULL, NULL); + validate_cbk(frame, NULL, this, gf_failure, ESTALE, NULL, NULL, NULL, NULL); return 0; } diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 5df118c04d..d63cc4a4d0 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -418,7 +418,7 @@ check_ancestory(call_frame_t *frame, inode_t *inode) if (cur_inode) { inode_unref(cur_inode); - check_ancestory_continue(NULL, NULL, 0, 0, frame); + check_ancestory_continue(NULL, NULL, gf_zero_ret, 0, frame); } else { check_ancestory_continue(NULL, NULL, gf_failure, ESTALE, frame); } @@ -832,7 +832,7 @@ if (IS_SUCCESS(op_ret) && (entries != NULL)) { } } - local->ancestry_cbk(&parents, local->loc.inode, 0, 0, local->ancestry_data); + local->ancestry_cbk(&parents, local->loc.inode, gf_zero_ret, 0, local->ancestry_data); goto cleanup; err: @@ -868,7 +868,8 @@ quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk, gf_return_t op_ret = gf_failure; xlator_t *this = NULL; dict_t *xdata_req = NULL; - + int ret = -1; + this = THIS; xdata_req = dict_new(); @@ -893,21 +894,21 @@ quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk, local->ancestry_data = data; local->loc.inode = inode_ref(inode); - op_ret = dict_set_int8(xdata_req, QUOTA_LIMIT_KEY, 1); - if (IS_ERROR(op_ret)) { - op_errno = -op_ret; + ret = dict_set_int8(xdata_req, QUOTA_LIMIT_KEY, 1); + if (ret) { + op_errno = -ret; goto err; } - op_ret = dict_set_int8(xdata_req, QUOTA_LIMIT_OBJECTS_KEY, 1); - if (IS_ERROR(op_ret)) { - op_errno = -op_ret; + ret = dict_set_int8(xdata_req, QUOTA_LIMIT_OBJECTS_KEY, 1); + if (ret) { + op_errno = -ret; goto err; } - op_ret = dict_set_int8(xdata_req, GET_ANCESTRY_DENTRY_KEY, 1); - if (IS_ERROR(op_ret)) { - op_errno = -op_ret; + ret = dict_set_int8(xdata_req, GET_ANCESTRY_DENTRY_KEY, 1); + if (ret) { + op_errno = -ret; goto err; } @@ -920,7 +921,7 @@ quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk, STACK_WIND(new_frame, quota_build_ancestry_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->readdirp, fd, 0, 0, xdata_req); - op_ret = gf_zero_ret; + ret = 0; err: if (fd) @@ -929,8 +930,9 @@ quota_build_ancestry(inode_t *inode, quota_ancestry_built_t ancestry_cbk, if (xdata_req) dict_unref(xdata_req); + SET_RET(op_ret, ret); if (IS_ERROR(op_ret)) { - ancestry_cbk(NULL, NULL, gf_failure, op_errno, data); + ancestry_cbk(NULL, NULL, op_ret, op_errno, data); if (new_frame) { local = new_frame->local; @@ -1033,7 +1035,7 @@ quota_check_limit_continuation(struct list_head *parents, inode_t *inode, else par_local = local; - if (IS_ERROR((op_ret)) || list_empty(parents)) { + if (IS_ERROR(op_ret) || list_empty(parents)) { if (IS_SUCCESS(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, EIO, Q_MSG_ANCESTRY_BUILD_FAILED, "Couldn't build ancestry for inode (gfid:%s). " @@ -1225,7 +1227,7 @@ quota_check_size_limit(call_frame_t *frame, quota_inode_ctx_t *ctx, int32_t quota_check_limit(call_frame_t *frame, inode_t *inode, xlator_t *this) { - int32_t ret = gf_failure, op_errno = EINVAL; + int32_t ret = -1, op_errno = EINVAL; inode_t *_inode = NULL, *parent = NULL; quota_inode_ctx_t *ctx = NULL; quota_priv_t *priv = NULL; @@ -1587,23 +1589,26 @@ quota_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { quota_local_t *local = NULL; inode_t *this_inode = NULL; + int ret; local = frame->local; frame->local = NULL; - if (op_ret >= 0 && inode) { + if (IS_SUCCESS(op_ret) && inode) { this_inode = inode_ref(inode); - op_ret = quota_fill_inodectx(this, inode, dict, &local->loc, buf, + ret = quota_fill_inodectx(this, inode, dict, &local->loc, buf, &op_errno); - if (IS_ERROR(op_ret)) + if (ret < 0) { + op_ret = gf_failure; op_errno = ENOMEM; + } } QUOTA_STACK_UNWIND(lookup, frame, op_ret, op_errno, inode, buf, dict, postparent); - if (op_ret < 0 || this_inode == NULL || gf_uuid_is_null(this_inode->gfid)) + if (IS_ERROR(op_ret) || this_inode == NULL || gf_uuid_is_null(this_inode->gfid)) goto out; check_ancestory_2(this, local, this_inode); @@ -1688,7 +1693,7 @@ quota_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (IS_ERROR((op_ret)) || (local == NULL) || (postbuf == NULL)) { + if (IS_ERROR(op_ret) || (local == NULL) || (postbuf == NULL)) { goto out; } @@ -1738,7 +1743,7 @@ quota_writev_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, GF_VALIDATE_OR_GOTO("quota", local, unwind); - if IS_ERROR((local->op_ret)) { + if (IS_ERROR(local->op_ret)) { op_errno = local->op_errno; if ((op_errno == EDQUOT) && (local->space_available > 0)) { @@ -1952,7 +1957,7 @@ quota_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, op_errno = local->op_errno; - if IS_ERROR((local->op_ret)) { + if (IS_ERROR(local->op_ret)) { goto unwind; } @@ -2096,7 +2101,7 @@ quota_create_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, GF_VALIDATE_OR_GOTO("quota", local, unwind); - if IS_ERROR((local->op_ret)) { + if (IS_ERROR(local->op_ret)) { op_errno = local->op_errno; goto unwind; } @@ -2334,7 +2339,7 @@ quota_link_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, op_errno = local->op_errno; - if IS_ERROR((local->op_ret)) { + if (IS_ERROR(local->op_ret)) { goto unwind; } @@ -2362,7 +2367,7 @@ quota_link_continue(call_frame_t *frame) local = frame->local; this = THIS; - if IS_ERROR((local->op_ret)) { + if (IS_ERROR(local->op_ret)) { op_errno = local->op_errno; goto err; } @@ -2639,7 +2644,7 @@ quota_rename_helper(call_frame_t *frame, xlator_t *this, loc_t *oldloc, op_errno = local->op_errno; - if IS_ERROR((local->op_ret)) { + if (IS_ERROR(local->op_ret)) { goto unwind; } @@ -2704,7 +2709,7 @@ quota_rename_continue(call_frame_t *frame) local = frame->local; this = THIS; - if IS_ERROR((local->op_ret)) { + if (IS_ERROR(local->op_ret)) { op_errno = local->op_errno; goto err; } @@ -2918,7 +2923,7 @@ quota_symlink_helper(call_frame_t *frame, xlator_t *this, const char *linkpath, GF_VALIDATE_OR_GOTO("quota", local, unwind); - if IS_ERROR((local->op_ret)) { + if (IS_ERROR(local->op_ret)) { op_errno = local->op_errno; goto unwind; } @@ -3184,7 +3189,7 @@ quota_send_dir_limit_to_cli(call_frame_t *frame, xlator_t *this, inode_t *inode, gf_msg_debug(this->name, 0, "str = %s", dir_limit); - QUOTA_STACK_UNWIND(getxattr, frame, 0, 0, dict, NULL); + QUOTA_STACK_UNWIND(getxattr, frame, gf_zero_ret, 0, dict, NULL); ret = 0; @@ -3525,7 +3530,7 @@ quota_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return 0; unwind: - QUOTA_STACK_UNWIND(readv, frame, gf_failure, ENOMEM, NULL, gf_failure, NULL, NULL, NULL); + QUOTA_STACK_UNWIND(readv, frame, gf_failure, ENOMEM, NULL, -1, NULL, NULL, NULL); return 0; off: @@ -3824,7 +3829,7 @@ quota_mknod_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, GF_VALIDATE_OR_GOTO("quota", local, unwind); - if IS_ERROR((local->op_ret)) { + if (IS_ERROR(local->op_ret)) { op_errno = local->op_errno; goto unwind; } @@ -4005,6 +4010,7 @@ quota_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, { quota_inode_ctx_t *ctx = NULL; quota_local_t *local = NULL; + int ret; if (IS_ERROR(op_ret)) goto out; @@ -4013,8 +4019,9 @@ quota_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (!local) goto out; - op_ret = quota_inode_ctx_get(local->loc.inode, this, &ctx, 1); - if (IS_ERROR((op_ret)) || (ctx == NULL)) { + ret = quota_inode_ctx_get(local->loc.inode, this, &ctx, 1); + if ((ret < 0) || (ctx == NULL)) { + op_ret = gf_failure; op_errno = ENOMEM; goto out; } @@ -4266,7 +4273,7 @@ quota_statfs_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, GF_VALIDATE_OR_GOTO("quota", local, err); - if (-1 == local->op_ret) { + if (IS_ERROR(local->op_ret)) { op_errno = local->op_errno; goto err; } @@ -4352,7 +4359,7 @@ quota_get_limit_dir_continuation(struct list_head *parents, inode_t *inode, frame = data; this = THIS; - if (IS_ERROR((op_ret)) || list_empty(parents)) { + if (IS_ERROR(op_ret) || list_empty(parents)) { if (IS_SUCCESS(op_ret)) { gf_msg(this->name, GF_LOG_WARNING, EIO, Q_MSG_ANCESTRY_BUILD_FAILED, "Couldn't build ancestry for inode (gfid:%s). " @@ -4541,7 +4548,7 @@ quota_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, 0, }; - if (op_ret <= 0) + if (IS_ERROR(op_ret)) goto unwind; local = frame->local; @@ -4652,7 +4659,7 @@ quota_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - if (IS_ERROR((op_ret)) || (local == NULL)) { + if (IS_ERROR(op_ret) || (local == NULL)) { goto out; } @@ -4696,7 +4703,7 @@ quota_fallocate_helper(call_frame_t *frame, xlator_t *this, fd_t *fd, GF_VALIDATE_OR_GOTO("quota", local, unwind); - if IS_ERROR((local->op_ret)) { + if (IS_ERROR(local->op_ret)) { op_errno = local->op_errno; if (op_errno == ENOENT || op_errno == ESTALE) { /* We may get ENOENT/ESTALE in case of below scenario diff --git a/xlators/features/quota/src/quotad-aggregator.c b/xlators/features/quota/src/quotad-aggregator.c index 50a8c3c1cf..e69613969e 100644 --- a/xlators/features/quota/src/quotad-aggregator.c +++ b/xlators/features/quota/src/quotad-aggregator.c @@ -139,7 +139,7 @@ quotad_aggregator_getlimit_cbk(xlator_t *this, call_frame_t *frame, int ret = -1; int type = 0; - if (!rsp || IS_ERROR((rsp->op_ret))) + if (!rsp || (rsp->op_ret < 0)) goto reply; GF_PROTOCOL_DICT_UNSERIALIZE(frame->this, xdata, (rsp->xdata.xdata_val), @@ -281,7 +281,7 @@ quotad_aggregator_getlimit(rpcsvc_request_t *req) err: cli_rsp.op_errno = op_errno; errx: - cli_rsp.op_ret = gf_failure; + cli_rsp.op_ret = -1; cli_rsp.op_errstr = ""; quotad_aggregator_getlimit_cbk(this, frame, &cli_rsp); @@ -370,7 +370,7 @@ quotad_aggregator_lookup(rpcsvc_request_t *req) return ret; err: - rsp.op_ret = gf_failure; + rsp.op_ret = -1; rsp.op_errno = op_errno; quotad_aggregator_lookup_cbk(this, frame, &rsp); diff --git a/xlators/features/quota/src/quotad.c b/xlators/features/quota/src/quotad.c index bb721527bb..c7cb714a07 100644 --- a/xlators/features/quota/src/quotad.c +++ b/xlators/features/quota/src/quotad.c @@ -54,7 +54,7 @@ qd_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, lookup_cbk = cookie; - rsp.op_ret = op_ret; + rsp.op_ret = GET_RET(op_ret); rsp.op_errno = op_errno; gf_stat_from_iatt(&rsp.postparent, postparent); @@ -148,7 +148,7 @@ qd_nameless_lookup(xlator_t *this, call_frame_t *frame, char *gfid, return 0; out: - rsp.op_ret = gf_failure; + rsp.op_ret = -1; rsp.op_errno = op_errno; lookup_cbk(this, frame, &rsp); From 80fd2f27747607604269ad43c5572af747aae95f Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sat, 19 Sep 2020 19:37:18 +0530 Subject: [PATCH 22/24] marker: compiles Change-Id: I34de2b5da56af06b18141c50f5bae786e88f2e4f Signed-off-by: Amar Tumballi --- xlators/features/marker/src/marker.c | 70 ++++++++++++++-------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 70528b18db..6fc0a2f478 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -345,7 +345,7 @@ marker_getxattr_stampfile_cbk(call_frame_t *frame, xlator_t *this, gf_log(this->name, GF_LOG_WARNING, "failed to set key %s", name); } - STACK_UNWIND_STRICT(getxattr, frame, 0, 0, dict, xdata); + STACK_UNWIND_STRICT(getxattr, frame, gf_zero_ret, 0, dict, xdata); if (dict) dict_unref(dict); @@ -568,7 +568,7 @@ marker_specific_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, local = (marker_local_t *)frame->local; - if (op_ret == -1 && op_errno == ENOSPC) { + if (IS_ERROR(op_ret) && op_errno == ENOSPC) { marker_error_handler(this, local, op_errno); goto out; } @@ -723,7 +723,7 @@ marker_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, frame->local = NULL; priv = this->private; - if (op_ret >= 0 && inode && (priv->feature_enabled & GF_QUOTA)) { + if (IS_SUCCESS(op_ret) && inode && (priv->feature_enabled & GF_QUOTA)) { ctx = mq_inode_ctx_new(inode, this); if (ctx == NULL) { gf_log(this->name, GF_LOG_WARNING, @@ -738,7 +738,7 @@ marker_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(mkdir, frame, op_ret, op_errno, inode, buf, preparent, postparent, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; if (gf_uuid_is_null(local->loc.gfid)) @@ -810,7 +810,7 @@ marker_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, frame->local = NULL; priv = this->private; - if (op_ret >= 0 && inode && (priv->feature_enabled & GF_QUOTA)) { + if (IS_SUCCESS(op_ret) && inode && (priv->feature_enabled & GF_QUOTA)) { ctx = mq_inode_ctx_new(inode, this); if (ctx == NULL) { gf_log(this->name, GF_LOG_WARNING, @@ -825,7 +825,7 @@ marker_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(create, frame, op_ret, op_errno, fd, inode, buf, preparent, postparent, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; if (gf_uuid_is_null(local->loc.gfid)) @@ -898,7 +898,7 @@ marker_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, prebuf, postbuf, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -969,7 +969,7 @@ marker_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this, frame->local = NULL; priv = this->private; - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; if (priv->feature_enabled & GF_XTIME) @@ -1057,7 +1057,7 @@ marker_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, frame->local = NULL; priv = this->private; - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; if (priv->feature_enabled & GF_XTIME) @@ -1180,7 +1180,7 @@ marker_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(link, frame, op_ret, op_errno, inode, buf, preparent, postparent, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -1259,7 +1259,7 @@ marker_rename_done(call_frame_t *frame, void *cookie, xlator_t *this, if (local->err != 0) goto err; - mq_reduce_parent_size_txn(this, &oplocal->loc, &oplocal->contribution, gf_failure, + mq_reduce_parent_size_txn(this, &oplocal->loc, &oplocal->contribution, -1, NULL); if (local->loc.inode != NULL) { @@ -1475,7 +1475,7 @@ marker_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(rename, frame, op_ret, op_errno, buf, preoldparent, postoldparent, prenewparent, postnewparent, xdata); - if (IS_ERROR((op_ret)) || (local == NULL)) { + if (IS_ERROR(op_ret) || (local == NULL)) { goto out; } @@ -1498,7 +1498,7 @@ marker_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this, return 0; quota_err: - marker_rename_unwind(frame, NULL, this, 0, 0, NULL); + marker_rename_unwind(frame, NULL, this, gf_zero_ret, 0, NULL); return 0; } @@ -1524,7 +1524,7 @@ marker_do_rename(call_frame_t *frame, void *cookie, xlator_t *this, if (cookie == (void *)_GF_UID_GID_CHANGED) MARKER_RESET_UID_GID(frame, frame->root, local); - if (IS_ERROR((op_ret)) && (op_errno != ENOATTR) && (op_errno != ENODATA)) { + if (IS_ERROR(op_ret) && (op_errno != ENOATTR) && (op_errno != ENODATA)) { local->err = op_errno ? op_errno : EINVAL; gf_log(this->name, GF_LOG_WARNING, "fetching contribution values from %s (gfid:%s) " @@ -1549,7 +1549,7 @@ marker_do_rename(call_frame_t *frame, void *cookie, xlator_t *this, return 0; err: - marker_rename_unwind(frame, NULL, this, 0, 0, NULL); + marker_rename_unwind(frame, NULL, this, gf_zero_ret, 0, NULL); return 0; } @@ -1604,7 +1604,7 @@ marker_get_oldpath_contribution(call_frame_t *lk_frame, void *cookie, return 0; err: - marker_rename_unwind(frame, NULL, this, 0, 0, NULL); + marker_rename_unwind(frame, NULL, this, gf_zero_ret, 0, NULL); return 0; } @@ -1803,7 +1803,7 @@ marker_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(truncate, frame, op_ret, op_errno, prebuf, postbuf, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -1888,7 +1888,7 @@ marker_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(ftruncate, frame, op_ret, op_errno, prebuf, postbuf, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -1961,7 +1961,7 @@ marker_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, frame->local = NULL; priv = this->private; - if (op_ret >= 0 && inode && (priv->feature_enabled & GF_QUOTA)) { + if (IS_SUCCESS(op_ret) && inode && (priv->feature_enabled & GF_QUOTA)) { ctx = mq_inode_ctx_new(inode, this); if (ctx == NULL) { gf_log(this->name, GF_LOG_WARNING, @@ -1976,7 +1976,7 @@ marker_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(symlink, frame, op_ret, op_errno, inode, buf, preparent, postparent, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; if (gf_uuid_is_null(local->loc.gfid)) @@ -2048,7 +2048,7 @@ marker_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, frame->local = NULL; priv = this->private; - if (op_ret >= 0 && inode && (priv->feature_enabled & GF_QUOTA)) { + if (IS_SUCCESS(op_ret) && inode && (priv->feature_enabled & GF_QUOTA)) { ctx = mq_inode_ctx_new(inode, this); if (ctx == NULL) { gf_log(this->name, GF_LOG_WARNING, @@ -2063,7 +2063,7 @@ marker_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(mknod, frame, op_ret, op_errno, inode, buf, preparent, postparent, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; if (gf_uuid_is_null(local->loc.gfid)) @@ -2136,7 +2136,7 @@ marker_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(fallocate, frame, op_ret, op_errno, prebuf, postbuf, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -2204,7 +2204,7 @@ marker_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(discard, frame, op_ret, op_errno, prebuf, postbuf, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -2271,7 +2271,7 @@ marker_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(zerofill, frame, op_ret, op_errno, prebuf, postbuf, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -2397,7 +2397,7 @@ marker_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(setxattr, frame, op_ret, op_errno, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -2457,7 +2457,7 @@ quota_xattr_cleaner_cbk(int ret, call_frame_t *frame, void *args) gf_return_t op_ret = gf_failure; int op_errno = 0; - op_ret = (ret < 0) ? -1 : 0; + op_ret = (ret < 0) ? gf_failure : gf_zero_ret; op_errno = -ret; MARKER_STACK_UNWIND(setxattr, frame, op_ret, op_errno, xdata); @@ -2620,7 +2620,7 @@ marker_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(fsetxattr, frame, op_ret, op_errno, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -2690,7 +2690,7 @@ marker_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(fsetattr, frame, op_ret, op_errno, statpre, statpost, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -2754,7 +2754,7 @@ marker_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(setattr, frame, op_ret, op_errno, statpre, statpost, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -2818,7 +2818,7 @@ marker_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(removexattr, frame, op_ret, op_errno, xdata); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; priv = this->private; @@ -2929,7 +2929,7 @@ marker_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, xattrs = dict_ref(dict); } - if (op_ret >= 0 && inode && (priv->feature_enabled & GF_QUOTA)) { + if (IS_SUCCESS(op_ret) && inode && (priv->feature_enabled & GF_QUOTA)) { ctx = mq_inode_ctx_new(inode, this); if (ctx == NULL) { gf_log(this->name, GF_LOG_WARNING, @@ -2945,7 +2945,7 @@ marker_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, STACK_UNWIND_STRICT(lookup, frame, op_ret, op_errno, inode, buf, xattrs, postparent); - if (op_ret == -1 || local == NULL) + if (IS_ERROR(op_ret) || local == NULL) goto out; /* copy the gfid from the stat structure instead of inode, @@ -3027,7 +3027,7 @@ marker_build_ancestry_cbk(call_frame_t *frame, void *cookie, xlator_t *this, quota_inode_ctx_t *ctx = NULL; int ret = -1; - if ((op_ret <= 0) || (entries == NULL)) { + if (IS_ERROR(op_ret) || (entries == NULL)) { goto out; } @@ -3071,7 +3071,7 @@ marker_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, char *resolvedpath = NULL; quota_inode_ctx_t *ctx = NULL; - if (op_ret <= 0) + if (IS_ERROR(op_ret)) goto unwind; priv = this->private; From 3c0188551e4b90866ac4e9e2d4ba7399885bc38a Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 21 Sep 2020 09:26:03 +0530 Subject: [PATCH 23/24] index & arbiter: compiles Change-Id: I7de6e071ae04674f974a58519dc2e4cef5f4bbd5 Signed-off-by: Amar Tumballi --- xlators/features/arbiter/src/arbiter.c | 2 +- xlators/features/index/src/index.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xlators/features/arbiter/src/arbiter.c b/xlators/features/arbiter/src/arbiter.c index 344b39687c..c8e90d4e04 100644 --- a/xlators/features/arbiter/src/arbiter.c +++ b/xlators/features/arbiter/src/arbiter.c @@ -188,7 +188,7 @@ arbiter_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, goto unwind; } buf = &ctx->iattbuf; - op_ret = iov_length(vector, count); + SET_RET(op_ret, iov_length(vector, count)); rsp_xdata = arbiter_fill_writev_xdata(fd, xdata, this); unwind: STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, buf, buf, rsp_xdata); diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 65f215f1c9..cc2a99f0e3 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -1017,7 +1017,7 @@ xattrop_index_action(xlator_t *this, index_local_t *local, dict_t *xattr, inode = local->inode; req_xdata = local->xdata; - memset(zfilled, gf_failure, sizeof(zfilled)); + memset(zfilled, -1, sizeof(zfilled)); ret = dict_foreach_match(xattr, match, match_data, _check_key_is_zero_filled, zfilled); _index_action(this, inode, zfilled); @@ -1287,7 +1287,7 @@ index_xattrop_do(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, // In wind phase bring the gfid into index. This way if the brick crashes // just after posix performs xattrop before _cbk reaches index xlator // we will still have the gfid in index. - memset(zfilled, gf_failure, sizeof(zfilled)); + memset(zfilled, -1, sizeof(zfilled)); /* Foreach xattr, set corresponding index of zfilled to 1 * zfilled[index] = 1 implies the xattr's value is zero filled @@ -1512,7 +1512,7 @@ index_getxattr_wrapper(call_frame_t *frame, xlator_t *this, loc_t *loc, if (ret) STACK_UNWIND_STRICT(getxattr, frame, gf_failure, -ret, xattr, NULL); else - STACK_UNWIND_STRICT(getxattr, frame, 0, 0, xattr, NULL); + STACK_UNWIND_STRICT(getxattr, frame, gf_zero_ret, 0, xattr, NULL); if (xattr) dict_unref(xattr); @@ -1747,7 +1747,7 @@ index_readdir_wrapper(call_frame_t *frame, xlator_t *this, fd_t *fd, /* pick ENOENT to indicate EOF */ op_errno = errno; - op_ret = count; + SET_RET(op_ret, count); if (index_is_virtual_gfid(priv, fd->inode->gfid) && xdata && dict_get(xdata, "get-gfid-type")) { args.parent = fd->inode; @@ -1796,7 +1796,7 @@ index_wipe_index_subdir(void *opaque) static void index_get_parent_iatt(struct iatt *parent, char *path, loc_t *loc, - int32_t *op_ret, int32_t *op_errno) + gf_return_t *op_ret, int32_t *op_errno) { int ret = -1; struct stat lstatbuf = { @@ -2154,7 +2154,7 @@ index_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, goto normal; frame->local = NULL; - STACK_UNWIND_STRICT(opendir, frame, 0, 0, fd, NULL); + STACK_UNWIND_STRICT(opendir, frame, gf_zero_ret, 0, fd, NULL); return 0; normal: From efd7fd9b86bfb932bb9d37c1029e21248ec430f5 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 21 Sep 2020 09:29:07 +0530 Subject: [PATCH 24/24] upcall: compiles Change-Id: I6a82398201de724c96aebb6d30264e07c266d98b Signed-off-by: Amar Tumballi --- xlators/features/upcall/src/upcall.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c index 16b0c05a95..3142421da7 100644 --- a/xlators/features/upcall/src/upcall.c +++ b/xlators/features/upcall/src/upcall.c @@ -40,7 +40,7 @@ up_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if (IS_ERROR((op_ret)) || !local) { + if (IS_ERROR(op_ret) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -91,7 +91,7 @@ up_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if (IS_ERROR((op_ret)) || !local) { + if (IS_ERROR(op_ret) || !local) { goto out; } flags = UP_WRITE_FLAGS; @@ -147,7 +147,7 @@ up_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this, client = frame->root->client; local = frame->local; - if (IS_ERROR((op_ret)) || !local) { + if (IS_ERROR(op_ret) || !local) { goto out; } flags = UP_UPDATE_CLIENT; @@ -1606,7 +1606,7 @@ up_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = up_filter_xattr(local->xattr, priv->xattrs); if (ret < 0) { - op_ret = ret; + SET_RET(op_ret, ret); goto out; } if (!up_invalidate_needed(local->xattr)) @@ -1680,7 +1680,7 @@ up_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = up_filter_xattr(local->xattr, priv->xattrs); if (ret < 0) { - op_ret = ret; + SET_RET(op_ret, ret); goto out; } if (!up_invalidate_needed(local->xattr)) @@ -1753,7 +1753,7 @@ up_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = up_filter_xattr(local->xattr, priv->xattrs); if (ret < 0) { - op_ret = ret; + SET_RET(op_ret, ret); goto out; } if (!up_invalidate_needed(local->xattr)) @@ -1836,7 +1836,7 @@ up_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, ret = up_filter_xattr(local->xattr, priv->xattrs); if (ret < 0) { - op_ret = ret; + SET_RET(op_ret, ret); goto out; } if (!up_invalidate_needed(local->xattr)) @@ -2198,7 +2198,8 @@ up_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata) { upcall_private_t *priv = NULL; int ret = 0; - + gf_return_t op_ret; + priv = this->private; GF_VALIDATE_OR_GOTO(this->name, priv, out); @@ -2215,7 +2216,8 @@ up_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata) } out: - STACK_UNWIND_STRICT(ipc, frame, ret, 0, NULL); + SET_RET(op_ret, ret); + STACK_UNWIND_STRICT(ipc, frame, op_ret, 0, NULL); return 0; wind: