summaryrefslogtreecommitdiff
path: root/nfs/nfs.c
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2016-02-14 18:37:54 -0500
committerJustus Winter <justus@gnupg.org>2016-02-15 01:13:07 +0100
commit63ac03bc069b81559b04596d6b337880c3351700 (patch)
tree2e8e91a888d3d42d95c9041ebe917fae028504f8 /nfs/nfs.c
parent254a4d43674a0d5fe8f8475e3b625924691048d3 (diff)
nfs: Use libihash for the node cache.
* nfs/cache.c: Remove old node cache and use libihash. Use a pointer to the node handle as the key and the node itself as the value. Use netfs_make_node_alloc to allow libihash to set 'slot'. * nfs/nfs.c: Pass in a struct handle instead. * nfs/nfs.h: Add a hurd_ihash_locp_t field and remove hnext and hprevp.
Diffstat (limited to 'nfs/nfs.c')
-rw-r--r--nfs/nfs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/nfs/nfs.c b/nfs/nfs.c
index 4916df65..77281566 100644
--- a/nfs/nfs.c
+++ b/nfs/nfs.c
@@ -383,18 +383,19 @@ xdr_decode_64bit (int *p, long long *n)
int *
xdr_decode_fhandle (int *p, struct node **npp)
{
- size_t len;
+ struct fhandle handle;
if (protocol_version == 2)
- len = NFS2_FHSIZE;
+ handle.size = NFS2_FHSIZE;
else
{
- len = ntohl (*p);
+ handle.size = ntohl (*p);
p++;
}
+ memcpy (&handle.data, p, handle.size);
/* Enter into cache. */
- lookup_fhandle (p, len, npp);
- return p + len / sizeof (int);
+ lookup_fhandle (&handle, npp);
+ return p + handle.size / sizeof (int);
}
/* Decode *P into a stat structure; return the address of the