aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2005-01-11 07:36:22 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2005-01-11 07:36:22 +0000
commit8df6bac4c74fad8167cbb05a2a358a36b1ce6f78 (patch)
tree7316b582ef3e13abcf40fdc592649edfe19bde75 /sys/kern
parentad3142eda4f934d9940348293082cc1392ce550d (diff)
downloadsrc-8df6bac4c74fad8167cbb05a2a358a36b1ce6f78.tar.gz
src-8df6bac4c74fad8167cbb05a2a358a36b1ce6f78.zip
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
Notes
Notes: svn path=/head/; revision=140048
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_bio.c2
-rw-r--r--sys/kern/vfs_default.c8
-rw-r--r--sys/kern/vfs_extattr.c5
-rw-r--r--sys/kern/vfs_mount.c2
-rw-r--r--sys/kern/vfs_subr.c6
-rw-r--r--sys/kern/vfs_syscalls.c5
-rw-r--r--sys/kern/vfs_vnops.c2
-rw-r--r--sys/kern/vnode_if.src1
8 files changed, 13 insertions, 18 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 5562c9e45686..d1cc3638598a 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 ba253e760d72..970861aabcbb 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 82a5f1ff612a..17ef241c8646 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 8a635f339bed..5e007e8154c0 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 2b6f7a1a14cc..3f5d431c9a4a 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 82a5f1ff612a..17ef241c8646 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 e69cedaf69a2..3e98446c2dd8 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 17efba77934b..03f63037b91c 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;
};