+#endif
+#if QUOTA
+ /*
+ * This doesn't allow for holes in files (which hopefully don't
+ * happen often in files that we chown), and is not accurate anyway
+ * (eg: it totally ignores 3 level indir blk files - but hopefully
+ * noone who can make a file that big will have a quota)
+ */
+ if (ip->i_uid == uap->uid)
+ change = 0;
+ else {
+ register struct fs *fs = ip->i_fs;
+
+ if (ip->i_size > (change = NDADDR * fs->fs_bsize)) {
+ register off_t size;
+
+ size = blkroundup(fs, ip->i_size) - change;
+ change += size;
+ change += fs->fs_bsize;
+ /* This assumes NIADDR <= 2 */
+ if (size > NINDIR(fs) * fs->fs_bsize)
+ change += fs->fs_bsize;
+ } else
+ change = fragroundup(fs, ip->i_size);
+ change /= DEV_BSIZE;
+ }
+ chkdq(ip, -change, 1);
+ chkiq(ip->i_dev, ip, ip->i_uid, 1);
+ dqrele(ip->i_dquot);