| OLD | NEW |
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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/mount_node.h" | 5 #include "nacl_io/mount_node.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 Error MountNode::GetDents(size_t offs, | 53 Error MountNode::GetDents(size_t offs, |
| 54 struct dirent* pdir, | 54 struct dirent* pdir, |
| 55 size_t count, | 55 size_t count, |
| 56 int* out_bytes) { | 56 int* out_bytes) { |
| 57 *out_bytes = 0; | 57 *out_bytes = 0; |
| 58 return ENOTDIR; | 58 return ENOTDIR; |
| 59 } | 59 } |
| 60 | 60 |
| 61 Error MountNode::GetStat(struct stat* pstat) { | 61 Error MountNode::GetStat(struct stat* pstat) { |
| 62 AutoLock lock(&lock_); | 62 AUTO_LOCK(node_lock_); |
| 63 memcpy(pstat, &stat_, sizeof(stat_)); | 63 memcpy(pstat, &stat_, sizeof(stat_)); |
| 64 return 0; | 64 return 0; |
| 65 } | 65 } |
| 66 | 66 |
| 67 Error MountNode::Ioctl(int request, char* arg) { return EINVAL; } | 67 Error MountNode::Ioctl(int request, char* arg) { return EINVAL; } |
| 68 | 68 |
| 69 Error MountNode::Read(size_t offs, void* buf, size_t count, int* out_bytes) { | 69 Error MountNode::Read(size_t offs, void* buf, size_t count, int* out_bytes) { |
| 70 *out_bytes = 0; | 70 *out_bytes = 0; |
| 71 return EINVAL; | 71 return EINVAL; |
| 72 } | 72 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 out_node->reset(NULL); | 142 out_node->reset(NULL); |
| 143 return ENOTDIR; | 143 return ENOTDIR; |
| 144 } | 144 } |
| 145 | 145 |
| 146 int MountNode::ChildCount() { return 0; } | 146 int MountNode::ChildCount() { return 0; } |
| 147 | 147 |
| 148 void MountNode::Link() { stat_.st_nlink++; } | 148 void MountNode::Link() { stat_.st_nlink++; } |
| 149 | 149 |
| 150 void MountNode::Unlink() { stat_.st_nlink--; } | 150 void MountNode::Unlink() { stat_.st_nlink--; } |
| 151 | 151 |
| OLD | NEW |