]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/os/filestore/FileStore.cc
update sources to v12.1.3
[ceph.git] / ceph / src / os / filestore / FileStore.cc
index f9b931a62861640e0edf94820a22aaf9794a6ef4..b097a3c18a61ba812932f636680b0470ebae1109 100644 (file)
@@ -1157,6 +1157,30 @@ bool FileStore::is_rotational()
   return rotational;
 }
 
+bool FileStore::is_journal_rotational()
+{
+  bool journal_rotational;
+  if (backend) {
+    journal_rotational = backend->is_journal_rotational();
+  } else {
+    int fd = ::open(journalpath.c_str(), O_RDONLY);
+    if (fd < 0)
+      return true;
+    struct statfs st;
+    int r = ::fstatfs(fd, &st);
+    ::close(fd);
+    if (r < 0) {
+      return true;
+    }
+    create_backend(st.f_type);
+    journal_rotational = backend->is_journal_rotational();
+    delete backend;
+    backend = NULL;
+  }
+  dout(10) << __func__ << " " << (int)journal_rotational << dendl;
+  return journal_rotational;
+}
+
 int FileStore::_detect_fs()
 {
   struct statfs st;