[PATCH 1/4] libdiskfs: add diskfs_make_node_alloc to allocate fat nodes

2014-05-18 Thread Justus Winter
libdiskfs has two kind of nodes, struct node and struct netnode. struct node is used to store libdiskfs specific data, while struct netnode contains user supplied data. Previously, both objects were allocated separatly, and a pointer from the node to the netnode provided a mapping from the former

[PATCH 3/4] trans/fakeroot: use fat nodes to simplify the node cache

2014-05-18 Thread Justus Winter
Previously, fakeroot stored netnodes in the hash table. But we are not interested in a cache for netnodes, we need a node cache. So fakeroot kept pointers to the associated node object in each netnode object. Use fat netfs nodes, which combine node and netnode objects. * trans/fakeroot.c (struc

[PATCH 2/4] libnetfs: add netfs_make_node_alloc to allocate fat nodes

2014-05-18 Thread Justus Winter
libnetfs has two kind of nodes, struct node and struct netnode. struct node is used to store libnetfs specific data, while struct netnode contains user supplied data. Previously, both objects were allocated separatly, and a pointer from the node to the netnode provided a mapping from the former to

[PATCH 4/4] trans/fakeroot: use netfs_node_netnode instead of np->nn

2014-05-18 Thread Justus Winter
When using fat nodes, expressions of the form E->nn can be rewritten as netfs_node_netnode (E). This is much faster as it only involves a offset calculation. For reference, I used the following semantic patch to create the patch: @@ expression E; @@ - E->nn + netfs_node_netnode (E) * trans/fak