diff options
author | phk <phk@FreeBSD.org> | 2005-01-11 10:43:08 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-01-11 10:43:08 +0000 |
commit | 5a497775d6a793f5afeceff71192b3980f5a8ad2 (patch) | |
tree | 345fd3ee96f403ea4e52a2ed39eed971f68efa29 /sys/kern | |
parent | 169f1013f0189eb8dd358567ce979f1288609974 (diff) | |
download | FreeBSD-src-5a497775d6a793f5afeceff71192b3980f5a8ad2.zip FreeBSD-src-5a497775d6a793f5afeceff71192b3980f5a8ad2.tar.gz |
Add BO_SYNC() and add a default which uses the secret vnode pointer
and VOP_FSYNC() for now.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_bio.c | 8 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index d1cc363..a65708b 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -79,6 +79,7 @@ struct buf_ops buf_ops_bio = { .bop_name = "buf_ops_bio", .bop_write = bufwrite, .bop_strategy = bufstrategy, + .bop_sync = bufsync, }; /* @@ -3822,6 +3823,13 @@ bwait(struct buf *bp, u_char pri, const char *wchan) mtx_unlock(&bdonelock); } +int +bufsync(struct bufobj *bo, int waitfor, struct thread *td) +{ + + return (VOP_FSYNC(bo->__bo_vnode, waitfor, td)); +} + void bufstrategy(struct bufobj *bo, struct buf *bp) { diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index bf7623b..52b7b2d 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -935,7 +935,7 @@ vinvalbuf(vp, flags, cred, td, slpflag, slptimeo) } if (bo->bo_dirty.bv_cnt > 0) { BO_UNLOCK(bo); - if ((error = VOP_FSYNC(vp, MNT_WAIT, td)) != 0) + if ((error = BO_SYNC(bo, MNT_WAIT, td)) != 0) return (error); /* * XXX We could save a lock/unlock if this was only |