[828] in arla-drinkers

home help back first fref pref prev next nref lref last post

re: your mail

daemon@ATHENA.MIT.EDU (assar@stacken.kth.se)
Sat May 15 19:37:39 1999

From owner-arla-drinkers@stacken.kth.se Sat May 15 23:37:38 1999
Return-Path: <owner-arla-drinkers@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 4365 invoked from network); 15 May 1999 23:37:37 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
  by bloom-picayune.mit.edu with SMTP; 15 May 1999 23:37:37 -0000
Received: (from majordom@localhost)
	by sundance.stacken.kth.se (8.8.8/8.8.8) id BAA16299
	for arla-drinkers-list; Sun, 16 May 1999 01:28:33 +0200 (MET DST)
Received: from assaris.sics.se (assaris.sics.se [193.10.66.108])
	by sundance.stacken.kth.se (8.8.8/8.8.8) with ESMTP id BAA16295
	for <arla-drinkers@stacken.kth.se>; Sun, 16 May 1999 01:28:27 +0200 (MET DST)
Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.7.3) id BAA01930; Sun, 16 May 1999 01:31:50 +0200 (CEST)
From: assar@stacken.kth.se
To: Niklas Hallqvist <niklas@appli.se>
CC: arla-drinkers@stacken.kth.se
Subject: re: your mail
Mime-Version: 1.0 (generated by tm-edit 7.68)
Content-Type: multipart/mixed;
 boundary="Multipart_Sun_May_16_01:31:47_1999-1"
Content-Transfer-Encoding: 7bit
Date: 16 May 1999 01:31:47 +0200
Message-ID: <5liu9t52qk.fsf@assaris.sics.se>
Lines: 157
X-Mailer: Gnus v5.5/Emacs 19.34
Sender: owner-arla-drinkers@stacken.kth.se
Precedence: bulk

--Multipart_Sun_May_16_01:31:47_1999-1
Content-Type: text/plain; charset=US-ASCII

Niklas wrote:
> These patches fixes bug when having a lot of cached nodes.  One thing
> is the 4-character limit of the filenames that reconnect.c assumes,
> whcih breaks at 64K nodes.

Thanks for your patch.  I took the occasion of doing some clean-up in
reconnect.c as well.  My version of your patch is appended.

> The other thing is that the extra file used for directories, has a
> naming that clashed with standard cached files when more than 40K
> nodes exist. "1000" maps to "A000", which is also the name of the
> 40960th cached file.

We might as well do an encoding that doesn't clash and preserves the
number of the cache node, so I did this instead:

Index: arlad/fcache.c
===================================================================
RCS file: /usr/local/cvsroot/arla/arlad/fcache.c,v
retrieving revision 1.190
diff -u -w -u -w -r1.190 fcache.c
--- fcache.c	1999/05/04 09:29:18	1.190
+++ fcache.c	1999/05/15 23:16:22
@@ -214,9 +214,9 @@
 	    entry->flags.extradirp &&
 	    entry->status.FileType == TYPE_DIR);
 
-    ret = fcache_file_name (entry, s, len);
-    *s += 0x10;
-    return ret;
+    *s = '@';
+    ret = fcache_file_name (entry, s + 1, len - 1);
+    return ret + 1;
 }
 
 static int fhopen_working;


> I have a cache with 100K nodes which is why I notice.

:-)

> PS, are you looking into the cvs/ mirror in your AFS space?

I think we're going to move the CVS repository into AFS, but it hasn't
happened yet.

/assar

--Multipart_Sun_May_16_01:31:47_1999-1
Content-Type: text/plain; charset=US-ASCII

Index: reconnect.c
===================================================================
RCS file: /usr/local/cvsroot/arla/arlad/reconnect.c,v
retrieving revision 1.11
diff -u -w -u -w -r1.11 reconnect.c
--- reconnect.c	1999/02/15 04:49:43	1.11
+++ reconnect.c	1999/05/15 23:26:28
@@ -793,7 +793,7 @@
     fs_server_context context;
     AFSFetchStatus status;
     AFSVolSync volsync; 
-    char tmp[5];
+    char tmp[2 * sizeof(int) + 2];
     xfs_cache_handle cache_handle;
 
     fid = &(vcp->fid); /* points to the VenusFid structure */
@@ -903,7 +903,7 @@
     int error;               
     VenusFid *fid, tempfid; /* Ba san: to check the deletion of file*/
     Result res;
-    char tmp[5];
+    char tmp[2 * sizeof(int) + 2];
     int ret = 0; 
     Result tempres; 
     xfs_cache_handle cache_handle;
@@ -1033,16 +1033,13 @@
 void
 copy_cached_file(int from, int to)
 {
-    char tmpname[5],name_from[21],name_to[27];
+    char name_from[2 * sizeof(int) + 1], name_to[2 * sizeof(int) + 1];
     int fd_from, n, fd_to;
     char buf[BUFSIZE];
 
-    strcpy(name_from,ARLACACHEDIR);
-    strcpy(name_to,ARLACACHEDIR);
-    sprintf(tmpname,"%04X",from);
-    strcat(name_from, tmpname);
-    sprintf(tmpname,"%04X",to);
-    strcat(name_to, tmpname);
+    snprintf (name_from, sizeof(name_from), "%04X", from);
+    snprintf (name_to,   sizeof(name_to),   "%04X", to);
+
     fd_from = open(name_from,O_RDONLY | O_BINARY);  
     fd_to   = open(name_to,  O_WRONLY | O_CREAT | O_BINARY);
 
@@ -1069,7 +1066,7 @@
 
     FCacheEntry *parent_fce;
     u_long host;
-    char name[9],tmp[5];
+    char name[2 * sizeof(int) + 3 + 1], tmp[2 * sizeof(int) + 2];
     AFSStoreStatus store_attr;
     AFSFetchStatus fetch_attr;
     CredCacheEntry *ce; 
@@ -1438,7 +1435,7 @@
 
     int ret = 0;
     Result res;
-    char tmp[5];
+    char tmp[2 * sizeof(int) + 2];
     int isnewpar = 0;
     ConnCacheEntry *conn;
     fs_server_context context;
@@ -1673,7 +1670,7 @@
     AFSCallBack callback;
     AFSVolSync volsync;
     int ret; 
-    char tmp[5];
+    char tmp[2 * sizeof(int) + 2];
     xfs_cache_handle cache_handle;
     int32_t type;
 
@@ -1875,7 +1872,7 @@
     int    ret = 0;
     int    tempret = 0;
     struct timeval tv;
-    char tmp[5];
+    char tmp[2 * sizeof(int) + 2];
 
     AFSFid  Outfid;   /* Ba Wu: These are used to get the info from FS*/
     AFSFetchStatus fetch_attr;
@@ -2011,7 +2008,7 @@
     CredCacheEntry *ce;
     VenusFid *parent_fid;  
     VenusFid *existing_fid;
-    char tmp[5];
+    char tmp[2 * sizeof(int) + 2];
     int ret = 0;
     FCacheEntry *dir_entry,*existing_entry;
     Result res;
@@ -2084,7 +2081,7 @@
     fs_server_context context;
     CredCacheEntry *ce;
     VenusFid *parent_fid, *child_fid, fakeFid;
-    char tmp[5];
+    char tmp[2 * sizeof(int) + 2];
     int ret = 0;
     FCacheEntry *dir_entry, *childEntry;
     Result res;

--Multipart_Sun_May_16_01:31:47_1999-1--

home help back first fref pref prev next nref lref last post