| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "nacl_io/kernel_wrap_real.h" | 13 #include "nacl_io/kernel_wrap_real.h" |
| 14 #include "nacl_io/mount.h" | 14 #include "nacl_io/mount.h" |
| 15 #include "nacl_io/osmman.h" | 15 #include "nacl_io/osmman.h" |
| 16 #include "utils/auto_lock.h" | 16 #include "sdk_util/auto_lock.h" |
| 17 | 17 |
| 18 static const int USR_ID = 1001; | 18 static const int USR_ID = 1001; |
| 19 static const int GRP_ID = 1002; | 19 static const int GRP_ID = 1002; |
| 20 | 20 |
| 21 MountNode::MountNode(Mount* mount) | 21 MountNode::MountNode(Mount* mount) |
| 22 : mount_(mount) { | 22 : mount_(mount) { |
| 23 memset(&stat_, 0, sizeof(stat_)); | 23 memset(&stat_, 0, sizeof(stat_)); |
| 24 stat_.st_gid = GRP_ID; | 24 stat_.st_gid = GRP_ID; |
| 25 stat_.st_uid = USR_ID; | 25 stat_.st_uid = USR_ID; |
| 26 | 26 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 void MountNode::Link() { | 164 void MountNode::Link() { |
| 165 Acquire(); | 165 Acquire(); |
| 166 stat_.st_nlink++; | 166 stat_.st_nlink++; |
| 167 } | 167 } |
| 168 | 168 |
| 169 void MountNode::Unlink() { | 169 void MountNode::Unlink() { |
| 170 stat_.st_nlink--; | 170 stat_.st_nlink--; |
| 171 Release(); | 171 Release(); |
| 172 } | 172 } |
| OLD | NEW |