diff options
author | Raghavendra Talur <rtalur@redhat.com> | 2015-03-05 18:19:30 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-04-02 03:08:36 -0700 |
commit | 10b4ecb85c5009c6c7b9422bd5299ba43d8448a1 (patch) | |
tree | ba85f07d5d3c150051c0f344536fb2ce7347af3d /libglusterfs/src | |
parent | 4a339be28a715aa22d8d07b3137920edea8a1c4a (diff) |
iobuf: Do not call __iobuf_ref directly
iobuf_get will be creating the iobuf and
hence lock is not necessary to increment ref.
However, it is a good practice to call
iobuf_ref instead of __iobuf_ref so that
we have a single point to get refs and
this can be used later to do mem
accounting etc.
Change-Id: I1fd328c3c463c23fd5f6df505ccb5c86f6207f28
BUG: 1199075
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/9812
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/iobuf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c index c414d728037..9dbf19b71d7 100644 --- a/libglusterfs/src/iobuf.c +++ b/libglusterfs/src/iobuf.c @@ -665,7 +665,7 @@ iobuf_get2 (struct iobuf_pool *iobuf_pool, size_t page_size) if (!iobuf) goto unlock; - __iobuf_ref (iobuf); + iobuf_ref (iobuf); } unlock: pthread_mutex_unlock (&iobuf_pool->mutex); @@ -698,7 +698,7 @@ iobuf_get (struct iobuf_pool *iobuf_pool) goto unlock; } - __iobuf_ref (iobuf); + iobuf_ref (iobuf); } unlock: pthread_mutex_unlock (&iobuf_pool->mutex); |