]> arthur.barton.de Git - netatalk.git/commitdiff
Add force 2GB conditional at configure time. This will turn off the code in etc...
authorjnewman <jnewman>
Wed, 8 Nov 2000 17:12:38 +0000 (17:12 +0000)
committerjnewman <jnewman>
Wed, 8 Nov 2000 17:12:38 +0000 (17:12 +0000)
acconfig.h
configure.in
etc/afpd/unix.c

index a1ea43670dbecf3717943d8e4b595d44728b1f9c..b21c9a97c3df74a8827ef1eb69c61dc9aed6664d 100644 (file)
@@ -29,3 +29,4 @@
 #undef USE_FLOCK_LOCKS
 #undef USE_LASTDID
 #undef USE_PAM
+#undef FORCE_2GB
index 1de63ec939f7154daca7dc0cafe9b4ef58b5f333..4b6fb33eb2d72c98a063c36042d653a4373eb8ad 100644 (file)
@@ -184,6 +184,14 @@ AC_ARG_ENABLE(ddp,
        fi
 )
 
+AC_ARG_ENABLE(force2GB,
+       [  --enable-force2GB           enable force 2GB max reported volume size],
+       if test "x$enableval" = "xyes"; then 
+               AC_DEFINE(FORCE_2GB, 1)
+               AC_MSG_RESULT([enable forge 2GB])
+       fi
+)
+
 AC_ARG_ENABLE(debug,
        [  --enable-debug          enable debug code],
        if test "$enableval" != "no"; then
index bd7be335e6723d6451235c13a1fad2609da0185b..048dcba08bd34b6855e44c782efd36b41f890139 100644 (file)
@@ -51,11 +51,17 @@ int ustatfs_getvolspace( vol, bfree, btotal, bsize )
     *bsize = sfs.f_frsize;
 #endif ultrix
 
+#if FORCE_2GB
+    // if the volume is over 2GB in size, report
+    // the size as 2GB.
+    // this doesn't seem to work correctly for
+    // 64 bit size descriptors.  
     if ( *bfree > 0x7fffffff / *bsize ) {
         *bfree = 0x7fffffff;
     } else {
         *bfree *= *bsize;
     }
+#endif
 
 #ifdef ultrix
     *btotal = (VolSpace) 
@@ -64,11 +70,16 @@ int ustatfs_getvolspace( vol, bfree, btotal, bsize )
     *btotal = (VolSpace) 
       ( sfs.f_blocks - ( sfs.f_bfree - sfs.f_bavail )) * sfs.f_frsize;
 #endif ultrix
+
+#if FORCE_2GB
+    // see similar block above comments
     if ( *bfree > 0x7fffffff / *bsize ) {
         *bfree = 0x7fffffff;
     } else {
         *bfree *= *bsize;
     }
+#endif
+
     return( AFP_OK );
 }