summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-cache/src/io-cache.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@zresearch.com>2009-03-04 04:00:24 -0800
committerAnand V. Avati <avati@amp.gluster.com>2009-03-05 01:04:34 +0530
commit762b1f9aefe07971178e584e288833bf142f402b (patch)
tree75aa359b245ca2f95af82866abc937e47bdc6654 /xlators/performance/io-cache/src/io-cache.c
parentc8340e70f881dbb95d5238e588a7e985f6f04816 (diff)
code changes in the usage of inode_ctx_get and inode_ctx_put after their implementation is changed to hold inode->lock.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance/io-cache/src/io-cache.c')
-rw-r--r--xlators/performance/io-cache/src/io-cache.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index 55dfa5ac6..00d95857d 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -616,30 +616,29 @@ ioc_open_cbk (call_frame_t *frame,
if (op_ret != -1) {
/* look for ioc_inode corresponding to this fd */
LOCK (&fd->inode->lock);
- //{
-
- inode_ctx_get (fd->inode, this, &tmp_ioc_inode);
- ioc_inode = (ioc_inode_t *)(long)tmp_ioc_inode;
-
- if (!ioc_inode) {
- /* this is the first time someone is opening this
- file, assign weight
- */
- weight = ioc_get_priority (table, path);
+ {
+ __inode_ctx_get (fd->inode, this, &tmp_ioc_inode);
+ ioc_inode = (ioc_inode_t *)(long)tmp_ioc_inode;
+
+ if (!ioc_inode) {
+ /* this is the first time someone is opening this
+ file, assign weight
+ */
+ weight = ioc_get_priority (table, path);
- ioc_inode = ioc_inode_update (table, inode, weight);
- inode_ctx_put (fd->inode, this,
- (uint64_t)(long)ioc_inode);
- } else {
- ioc_table_lock (ioc_inode->table);
- //{
- list_move_tail (&ioc_inode->inode_lru,
- &table->inode_lru[ioc_inode->weight]);
- //}
- ioc_table_unlock (ioc_inode->table);
- }
+ ioc_inode = ioc_inode_update (table, inode, weight);
+ __inode_ctx_put (fd->inode, this,
+ (uint64_t)(long)ioc_inode);
+ } else {
+ ioc_table_lock (ioc_inode->table);
+ {
+ list_move_tail (&ioc_inode->inode_lru,
+ &table->inode_lru[ioc_inode->weight]);
+ }
+ ioc_table_unlock (ioc_inode->table);
+ }
- //}
+ }
UNLOCK (&fd->inode->lock);
/* If mandatory locking has been enabled on this file,