path: root/procfs.h
diff options
authorJeremie Koenig <>2010-08-19 07:48:30 +0000
committerJeremie Koenig <>2010-08-30 14:18:32 +0200
commitc6c770c33eb0f23e7e8e04976c711653cdf1a41d (patch)
treeff22cd9494fe9fb50f8d7b514d9a0f4102dd7db3 /procfs.h
parent4ac169deaa1eb4c8df4a49fc940700971fa5863a (diff)
Implement lookup for . and ..
* procfs.c (procfs_lookup): Keep track of the parent directory, implement the lookup of the dot-directories. (procfs_cleanup): Release the reference to the parent node, if applicable. * procfs.h: Add a comment about the parent reference. * netfs.c (netfs_attempt_lookup): Lock the looked up node after the directory has been unlocked, in case they are the same.
Diffstat (limited to 'procfs.h')
1 files changed, 4 insertions, 1 deletions
diff --git a/procfs.h b/procfs.h
index b44db6e..42eed0e 100644
--- a/procfs.h
+++ b/procfs.h
@@ -22,7 +22,10 @@ struct procfs_node_ops
/* Lookup NAME in this directory, and store the result in *np. The
returned node should be created by lookup() using procfs_make_node()
- or a derived function. */
+ or a derived function. Note that the parent will be kept alive as
+ long as the child exists, so you can safely reference the parent's
+ data from the child. You may want to consider locking if there's
+ any mutation going on, though. */
error_t (*lookup) (void *hook, const char *name, struct node **np);
/* Destroy this node. */