Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1289)

Unified Diff: native_client_sdk/src/libraries/nacl_mounts/mount_node_dir.cc

Issue 9956156: Add mount sources for a MountNode (inode) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_mounts/mount_node_dir.cc
===================================================================
--- native_client_sdk/src/libraries/nacl_mounts/mount_node_dir.cc (revision 134714)
+++ native_client_sdk/src/libraries/nacl_mounts/mount_node_dir.cc (working copy)
@@ -3,15 +3,17 @@
* found in the LICENSE file.
*/
+#include <dirent.h>
#include <errno.h>
#include <sys/stat.h>
+#include "macros.h"
#include "auto_lock.h"
#include "mount_node_dir.h"
-MountNodeDir::MountNodeDir(Mount* mount, int ino, int dev) :
- MountNode(mount, ino, dev),
- cache_(NULL) {
+MountNodeDir::MountNodeDir(Mount* mount, int ino, int dev)
+ : MountNode(mount, ino, dev),
+ cache_(NULL) {
}
MountNodeDir::~MountNodeDir() {
@@ -73,7 +75,6 @@
errno = ENOENT;
return -1;
}
-
if (name.length() >= MEMBER_SIZE(struct dirent, d_name)) {
errno = ENAMETOOLONG;
return -1;
@@ -114,6 +115,11 @@
return NULL;
}
+int MountNodeDir::ChildCount() {
+ AutoLock lock(&lock_);
+ return map_.size();
+}
+
void MountNodeDir::ClearCache() {
free(cache_);
cache_ = NULL;

Powered by Google App Engine
This is Rietveld 408576698