]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/bluefs: update mtime of inode in unified path
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 31 Aug 2016 01:55:04 +0000 (09:55 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 31 Aug 2016 02:36:41 +0000 (10:36 +0800)
To reduce code redundancy.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueFS.cc

index 2b4cec5dec3daac134c4b6fc25b0d855e03b925d..8268c5632ec095491b60d45797d4a6759c682d0d 100644 (file)
@@ -156,7 +156,7 @@ int BlueFS::reclaim_blocks(unsigned id, uint64_t want,
 {
   std::unique_lock<std::mutex> l(lock);
   dout(1) << __func__ << " bdev " << id
-          << " want 0x" << std::hex << want << std:: dec << dendl;
+          << " want 0x" << std::hex << want << std::dec << dendl;
   assert(id < alloc.size());
   assert(alloc[id]);
   int r = alloc[id]->reserve(want);
@@ -1770,7 +1770,6 @@ int BlueFS::open_for_write(
     }
     file = new File;
     file->fnode.ino = ++ino_last;
-    file->fnode.mtime = ceph_clock_now(NULL);
     file_map[ino_last] = file;
     dir->file_map[filename] = file;
     ++file->refs;
@@ -1792,9 +1791,9 @@ int BlueFS::open_for_write(
       }
       file->fnode.extents.clear();
     }
-    file->fnode.mtime = ceph_clock_now(NULL);
   }
 
+  file->fnode.mtime = ceph_clock_now(NULL);
   file->fnode.prefer_bdev = BlueFS::BDEV_DB;
   if (dirname.length() > 5) {
     // the "db.slow" and "db.wal" directory names are hard-coded at