]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
FileStore: remove the fdcache_lock
authorGreg Farnum <greg@inktank.com>
Thu, 30 Jan 2014 22:27:04 +0000 (14:27 -0800)
committerSomnath Roy <somnath.roy@sandisk.com>
Thu, 14 Aug 2014 22:28:30 +0000 (15:28 -0700)
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 <greg@inktank.com>
Merged conflict fixed.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
Conflicts:
src/os/FileStore.cc

src/os/FileStore.cc
src/os/FileStore.h

index b3f06f20d6315d5709e68e5979ac1f976f94e521..436f1e772ae1b52f31390250986ba89a0d9a217e 100644 (file)
@@ -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"),
index ca3def0d3afae2964f59e90acf0a130d961032c2..34c46c55b5d45dc65cb7ae3904b7a1a9b631fc62 100644 (file)
@@ -321,7 +321,6 @@ private:
 
   friend ostream& operator<<(ostream& out, const OpSequencer& s);
 
-  Mutex fdcache_lock;
   FDCache fdcache;
   WBThrottle wbthrottle;