From 63ac03bc069b81559b04596d6b337880c3351700 Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Sun, 14 Feb 2016 18:37:54 -0500 Subject: 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. --- nfs/nfs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'nfs/nfs.c') 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 -- cgit v1.2.3