summaryrefslogtreecommitdiffstats
path: root/sys/fs/smbfs
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2003-03-11 22:15:10 +0000
committerkan <kan@FreeBSD.org>2003-03-11 22:15:10 +0000
commit378cd3b05d24e35b8f882e3eff724bb1ad5459f7 (patch)
treeefabc12de7b77fafe029a678e61151926f8cec1c /sys/fs/smbfs
parentb2bb08b487890b3c3ed6adca7372f3d742354a76 (diff)
downloadFreeBSD-src-378cd3b05d24e35b8f882e3eff724bb1ad5459f7.zip
FreeBSD-src-378cd3b05d24e35b8f882e3eff724bb1ad5459f7.tar.gz
Rename vfs_stdsync function to vfs_stdnosync which matches more
closely what function is really doing. Update all existing consumers to use the new name. Introduce a new vfs_stdsync function, which iterates over mount point's vnodes and call FSYNC on each one of them in turn. Make nwfs and smbfs use this new function instead of rolling their own identical sync implementations. Reviewed by: jeff
Diffstat (limited to 'sys/fs/smbfs')
-rw-r--r--sys/fs/smbfs/smbfs_vfsops.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c
index b1d1c68..17ce21d 100644
--- a/sys/fs/smbfs/smbfs_vfsops.c
+++ b/sys/fs/smbfs/smbfs_vfsops.c
@@ -83,7 +83,6 @@ static int smbfs_quotactl(struct mount *, int, uid_t, caddr_t, struct thread *);
static int smbfs_root(struct mount *, struct vnode **);
static int smbfs_start(struct mount *, int, struct thread *);
static int smbfs_statfs(struct mount *, struct statfs *, struct thread *);
-static int smbfs_sync(struct mount *, int, struct ucred *, struct thread *);
static int smbfs_unmount(struct mount *, int, struct thread *);
static int smbfs_init(struct vfsconf *vfsp);
static int smbfs_uninit(struct vfsconf *vfsp);
@@ -95,7 +94,7 @@ static struct vfsops smbfs_vfsops = {
smbfs_root,
smbfs_quotactl,
smbfs_statfs,
- smbfs_sync,
+ vfs_stdsync,
vfs_stdvget,
vfs_stdfhtovp, /* shouldn't happen */
vfs_stdcheckexp,
@@ -401,46 +400,3 @@ smbfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td)
strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN);
return 0;
}
-
-/*
- * Flush out the buffer cache
- */
-/* ARGSUSED */
-static int
-smbfs_sync(mp, waitfor, cred, td)
- struct mount *mp;
- int waitfor;
- struct ucred *cred;
- struct thread *td;
-{
- struct vnode *vp;
- int error, allerror = 0;
- /*
- * Force stale buffer cache information to be flushed.
- */
-loop:
- for (vp = TAILQ_FIRST(&mp->mnt_nvnodelist);
- vp != NULL;
- vp = TAILQ_NEXT(vp, v_nmntvnodes)) {
- /*
- * If the vnode that we are about to sync is no longer
- * associated with this mount point, start over.
- */
- if (vp->v_mount != mp)
- goto loop;
- VI_LOCK(vp);
- if (VOP_ISLOCKED(vp, NULL) || TAILQ_EMPTY(&vp->v_dirtyblkhd) ||
- waitfor == MNT_LAZY) {
- VI_UNLOCK(vp);
- continue;
- }
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td))
- goto loop;
- error = VOP_FSYNC(vp, cred, waitfor, td);
- if (error)
- allerror = error;
- vput(vp);
- }
- return (allerror);
-}
-
OpenPOWER on IntegriCloud