SCCS-vsn: sys/ufs/ffs/ffs_inode.c 7.60
SCCS-vsn: sys/ufs/ffs/ffs_vnops.c 7.87
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ffs_inode.c 7.59 (Berkeley) %G%
+ * @(#)ffs_inode.c 7.60 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
/*
* Truncate the inode ip to at most length size. Free affected disk
* blocks -- the blocks of the file are removed in reverse order.
/*
* Truncate the inode ip to at most length size. Free affected disk
* blocks -- the blocks of the file are removed in reverse order.
- *
- * NB: triple indirect blocks are untested.
*/
ffs_truncate(ap)
struct vop_truncate_args /* {
*/
ffs_truncate(ap)
struct vop_truncate_args /* {
struct buf *bp;
int offset, size, level;
long count, nblocks, blocksreleased = 0;
struct buf *bp;
int offset, size, level;
long count, nblocks, blocksreleased = 0;
register int i;
int aflags, error, allerror;
struct inode tip;
off_t osize;
oip = VTOI(ovp);
register int i;
int aflags, error, allerror;
struct inode tip;
off_t osize;
oip = VTOI(ovp);
if (ovp->v_type == VLNK && ovp->v_mount->mnt_maxsymlinklen > 0) {
#ifdef DIAGNOSTIC
if (length != 0)
if (ovp->v_type == VLNK && ovp->v_mount->mnt_maxsymlinklen > 0) {
#ifdef DIAGNOSTIC
if (length != 0)
bzero((char *)&oip->i_shortlink, (u_int)oip->i_size);
oip->i_size = 0;
oip->i_flag |= ICHG|IUPD;
bzero((char *)&oip->i_shortlink, (u_int)oip->i_size);
oip->i_size = 0;
oip->i_flag |= ICHG|IUPD;
- return (VOP_UPDATE(ovp, &time, &time, 1));
+ return (VOP_UPDATE(ovp, &tv, &tv, 1));
}
if (oip->i_size <= length) {
oip->i_flag |= ICHG|IUPD;
}
if (oip->i_size <= length) {
oip->i_flag |= ICHG|IUPD;
- return (VOP_UPDATE(ovp, &time, &time, 1));
+ return (VOP_UPDATE(ovp, &tv, &tv, 1));
}
vnode_pager_setsize(ovp, (u_long)length);
/*
}
vnode_pager_setsize(ovp, (u_long)length);
/*
oip->i_db[i] = 0;
oip->i_flag |= ICHG|IUPD;
allerror = vinvalbuf(ovp, length > 0, ap->a_cred, ap->a_p);
oip->i_db[i] = 0;
oip->i_flag |= ICHG|IUPD;
allerror = vinvalbuf(ovp, length > 0, ap->a_cred, ap->a_p);
- if (error = VOP_UPDATE(ovp, &time, &time, MNT_WAIT))
+ if (error = VOP_UPDATE(ovp, &tv, &tv, MNT_WAIT))
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ffs_vnops.c 7.86 (Berkeley) %G%
+ * @(#)ffs_vnops.c 7.87 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
register struct fs *fs;
struct proc *p = uio->uio_procp;
int ioflag = ap->a_ioflag;
register struct fs *fs;
struct proc *p = uio->uio_procp;
int ioflag = ap->a_ioflag;
struct buf *bp;
daddr_t lbn, bn;
off_t osize;
struct buf *bp;
daddr_t lbn, bn;
off_t osize;
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
}
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
}
- if (!error && (ioflag & IO_SYNC))
- error = VOP_UPDATE(vp, &time, &time, 1);
+ if (!error && (ioflag & IO_SYNC)) {
+ tv = time;
+ error = VOP_UPDATE(vp, &tv, &tv, 1);
+ }
register struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
register struct buf *bp;
register struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
register struct buf *bp;
- return (VOP_UPDATE(ap->a_vp, &time, &time, ap->a_waitfor == MNT_WAIT));
+ tv = time;
+ return (VOP_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
{
register struct vnode *vp = ap->a_vp;
register struct inode *ip = VTOI(vp);
{
register struct vnode *vp = ap->a_vp;
register struct inode *ip = VTOI(vp);
int mode, error;
extern int prtactive;
int mode, error;
extern int prtactive;
ip->i_flag |= IUPD|ICHG;
VOP_VFREE(vp, ip->i_number, mode);
}
ip->i_flag |= IUPD|ICHG;
VOP_VFREE(vp, ip->i_number, mode);
}
- if (ip->i_flag&(IUPD|IACC|ICHG|IMOD))
- VOP_UPDATE(vp, &time, &time, 0);
+ if (ip->i_flag&(IUPD|IACC|ICHG|IMOD)) {
+ tv = time;
+ VOP_UPDATE(vp, &tv, &tv, 0);
+ }
IUNLOCK(ip);
ip->i_flag = 0;
/*
IUNLOCK(ip);
ip->i_flag = 0;
/*