-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
make functions static/remove redundant checks [afr] #3348
Conversation
@@ -729,7 +729,7 @@ afr_copy_frame(call_frame_t *base) | |||
} | |||
|
|||
/* Check if an entry or inode could be undergoing a transaction. */ | |||
gf_boolean_t | |||
static gf_boolean_t | |||
afr_is_possibly_under_txn(afr_transaction_type type, afr_local_t *local, |
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.
nit: this one is a good example - you do not need really to pass 'this' , as you need 'priv'. To be more accurate, you need 'priv->child_count' - which is already available in the 2 callers of this function. We could pass it instead of 'this'. It could be in a follow-up patch of course (and perhaps the compiler already does that?)
@@ -1118,7 +1118,7 @@ __afr_inode_read_subvol_get(inode_t *inode, xlator_t *this, unsigned char *data, | |||
return ret; | |||
} | |||
|
|||
int | |||
static int | |||
__afr_inode_split_brain_choice_get(inode_t *inode, xlator_t *this, |
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.
nit: this one is called only once, from afr_inode_split_brain_choice_get() which by itself is static - can probably be folded into it? (I've done it here for example - https://github.com/gluster/glusterfs/pull/3327/files )
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.
@mykaul do you suggest incoporating your changes of altering the return type of __afr_inode_ctx_get() to resolve the above or simply clubbing the two funcs to resolve the above in this patch?
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.
The latter, if anything (or we can keep it for later).
@@ -1572,7 +1572,7 @@ afr_set_split_brain_choice(int ret, call_frame_t *frame, void *opaque) | |||
return 0; | |||
} | |||
|
|||
int | |||
static int | |||
afr_accused_fill(xlator_t *this, dict_t *xdata, unsigned char *accused, |
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.
nit: same as previously, instead of 'this' - you can pass 'priv'. Worth doing in a different patch though.
Change-Id: I96172331f1aa0ff2d65ea2a876303ec799bf5144
Change-Id: Ic3e0a9c8b2db515ca4b5eedfda36b54c4ac9f77b
348d16b
to
5f2dcbb
Compare
Will be sending a new patch for the above changes |
/run regression |
LGTM |
Made relevant functions static in afr component to improve code readability and performance. Also removed redundant null checks Reference to issue gluster#2967 Change-Id: I96172331f1aa0ff2d65ea2a876303ec799bf5144 Signed-off-by: Harshita Shree <hshree@redhat.com>
Made relevant functions static in afr component to improve code readability and performance. Also removed redundant null checks Reference to issue #2967 Change-Id: I96172331f1aa0ff2d65ea2a876303ec799bf5144 Signed-off-by: Harshita Shree <hshree@redhat.com> Co-authored-by: Harshita Shree <97235968+harshita-shree@users.noreply.github.com>
Follow up patch for #3348 which simplifies afr function calls . For instance using replacing xlator_t * with afr_private_t * where needed. Change-Id: Iaa7b692ed479c8a2bdf7943a6ca1932457a83c99 Signed-off-by : Harshita Shree <hshree@redhat.com>
Making relevant functions static and removed redundant checks on arguments in the DHT component. Sequence to the patch gluster#3348 Updates gluster#2967 Change-Id: I8e71d82a5a988d815ce7cb6f4021ffde34f6256c Signed-off-by: Harshita Shree <hshree@redhat.com>
Made relevant functions static in afr component to improve code readability and performance.
Also removed redundant null checks
Reference to issue #2967
Change-Id: I96172331f1aa0ff2d65ea2a876303ec799bf5144
Signed-off-by: Harshita Shree hshree@redhat.com