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/fs/coda/coda_venus.c | 5 ++--- sys/fs/coda/coda_venus.h | 3 +-- sys/fs/coda/coda_vfsops.c | 3 +-- sys/fs/coda/coda_vnops.c | 5 ++--- 4 files changed, 6 insertions(+), 10 deletions(-) (limited to 'sys/fs/coda') diff --git a/sys/fs/coda/coda_venus.c b/sys/fs/coda/coda_venus.c index a222e7d..5982367 100644 --- a/sys/fs/coda/coda_venus.c +++ b/sys/fs/coda/coda_venus.c @@ -395,14 +395,13 @@ venus_readlink(void *mdp, CodaFid *fid, } int -venus_fsync(void *mdp, CodaFid *fid, - struct ucred *cred, struct proc *p) +venus_fsync(void *mdp, CodaFid *fid, struct proc *p) { DECL_NO_OUT(coda_fsync); /* sets Isize & Osize */ ALLOC_NO_OUT(coda_fsync); /* sets inp & outp */ /* send the open to venus. */ - INIT_IN(&inp->ih, CODA_FSYNC, cred, p); + INIT_IN(&inp->ih, CODA_FSYNC, NOCRED, p); /* XXX: should be cached mount cred */ inp->Fid = *fid; error = coda_call(mdp, Isize, &Osize, (char *)inp); diff --git a/sys/fs/coda/coda_venus.h b/sys/fs/coda/coda_venus.h index 533ddcb..1d1e0cf 100644 --- a/sys/fs/coda/coda_venus.h +++ b/sys/fs/coda/coda_venus.h @@ -75,8 +75,7 @@ venus_readlink(void *mdp, CodaFid *fid, /*out*/ char **str, int *len); int -venus_fsync(void *mdp, CodaFid *fid, - struct ucred *cred, struct proc *p); +venus_fsync(void *mdp, CodaFid *fid, struct proc *p); int venus_lookup(void *mdp, CodaFid *fid, diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c index 103946b..5e7c250 100644 --- a/sys/fs/coda/coda_vfsops.c +++ b/sys/fs/coda/coda_vfsops.c @@ -419,10 +419,9 @@ coda_nb_statfs(vfsp, sbp, td) * Flush any pending I/O. */ int -coda_sync(vfsp, waitfor, cred, td) +coda_sync(vfsp, waitfor, td) struct mount *vfsp; int waitfor; - struct ucred *cred; struct thread *td; { ENTRY; diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c index c204ef6..71b6976 100644 --- a/sys/fs/coda/coda_vnops.c +++ b/sys/fs/coda/coda_vnops.c @@ -763,7 +763,6 @@ coda_fsync(struct vop_fsync_args *ap) /* true args */ struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); - struct ucred *cred = ap->a_cred; struct thread *td = ap->a_td; /* locals */ struct vnode *convp = cp->c_ovp; @@ -787,7 +786,7 @@ coda_fsync(struct vop_fsync_args *ap) } if (convp) - VOP_FSYNC(convp, cred, MNT_WAIT, td); + VOP_FSYNC(convp, MNT_WAIT, td); /* * We see fsyncs with usecount == 1 then usecount == 0. @@ -815,7 +814,7 @@ coda_fsync(struct vop_fsync_args *ap) /* needs research */ return 0; - error = venus_fsync(vtomi(vp), &cp->c_fid, cred, td->td_proc); + error = venus_fsync(vtomi(vp), &cp->c_fid, td->td_proc); CODADEBUG(CODA_FSYNC, myprintf(("in fsync result %d\n",error)); ); return(error); -- cgit v1.1