SCCS-vsn: sys/ufs/ffs/ffs_alloc.c 7.22
SCCS-vsn: sys/ufs/lfs/lfs_alloc.c 7.22
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ffs_alloc.c 7.21 (Berkeley) %G%
+ * @(#)ffs_alloc.c 7.22 (Berkeley) %G%
*bnp = bno;
return (0);
}
*bnp = bno;
return (0);
}
+#ifdef QUOTA
+ /*
+ * Restore user's disk quota because allocation failed.
+ */
+ (void) chkdq(ip, (long)-btodb(size), cred, FORCE);
+#endif
nospace:
fserr(fs, cred->cr_uid, "file system full");
uprintf("\n%s: write failed, file system is full\n", fs->fs_fsmnt);
nospace:
fserr(fs, cred->cr_uid, "file system full");
uprintf("\n%s: write failed, file system is full\n", fs->fs_fsmnt);
ip->i_dev, fs->fs_bsize, bprev, fs->fs_fsmnt);
panic("realloccg: bad bprev");
}
ip->i_dev, fs->fs_bsize, bprev, fs->fs_fsmnt);
panic("realloccg: bad bprev");
}
-#ifdef QUOTA
- if (error = chkdq(ip, (long)btodb(nsize - osize), cred, 0))
- return (error);
-#endif
/*
* Allocate the extra space in the buffer.
*/
/*
* Allocate the extra space in the buffer.
*/
brelse(bp);
return (error);
}
brelse(bp);
return (error);
}
+#ifdef QUOTA
+ if (error = chkdq(ip, (long)btodb(nsize - osize), cred, 0)) {
+ brelse(bp);
+ return (error);
+ }
+#endif
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
bzero(bp->b_un.b_addr + osize, (unsigned)nsize - osize);
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
bzero(bp->b_un.b_addr + osize, (unsigned)nsize - osize);
+#ifdef QUOTA
+ /*
+ * Restore user's disk quota because allocation failed.
+ */
+ (void) chkdq(ip, (long)-btodb(nsize - osize), cred, FORCE);
+#endif
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)lfs_alloc.c 7.21 (Berkeley) %G%
+ * @(#)lfs_alloc.c 7.22 (Berkeley) %G%
*bnp = bno;
return (0);
}
*bnp = bno;
return (0);
}
+#ifdef QUOTA
+ /*
+ * Restore user's disk quota because allocation failed.
+ */
+ (void) chkdq(ip, (long)-btodb(size), cred, FORCE);
+#endif
nospace:
fserr(fs, cred->cr_uid, "file system full");
uprintf("\n%s: write failed, file system is full\n", fs->fs_fsmnt);
nospace:
fserr(fs, cred->cr_uid, "file system full");
uprintf("\n%s: write failed, file system is full\n", fs->fs_fsmnt);
ip->i_dev, fs->fs_bsize, bprev, fs->fs_fsmnt);
panic("realloccg: bad bprev");
}
ip->i_dev, fs->fs_bsize, bprev, fs->fs_fsmnt);
panic("realloccg: bad bprev");
}
-#ifdef QUOTA
- if (error = chkdq(ip, (long)btodb(nsize - osize), cred, 0))
- return (error);
-#endif
/*
* Allocate the extra space in the buffer.
*/
/*
* Allocate the extra space in the buffer.
*/
brelse(bp);
return (error);
}
brelse(bp);
return (error);
}
+#ifdef QUOTA
+ if (error = chkdq(ip, (long)btodb(nsize - osize), cred, 0)) {
+ brelse(bp);
+ return (error);
+ }
+#endif
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
bzero(bp->b_un.b_addr + osize, (unsigned)nsize - osize);
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
bzero(bp->b_un.b_addr + osize, (unsigned)nsize - osize);
+#ifdef QUOTA
+ /*
+ * Restore user's disk quota because allocation failed.
+ */
+ (void) chkdq(ip, (long)-btodb(nsize - osize), cred, FORCE);
+#endif