summaryrefslogtreecommitdiff
path: root/procfs.h
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-19 23:10:11 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:19:08 +0200
commit5baed27bd3b7a7d20ecb77068546b158d131fc1c (patch)
tree417041017a32eefd59ffbbccdffcd0dc2189a3a9 /procfs.h
parent87fbcc7a89559aa529eeb12472053ff869f66de9 (diff)
Invent path-based inode numbers
* procfs.h, procfs.c (procfs_make_ino): New function, invents an inode number by hashing the parent's and the name of an entry. (procfs_lookup): Use it to assign an inode number to child nodes at lookup time. * main.c (root_make_node): Assign an arbitrary inode number to the root directory.
Diffstat (limited to 'procfs.h')
-rw-r--r--procfs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/procfs.h b/procfs.h
index 42eed0e2..4c9d828b 100644
--- a/procfs.h
+++ b/procfs.h
@@ -51,6 +51,11 @@ struct node *procfs_make_node (const struct procfs_node_ops *ops, void *hook);
/* Interface for the libnetfs side. */
+/* Get the inode number which will be given to a child of NP named FILENAME.
+ This allows us to retreive them for readdir() without creating the
+ corresponding child nodes. */
+ino64_t procfs_make_ino (struct node *np, const char *filename);
+
error_t procfs_get_contents (struct node *np, void **data, size_t *data_len);
error_t procfs_lookup (struct node *np, const char *name, struct node **npp);
void procfs_cleanup (struct node *np);