summaryrefslogtreecommitdiff
path: root/fatfs/fatfs.h
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-04-16 16:12:05 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-04-17 22:16:14 +0200
commitb497f1613187c142ad6d0b76761a49811c37da80 (patch)
tree1d9cf49eabbb1e9c2de5768ae52aeaa895c93a59 /fatfs/fatfs.h
parent4266bb02b1f3342d3fc4920c07c71592a14acdd9 (diff)
fatfs: port to libdiskfs' node cache
* 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_softrefs'. (diskfs_node_reload): Pass context to `diskfs_user_read_node'. (diskfs_alloc_node): Pass `dir' via context to `diskfs_user_read_node'. * fatfs/fatfs.h (struct disknode): Drop fields `hnext', `hprevp'. (struct lookup_context): New definition. (ifind): Drop declaration. * fatfs/dir.c (diskfs_lookup_hard): Adjust accordingly. * fatfs/main.c (fetch_root): Likewise.
Diffstat (limited to 'fatfs/fatfs.h')
-rw-r--r--fatfs/fatfs.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/fatfs/fatfs.h b/fatfs/fatfs.h
index 9d385463..3c3d8366 100644
--- a/fatfs/fatfs.h
+++ b/fatfs/fatfs.h
@@ -36,9 +36,6 @@ struct disknode
{
cluster_t start_cluster;
- /* Links on hash list. */
- struct node *hnext, **hprevp;
-
/* The inode as returned by virtual inode management routines. */
inode_t inode;
@@ -71,6 +68,18 @@ struct disknode
int dir_idx;
};
+struct lookup_context
+{
+ /* The inode as returned by virtual inode management routines. */
+ inode_t inode;
+
+ /* Use BUF as the directory file map. */
+ vm_address_t buf;
+
+ /* Directory this node was allocated in (used by diskfs_alloc_node). */
+ struct node *dir;
+};
+
struct user_pager_info
{
struct node *node;
@@ -117,8 +126,6 @@ void flush_node_pager (struct node *node);
void write_all_disknodes ();
-struct node *ifind (ino_t inum);
-
error_t fat_get_next_cluster (cluster_t cluster, cluster_t *next_cluster);
void fat_to_unix_filename (const char *, char *);