From 51fec467c4b771db8ffc6a10a07dbf781a905482 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 30 Jan 2001 00:38:45 +0000 Subject: 2000-12-26 Neal H Walfield * cache.c: Change cache/hash table size to 509, a prime. Use memcpy/memcmp not bcopy/bcmp. Verify return value from malloc and check the result of rpc transaction _and_ do not act if failed. * main.c: Correct the wording of the help messages. Do not bother initializing global variable to 0. Use memcpy/memcmp not bcopy/bcmp. Verify return value from malloc and check the result of rpc transaction _and_ do not act if failed. * mount.c: Check return values of initialize_rpc. Use memcpy/memcmp not bcopy/bcmp. Verify return value from malloc and strdup. Correct comments. (mount_root): Check result of connect. Handle errors consistently. Reverse loops that are if (! c) {} else when appropriate. * mount.h: Protect header with #ifdef. * name-cache.c: Correct dangerous NPARTIALS macro. Use memcpy/memcmp not bcopy/bcmp. (find_cache): Use PARTIAL_THRESH, not the constant. * nfs-spec.h: Protect header with #ifdef. * nfs.c: Use memcpy/memcmp not bcopy/bcmp. * nfs.h: Likewise. * ops.c (netfs_attempt_mkdir): Check return values of initialize_rpc. Use memcpy/memcmp not bcopy/bcmp. Verify return value from malloc and check the result of rpc transaction _and_ do not act if failed. (netfs_attempt_link): Unlock the directory before the rpc transaction. Check the result of rpc transaction _and_ do not act if failed. * pager.c: Remove, we do not use it. * rpc.c: Use memcpy/memcmp not bcopy/bcmp. Verify return value from malloc and check the result of rpc transaction _and_ do not act if failed. (initialize_rpc): Use AUTH_NONE, not the depreciated AUTH_NULL. Return sane values on failure. (generate_xid): Make inline. (link_rpc): New function. Complements unlink_rpc. (conduct_rpc): Use link_rpc. (rpc_receive_thread): Reroll to a single loop. --- nfs/nfs.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'nfs/nfs.h') diff --git a/nfs/nfs.h b/nfs/nfs.h index 2c32ff9b..5fb62c50 100644 --- a/nfs/nfs.h +++ b/nfs/nfs.h @@ -15,6 +15,9 @@ 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 #include #include @@ -26,11 +29,11 @@ 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 { @@ -66,8 +69,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; }; @@ -150,7 +153,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) @@ -193,3 +196,5 @@ 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 */ -- cgit v1.2.3