Subject: Re: [netatalk-admins] Netatalk and large shared volumes?

From: Ben Burch <[email-masked]>
Date: Mon, 4 Aug 97 15:46:02 -0500

I made the following modification in the source file unix.c, its effect 
is to report any size that would overflow an signed long as a smaller 
size which won't.  From my limited testing, there appear to be no 
problems with this kludge...

/*
 * Get the free space on a partition.
 */
ustatfs_getvolspace( vol, bfree, btotal )
    struct vol	*vol;
    u_long	*bfree, *btotal;
{
#ifdef ultrix
    struct fs_data	sfs;
#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;
*/
    {
	long long temp;

	temp = sfs.f_bavail * sfs.f_frsize;

	if( temp < 2147483647 )
	{
		*bfree = (unsigned long) temp;
	}
	else
	{
		*bfree = 2147483647 ;
	}
    }
#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;
*/
    {
	long long temp;

	temp = ( sfs.f_blocks - ( sfs.f_bfree - sfs.f_bavail )) * sfs.f_frsize;

	if( temp < 2147483647 )
	{
		*btotal = (unsigned long) temp;
	}
	else
	{
		*btotal = 2147483647 ;
	}
    }
#endif ultrix

    return( AFP_OK );
}

--
"Love is the law, love under will."

Ben Burch
[email-masked]

---

From: Eric Rasmussen <[email-masked]>
Date: Tue, 5 Aug 1997 08:29:49 -0400

I'm not so sure I want to start playing games with reported file sizes.
Instead, I split the 3.7 GB partition into 2.0 and 1.7 GB partitions, and now
it's working.

Thanks for the suggestion, though.

-Eric Rasmussen

-------------------------------------------------------------------------
Eric Rasmussen
FIRST : For Inspiration and Recognition of Science and Technology
[email-masked], 800-871-8326, 603-666-0043 (fax), http://www.usfirst.org