Subject: [netatalk-admins] more than 2 GB

From: Albrecht Jacobs <[email-masked]>
Date: Fri, 10 Oct 1997 14:37:07 +0200 (MDT)

Hi,

I am new to this list. I am looking for a patch which allows the use of
netatalk on partitions bigger than 2 GB. I am using 1.4b2. Any chance to
get this working?

Thanks in advance.

Albrecht

+---------------------------------------------------------------------------+
| cand. aer. Albrecht Jacobs                              CAAD-Labor des SI |
| Systembetreuung                                    Universit"at Stuttgart |
|                                                                           |
| Liegeradgruppe Stuttgart                                                  | 
|  O__         http://www.architektur.uni-stuttgart.de:1200/users/aj/lieger |
|  \\_/\-o                                                                  |
| (+)   O                 [email-masked] |
+---------------------------------------------------------------------------+

---

From: [email-masked]
Date: Sun, 12 Oct 1997 23:01:17 -0400

> From:    Albrecht Jacobs <[email-masked]>
> To:      [email-masked]

> netatalk on partitions bigger than 2 GB. I am using 1.4b2. Any chance to

Give the attached patch a try.

:wes
*** etc/afpd/unix.c-	1997/08/17 00:01:46
--- etc/afpd/unix.c	1997/08/19 01:32:59
***************
*** 78,100 ****
  #else ultrix
      struct statfs	sfs;
  #endif ultrix
  
      if ( statfs( vol->v_path, &sfs ) < 0 ) {
  	return( AFPERR_PARAM );
      }
- 
  #ifdef ultrix
!     *bfree = sfs.fd_req.bfreen * 1024;
  #else
!     *bfree = sfs.f_bavail * sfs.f_frsize;
  #endif ultrix
  
  #ifdef ultrix
!     *btotal = ( sfs.fd_req.btot - ( sfs.fd_req.bfree - sfs.fd_req.bfreen )) *
! 	    1024;
  #else ultrix
!     *btotal = ( sfs.f_blocks - ( sfs.f_bfree - sfs.f_bavail )) * sfs.f_frsize;
  #endif ultrix
  
      return( AFP_OK );
  }
--- 78,113 ----
  #else ultrix
      struct statfs	sfs;
  #endif ultrix
+     u_long	multi;
  
      if ( statfs( vol->v_path, &sfs ) < 0 ) {
  	return( AFPERR_PARAM );
      }
  #ifdef ultrix
!     multi = 1024;
!     *bfree = sfs.fd_req.bfreen;
  #else
!     multi = sfs.f_frsize;
!     *bfree = sfs.f_bavail;
  #endif ultrix
  
+     if ( *bfree > 0x7fffffff / multi ) {
+ 	*bfree = 0x7fffffff;
+     } else {
+ 	*bfree *= multi;
+     }
+ 
  #ifdef ultrix
!     *btotal = sfs.fd_req.btot - ( sfs.fd_req.bfree - sfs.fd_req.bfreen );
  #else ultrix
!     *btotal = sfs.f_blocks - ( sfs.f_bfree - sfs.f_bavail );
  #endif ultrix
+ 
+     if ( *btotal > 0x7fffffff / multi ) {
+ 	*btotal = 0x7fffffff;
+     } else {
+ 	*btotal *= multi;
+     }
  
      return( AFP_OK );
  }

---

From: [email-masked]
Date: Tue, 14 Oct 1997 22:40:44 -0400

> From:    Jeff Wiegley <[email-masked]>
> To:      [email-masked]

> but my volumes are still showing a size of 1.9Gig even with the patch
> installed.

> How can I get the true size working properly?

You can remove the compares against 0x7fffffff.  But if you do that,
old MacOSs won't get correct info.

:wes

---

From: Jeff Wiegley <[email-masked]>
Date: Tue, 14 Oct 1997 16:50:11 -0700

I got this patch to install correctly.

- Jeff

[email-masked] wrote:
>                                                   ------------------------------------------------------------------------

-- 
<html><head><title>
J E F F  W I E G L E Y
</title></head><body><a href="http://www.w3-design.com/">
W 3 - d e s i g n,  I n c.
<p> phone: (310) 815-1177 x 307 fax:(310) 815-1133 </p>
</a></body></html>