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>
This commit is contained in:
parent
4a339be28a
commit
10b4ecb85c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user