* 2) quadradically rehash into other cylinder groups, until an
* available block is located.
*/
* 2) quadradically rehash into other cylinder groups, until an
* available block is located.
*/
-ffs_alloc(ip, lbn, bpref, size, bnp)
+ffs_alloc(ip, lbn, bpref, size, cred, bnp)
if ((unsigned)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("dev = 0x%x, bsize = %d, size = %d, fs = %s\n",
ip->i_dev, fs->fs_bsize, size, fs->fs_fsmnt);
panic("ffs_alloc: bad size");
}
if ((unsigned)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("dev = 0x%x, bsize = %d, size = %d, fs = %s\n",
ip->i_dev, fs->fs_bsize, size, fs->fs_fsmnt);
panic("ffs_alloc: bad size");
}
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
goto nospace;
if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
goto nospace;
if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
* the original block. Failing that, the regular block allocator is
* invoked to get an appropriate block.
*/
* the original block. Failing that, the regular block allocator is
* invoked to get an appropriate block.
*/
-ffs_realloccg(ip, lbprev, bpref, osize, nsize, bpp)
+ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
if ((unsigned)osize > fs->fs_bsize || fragoff(fs, osize) != 0 ||
(unsigned)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) {
printf(
if ((unsigned)osize > fs->fs_bsize || fragoff(fs, osize) != 0 ||
(unsigned)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) {
printf(
ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt);
panic("ffs_realloccg: bad size");
}
ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt);
panic("ffs_realloccg: bad size");
}
if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {
if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {
if (nsize < request)
ffs_blkfree(ip, bno + numfrags(fs, nsize),
if (nsize < request)
ffs_blkfree(ip, bno + numfrags(fs, nsize),
ffs_blkfree(ip, bno, size)
register struct inode *ip;
daddr_t bno;
ffs_blkfree(ip, bno, size)
register struct inode *ip;
daddr_t bno;
{
register struct fs *fs;
register struct cg *cgp;
struct buf *bp;
int error, cg, blk, frags, bbase;
register int i;
{
register struct fs *fs;
register struct cg *cgp;
struct buf *bp;
int error, cg, blk, frags, bbase;
register int i;
cg = dtog(fs, bno);
if ((unsigned)bno >= fs->fs_size) {
printf("bad block %d, ino %d\n", bno, ip->i_number);
cg = dtog(fs, bno);
if ((unsigned)bno >= fs->fs_size) {
printf("bad block %d, ino %d\n", bno, ip->i_number);