Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/smbfs sprinkle VN_KNOTE()s
details: https://anonhg.NetBSD.org/src/rev/7ec20be1ef7c
branches: trunk
changeset: 543445:7ec20be1ef7c
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Tue Feb 25 10:33:19 2003 +0000
description:
sprinkle VN_KNOTE()s
diffstat:
sys/fs/smbfs/smbfs_io.c | 10 ++++++++--
sys/fs/smbfs/smbfs_vnops.c | 17 ++++++++++++++---
2 files changed, 22 insertions(+), 5 deletions(-)
diffs (123 lines):
diff -r 8f4a79e5167d -r 7ec20be1ef7c sys/fs/smbfs/smbfs_io.c
--- a/sys/fs/smbfs/smbfs_io.c Tue Feb 25 10:29:12 2003 +0000
+++ b/sys/fs/smbfs/smbfs_io.c Tue Feb 25 10:33:19 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbfs_io.c,v 1.11 2003/02/25 10:14:29 jdolecek Exp $ */
+/* $NetBSD: smbfs_io.c,v 1.12 2003/02/25 10:33:19 jdolecek Exp $ */
/*
* Copyright (c) 2000-2001, Boris Popov
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbfs_io.c,v 1.11 2003/02/25 10:14:29 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_io.c,v 1.12 2003/02/25 10:33:19 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -240,6 +240,8 @@
struct smb_cred scred;
struct proc *p;
int error = 0;
+ int extended = 0;
+ size_t resid = uiop->uio_resid;
/* vn types other than VREG unsupported */
KASSERT(vp->v_type == VREG);
@@ -282,8 +284,12 @@
if (uiop->uio_offset > np->n_size) {
np->n_size = uiop->uio_offset;
uvm_vnp_setsize(vp, np->n_size);
+ extended = 1;
}
+
}
+ if (resid > uiop->uio_resid)
+ VN_KNOTE(vp, NOTE_WRITE | (extended ? NOTE_EXTEND : 0));
return error;
}
diff -r 8f4a79e5167d -r 7ec20be1ef7c sys/fs/smbfs/smbfs_vnops.c
--- a/sys/fs/smbfs/smbfs_vnops.c Tue Feb 25 10:29:12 2003 +0000
+++ b/sys/fs/smbfs/smbfs_vnops.c Tue Feb 25 10:33:19 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbfs_vnops.c,v 1.14 2003/02/25 09:09:32 jdolecek Exp $ */
+/* $NetBSD: smbfs_vnops.c,v 1.15 2003/02/25 10:33:19 jdolecek Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbfs_vnops.c,v 1.14 2003/02/25 09:09:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_vnops.c,v 1.15 2003/02/25 10:33:19 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -497,6 +497,7 @@
smbfs_attr_cacheremove(vp); /* invalidate cache */
VOP_GETATTR(vp, vap, ap->a_cred, ap->a_p);
np->n_mtime.tv_sec = vap->va_mtime.tv_sec;
+ VN_KNOTE(vp, NOTE_ATTRIB);
return error;
}
/*
@@ -587,6 +588,7 @@
out:
PNBUF_PUT(cnp->cn_pnbuf);
+ VN_KNOTE(dvp, NOTE_WRITE);
vput(dvp);
return (error);
@@ -618,6 +620,8 @@
}
PNBUF_PUT(cnp->cn_pnbuf);
+ VN_KNOTE(ap->a_vp, NOTE_DELETE);
+ VN_KNOTE(ap->a_dvp, NOTE_WRITE);
if (dvp == vp)
vrele(vp);
else
@@ -687,9 +691,14 @@
error = smbfs_smb_delete(VTOSMB(tvp), &scred);
if (error)
goto out;
+ VN_KNOTE(tdvp, NOTE_WRITE);
+ VN_KNOTE(tvp, NOTE_DELETE);
+ cache_purge(tvp);
}
error = smbfs_smb_rename(VTOSMB(fvp), VTOSMB(tdvp),
tcnp->cn_nameptr, tcnp->cn_namelen, &scred);
+ VN_KNOTE(fdvp, NOTE_WRITE);
+ VN_KNOTE(fvp, NOTE_RENAME);
}
if (fvp->v_type == VDIR) {
@@ -697,7 +706,6 @@
cache_purge(tdvp);
cache_purge(fdvp);
}
-
out:
smbfs_attr_cacheremove(fdvp);
smbfs_attr_cacheremove(tdvp);
@@ -776,6 +784,7 @@
out:
PNBUF_PUT(cnp->cn_pnbuf);
+ VN_KNOTE(dvp, NOTE_WRITE | NOTE_LINK);
vput(dvp);
return (error);
@@ -814,6 +823,8 @@
PNBUF_PUT(cnp->cn_pnbuf);
dnp->n_flag |= NMODIFIED;
smbfs_attr_cacheremove(dvp);
+ VN_KNOTE(dvp, NOTE_WRITE | NOTE_LINK);
+ VN_KNOTE(vp, NOTE_DELETE);
cache_purge(dvp);
cache_purge(vp);
vput(vp);
Home |
Main Index |
Thread Index |
Old Index