OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "nacl_io/filesystem.h" | 5 #include "nacl_io/filesystem.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "nacl_io/dir_node.h" | 11 #include "nacl_io/dir_node.h" |
12 #include "nacl_io/node.h" | 12 #include "nacl_io/node.h" |
13 #include "nacl_io/osstat.h" | 13 #include "nacl_io/osstat.h" |
14 #include "nacl_io/path.h" | 14 #include "nacl_io/path.h" |
15 #include "sdk_util/auto_lock.h" | 15 #include "sdk_util/auto_lock.h" |
16 #include "sdk_util/ref_object.h" | 16 #include "sdk_util/ref_object.h" |
17 | 17 |
18 #if defined(WIN32) | 18 #if defined(WIN32) |
19 #include <windows.h> | 19 #include <windows.h> |
20 #endif | 20 #endif |
21 | 21 |
22 namespace nacl_io { | 22 namespace nacl_io { |
23 | 23 |
24 Filesystem::Filesystem() : dev_(0) {} | 24 Filesystem::Filesystem() : dev_(0) { |
| 25 } |
25 | 26 |
26 Filesystem::~Filesystem() {} | 27 Filesystem::~Filesystem() { |
| 28 } |
27 | 29 |
28 Error Filesystem::Init(const FsInitArgs& args) { | 30 Error Filesystem::Init(const FsInitArgs& args) { |
29 dev_ = args.dev; | 31 dev_ = args.dev; |
30 ppapi_ = args.ppapi; | 32 ppapi_ = args.ppapi; |
31 return 0; | 33 return 0; |
32 } | 34 } |
33 | 35 |
34 void Filesystem::Destroy() {} | 36 void Filesystem::Destroy() { |
| 37 } |
35 | 38 |
36 Error Filesystem::OpenResource(const Path& path, ScopedNode* out_node) { | 39 Error Filesystem::OpenResource(const Path& path, ScopedNode* out_node) { |
37 out_node->reset(NULL); | 40 out_node->reset(NULL); |
38 return EINVAL; | 41 return EINVAL; |
39 } | 42 } |
40 | 43 |
41 void Filesystem::OnNodeCreated(Node* node) { | 44 void Filesystem::OnNodeCreated(Node* node) { |
42 node->stat_.st_ino = inode_pool_.Acquire(); | 45 node->stat_.st_ino = inode_pool_.Acquire(); |
43 node->stat_.st_dev = dev_; | 46 node->stat_.st_dev = dev_; |
44 } | 47 } |
45 | 48 |
46 void Filesystem::OnNodeDestroyed(Node* node) { | 49 void Filesystem::OnNodeDestroyed(Node* node) { |
47 if (node->stat_.st_ino) | 50 if (node->stat_.st_ino) |
48 inode_pool_.Release(node->stat_.st_ino); | 51 inode_pool_.Release(node->stat_.st_ino); |
49 } | 52 } |
50 | 53 |
51 Error Filesystem::Filesystem_VIoctl(int request, va_list args) { | 54 Error Filesystem::Filesystem_VIoctl(int request, va_list args) { |
52 return EINVAL; | 55 return EINVAL; |
53 } | 56 } |
54 | 57 |
55 } // namespace nacl_io | 58 } // namespace nacl_io |
OLD | NEW |