[committed hurd 13/13] fatfs: port to libdiskfs' node cache

2015-04-17 Thread Justus Winter
* fatfs/inode.c: Drop all cache-related code. (diskfs_user_make_node): New function. (diskfs_cached_lookup_in_dirbuf): Reimplement using the `lookup_context'. (read_node): Rename to diskfs_user_read_node and adopt accordingly. (diskfs_try_dropping_softrefs): Rename to `diskfs_user_try_dropping_soft

[committed hurd 12/13] isofs: port to libdiskfs' node cache

2015-04-17 Thread Justus Winter
* isofs/inode.c: Drop all cache-related code. (diskfs_user_make_node): New function. (calculate_file_start): Check for `record' being null. (cache_id): New function. (read_node): Rename to diskfs_user_read_node and adopt accordingly. (diskfs_try_dropping_softrefs): Rename to diskfs_user_try_droppin

[committed hurd 10/13] ext2fs: use fat nodes

2015-04-17 Thread Justus Winter
Use `diskfs_make_node_alloc' to allocate both the node and the disknode in a continuous chunk of memory. This increases locality and reduces the pressure on the memory allocator. * ext2fs/inode.c: Use `diskfs_node_disknode' to access the disknode. (diskfs_cached_lookup): Use `diskfs_make_node_all

[committed hurd 11/13] libdiskfs: implement a node cache

2015-04-17 Thread Justus Winter
Previously, all users of libdiskfs implemented a node cache on their own. Move the node cache from ext2fs into libdiskfs. We preserve the previous API by marking all functions that we pull from ext2fs as weak, so that users like tmpfs can still implement their own node cache. * ext2fs/dir.c (dis

[committed hurd 08/13] libdiskfs: fix node initialization

2015-04-17 Thread Justus Winter
* libdiskfs/node-make.c (init_node): Initialize flag `author_tracks_uid'. --- libdiskfs/node-make.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libdiskfs/node-make.c b/libdiskfs/node-make.c index c7ca3b0..7bc1d85 100644 --- a/libdiskfs/node-make.c +++ b/libdiskfs/node-make.c @@ -27,6 +27,7

[committed hurd 02/13] fatfs: use a seperate lock to protect nodehash

2015-04-17 Thread Justus Winter
Previously, fatfs used diskfs_node_refcnt_lock to serialize access to the nodehash. Use a separate lock to protect nodehash. Adjust the reference counting accordingly. Every node in the nodehash carries a light reference. When we are asked to give up that light reference, we reacquire our lock

[committed hurd 06/13] libdiskfs: make struct node more compact

2015-04-17 Thread Justus Winter
* libdiskfs/diskfs.h (struct node): Turn flags into a bit field. --- libdiskfs/diskfs.h | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h index 535fb39..18df0eb 100644 --- a/libdiskfs/diskfs.h +++ b/libdiskfs/diskfs.h @@

[committed hurd 05/13] libdiskfs: lock-less reference counting of nodes

2015-04-17 Thread Justus Winter
* libdiskfs/diskfs.h (struct node): Use refcounts_t for reference counting. (diskfs_node_refcnt_lock): Remove. (diskfs_node_norefs,diskfs_drop_node): Change comments accordingly. * libdiskfs/init-init.c: Adjust accordingly. * libdiskfs/node-drop.c: Likewise. * libdiskfs/node-make.c: Likewise. * lib

[committed hurd 09/13] libdiskfs: declare all inline functions as `extern inline'

2015-04-17 Thread Justus Winter
* libdiskfs/diskfs.h (diskfs_node_disknode, diskfs_disknode_node): Declare functions as `extern inline' so that we can use them in other functions declared as `extern inline'. --- libdiskfs/diskfs.h | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libdiskfs/diskfs.h b/li

[committed hurd 01/13] ext2fs: use a seperate lock to protect nodehash

2015-04-17 Thread Justus Winter
Previously, ext2fs used diskfs_node_refcnt_lock to serialize access to the nodehash. Use a separate lock to protect nodehash. Adjust the reference counting accordingly. Every node in the nodehash carries a light reference. When we are asked to give up that light reference, we reacquire our lock

[committed hurd 07/13] libdiskfs: drop unused fields from struct node

2015-04-17 Thread Justus Winter
* libdiskfs/diskfs.h (struct node): Drop unused fields from struct node. --- libdiskfs/diskfs.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h index 18df0eb..7a21dff 100644 --- a/libdiskfs/diskfs.h +++ b/libdiskfs/diskfs.h @@ -80,8 +80,6 @@ struct pero

[committed hurd 03/13] isofs: use a seperate lock to protect node_cache

2015-04-17 Thread Justus Winter
Previously, isofs used diskfs_node_refcnt_lock to serialize access to the node_cache. Use a separate lock to protect node_cache. Adjust the reference counting accordingly. Every node in the node_cache carries a light reference. When we are asked to give up that light reference, we reacquire our

[committed hurd 04/13] tmpfs: use a seperate lock to protect all_nodes

2015-04-17 Thread Justus Winter
Previously, tmpfs used diskfs_node_refcnt_lock to serialize access to the all_nodes and some other related global state related to memory consumption. Use a separate lock to protect all_nodes, and atomic operations to access the state related to memory consumption. Adjust the reference counting ac