summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand V. Avati <avati@amp.gluster.com>2009-04-17 23:35:43 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-04-17 23:35:43 +0530
commit50b2291e3b046ea6b8fdfcb7e206c772eae64f0e (patch)
tree53e544086f9ae24cc1a00623aeaa4cf8cd4ef617
parent1d6dfe94fb970b51d96653da6c3361533d697fc3 (diff)
iobuf - account with iobref_size() instead of iov_length (vector)
-rw-r--r--xlators/performance/io-cache/src/io-cache.c5
-rw-r--r--xlators/performance/io-cache/src/page.c9
2 files changed, 9 insertions, 5 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index 0c394b84e..3082242b3 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -264,7 +264,7 @@ ioc_lookup_cbk (call_frame_t *frame,
ioc_table_lock (table);
{
table->cache_used -=
- page->size;
+ iobref_size (page->iobref);
}
ioc_table_unlock (table);
} else {
@@ -291,7 +291,8 @@ ioc_lookup_cbk (call_frame_t *frame,
ioc_table_lock (table);
{
- table->cache_used += page->size;
+ table->cache_used +=
+ iobref_size (page->iobref);
}
ioc_table_unlock (table);
diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c
index 98897b7d9..73db26db8 100644
--- a/xlators/performance/io-cache/src/page.c
+++ b/xlators/performance/io-cache/src/page.c
@@ -74,7 +74,7 @@ ioc_page_destroy (ioc_page_t *page)
{
int64_t page_size = 0;
- page_size = page->size;
+ page_size = iobref_size (page->iobref);
if (page->waitq) {
/* frames waiting on this page, do not destroy this page */
@@ -336,6 +336,7 @@ ioc_fault_cbk (call_frame_t *frame,
int32_t destroy_size = 0;
size_t page_size = 0;
ioc_waitq_t *waitq = NULL;
+ size_t iobref_page_size = 0;
trav_offset = offset;
payload_size = op_ret;
@@ -403,6 +404,8 @@ ioc_fault_cbk (call_frame_t *frame,
page->size = page_size;
+ iobref_page_size = iobref_size (page->iobref);
+
if (page->waitq) {
/* wake up all the frames waiting on
* this page, including
@@ -416,10 +419,10 @@ ioc_fault_cbk (call_frame_t *frame,
ioc_waitq_return (waitq);
- if (page_size) {
+ if (iobref_page_size) {
ioc_table_lock (table);
{
- table->cache_used += page_size;
+ table->cache_used += iobref_page_size;
}
ioc_table_unlock (table);
}