Skip to content

Commit

Permalink
Merge branch 'tp/ibm_next_may8_1' into ibm_next_tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Venkateswararao Jujjuri committed May 10, 2012
2 parents 705c805 + 1be6c36 commit 9694d37
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Cache_inode/cache_inode_open_close.c
Expand Up @@ -317,7 +317,8 @@ cache_inode_close(cache_entry_t *entry,
*status, cache_inode_err_str(*status));
goto unlock;
}
atomic_dec_int(&open_fd_count);
if (!FSAL_IS_ERROR(fsal_status))
atomic_dec_int(&open_fd_count);
}

*status = CACHE_INODE_SUCCESS;
Expand Down
15 changes: 11 additions & 4 deletions src/Cache_inode/cache_inode_rdwr.c
Expand Up @@ -254,21 +254,28 @@ cache_inode_rdwr(cache_entry_t *entry,

if (fsal_status.major == ERR_FSAL_STALE) {
cache_inode_kill_entry(entry, client);
goto out;
}

if ((fsal_status.major != ERR_FSAL_NOT_OPENED)
&& (entry->object.file.open_fd.openflags
!= FSAL_O_CLOSED)) {
fsal_status_t cfsal_status = {0, 0};
LogFullDebug(COMPONENT_CACHE_INODE,
"cache_inode_rdwr: CLOSING entry %p",
entry);

pthread_rwlock_unlock(&entry->content_lock);
pthread_rwlock_wrlock(&entry->content_lock);
FSAL_close(&(entry->object.file.open_fd.fd));
entry->object.file.open_fd.openflags
= FSAL_O_CLOSED;
atomic_dec_int(&open_fd_count);
cfsal_status = FSAL_close(&(entry->object.file.open_fd.fd));
if (!FSAL_IS_ERROR(cfsal_status) ||
(cfsal_status.major == ERR_FSAL_NOT_OPENED)) {
entry->object.file.open_fd.openflags = FSAL_O_CLOSED;
}

if (!FSAL_IS_ERROR(cfsal_status))
atomic_dec_int(&open_fd_count);

*status = cache_inode_error_convert(fsal_status);
}

Expand Down

0 comments on commit 9694d37

Please sign in to comment.