diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-05-01 03:43:24 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-05-01 03:43:24 +0000 |
commit | 6fb575d2c3daf3def4e179b9795f497c735d9340 (patch) | |
tree | b0ef00272926ee5684f07c80d6583562bdfadd3e /lib/libkvm/kvm_file2.c | |
parent | fb9b82f51c08b1684ae822ae0225f07715a788c1 (diff) |
Eliminate the f_usecount ref count in struct file; instead of sleeping
at the top of closef() until all in-progress calls finish, just do the
advisory locking bits required of close() by POSIX and let whichever
thread has the last reference do the call to the file's fo_close()
method and the final cleanup.
lots of discussion with deraadt@ and others; worked out with and ok krw@
Diffstat (limited to 'lib/libkvm/kvm_file2.c')
-rw-r--r-- | lib/libkvm/kvm_file2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_file2.c b/lib/libkvm/kvm_file2.c index ae117c10bd9..92db2ffef6c 100644 --- a/lib/libkvm/kvm_file2.c +++ b/lib/libkvm/kvm_file2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_file2.c,v 1.23 2012/04/20 15:59:52 guenther Exp $ */ +/* $OpenBSD: kvm_file2.c,v 1.24 2012/05/01 03:43:23 guenther Exp $ */ /* * Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com> @@ -497,7 +497,7 @@ fill_file2(kvm_t *kd, struct kinfo_file2 *kf, struct file *fp, u_long fpaddr, st kf->f_ops = PTRTOINT64(fp->f_ops); kf->f_offset = fp->f_offset; kf->f_data = PTRTOINT64(fp->f_data); - kf->f_usecount = fp->f_usecount; + kf->f_usecount = 0; kf->f_rxfer = fp->f_rxfer; kf->f_rwfer = fp->f_wxfer; |