SCCS-vsn: sys/ufs/lfs/lfs_inode.c 8.2
SCCS-vsn: sys/ufs/ffs/ffs_inode.c 8.2
SCCS-vsn: sys/ufs/ffs/ffs_balloc.c 8.2
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ffs_balloc.c 8.1 (Berkeley) %G%
+ * @(#)ffs_balloc.c 8.2 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
struct buf *bp, *nbp;
struct vnode *vp = ITOV(ip);
struct indir indirs[NIADDR + 2];
struct buf *bp, *nbp;
struct vnode *vp = ITOV(ip);
struct indir indirs[NIADDR + 2];
- int osize, nsize, num, j, error;
daddr_t newb, lbn, *bap, pref;
daddr_t newb, lbn, *bap, pref;
+ int osize, nsize, num, i, error;
- *bpp = (struct buf *)0;
if (bn < 0)
return (EFBIG);
fs = ip->i_fs;
if (bn < 0)
return (EFBIG);
fs = ip->i_fs;
/*
* Fetch through the indirect blocks, allocating as necessary.
*/
/*
* Fetch through the indirect blocks, allocating as necessary.
*/
- for (j = 1; ; ) {
- error = bread(vp, indirs[j].in_lbn, (int)fs->fs_bsize, NOCRED,
- &bp);
+ for (i = 1;;) {
+ error = bread(vp,
+ indirs[i].in_lbn, (int)fs->fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (error);
}
bap = bp->b_un.b_daddr;
if (error) {
brelse(bp);
return (error);
}
bap = bp->b_un.b_daddr;
- nb = bap[indirs[j].in_off];
- if (j == num)
+ nb = bap[indirs[i].in_off];
+ if (i == num)
if (nb != 0) {
brelse(bp);
continue;
if (nb != 0) {
brelse(bp);
continue;
return (error);
}
nb = newb;
return (error);
}
nb = newb;
- nbp = getblk(vp, indirs[j].in_lbn, fs->fs_bsize, 0, 0);
+ nbp = getblk(vp, indirs[i].in_lbn, fs->fs_bsize, 0, 0);
nbp->b_blkno = fsbtodb(fs, nb);
clrbuf(nbp);
/*
nbp->b_blkno = fsbtodb(fs, nb);
clrbuf(nbp);
/*
brelse(bp);
return (error);
}
brelse(bp);
return (error);
}
- bap[indirs[j - 1].in_off] = nb;
+ bap[indirs[i - 1].in_off] = nb;
/*
* If required, write synchronously, otherwise use
* delayed write.
/*
* If required, write synchronously, otherwise use
* delayed write.
* Get the data block, allocating if necessary.
*/
if (nb == 0) {
* Get the data block, allocating if necessary.
*/
if (nb == 0) {
- pref = ffs_blkpref(ip, lbn, indirs[j].in_off, &bap[0]);
- if (error =
- ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, cred, &newb)) {
+ pref = ffs_blkpref(ip, lbn, indirs[i].in_off, &bap[0]);
+ if (error = ffs_alloc(ip,
+ lbn, pref, (int)fs->fs_bsize, cred, &newb)) {
brelse(bp);
return (error);
}
brelse(bp);
return (error);
}
nbp->b_blkno = fsbtodb(fs, nb);
if (flags & B_CLRBUF)
clrbuf(nbp);
nbp->b_blkno = fsbtodb(fs, nb);
if (flags & B_CLRBUF)
clrbuf(nbp);
- bap[indirs[j].in_off] = nb;
+ bap[indirs[i].in_off] = nb;
/*
* If required, write synchronously, otherwise use
* delayed write.
/*
* If required, write synchronously, otherwise use
* delayed write.
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ffs_inode.c 8.1 (Berkeley) %G%
+ * @(#)ffs_inode.c 8.2 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
ffs_update(ap)
struct vop_update_args /* {
struct vnode *a_vp;
ffs_update(ap)
struct vop_update_args /* {
struct vnode *a_vp;
- struct timeval *a_ta;
- struct timeval *a_tm;
+ struct timeval *a_access;
+ struct timeval *a_modify;
int a_waitfor;
} */ *ap;
{
int a_waitfor;
} */ *ap;
{
+ register struct fs *fs;
struct buf *bp;
struct inode *ip;
struct dinode *dp;
struct buf *bp;
struct inode *ip;
struct dinode *dp;
ip = VTOI(ap->a_vp);
if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) {
ip = VTOI(ap->a_vp);
if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) {
- ip->i_flag &= ~(IUPD|IACC|ICHG|IMOD);
+ ip->i_flag &= ~(IUPD | IACC | ICHG | IMOD);
return (0);
}
if ((ip->i_flag & (IUPD|IACC|ICHG|IMOD)) == 0)
return (0);
return (0);
}
if ((ip->i_flag & (IUPD|IACC|ICHG|IMOD)) == 0)
return (0);
- if (ip->i_flag&IACC)
- ip->i_atime.ts_sec = ap->a_ta->tv_sec;
- if (ip->i_flag&IUPD) {
- ip->i_mtime.ts_sec = ap->a_tm->tv_sec;
+ if (ip->i_flag & IACC)
+ ip->i_atime.ts_sec = ap->a_access->tv_sec;
+ if (ip->i_flag & IUPD) {
+ ip->i_mtime.ts_sec = ap->a_modify->tv_sec;
ip->i_modrev++;
}
if (ip->i_flag&ICHG)
ip->i_ctime.ts_sec = time.tv_sec;
ip->i_modrev++;
}
if (ip->i_flag&ICHG)
ip->i_ctime.ts_sec = time.tv_sec;
- ip->i_flag &= ~(IUPD|IACC|ICHG|IMOD);
+ ip->i_flag &= ~(IUPD | IACC | ICHG | IMOD);
fs = ip->i_fs;
/*
* Ensure that uid and gid are correct. This is a temporary
fs = ip->i_fs;
/*
* Ensure that uid and gid are correct. This is a temporary
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)lfs_inode.c 8.1 (Berkeley) %G%
+ * @(#)lfs_inode.c 8.2 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
lfs_update(ap)
struct vop_update_args /* {
struct vnode *a_vp;
lfs_update(ap)
struct vop_update_args /* {
struct vnode *a_vp;
- struct timeval *a_ta;
- struct timeval *a_tm;
+ struct timeval *a_access;
+ struct timeval *a_modify;
int a_waitfor;
} */ *ap;
{
int a_waitfor;
} */ *ap;
{
if ((ip->i_flag & (IUPD | IACC | ICHG | IMOD)) == 0)
return (0);
if (ip->i_flag & IACC)
if ((ip->i_flag & (IUPD | IACC | ICHG | IMOD)) == 0)
return (0);
if (ip->i_flag & IACC)
- ip->i_atime.ts_sec = ap->a_ta->tv_sec;
+ ip->i_atime.ts_sec = ap->a_access->tv_sec;
- ip->i_mtime.ts_sec = ap->a_tm->tv_sec;
+ ip->i_mtime.ts_sec = ap->a_modify->tv_sec;
(ip)->i_modrev++;
}
if (ip->i_flag & ICHG)
ip->i_ctime.ts_sec = time.tv_sec;
(ip)->i_modrev++;
}
if (ip->i_flag & ICHG)
ip->i_ctime.ts_sec = time.tv_sec;
- ip->i_flag &= ~(IUPD|IACC|ICHG);
+ ip->i_flag &= ~(IUPD | IACC | ICHG);
if (!(ip->i_flag & IMOD))
++(VFSTOUFS(vp->v_mount)->um_lfs->lfs_uinodes);
if (!(ip->i_flag & IMOD))
++(VFSTOUFS(vp->v_mount)->um_lfs->lfs_uinodes);