From da2718f1af898ee94e792d508153bc47de407fe3 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 11 Jan 2005 07:36:22 +0000 Subject: 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 --- sys/gnu/ext2fs/ext2_vfsops.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sys/gnu/ext2fs/ext2_vfsops.c') diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index bce81c9..9cd8916 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -152,7 +152,7 @@ ext2_mount(mp, td) error = 0; if (fs->s_rd_only == 0 && vfs_flagopt(opts, "ro", NULL, 0)) { - error = VFS_SYNC(mp, MNT_WAIT, td->td_ucred, td); + error = VFS_SYNC(mp, MNT_WAIT, td); if (error) return (error); flags = WRITECLOSE; @@ -837,10 +837,9 @@ ext2_statfs(mp, sbp, td) * Note: we are always called with the filesystem marked `MPBUSY'. */ static int -ext2_sync(mp, waitfor, cred, td) +ext2_sync(mp, waitfor, td) struct mount *mp; int waitfor; - struct ucred *cred; struct thread *td; { struct vnode *nvp, *vp; @@ -882,7 +881,7 @@ loop: goto loop; continue; } - if ((error = VOP_FSYNC(vp, cred, waitfor, td)) != 0) + if ((error = VOP_FSYNC(vp, waitfor, td)) != 0) allerror = error; VOP_UNLOCK(vp, 0, td); vrele(vp); @@ -894,7 +893,7 @@ loop: */ if (waitfor != MNT_LAZY) { vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td); - if ((error = VOP_FSYNC(ump->um_devvp, cred, waitfor, td)) != 0) + if ((error = VOP_FSYNC(ump->um_devvp, waitfor, td)) != 0) allerror = error; VOP_UNLOCK(ump->um_devvp, 0, td); } -- cgit v1.1