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


Subject: Re: [netatalk-admins] Netatalk and large shared volumes?
From: Ben Burch (ben.burch@zenith.com)
Date: Mon Aug 04 1997 - 16:46:02 EDT


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 ben.burch@zenith.com



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:25:58 EST