[382] in arla-drinkers

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

Minor patches for fs.c

daemon@ATHENA.MIT.EDU (Andrzej Filinski)
Fri Nov 6 13:47:18 1998

From owner-arla-drinkers@stacken.kth.se Fri Nov 06 18:47:17 1998
Return-Path: <owner-arla-drinkers@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 1906 invoked from network); 6 Nov 1998 18:47:17 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
  by bloom-picayune.mit.edu with SMTP; 6 Nov 1998 18:47:17 -0000
Received: (from majordom@localhost)
	by sundance.stacken.kth.se (8.8.8/8.8.8) id TAA14061
	for arla-drinkers-list; Fri, 6 Nov 1998 19:39:42 +0100 (MET)
Received: from ppp.brics.dk (andrzej@ironcity.daimi.aau.dk [130.225.19.245])
	by sundance.stacken.kth.se (8.8.8/8.8.8) with ESMTP id TAA14056
	for <arla-drinkers@stacken.kth.se>; Fri, 6 Nov 1998 19:39:36 +0100 (MET)
Received: (from andrzej@localhost)
	by ppp.brics.dk (8.8.7/8.8.7) id TAA04128;
	Fri, 6 Nov 1998 19:39:30 +0100
From: Andrzej Filinski <andrzej@daimi.aau.dk>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="WuhNGu4O5z"
Content-Transfer-Encoding: 7bit
Date: Fri,  6 Nov 1998 19:39:29 +0100 (CET)
To: arla-drinkers@stacken.kth.se
cc: andrzej@daimi.aau.dk
Subject: Minor patches for fs.c
X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs  Lucid
Message-ID: <13891.15208.426291.869872@ironcity.daimi.aau.dk>
Sender: owner-arla-drinkers@stacken.kth.se
Precedence: bulk


--WuhNGu4O5z
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

Great job!  0.14.1 on Linux 2.0.35 finally appears quite stable for me!
I did note a couple of minor glitches in the "fs" command, though:

- "fs whereis" unly works right on a big-endian host. Also, the
  formatting of numeric IP addresses is slightly broken.

- "fs quota" reports the percentage of quota remaining, rather than used.

- Unlike Transarc AFS, "fs examine", "fs quota", and "fs diskfree" don't
  follow symlinks (thus breaking idioms like "fs quota ~/afs").  I
  assume this is unintentional, especially since "fs listquota" and 
  "fs setquota" do follow symlinks.

The enclosed patch should fix all of those.

-- Andrzej

--WuhNGu4O5z
Content-Type: text/plain
Content-Description: Arla fs.c patch (against 0.14.1)
Content-Disposition: inline;
	filename="fs.c.patch"
Content-Transfer-Encoding: 7bit

--- fs.c.orig	Fri Oct 16 04:30:02 1998
+++ fs.c	Fri Nov  6 18:56:39 1998
@@ -1283,10 +1283,10 @@
 
     while(curptr[i] && i<8) {
 	struct hostent *h;
-	addr.s_addr=curptr[i];
+	addr.s_addr=htonl(curptr[i]);
 	h=gethostbyaddr((const char *) &addr, sizeof(addr), AF_INET);
 	if (h == NULL)
-	    printf ("%s", inet_ntoa (addr));
+	    printf (" %s", inet_ntoa (addr));
 	else {
 	    printf(" %s",h->h_name);
 	}
@@ -1400,7 +1400,7 @@
 	return;
     }
 
-    if (k_pioctl (path, VIOCGETVOLSTAT, &a_params, 0) == -1) {
+    if (k_pioctl (path, VIOCGETVOLSTAT, &a_params, 1) == -1) {
 	fserr(PROGNAME, errno, path);
 	free(a_params.out);
 	return;
@@ -1528,7 +1528,7 @@
 	return;
     }
 
-    if (k_pioctl (path, VIOCGETVOLSTAT, &a_params, 0) == -1) {
+    if (k_pioctl (path, VIOCGETVOLSTAT, &a_params, 1) == -1) {
 	fserr(PROGNAME, errno, path);
 	free(a_params.out);
 	return;
@@ -1561,7 +1561,7 @@
 	return;
     }
 
-    if (k_pioctl (path, VIOCGETVOLSTAT, &a_params, 0) == -1) {
+    if (k_pioctl (path, VIOCGETVOLSTAT, &a_params, 1) == -1) {
 	fserr(PROGNAME, errno, path);
 	free(a_params.out);
 	return;
@@ -1570,7 +1570,7 @@
     status = (struct VolumeStatus *) a_params.out;
   
     printf("%.0f%% of quota used.\n",
-	   (1.0 - (float) status->BlocksInUse / status->MaxQuota) * 100);
+	   ((float) status->BlocksInUse / status->MaxQuota) * 100);
 
     free(a_params.out);
 }

--WuhNGu4O5z--

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