There's no reason to use std::mutex where we can use Osv's "mutex".
std::mutex basically wraps OSv's mutex by a Posix mutex and then C++'s
mutex implementation, adding both compile-time and run-time overheads -
which are not huge, but not zero either.

To use "mutex" we need to stop doing "using namespace std", because that
makes the name "mutex" ambiguous.

Signed-off-by: Nadav Har'El <>
 fs/vfs/ | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/vfs/ b/fs/vfs/
index ef6f29e..9e241ad 100644
--- a/fs/vfs/
+++ b/fs/vfs/
@@ -53,17 +53,15 @@
 #include <memory>
 #include <list>
-using namespace std;
  * List for VFS mount points.
-static list<mount*> mount_list;
+static std::list<mount*> mount_list;
  * Global lock to access mount point.
-static std::mutex mount_lock;
+static mutex mount_lock;
  * Lookup file system.
@@ -452,11 +450,11 @@ mount_desc to_mount_desc(mount* m)
     return ret;
     WITH_LOCK(mount_lock) {
-        vector<mount_desc> ret;
+        std::vector<mount_desc> ret;
         for (auto&& mp : mount_list) {

You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to