]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
WBThrottle: rename replica nocache
authorSamuel Just <sam.just@inktank.com>
Wed, 29 May 2013 22:05:34 +0000 (15:05 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 29 May 2013 22:05:34 +0000 (15:05 -0700)
We may want to influence the caching behavior for other
reasons.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/os/WBThrottle.cc
src/os/WBThrottle.h

index 12186445bc154be1ea187512471bf6a577b019ea..23e24765cc2424e06d58d10368ad882e5d35f70f 100644 (file)
@@ -146,7 +146,7 @@ void *WBThrottle::entry()
     clearing = wb.get<0>();
     lock.Unlock();
     ::fsync(**wb.get<1>());
-    if (wb.get<2>().replica)
+    if (wb.get<2>().nocache)
       posix_fadvise(**wb.get<1>(), 0, 0, POSIX_FADV_DONTNEED);
     lock.Lock();
     clearing = hobject_t();
@@ -163,7 +163,7 @@ void *WBThrottle::entry()
 
 void WBThrottle::queue_wb(
   FDRef fd, const hobject_t &hoid, uint64_t offset, uint64_t len,
-  bool replica)
+  bool nocache)
 {
   Mutex::Locker l(lock);
   map<hobject_t, pair<PendingWB, FDRef> >::iterator wbiter =
@@ -184,7 +184,7 @@ void WBThrottle::queue_wb(
   cur_size += len;
   logger->inc(l_wbthrottle_bytes_dirtied, len);
 
-  wbiter->second.first.add(replica, len, 1);
+  wbiter->second.first.add(nocache, len, 1);
   insert_object(hoid);
   cond.Signal();
 }
index a188855b268c2f85e3f445462236230aecd3245d..797a6e78246ba4600e3c719c0c0891ca988c9c69 100644 (file)
@@ -63,13 +63,13 @@ class WBThrottle : Thread, public md_config_obs_t {
    */
   class PendingWB {
   public:
-    bool replica;
+    bool nocache;
     uint64_t size;
     uint64_t ios;
-    PendingWB() : replica(true), size(0), ios(0) {}
-    void add(bool _replica, uint64_t _size, uint64_t _ios) {
-      if (!_replica)
-       replica = false; // only replica if all writes are replica
+    PendingWB() : nocache(true), size(0), ios(0) {}
+    void add(bool _nocache, uint64_t _size, uint64_t _ios) {
+      if (!_nocache)
+       nocache = false; // only nocache if all writes are nocache
       size += _size;
       ios += _ios;
     }
@@ -143,7 +143,7 @@ public:
     const hobject_t &hoid, ///< [in] object
     uint64_t offset,       ///< [in] offset written
     uint64_t len,          ///< [in] length written
-    bool replica           ///< [in] write is for replica
+    bool nocache           ///< [in] try to clear out of cache after write
     );
 
   /// Clear all wb (probably due to sync)