[devmgr] Replace devmgr dispatcher with libasync

Change-Id: I91781a4e605792341b10eda09a77bb4fca377ffe
Esse commit está contido em:
Sean Klein
2017-09-07 11:59:44 -07:00
commit de CQ bot account: commit-bot@chromium.org
commit d02a1325d3
2 arquivos alterados com 16 adições e 10 exclusões
+4 -1
Ver Arquivo
@@ -37,8 +37,10 @@ MODULE_HEADER_DEPS := \
system/ulib/ddk
MODULE_STATIC_LIBS := \
system/ulib/gpt \
system/ulib/fs \
system/ulib/async \
system/ulib/async.loop \
system/ulib/gpt \
system/ulib/mx \
system/ulib/bootdata \
third_party/ulib/lz4 \
@@ -49,6 +51,7 @@ MODULE_STATIC_LIBS := \
system/ulib/driver-info \
MODULE_LIBS := \
system/ulib/async.default \
system/ulib/fs-management \
system/ulib/launchpad \
system/ulib/mxio \
+12 -9
Ver Arquivo
@@ -9,19 +9,20 @@
#include <string.h>
#include <sys/stat.h>
#include <async/loop.h>
#include <ddk/device.h>
#include <fs/mxio-dispatcher.h>
#include <fs/vfs.h>
#include <magenta/device/vfs.h>
#include <magenta/thread_annotations.h>
#include <mxio/debug.h>
#include <mxio/vfs.h>
#include <fbl/algorithm.h>
#include <fbl/alloc_checker.h>
#include <fbl/atomic.h>
#include <fbl/auto_lock.h>
#include <fbl/ref_ptr.h>
#include <fbl/unique_ptr.h>
#include <fs/async-dispatcher.h>
#include <fs/vfs.h>
#include <magenta/device/vfs.h>
#include <magenta/thread_annotations.h>
#include <mxio/debug.h>
#include <mxio/vfs.h>
#include "devmgr.h"
#include "dnode.h"
@@ -33,7 +34,8 @@ namespace memfs {
namespace {
fs::Vfs vfs;
fbl::unique_ptr<fs::MxioDispatcher> global_dispatcher;
fbl::unique_ptr<async::Loop> global_loop;
fbl::unique_ptr<fs::AsyncDispatcher> global_dispatcher;
}
@@ -777,8 +779,9 @@ VnodeDir* vfs_create_global_root() {
memfs_create_directory_unsafe("/volume", 0);
memfs_create_directory_unsafe("/dev/socket", 0);
fs::MxioDispatcher::Create(&memfs::global_dispatcher);
memfs::global_dispatcher->StartThread();
memfs::global_loop.reset(new async::Loop());
memfs::global_dispatcher.reset(new fs::AsyncDispatcher(memfs::global_loop->async()));
memfs::global_loop->StartThread("root-dispatcher");
memfs::vfs.SetDispatcher(memfs::global_dispatcher.get());
}
return memfs::vfs_root.get();