Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT(cosfs, 1.0.13)
AC_INIT(cosfs, 1.0.14)
AC_CONFIG_HEADER([config.h])

AC_CANONICAL_SYSTEM
Expand Down
10 changes: 8 additions & 2 deletions src/fdcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,10 @@ bool FdEntity::OpenAndLoadAll(headers_t* pmeta, size_t* size, bool force_load)

bool FdEntity::GetStats(struct stat& st)
{
AutoLock auto_lock(&fdent_lock);
if(-1 == fd){
return false;
}
AutoLock auto_lock(&fdent_lock);

memset(&st, 0, sizeof(struct stat));
if(-1 == fstat(fd, &st)){
Expand All @@ -899,8 +899,8 @@ int FdEntity::SetMtime(time_t time)
if(-1 == time){
return 0;
}
AutoLock auto_lock(&fdent_lock);
if(-1 != fd){
AutoLock auto_lock(&fdent_lock);

struct timeval tv[2];
tv[0].tv_sec = time;
Expand Down Expand Up @@ -928,6 +928,7 @@ int FdEntity::SetMtime(time_t time)

bool FdEntity::UpdateMtime(void)
{
AutoLock auto_lock(&fdent_lock);
struct stat st;
if(!GetStats(st)){
return false;
Expand All @@ -949,18 +950,21 @@ bool FdEntity::GetSize(size_t& size)

bool FdEntity::SetMode(mode_t mode)
{
AutoLock auto_lock(&fdent_lock);
orgmeta["x-cos-meta-mode"] = str(mode);
return true;
}

bool FdEntity::SetUId(uid_t uid)
{
AutoLock auto_lock(&fdent_lock);
orgmeta["x-cos-meta-uid"] = str(uid);
return true;
}

bool FdEntity::SetGId(gid_t gid)
{
AutoLock auto_lock(&fdent_lock);
orgmeta["x-cos-meta-gid"] = str(gid);
return true;
}
Expand All @@ -970,6 +974,7 @@ bool FdEntity::SetContentType(const char* path)
if(!path){
return false;
}
AutoLock auto_lock(&fdent_lock);
orgmeta["Content-Type"] = S3fsCurl::LookupMimeType(string(path));
return true;
}
Expand Down Expand Up @@ -1885,6 +1890,7 @@ FdEntity* FdManager::ExistOpen(const char* path, int existfd, bool ignore_existf

void FdManager::Rename(const std::string &from, const std::string &to)
{
AutoLock auto_lock(&FdManager::fd_manager_lock);
fdent_map_t::iterator iter = fent.find(from);
if(fent.end() != iter){
// found
Expand Down