#include <string.h>
#include <errno.h>
#include <sys/types.h>
-/* STDC check */
-#if STDC_HEADERS
#include <string.h>
-#else /* STDC_HEADERS */
-#ifndef HAVE_STRCHR
-#define strchr index
-#define strrchr index
-#endif /* HAVE_STRCHR */
-char *strchr (), *strrchr ();
-#ifndef HAVE_MEMCPY
-#define memcpy(d,s,n) bcopy ((s), (d), (n))
-#define memmove(d,s,n) bcopy ((s), (d), (n))
-#endif /* ! HAVE_MEMCPY */
-#endif /* STDC_HEADERS */
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/param.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
#include <atalk/logger.h>
#include <atalk/afp.h>
if ((ret = quotactl(QCMD(Q_XGETQUOTA,(what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t)&D)))
return ret;
- dqb->bsize = (u_int64_t)512;
- dqb->dqb_bsoftlimit = (u_int64_t)D.d_blk_softlimit;
- dqb->dqb_bhardlimit = (u_int64_t)D.d_blk_hardlimit;
- dqb->dqb_ihardlimit = (u_int64_t)D.d_ino_hardlimit;
- dqb->dqb_isoftlimit = (u_int64_t)D.d_ino_softlimit;
- dqb->dqb_curinodes = (u_int64_t)D.d_icount;
- dqb->dqb_curblocks = (u_int64_t)D.d_bcount;
+ dqb->bsize = (uint64_t)512;
+ dqb->dqb_bsoftlimit = (uint64_t)D.d_blk_softlimit;
+ dqb->dqb_bhardlimit = (uint64_t)D.d_blk_hardlimit;
+ dqb->dqb_ihardlimit = (uint64_t)D.d_ino_hardlimit;
+ dqb->dqb_isoftlimit = (uint64_t)D.d_ino_softlimit;
+ dqb->dqb_curinodes = (uint64_t)D.d_icount;
+ dqb->dqb_curblocks = (uint64_t)D.d_bcount;
#endif
return ret;
}
if(
/* if overquota, free space is 0 otherwise hard-current */
( overquota( dq ) ? 0 : ( dq->dqb_bhardlimit ? dq->dqb_bhardlimit -
- dq->dqb_curblocks : ~((u_int64_t) 0) ) )
+ dq->dqb_curblocks : ~((uint64_t) 0) ) )
>
( overquota( &dqg ) ? 0 : ( dqg.dqb_bhardlimit ? dqg.dqb_bhardlimit -
- dqg.dqb_curblocks : ~((u_int64_t) 0) ) )
+ dqg.dqb_curblocks : ~((uint64_t) 0) ) )
) /* if */
{
}
-static int getquota( struct vol *vol, struct dqblk *dq, const u_int32_t bsize)
+static int getquota(const AFPObj *obj, struct vol *vol, struct dqblk *dq, const uint32_t bsize)
{
char *p;
return getfsquota(vol, uuid, dq);
#else /* TRU64 */
- return vol->v_nfs ? getnfsquota(vol, uuid, bsize, dq) :
- getfsquota(vol, uuid, dq);
+ return vol->v_nfs ? getnfsquota(vol, obj->uid, bsize, dq) :
+ getfsquota(vol, obj->uid, dq);
#endif /* TRU64 */
}
#define tobytes(a, b) dbtob((VolSpace) (a))
#endif
-int uquota_getvolspace( struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize)
+int uquota_getvolspace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal, const uint32_t bsize)
{
- u_int64_t this_bsize;
+ uint64_t this_bsize;
struct dqblk dqblk;
this_bsize = bsize;
- if (getquota( vol, &dqblk, bsize) != 0 ) {
+ if (getquota(obj, vol, &dqblk, bsize) != 0 ) {
return( AFPERR_PARAM );
}