summaryrefslogtreecommitdiff
path: root/ftpfs
diff options
context:
space:
mode:
Diffstat (limited to 'ftpfs')
-rw-r--r--ftpfs/ChangeLog14
-rw-r--r--ftpfs/fs.c28
-rw-r--r--ftpfs/ftpfs.h5
-rw-r--r--ftpfs/node.c4
4 files changed, 34 insertions, 17 deletions
diff --git a/ftpfs/ChangeLog b/ftpfs/ChangeLog
index c58cfb3e..b53da74f 100644
--- a/ftpfs/ChangeLog
+++ b/ftpfs/ChangeLog
@@ -1,3 +1,17 @@
+2003-08-17 Marcus Brinkmann <marcus@gnu.org>
+
+ * ftpfs.h: Include <hurd/ihash.h>.
+ (struct ftpfs): Change type of INODE_MAPPINGS to struct
+ hurd_ihash.
+ (struct ftpfs_dir_entry): Change type of INODE_LOCP to
+ hurd_ihash_locp_t.
+ * node.c (ftpfs_create_node): Call hurd_ihash_add, not ihash_add.
+ (netfs_node_norefs): Call hurd_ihash_locp_remove, not
+ ihash_locp_remove.
+ * fs.c: Include <stddef.h>.
+ (ftpfs_create): Call hurd_ihash_init, not hurd_ihash_create.
+ Call hurd_ihash_destroy on error.
+
2002-10-18 Moritz Schulte <moritz@duesseldorf.ccc.de>
* dir.c (ftpfs_dir_lookup): Initialize NES.entry.
diff --git a/ftpfs/fs.c b/ftpfs/fs.c
index db6205ce..e4db3031 100644
--- a/ftpfs/fs.c
+++ b/ftpfs/fs.c
@@ -1,6 +1,6 @@
/* Fs operations
- Copyright (C) 1997,2001 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2001, 2003 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.org>
This file is part of the GNU Hurd.
@@ -18,6 +18,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
+#include <stddef.h>
#include <string.h>
#include <hurd/ihash.h>
@@ -59,24 +60,25 @@ ftpfs_create (char *rmt_path, int fsid,
new->ftp_params = ftp_params;
new->ftp_hooks = ftp_hooks;
- err = ihash_create (&new->inode_mappings);
+ hurd_ihash_init (&new->inode_mappings,
+ offsetof (struct ftpfs_dir_entry, inode_locp));
spin_lock_init (&new->inode_mappings_lock);
- if (! err)
+ super_root = netfs_make_node (0);
+ if (! super_root)
+ err = ENOMEM;
+ else
{
- super_root = netfs_make_node (0);
- if (! super_root)
- err = ENOMEM;
- else
- {
- err = ftpfs_dir_create (new, super_root, rmt_path, &super_root_dir);
- if (! err)
- err = ftpfs_dir_null_lookup (super_root_dir, &new->root);
- }
+ err = ftpfs_dir_create (new, super_root, rmt_path, &super_root_dir);
+ if (! err)
+ err = ftpfs_dir_null_lookup (super_root_dir, &new->root);
}
if (err)
- free (new);
+ {
+ hurd_ihash_destroy (&new->inode_mappings);
+ free (new);
+ }
else
*fs = new;
diff --git a/ftpfs/ftpfs.h b/ftpfs/ftpfs.h
index 0ca67aa4..d1d816d7 100644
--- a/ftpfs/ftpfs.h
+++ b/ftpfs/ftpfs.h
@@ -25,6 +25,7 @@
#include <cthreads.h>
#include <ftpconn.h>
#include <maptime.h>
+#include <hurd/ihash.h>
/* Anonymous types. */
struct ccache;
@@ -58,7 +59,7 @@ struct ftpfs_dir_entry
/* When the presence/absence of this file was last checked. */
time_t name_timestamp;
- void **inode_locp; /* Used for removing this entry */
+ hurd_ihash_locp_t inode_locp; /* Used for removing this entry */
int noent : 1; /* A negative lookup result. */
int valid : 1; /* Marker for GC'ing. */
@@ -173,7 +174,7 @@ struct ftpfs
int fsid;
/* A hash table mapping inode numbers to directory entries. */
- struct ihash *inode_mappings;
+ struct hurd_ihash inode_mappings;
spin_lock_t inode_mappings_lock;
struct ftpfs_params params;
diff --git a/ftpfs/node.c b/ftpfs/node.c
index 73af41f2..1d15a686 100644
--- a/ftpfs/node.c
+++ b/ftpfs/node.c
@@ -61,7 +61,7 @@ ftpfs_create_node (struct ftpfs_dir_entry *e, const char *rmt_path,
ftpfs_maptime);
spin_lock (&nn->fs->inode_mappings_lock);
- ihash_add (nn->fs->inode_mappings, e->stat.st_ino, new, &e->inode_locp);
+ hurd_ihash_add (&nn->fs->inode_mappings, e->stat.st_ino, new);
spin_unlock (&nn->fs->inode_mappings_lock);
e->node = new;
@@ -92,7 +92,7 @@ netfs_node_norefs (struct node *node)
/* Remove this entry from the set of known inodes. */
spin_lock (&nn->fs->inode_mappings_lock);
- ihash_locp_remove (nn->fs->inode_mappings, nn->dir_entry->inode_locp);
+ hurd_ihash_locp_remove (&nn->fs->inode_mappings, nn->dir_entry->inode_locp);
spin_unlock (&nn->fs->inode_mappings_lock);
if (nn->contents)