From: Greg Farnum Date: Thu, 30 Jan 2014 22:27:04 +0000 (-0800) Subject: FileStore: remove the fdcache_lock X-Git-Tag: v0.85~37^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=95ac43f34cca6b97456bc06223cf3c1287630074;p=ceph.git FileStore: remove the fdcache_lock With the changes to the shared_cache, we no longer need the fdcache_lock to prevent us from inserting a second fd for the same hobject into the cache. Signed-off-by: Greg Farnum Merged conflict fixed. Signed-off-by: Somnath Roy Conflicts: src/os/FileStore.cc --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index b3f06f20d631..436f1e772ae1 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -236,7 +236,6 @@ int FileStore::lfn_open(coll_t cid, int fd, exist; if (!replaying) { - Mutex::Locker l(fdcache_lock); *outfd = fdcache.lookup(oid); if (*outfd) return 0; @@ -287,15 +286,11 @@ int FileStore::lfn_open(coll_t cid, } if (!replaying) { - Mutex::Locker l(fdcache_lock); - *outfd = fdcache.lookup(oid); - if (*outfd) { - VOID_TEMP_FAILURE_RETRY(::close(fd)); + bool existed; + *outfd = fdcache.add(oid, fd, &existed); + if (existed) { + TEMP_FAILURE_RETRY(::close(fd)); return 0; - } else { - bool existed; - *outfd = fdcache.add(oid, fd, &existed); - assert(!existed); } } else { *outfd = FDRef(new FDCache::FD(fd)); @@ -376,7 +371,6 @@ int FileStore::lfn_unlink(coll_t cid, const ghobject_t& o, int r = get_index(cid, &index); if (r < 0) return r; - Mutex::Locker l(fdcache_lock); { IndexedPath path; int exist; @@ -436,7 +430,6 @@ FileStore::FileStore(const std::string &base, const std::string &jdev, const cha sync_entry_timeo_lock("sync_entry_timeo_lock"), timer(g_ceph_context, sync_entry_timeo_lock), stop(false), sync_thread(this), - fdcache_lock("fdcache_lock"), fdcache(g_ceph_context), wbthrottle(g_ceph_context), default_osr("default"), diff --git a/src/os/FileStore.h b/src/os/FileStore.h index ca3def0d3afa..34c46c55b5d4 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -321,7 +321,6 @@ private: friend ostream& operator<<(ostream& out, const OpSequencer& s); - Mutex fdcache_lock; FDCache fdcache; WBThrottle wbthrottle;