diff options
author | kib <kib@FreeBSD.org> | 2012-12-23 22:43:27 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-12-23 22:43:27 +0000 |
commit | c6bad3bef79216ab7313dba42827d02cecb65b47 (patch) | |
tree | 91718c036281468c475132b2be95a4490ccbd71a /sys/fs/devfs | |
parent | 59cd15065c1301153ea8bfc71730fbf51f2d7e43 (diff) | |
download | FreeBSD-src-c6bad3bef79216ab7313dba42827d02cecb65b47.zip FreeBSD-src-c6bad3bef79216ab7313dba42827d02cecb65b47.tar.gz |
Do not force a writer to the devfs file to drain the buffer writes.
Requested and tested by: Ian Lepore <freebsd@damnhippie.dyndns.org>
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/devfs')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 97a1bcf..9851229 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -1049,6 +1049,7 @@ devfs_open(struct vop_open_args *ap) int error, ref, vlocked; struct cdevsw *dsw; struct file *fpop; + struct mtx *mtxp; if (vp->v_type == VBLK) return (ENXIO); @@ -1099,6 +1100,16 @@ devfs_open(struct vop_open_args *ap) #endif if (fp->f_ops == &badfileops) finit(fp, fp->f_flag, DTYPE_VNODE, dev, &devfs_ops_f); + mtxp = mtx_pool_find(mtxpool_sleep, fp); + + /* + * Hint to the dofilewrite() to not force the buffer draining + * on the writer to the file. Most likely, the write would + * not need normal buffers. + */ + mtx_lock(mtxp); + fp->f_vnread_flags |= FDEVFS_VNODE; + mtx_unlock(mtxp); return (error); } |