X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/d52fe63fc81f7e44faaae711812a211a78434976..9bccf70c0258c7cac2dcb80011b2a964d884c552:/bsd/ufs/ffs/ffs_alloc.c diff --git a/bsd/ufs/ffs/ffs_alloc.c b/bsd/ufs/ffs/ffs_alloc.c index c6e462097..f14ac29f9 100644 --- a/bsd/ufs/ffs/ffs_alloc.c +++ b/bsd/ufs/ffs/ffs_alloc.c @@ -65,6 +65,7 @@ #include #include #include +#include #include @@ -141,7 +142,7 @@ ffs_alloc(ip, lbn, bpref, size, cred, bnp) goto nospace; VOP_DEVBLOCKSIZE(ip->i_devvp,&devBlockSize); #if QUOTA - if (error = chkdq(ip, (long)btodb(size, devBlockSize), cred, 0)) + if (error = chkdq(ip, (int64_t)size, cred, 0)) return (error); #endif /* QUOTA */ if (bpref >= fs->fs_size) @@ -162,7 +163,7 @@ ffs_alloc(ip, lbn, bpref, size, cred, bnp) /* * Restore user's disk quota because allocation failed. */ - (void) chkdq(ip, (long)-btodb(size, devBlockSize), cred, FORCE); + (void) chkdq(ip, (int64_t)-size, cred, FORCE); #endif /* QUOTA */ nospace: ffs_fserr(fs, cred->cr_uid, "file system full"); @@ -222,7 +223,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp) VOP_DEVBLOCKSIZE(ip->i_devvp,&devBlockSize); #if QUOTA - if (error = chkdq(ip, (long)btodb(nsize - osize, devBlockSize), cred, 0)) + if (error = chkdq(ip, (int64_t)(nsize - osize), cred, 0)) { brelse(bp); return (error); @@ -311,7 +312,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp) /* * Restore user's disk quota because allocation failed. */ - (void) chkdq(ip, (long)-btodb(nsize - osize, devBlockSize), cred, FORCE); + (void) chkdq(ip, (int64_t)-(nsize - osize), cred, FORCE); #endif /* QUOTA */ brelse(bp); nospace: