diff options
author | phk <phk@FreeBSD.org> | 2005-01-11 07:36:22 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-01-11 07:36:22 +0000 |
commit | da2718f1af898ee94e792d508153bc47de407fe3 (patch) | |
tree | 7316b582ef3e13abcf40fdc592649edfe19bde75 /sys/kern | |
parent | 63ced9b235017eb23882751a80aa345b4e4cf075 (diff) | |
download | FreeBSD-src-da2718f1af898ee94e792d508153bc47de407fe3.zip FreeBSD-src-da2718f1af898ee94e792d508153bc47de407fe3.tar.gz |
Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().
I'm not sure why a credential was added to these in the first place, it is
not used anywhere and it doesn't make much sense:
The credentials for syncing a file (ability to write to the
file) should be checked at the system call level.
Credentials for syncing one or more filesystems ("none")
should be checked at the system call level as well.
If the filesystem implementation needs a particular credential
to carry out the syncing it would logically have to the
cached mount credential, or a credential cached along with
any delayed write data.
Discussed with: rwatson
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_bio.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_default.c | 8 | ||||
-rw-r--r-- | sys/kern/vfs_extattr.c | 5 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 5 | ||||
-rw-r--r-- | sys/kern/vfs_vnops.c | 2 | ||||
-rw-r--r-- | sys/kern/vnode_if.src | 1 |
8 files changed, 13 insertions, 18 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 5562c9e..d1cc363 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1028,7 +1028,7 @@ bdwrite(struct buf *bp) recursiveflushes++; } else if (bo->bo_dirty.bv_cnt > dirtybufthresh + 10) { BO_UNLOCK(bo); - (void) VOP_FSYNC(vp, td->td_ucred, MNT_NOWAIT, td); + (void) VOP_FSYNC(vp, MNT_NOWAIT, td); BO_LOCK(bo); altbufferflushes++; } else if (bo->bo_dirty.bv_cnt > dirtybufthresh) { diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index ba253e7..970861a 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -686,10 +686,9 @@ vfs_stdquotactl (mp, cmds, uid, arg, td) } int -vfs_stdsync(mp, waitfor, cred, td) +vfs_stdsync(mp, waitfor, td) struct mount *mp; int waitfor; - struct ucred *cred; struct thread *td; { struct vnode *vp, *nvp; @@ -718,7 +717,7 @@ loop: goto loop; continue; } - error = VOP_FSYNC(vp, cred, waitfor, td); + error = VOP_FSYNC(vp, waitfor, td); if (error) allerror = error; @@ -731,10 +730,9 @@ loop: } int -vfs_stdnosync (mp, waitfor, cred, td) +vfs_stdnosync (mp, waitfor, td) struct mount *mp; int waitfor; - struct ucred *cred; struct thread *td; { diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 82a5f1f..17ef241 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -133,8 +133,7 @@ sync(td, uap) asyncflag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &= ~MNT_ASYNC; vfs_msync(mp, MNT_NOWAIT); - VFS_SYNC(mp, MNT_NOWAIT, - ((td != NULL) ? td->td_ucred : NOCRED), td); + VFS_SYNC(mp, MNT_NOWAIT, td); mp->mnt_flag |= asyncflag; vn_finished_write(mp); } @@ -3053,7 +3052,7 @@ fsync(td, uap) vm_object_page_clean(obj, 0, 0, 0); VM_OBJECT_UNLOCK(obj); } - error = VOP_FSYNC(vp, fp->f_cred, MNT_WAIT, td); + error = VOP_FSYNC(vp, MNT_WAIT, td); if (error == 0 && vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP) && softdep_fsync_hook != NULL) error = (*softdep_fsync_hook)(vp); diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 8a635f3..5e007e8 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -950,7 +950,7 @@ dounmount(mp, flags, td) vput(fsrootvp); } if (((mp->mnt_flag & MNT_RDONLY) || - (error = VFS_SYNC(mp, MNT_WAIT, td->td_ucred, td)) == 0) || + (error = VFS_SYNC(mp, MNT_WAIT, td)) == 0) || (flags & MNT_FORCE)) { error = VFS_UNMOUNT(mp, flags, td); } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 2b6f7a1..3f5d431 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -936,7 +936,7 @@ vinvalbuf(vp, flags, cred, td, slpflag, slptimeo) } if (bo->bo_dirty.bv_cnt > 0) { VI_UNLOCK(vp); - if ((error = VOP_FSYNC(vp, cred, MNT_WAIT, td)) != 0) + if ((error = VOP_FSYNC(vp, MNT_WAIT, td)) != 0) return (error); /* * XXX We could save a lock/unlock if this was only @@ -1487,7 +1487,7 @@ sync_vnode(struct bufobj *bo, struct thread *td) vholdl(vp); mtx_unlock(&sync_mtx); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY | LK_INTERLOCK, td); - (void) VOP_FSYNC(vp, td->td_ucred, MNT_LAZY, td); + (void) VOP_FSYNC(vp, MNT_LAZY, td); VOP_UNLOCK(vp, 0, td); vn_finished_write(mp); VI_LOCK(vp); @@ -3135,7 +3135,7 @@ sync_fsync(ap) asyncflag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &= ~MNT_ASYNC; vfs_msync(mp, MNT_NOWAIT); - error = VFS_SYNC(mp, MNT_LAZY, ap->a_cred, td); + error = VFS_SYNC(mp, MNT_LAZY, td); if (asyncflag) mp->mnt_flag |= MNT_ASYNC; vn_finished_write(mp); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 82a5f1f..17ef241 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -133,8 +133,7 @@ sync(td, uap) asyncflag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &= ~MNT_ASYNC; vfs_msync(mp, MNT_NOWAIT); - VFS_SYNC(mp, MNT_NOWAIT, - ((td != NULL) ? td->td_ucred : NOCRED), td); + VFS_SYNC(mp, MNT_NOWAIT, td); mp->mnt_flag |= asyncflag; vn_finished_write(mp); } @@ -3053,7 +3052,7 @@ fsync(td, uap) vm_object_page_clean(obj, 0, 0, 0); VM_OBJECT_UNLOCK(obj); } - error = VOP_FSYNC(vp, fp->f_cred, MNT_WAIT, td); + error = VOP_FSYNC(vp, MNT_WAIT, td); if (error == 0 && vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP) && softdep_fsync_hook != NULL) error = (*softdep_fsync_hook)(vp); diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index e69ceda..3e98446 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1021,7 +1021,7 @@ vfs_write_suspend(mp) mp->mnt_kern_flag |= MNTK_SUSPEND; if (mp->mnt_writeopcount > 0) (void) tsleep(&mp->mnt_writeopcount, PUSER - 1, "suspwt", 0); - if ((error = VFS_SYNC(mp, MNT_WAIT, td->td_ucred, td)) != 0) { + if ((error = VFS_SYNC(mp, MNT_WAIT, td)) != 0) { vfs_write_resume(mp); return (error); } diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index 17efba7..03f6303 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -247,7 +247,6 @@ vop_revoke { # vop_fsync { IN struct vnode *vp; - IN struct ucred *cred; IN int waitfor; IN struct thread *td; }; |