-/* $OpenBSD: ext2fs_readwrite.c,v 1.41 2017/12/30 20:47:00 guenther Exp $ */
+/* $OpenBSD: ext2fs_readwrite.c,v 1.42 2018/01/08 16:15:34 millert Exp $ */
/* $NetBSD: ext2fs_readwrite.c,v 1.16 2001/02/27 04:37:47 chs Exp $ */
/*-
#include <sys/vnode.h>
#include <sys/malloc.h>
#include <sys/signalvar.h>
+#include <sys/event.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/ufsmount.h>
struct buf *bp;
int32_t lbn;
off_t osize;
- int blkoffset, error, flags, ioflag, size, xfersize;
+ int blkoffset, error, extended, flags, ioflag, size, xfersize;
size_t resid;
ssize_t overrun;
+ extended = 0;
ioflag = ap->a_ioflag;
uio = ap->a_uio;
vp = ap->a_vp;
if (error)
break;
uvm_vnp_setsize(vp, ip->i_e2fs_size);
+ extended = 1;
}
uvm_vnp_uncache(vp);
if (size < xfersize)
xfersize = size;
- error = uiomove((char *)bp->b_data + blkoffset, xfersize, uio);
+ error = uiomove(bp->b_data + blkoffset, xfersize, uio);
#if 0
if (ioflag & IO_NOCACHE)
bp->b_flags |= B_NOCACHE;
*/
if (resid > uio->uio_resid && ap->a_cred && ap->a_cred->cr_uid != 0)
ip->i_e2fs_mode &= ~(ISUID | ISGID);
+ if (resid > uio->uio_resid)
+ VN_KNOTE(vp, NOTE_WRITE | (extended ? NOTE_EXTEND : 0));
if (error) {
if (ioflag & IO_UNIT) {
(void)ext2fs_truncate(ip, osize,
-/* $OpenBSD: ext2fs_vnops.c,v 1.78 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: ext2fs_vnops.c,v 1.79 2018/01/08 16:15:34 millert Exp $ */
/* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */
/*
.vop_write = ext2fs_write,
.vop_ioctl = ufs_ioctl,
.vop_poll = ufs_poll,
- .vop_kqfilter = vop_generic_kqfilter,
+ .vop_kqfilter = ufs_kqfilter,
.vop_fsync = ext2fs_fsync,
.vop_remove = ext2fs_remove,
.vop_link = ext2fs_link,
-/* $OpenBSD: ufs_vnops.c,v 1.135 2018/01/02 06:38:45 guenther Exp $ */
+/* $OpenBSD: ufs_vnops.c,v 1.136 2018/01/08 16:15:34 millert Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */
/*
return (1);
}
- kn->kn_data = DIP(ip, size) - kn->kn_fp->f_offset;
+#ifdef EXT2FS
+ if (IS_EXT2_VNODE(ip->i_vnode))
+ kn->kn_data = ext2fs_size(ip) - kn->kn_fp->f_offset;
+ else
+#endif
+ kn->kn_data = DIP(ip, size) - kn->kn_fp->f_offset;
if (kn->kn_data == 0 && kn->kn_sfflags & NOTE_EOF) {
kn->kn_fflags |= NOTE_EOF;
return (1);