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_mounts/kernel_handle.h" |
5 | 6 |
6 #include <fcntl.h> | 7 #include <fcntl.h> |
7 #include <pthread.h> | 8 #include <pthread.h> |
8 | 9 |
9 #include "nacl_mounts/kernel_handle.h" | |
10 #include "nacl_mounts/mount.h" | 10 #include "nacl_mounts/mount.h" |
11 #include "nacl_mounts/mount_node.h" | 11 #include "nacl_mounts/mount_node.h" |
12 | 12 |
13 | |
14 // It is only legal to construct a handle while the kernel lock is held. | 13 // It is only legal to construct a handle while the kernel lock is held. |
15 KernelHandle::KernelHandle(Mount* mnt, MountNode* node, int mode) | 14 KernelHandle::KernelHandle(Mount* mnt, MountNode* node, int mode) |
16 : mount_(mnt), | 15 : mount_(mnt), |
17 node_(node), | 16 node_(node), |
18 mode_(mode), | 17 mode_(mode), |
19 offs_(0) { | 18 offs_(0) { |
20 if (mode & O_APPEND) offs_ = node->GetSize(); | 19 if (mode & O_APPEND) offs_ = node->GetSize(); |
21 } | 20 } |
22 | |
OLD | NEW |