diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-19 23:10:11 +0000 |
---|---|---|
committer | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-30 14:19:08 +0200 |
commit | 2c7dcef74c3259d2d5db7a11f5c77d18d3a51e85 (patch) | |
tree | 5135e8ce3082dc172cfce4d4b08f31a43f73590f /main.c | |
parent | c6c770c33eb0f23e7e8e04976c711653cdf1a41d (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 'main.c')
-rw-r--r-- | main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -42,6 +42,10 @@ root_make_node (struct node **np) if (! *np) return ENOMEM; + /* Since this one is not created through proc_lookup(), we have to affect an + inode number to it. */ + (*np)->nn_stat.st_ino = * (uint32_t *) "PROC"; + return 0; } |