Remove unused thread argument from vtruncbuf().

Reviewed by:	kib
This commit is contained in:
Edward Tomasz Napierala 2012-04-23 13:21:28 +00:00
parent dbb2e75504
commit c52fd858ae
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=234605
18 changed files with 31 additions and 38 deletions

View File

@ -249,7 +249,7 @@ ext2_truncate(vp, length, flags, cred, td)
bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof(newblks));
bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof(oldblks));
oip->i_size = osize;
error = vtruncbuf(ovp, cred, td, length, (int)fs->e2fs_bsize);
error = vtruncbuf(ovp, cred, length, (int)fs->e2fs_bsize);
if (error && (allerror == 0))
allerror = error;
vnode_pager_setsize(ovp, length);

View File

@ -528,7 +528,7 @@ hpfs_setattr(ap)
}
if (vap->va_size < hp->h_fn.fn_size) {
error = vtruncbuf(vp, cred, td, vap->va_size, DEV_BSIZE);
error = vtruncbuf(vp, cred, vap->va_size, DEV_BSIZE);
if (error)
return (error);
error = hpfs_truncate(hp, vap->va_size);

View File

@ -276,6 +276,6 @@ int dosdirempty(struct denode *dep);
int createde(struct denode *dep, struct denode *ddep, struct denode **depp, struct componentname *cnp);
int deupdat(struct denode *dep, int waitfor);
int removede(struct denode *pdep, struct denode *dep);
int detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred, struct thread *td);
int detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred);
int doscheckpath( struct denode *source, struct denode *target);
#endif /* _KERNEL */

View File

@ -326,12 +326,11 @@ deupdat(dep, waitfor)
* Truncate the file described by dep to the length specified by length.
*/
int
detrunc(dep, length, flags, cred, td)
detrunc(dep, length, flags, cred)
struct denode *dep;
u_long length;
int flags;
struct ucred *cred;
struct thread *td;
{
int error;
int allerror;
@ -426,7 +425,7 @@ detrunc(dep, length, flags, cred, td)
dep->de_FileSize = length;
if (!isadir)
dep->de_flag |= DE_UPDATE | DE_MODIFIED;
allerror = vtruncbuf(DETOV(dep), cred, td, length, pmp->pm_bpcluster);
allerror = vtruncbuf(DETOV(dep), cred, length, pmp->pm_bpcluster);
#ifdef MSDOSFS_DEBUG
if (allerror)
printf("detrunc(): vtruncbuf error %d\n", allerror);
@ -504,7 +503,7 @@ deextend(dep, length, cred)
error = extendfile(dep, count, NULL, NULL, DE_CLEAR);
if (error) {
/* truncate the added clusters away again */
(void) detrunc(dep, dep->de_FileSize, 0, cred, NULL);
(void) detrunc(dep, dep->de_FileSize, 0, cred);
return (error);
}
}
@ -607,7 +606,7 @@ msdosfs_inactive(ap)
dep, dep->de_refcnt, vp->v_mount->mnt_flag, MNT_RDONLY);
#endif
if (dep->de_refcnt <= 0 && (vp->v_mount->mnt_flag & MNT_RDONLY) == 0) {
error = detrunc(dep, (u_long) 0, 0, NOCRED, td);
error = detrunc(dep, (u_long) 0, 0, NOCRED);
dep->de_flag |= DE_UPDATE;
dep->de_Name[0] = SLOT_DELETED;
}

View File

@ -649,7 +649,7 @@ createde(dep, ddep, depp, cnp)
dirclust = de_clcount(pmp, diroffset);
error = extendfile(ddep, dirclust, 0, 0, DE_CLEAR);
if (error) {
(void)detrunc(ddep, ddep->de_FileSize, 0, NOCRED, NULL);
(void)detrunc(ddep, ddep->de_FileSize, 0, NOCRED);
return error;
}

View File

@ -476,7 +476,7 @@ msdosfs_setattr(ap)
*/
break;
}
error = detrunc(dep, vap->va_size, 0, cred, td);
error = detrunc(dep, vap->va_size, 0, cred);
if (error)
return error;
}
@ -835,11 +835,11 @@ msdosfs_write(ap)
errexit:
if (error) {
if (ioflag & IO_UNIT) {
detrunc(dep, osize, ioflag & IO_SYNC, NOCRED, NULL);
detrunc(dep, osize, ioflag & IO_SYNC, NOCRED);
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
} else {
detrunc(dep, dep->de_FileSize, ioflag & IO_SYNC, NOCRED, NULL);
detrunc(dep, dep->de_FileSize, ioflag & IO_SYNC, NOCRED);
if (uio->uio_resid != resid)
error = 0;
}
@ -1429,7 +1429,6 @@ msdosfs_rmdir(ap)
struct vnode *dvp = ap->a_dvp;
struct componentname *cnp = ap->a_cnp;
struct denode *ip, *dp;
struct thread *td = cnp->cn_thread;
int error;
ip = VTODE(vp);
@ -1467,7 +1466,7 @@ msdosfs_rmdir(ap)
/*
* Truncate the directory that is being deleted.
*/
error = detrunc(ip, (u_long)0, IO_SYNC, cnp->cn_cred, td);
error = detrunc(ip, (u_long)0, IO_SYNC, cnp->cn_cred);
cache_purge(vp);
out:

View File

@ -1817,7 +1817,7 @@ ncl_meta_setsize(struct vnode *vp, struct ucred *cred, struct thread *td, u_quad
* truncation point. We may have a B_DELWRI and/or B_CACHE
* buffer that now needs to be truncated.
*/
error = vtruncbuf(vp, cred, td, nsize, biosize);
error = vtruncbuf(vp, cred, nsize, biosize);
lbn = nsize / biosize;
bufsize = nsize & (biosize - 1);
bp = nfs_getcacheblk(vp, lbn, bufsize, td);

View File

@ -1327,8 +1327,7 @@ flushbuflist(struct bufv *bufv, int flags, struct bufobj *bo, int slpflag,
* sync activity.
*/
int
vtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td,
off_t length, int blksize)
vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length, int blksize)
{
struct buf *bp, *nbp;
int anyfreed;

View File

@ -1796,7 +1796,7 @@ nfs_meta_setsize(struct vnode *vp, struct ucred *cred, struct thread *td, u_quad
* truncation point. We may have a B_DELWRI and/or B_CACHE
* buffer that now needs to be truncated.
*/
error = vtruncbuf(vp, cred, td, nsize, biosize);
error = vtruncbuf(vp, cred, nsize, biosize);
lbn = nsize / biosize;
bufsize = nsize & (biosize - 1);
bp = nfs_getcacheblk(vp, lbn, bufsize, td);

View File

@ -634,8 +634,8 @@ void vhold(struct vnode *);
void vholdl(struct vnode *);
void vinactive(struct vnode *, struct thread *);
int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo);
int vtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td,
off_t length, int blksize);
int vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length,
int blksize);
void vunref(struct vnode *);
void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3);
#define vprint(label, vp) vn_printf((vp), "%s\n", (label))

View File

@ -93,7 +93,7 @@ void ffs_snapshot_unmount(struct mount *mp);
void process_deferred_inactive(struct mount *mp);
void ffs_sync_snap(struct mount *, int);
int ffs_syncvnode(struct vnode *vp, int waitfor, int flags);
int ffs_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *);
int ffs_truncate(struct vnode *, off_t, int, struct ucred *);
int ffs_update(struct vnode *, int);
int ffs_valloc(struct vnode *, int, struct ucred *, struct vnode **);

View File

@ -170,12 +170,11 @@ ffs_update(vp, waitfor)
* disk blocks.
*/
int
ffs_truncate(vp, length, flags, cred, td)
ffs_truncate(vp, length, flags, cred)
struct vnode *vp;
off_t length;
int flags;
struct ucred *cred;
struct thread *td;
{
struct inode *ip;
ufs2_daddr_t bn, lbn, lastblock, lastiblock[NIADDR], indir_lbn[NIADDR];
@ -449,7 +448,7 @@ ffs_truncate(vp, length, flags, cred, td)
ip->i_size = osize;
DIP_SET(ip, i_size, osize);
error = vtruncbuf(vp, cred, td, length, fs->fs_bsize);
error = vtruncbuf(vp, cred, length, fs->fs_bsize);
if (error && (allerror == 0))
allerror = error;

View File

@ -850,7 +850,7 @@ ffs_snapshot(mp, snapfile)
mp->mnt_flag = (mp->mnt_flag & MNT_QUOTA) | (flag & ~MNT_QUOTA);
MNT_IUNLOCK(mp);
if (error)
(void) ffs_truncate(vp, (off_t)0, 0, NOCRED, td);
(void) ffs_truncate(vp, (off_t)0, 0, NOCRED);
(void) ffs_syncvnode(vp, MNT_WAIT, 0);
if (error)
vput(vp);
@ -1989,7 +1989,7 @@ ffs_snapshot_mount(mp)
reason = "non-snapshot";
} else {
reason = "old format snapshot";
(void)ffs_truncate(vp, (off_t)0, 0, NOCRED, td);
(void)ffs_truncate(vp, (off_t)0, 0, NOCRED);
(void)ffs_syncvnode(vp, MNT_WAIT, 0);
}
printf("ffs_snapshot_mount: %s inode %d\n",

View File

@ -812,8 +812,7 @@ ffs_write(ap)
if (error) {
if (ioflag & IO_UNIT) {
(void)ffs_truncate(vp, osize,
IO_NORMAL | (ioflag & IO_SYNC),
ap->a_cred, uio->uio_td);
IO_NORMAL | (ioflag & IO_SYNC), ap->a_cred);
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
}
@ -1135,7 +1134,7 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *ucred)
if (error) {
if (ioflag & IO_UNIT) {
(void)ffs_truncate(vp, osize,
IO_EXT | (ioflag&IO_SYNC), ucred, uio->uio_td);
IO_EXT | (ioflag&IO_SYNC), ucred);
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
}
@ -1326,7 +1325,7 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td
luio.uio_td = td;
/* XXX: I'm not happy about truncating to zero size */
if (ip->i_ea_len < dp->di_extsize)
error = ffs_truncate(vp, 0, IO_EXT, cred, td);
error = ffs_truncate(vp, 0, IO_EXT, cred);
error = ffs_extwrite(vp, &luio, IO_EXT | IO_SYNC, cred);
}
if (--ip->i_ea_refs == 0) {

View File

@ -129,8 +129,7 @@ ufs_inactive(ap)
if (ip->i_ump->um_fstype == UFS2)
isize += ip->i_din2->di_extsize;
if (ip->i_effnlink <= 0 && isize && !UFS_RDONLY(ip))
error = UFS_TRUNCATE(vp, (off_t)0, IO_EXT | IO_NORMAL,
NOCRED, td);
error = UFS_TRUNCATE(vp, (off_t)0, IO_EXT | IO_NORMAL, NOCRED);
if (ip->i_nlink <= 0 && ip->i_mode && !UFS_RDONLY(ip)) {
#ifdef QUOTA
if (!getinoquota(ip))

View File

@ -1133,7 +1133,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename)
ufsdirhash_dirtrunc(dp, dp->i_endoff);
#endif
(void) UFS_TRUNCATE(dvp, (off_t)dp->i_endoff,
IO_NORMAL | IO_SYNC, cr, td);
IO_NORMAL | IO_SYNC, cr);
if (tvp != NULL)
vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY);
}

View File

@ -621,7 +621,7 @@ ufs_setattr(ap)
return (0);
}
if ((error = UFS_TRUNCATE(vp, vap->va_size, IO_NORMAL,
cred, td)) != 0)
cred)) != 0)
return (error);
}
if (vap->va_atime.tv_sec != VNOVAL ||
@ -1567,8 +1567,7 @@ ufs_rename(ap)
if (tdp->i_dirhash != NULL)
ufsdirhash_dirtrunc(tdp, endoff);
#endif
UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | IO_SYNC, tcnp->cn_cred,
td);
UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | IO_SYNC, tcnp->cn_cred);
}
if (error == 0 && tdp->i_flag & IN_NEEDSYNC)
error = VOP_FSYNC(tdvp, MNT_WAIT, td);

View File

@ -100,7 +100,7 @@ struct ufsmount {
int um_candelete; /* devvp supports TRIM */
int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **);
int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **);
int (*um_truncate)(struct vnode *, off_t, int, struct ucred *, struct thread *);
int (*um_truncate)(struct vnode *, off_t, int, struct ucred *);
int (*um_update)(struct vnode *, int);
int (*um_valloc)(struct vnode *, int, struct ucred *, struct vnode **);
int (*um_vfree)(struct vnode *, ino_t, int);
@ -111,7 +111,7 @@ struct ufsmount {
#define UFS_BALLOC(aa, bb, cc, dd, ee, ff) VFSTOUFS((aa)->v_mount)->um_balloc(aa, bb, cc, dd, ee, ff)
#define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd)
#define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee)
#define UFS_TRUNCATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd)
#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb)
#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd)
#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc)