-
Notifications
You must be signed in to change notification settings - Fork 1
all: return value signature changes #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gmaster
Are you sure you want to change the base?
Conversation
bbcf7d2 to
3f80f3c
Compare
libglusterfs/src/gen-defaults.py
Outdated
| return 0; | ||
| gf_return_t ret; | ||
| ret.op_ret = -1; | ||
| STACK_UNWIND_STRICT (@NAME@, frame, ret, op_errno, @ERROR_ARGS@); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just use gf_error
| #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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(val) is recommened.
libglusterfs/src/glusterfs/syncop.h
Outdated
| \ | ||
| if (!frame) { \ | ||
| stb->op_ret = -1; \ | ||
| stb->op_ret.op_ret = -1; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set to gf_error
| GF_XLATOR_BACKEND = 125, | ||
| GF_XLATOR_EXTERNAL = 126, | ||
| GF_XLATOR_MAXVALUE = 127, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a complete list!
libglusterfs/src/inode.c
Outdated
| 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)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use some other type.
| */ | ||
| AFR_STACK_UNWIND(setxattr, frame, 0, 0, NULL); | ||
| gf_return_t op_ret = {0}; | ||
| AFR_STACK_UNWIND(setxattr, frame, op_ret, 0, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gf_success
| gf_msg_debug(this->name, 0, "we're done locking"); | ||
|
|
||
| int_lock->lock_op_ret = 0; | ||
| SET_RET(int_lock->lock_op_ret, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gf_success
| &local->stbuf, &local->preparent, | ||
| &local->postparent, local->xattr); | ||
| SET_RET(op_ret, 0); | ||
| dht_lookup_linkfile_create_cbk( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gf_success
xlators/cluster/dht/src/dht-common.c
Outdated
| @@ -8760,17 +8801,19 @@ dht_create_finish(call_frame_t *frame, xlator_t *this, int op_ret, | |||
| DHT_STACK_DESTROY(lock_frame); | |||
| } | |||
|
|
|||
| if (op_ret == 0) | |||
| if (ret >= 0) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ret == 0
xlators/cluster/dht/src/dht-rename.c
Outdated
| } | ||
| } | ||
| if (local->ret_cache[conf->subvolume_cnt]) { | ||
| if (IS_SUCCESS(local->ret_cache[conf->subvolume_cnt])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IS_ERROR()
* return signature of all 'fops' callback changed to `gf_return_t`. * provide IS_ERROR()/IS_SUCCESS() macros to check only this type of argument. * provide 2 global variables `gf_success` and `gf_error` introduced, which can used instead of -1 and 0 return used largely today. Change-Id: Ib91216afaa89d7e4509757b50dd8a7d60a6bf0a9 Updates: #280 Signed-off-by: Amar Tumballi <amar@kadalu.io>
3f80f3c to
30c49d1
Compare
return signature of all 'fops' callback changed to
gf_return_t.provide IS_ERROR()/IS_SUCCESS() macros to check only this type of argument.
provide 2 global variables
gf_successandgf_errorintroduced, whichcan used instead of -1 and 0 return used largely today.
Change-Id: Ib91216afaa89d7e4509757b50dd8a7d60a6bf0a9
Updates: #280
Signed-off-by: Amar Tumballi amar@kadalu.io