diff options
author | Deepak Honnalli <Deepak.Honnalli@Sun.COM> | 2008-09-25 11:52:01 +0530 |
---|---|---|
committer | Deepak Honnalli <Deepak.Honnalli@Sun.COM> | 2008-09-25 11:52:01 +0530 |
commit | 1384c58687fc765ca3d9a998204826d3dd0ce419 (patch) | |
tree | 7ffd53cb62bc335ecb7309087790a804fbc0a123 /usr/src/uts/common/nfs/rnode.h | |
parent | aecfc01d1bad84e66649703f7fc2926ef70b34ba (diff) | |
download | illumos-joyent-1384c58687fc765ca3d9a998204826d3dd0ce419.tar.gz |
6503547 deadlock between utilities accessing /proc and processes using nfs
Diffstat (limited to 'usr/src/uts/common/nfs/rnode.h')
-rw-r--r-- | usr/src/uts/common/nfs/rnode.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/usr/src/uts/common/nfs/rnode.h b/usr/src/uts/common/nfs/rnode.h index f2a956040c..3df90d8ffb 100644 --- a/usr/src/uts/common/nfs/rnode.h +++ b/usr/src/uts/common/nfs/rnode.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -29,8 +29,6 @@ #ifndef _NFS_RNODE_H #define _NFS_RNODE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/avl.h> #include <sys/list.h> #include <nfs/nfs.h> @@ -221,6 +219,16 @@ typedef struct rhashq { * set r_modaddr and release r_statelock as long as the r_rwlock * writer lock is held. * + * r_inmap informs nfsX_read()/write() that there is a call to nfsX_map() + * in progress. nfsX_read()/write() check r_inmap to decide whether + * to perform directio on the file or not. r_inmap is atomically + * incremented in nfsX_map() before the address space routines are + * called and atomically decremented just before nfsX_map() exits. + * r_inmap is not protected by any lock. + * + * r_mapcnt tells that the rnode has mapped pages. r_inmap can be 0 + * while the rnode has mapped pages. + * * 64-bit offsets: the code formerly assumed that atomic reads of * r_size were safe and reliable; on 32-bit architectures, this is * not true since an intervening bus cycle from another processor @@ -283,6 +291,7 @@ typedef struct rnode { acache_t *r_acache; /* list of access cache entries */ kthread_t *r_serial; /* id of purging thread */ list_t r_indelmap; /* list of delmap callers */ + uint_t r_inmap; /* to serialize read/write and mmap */ } rnode_t; #endif /* _KERNEL */ |