diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-19 07:48:30 +0000 |
---|---|---|
committer | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-30 14:18:32 +0200 |
commit | 87fbcc7a89559aa529eeb12472053ff869f66de9 (patch) | |
tree | 8d36f1487cb9760285f3ab8a18e6cc73527aa9bc /procfs.h | |
parent | e9b239bbec8cae14a9a4d510bae7496d733e5812 (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')
-rw-r--r-- | procfs.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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. */ |