summaryrefslogtreecommitdiff
path: root/nfs/nfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'nfs/nfs.h')
-rw-r--r--nfs/nfs.h50
1 files changed, 36 insertions, 14 deletions
diff --git a/nfs/nfs.h b/nfs/nfs.h
index 51cd3e46..147dc900 100644
--- a/nfs/nfs.h
+++ b/nfs/nfs.h
@@ -1,5 +1,5 @@
/* Data structures and global variables for NFS client
- Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation
+ Copyright (C) 1994,95,96,97,99,2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -15,8 +15,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#ifndef NFS_NFS_H
+#define NFS_NFS_H
+
#include <sys/stat.h>
#include <sys/types.h>
+#include <stdint.h>
+#include <sys/mman.h>
#include "nfs-spec.h"
#include <hurd/netfs.h>
@@ -25,13 +30,13 @@ struct fhandle
{
size_t size;
- /* Leave enough room for the biggest possible fhandle. */
+ /* Leave enough room for the largest possible fhandle. */
char data[NFS3_FHSIZE];
};
-/* One of these exists for private data needed by the client for each
+/* There exists one of there for the private data needed by each client
node. */
-struct netnode
+struct netnode
{
struct fhandle handle;
time_t stat_updated;
@@ -54,9 +59,9 @@ struct netnode
char *name;
dev_t indexes;
} transarg;
-
+
#ifdef notyet
- /* This indicates that the length of the file must be at
+ /* This indicates that the length of the file must be at
least this big because we've written this much locally,
even if the server thinks we haven't gone this far. */
off_t extend_len;
@@ -65,8 +70,8 @@ struct netnode
struct user_pager_info *fileinfo;
/* If this node has been renamed by "deletion" then
- this is the directory and name in that directory which
- is holding the node */
+ this is the directory and the name in that directory
+ which is holding the node */
struct node *dead_dir;
char *dead_name;
};
@@ -77,7 +82,7 @@ int main_udp_socket;
/* Our hostname */
char *hostname;
-/* The current time */
+/* The current time */
volatile struct mapped_time_value *mapped_time;
/* Some tunable parameters */
@@ -88,6 +93,12 @@ extern int stat_timeout;
/* How long to keep around file contents caches */
extern int cache_timeout;
+/* How long to keep around positive dir cache entries */
+extern int name_cache_timeout;
+
+/* How long to keep around negative dir cache entries */
+extern int name_cache_neg_timeout;
+
/* How long to wait for replies before re-sending RPC's. */
extern int initial_transmit_timeout;
extern int max_transmit_timeout;
@@ -117,7 +128,7 @@ extern int mount_program;
/* RPC program version for the mount agent */
extern int mount_version;
-/* If this is nonzero, it's the port to use for the mount agent if
+/* If this is nonzero, it's the port to use for the mount agent if
the portmapper fails or can't be found. */
extern short mount_port;
@@ -131,7 +142,7 @@ extern int nfs_program;
/* RPC program version for the NFS server */
extern int nfs_version;
-/* If this is nonzero, it's the port to be used to find the nfs agent
+/* If this is nonzero, it's the port to be used to find the nfs agent
if the portmapper fails or can't be found */
extern short nfs_port;
@@ -143,7 +154,7 @@ extern int nfs_port_override;
extern int protocol_version;
-/* Count how many four-byte chunks it takss to hold LEN bytes. */
+/* Count how many four-byte chunks it takes to hold LEN bytes. */
#define INTSIZE(len) (((len)+3)>>2)
@@ -160,12 +171,15 @@ int *xdr_encode_sattr_stat (int *, struct stat *);
int *xdr_encode_create_state (int *, mode_t, uid_t);
int *xdr_decode_fattr (int *, struct stat *);
int *xdr_decode_string (int *, char *);
-int *nfs_initialize_rpc (int, struct iouser *, size_t, void **,
+int *xdr_decode_fhandle (int *, struct node **);
+int *nfs_initialize_rpc (int, struct iouser *, size_t, void **,
struct node *, uid_t);
error_t nfs_error_trans (int);
/* mount.c */
struct node *mount_root (char *, char *);
+extern const char *mounted_hostname;
+extern uint16_t mounted_nfs_port; /* host order */
/* ops.c */
int *register_fresh_stat (struct node *, int *);
@@ -177,5 +191,13 @@ void timeout_service_thread (void);
void rpc_receive_thread (void);
/* cache.c */
-int *lookup_fhandle (int *, struct node **);
+void lookup_fhandle (void *, size_t, struct node **);
int *recache_handle (int *, struct node *);
+
+/* name-cache.c */
+void enter_lookup_cache (char *, size_t, struct node *, char *);
+void purge_lookup_cache (struct node *, char *, size_t);
+struct node *check_lookup_cache (struct node *, char *);
+void purge_lookup_cache_node (struct node *);
+
+#endif /* NFS_NFS_H */