SCCS-vsn: sys/ufs/ffs/ffs_alloc.c 7.17
SCCS-vsn: sys/ufs/lfs/lfs_alloc.c 7.17
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#)ffs_alloc.c 7.16 (Berkeley) %G%
+ * @(#)ffs_alloc.c 7.17 (Berkeley) %G%
register struct fs *fs;
register struct buf *bp;
int cg, error;
register struct fs *fs;
register struct buf *bp;
int cg, error;
+ struct ucred *cred = u.u_cred; /* XXX */
}
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
goto nospace;
}
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
goto nospace;
- if (u.u_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
+ if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace;
#ifdef QUOTA
goto nospace;
#ifdef QUOTA
- if (error = chkdq(ip, (long)btodb(size), 0))
+ if (error = chkdq(ip, (long)btodb(size), cred, 0))
return (error);
#endif
if (bpref >= fs->fs_size)
return (error);
#endif
if (bpref >= fs->fs_size)
int cg, request;
daddr_t bprev, bno, bn;
int i, error, count;
int cg, request;
daddr_t bprev, bno, bn;
int i, error, count;
+ struct ucred *cred = u.u_cred; /* XXX */
ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt);
panic("realloccg: bad size");
}
ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt);
panic("realloccg: bad size");
}
- if (u.u_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
+ if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {
printf("dev = 0x%x, bsize = %d, bprev = %d, fs = %s\n",
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {
printf("dev = 0x%x, bsize = %d, bprev = %d, fs = %s\n",
panic("realloccg: bad bprev");
}
#ifdef QUOTA
panic("realloccg: bad bprev");
}
#ifdef QUOTA
- if (error = chkdq(ip, (long)btodb(nsize - osize), 0))
+ if (error = chkdq(ip, (long)btodb(nsize - osize), cred, 0))
return (error);
#endif
/*
return (error);
#endif
/*
* 2) quadradically rehash into other cylinder groups, until an
* available inode is located.
*/
* 2) quadradically rehash into other cylinder groups, until an
* available inode is located.
*/
-ialloc(pip, ipref, mode, ipp)
+ialloc(pip, ipref, mode, cred, ipp)
register struct inode *pip;
ino_t ipref;
int mode;
register struct inode *pip;
ino_t ipref;
int mode;
struct inode **ipp;
{
ino_t ino;
struct inode **ipp;
{
ino_t ino;
fs = pip->i_fs;
if (fs->fs_cstotal.cs_nifree == 0)
goto noinodes;
fs = pip->i_fs;
if (fs->fs_cstotal.cs_nifree == 0)
goto noinodes;
-#ifdef QUOTA
- if (error = chkiq(pip->i_dev, (struct inode *)NULL, u.u_uid, 0))
- return (error);
-#endif
if (ipref >= fs->fs_ncg * fs->fs_ipg)
ipref = 0;
cg = itog(fs, ipref);
if (ipref >= fs->fs_ncg * fs->fs_ipg)
ipref = 0;
cg = itog(fs, ipref);
goto noinodes;
error = iget(pip, ino, ipp);
if (error) {
goto noinodes;
error = iget(pip, ino, ipp);
if (error) {
return (error);
}
ip = *ipp;
return (error);
}
ip = *ipp;
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#)lfs_alloc.c 7.16 (Berkeley) %G%
+ * @(#)lfs_alloc.c 7.17 (Berkeley) %G%
register struct fs *fs;
register struct buf *bp;
int cg, error;
register struct fs *fs;
register struct buf *bp;
int cg, error;
+ struct ucred *cred = u.u_cred; /* XXX */
}
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
goto nospace;
}
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
goto nospace;
- if (u.u_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
+ if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace;
#ifdef QUOTA
goto nospace;
#ifdef QUOTA
- if (error = chkdq(ip, (long)btodb(size), 0))
+ if (error = chkdq(ip, (long)btodb(size), cred, 0))
return (error);
#endif
if (bpref >= fs->fs_size)
return (error);
#endif
if (bpref >= fs->fs_size)
int cg, request;
daddr_t bprev, bno, bn;
int i, error, count;
int cg, request;
daddr_t bprev, bno, bn;
int i, error, count;
+ struct ucred *cred = u.u_cred; /* XXX */
ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt);
panic("realloccg: bad size");
}
ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt);
panic("realloccg: bad size");
}
- if (u.u_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
+ if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {
printf("dev = 0x%x, bsize = %d, bprev = %d, fs = %s\n",
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {
printf("dev = 0x%x, bsize = %d, bprev = %d, fs = %s\n",
panic("realloccg: bad bprev");
}
#ifdef QUOTA
panic("realloccg: bad bprev");
}
#ifdef QUOTA
- if (error = chkdq(ip, (long)btodb(nsize - osize), 0))
+ if (error = chkdq(ip, (long)btodb(nsize - osize), cred, 0))
return (error);
#endif
/*
return (error);
#endif
/*
* 2) quadradically rehash into other cylinder groups, until an
* available inode is located.
*/
* 2) quadradically rehash into other cylinder groups, until an
* available inode is located.
*/
-ialloc(pip, ipref, mode, ipp)
+ialloc(pip, ipref, mode, cred, ipp)
register struct inode *pip;
ino_t ipref;
int mode;
register struct inode *pip;
ino_t ipref;
int mode;
struct inode **ipp;
{
ino_t ino;
struct inode **ipp;
{
ino_t ino;
fs = pip->i_fs;
if (fs->fs_cstotal.cs_nifree == 0)
goto noinodes;
fs = pip->i_fs;
if (fs->fs_cstotal.cs_nifree == 0)
goto noinodes;
-#ifdef QUOTA
- if (error = chkiq(pip->i_dev, (struct inode *)NULL, u.u_uid, 0))
- return (error);
-#endif
if (ipref >= fs->fs_ncg * fs->fs_ipg)
ipref = 0;
cg = itog(fs, ipref);
if (ipref >= fs->fs_ncg * fs->fs_ipg)
ipref = 0;
cg = itog(fs, ipref);
goto noinodes;
error = iget(pip, ino, ipp);
if (error) {
goto noinodes;
error = iget(pip, ino, ipp);
if (error) {
return (error);
}
ip = *ipp;
return (error);
}
ip = *ipp;