diff options
author | Raghavendra G <raghavendra@zresearch.com> | 2009-05-04 10:33:11 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-05 12:06:58 +0530 |
commit | 80c30634da16f7b333d07eeff9839b70d577e39f (patch) | |
tree | 3e0273450b20d166714f5efd5e47b78dfdf8c2b6 /xlators/performance/io-cache/src/ioc-inode.c | |
parent | 5d417f0f8853e4f17caf25255f98c559f3670434 (diff) |
io-cache: indentation and logging fixes
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance/io-cache/src/ioc-inode.c')
-rw-r--r-- | xlators/performance/io-cache/src/ioc-inode.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/xlators/performance/io-cache/src/ioc-inode.c b/xlators/performance/io-cache/src/ioc-inode.c index 917391de5ab..c984ce1337f 100644 --- a/xlators/performance/io-cache/src/ioc-inode.c +++ b/xlators/performance/io-cache/src/ioc-inode.c @@ -33,7 +33,9 @@ void * str_to_ptr (char *string) { - void *ptr = (void *)strtoul (string, NULL, 16); + void *ptr = NULL; + + ptr = (void *)strtoul (string, NULL, 16); return ptr; } @@ -46,23 +48,23 @@ str_to_ptr (char *string) char * ptr_to_str (void *ptr) { - char *str; + char *str = NULL; asprintf (&str, "%p", ptr); return str; } void -ioc_inode_wakeup (call_frame_t *frame, - ioc_inode_t *ioc_inode, - struct stat *stbuf) +ioc_inode_wakeup (call_frame_t *frame, ioc_inode_t *ioc_inode, + struct stat *stbuf) { ioc_waitq_t *waiter = NULL, *waited = NULL; ioc_waitq_t *page_waitq = NULL; - int8_t cache_still_valid = 1; - ioc_local_t *local = frame->local; - int8_t need_fault = 0; - ioc_page_t *waiter_page = NULL; + int8_t cache_still_valid = 1; + ioc_local_t *local = NULL; + int8_t need_fault = 0; + ioc_page_t *waiter_page = NULL; + local = frame->local; ioc_inode_lock (ioc_inode); { waiter = ioc_inode->waitq; @@ -143,11 +145,11 @@ ioc_inode_wakeup (call_frame_t *frame, * not for external reference */ ioc_inode_t * -ioc_inode_update (ioc_table_t *table, - inode_t *inode, - uint32_t weight) +ioc_inode_update (ioc_table_t *table, inode_t *inode, uint32_t weight) { - ioc_inode_t *ioc_inode = CALLOC (1, sizeof (ioc_inode_t)); + ioc_inode_t *ioc_inode = NULL; + + ioc_inode = CALLOC (1, sizeof (ioc_inode_t)); ERR_ABORT (ioc_inode); ioc_inode->table = table; @@ -185,7 +187,9 @@ ioc_inode_update (ioc_table_t *table, void ioc_inode_destroy (ioc_inode_t *ioc_inode) { - ioc_table_t *table = ioc_inode->table; + ioc_table_t *table = NULL; + + table = ioc_inode->table; ioc_table_lock (table); table->inode_count--; @@ -198,4 +202,3 @@ ioc_inode_destroy (ioc_inode_t *ioc_inode) pthread_mutex_destroy (&ioc_inode->inode_lock); free (ioc_inode); } - |