diff options
author | anton <anton@cvs.openbsd.org> | 2019-08-05 08:36:00 +0000 |
---|---|---|
committer | anton <anton@cvs.openbsd.org> | 2019-08-05 08:36:00 +0000 |
commit | 2de89e15b7def75453779ec4caaa525c42d8f6d5 (patch) | |
tree | 51666813036b139145bd44ffc7e017740fd196ae /sys/isofs | |
parent | 2e6a89f0541effeff8b1f6b09613577db20cbc5d (diff) |
Allow concurrent reads of the f_offset field of struct file by
serializing both read/write operations using the existing file mutex.
The vnode lock still grants exclusive write access to the offset; the
mutex is only used to make the actual write atomic and prevent any
concurrent reader from observing intermediate values.
ok mpi@ visa@
Diffstat (limited to 'sys/isofs')
-rw-r--r-- | sys/isofs/cd9660/cd9660_vnops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 5a588bb1a4e..c05b3dc5941 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_vnops.c,v 1.78 2019/07/12 13:56:27 solene Exp $ */ +/* $OpenBSD: cd9660_vnops.c,v 1.79 2019/08/05 08:35:59 anton Exp $ */ /* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */ /*- @@ -1016,7 +1016,7 @@ filt_cd9660read(struct knote *kn, long hint) return (1); } - kn->kn_data = node->i_size - kn->kn_fp->f_offset; + kn->kn_data = node->i_size - foffset(kn->kn_fp); if (kn->kn_data == 0 && kn->kn_sfflags & NOTE_EOF) { kn->kn_fflags |= NOTE_EOF; return (1); |