diff options
| author | praks <none@none> | 2007-08-14 17:10:25 -0700 |
|---|---|---|
| committer | praks <none@none> | 2007-08-14 17:10:25 -0700 |
| commit | df2381bfa5cf7dd654bcf30b2f5af53f34f3043a (patch) | |
| tree | 64f247ef81041ed83c44dc2d9aadf46ed66b5ab3 /usr/src/uts/common/sys/port_kernel.h | |
| parent | 2038334ab26baaa43c9083f35def041511c3cc1f (diff) | |
| download | illumos-joyent-df2381bfa5cf7dd654bcf30b2f5af53f34f3043a.tar.gz | |
PSARC/2007/027 File Events Notification API
6367770 RFE: add userland interface to fem (file event monitoring)
--HG--
rename : deleted_files/usr/src/uts/common/fs/portfs/port_fop.c => usr/src/uts/common/fs/portfs/port_fop.c
Diffstat (limited to 'usr/src/uts/common/sys/port_kernel.h')
| -rw-r--r-- | usr/src/uts/common/sys/port_kernel.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/usr/src/uts/common/sys/port_kernel.h b/usr/src/uts/common/sys/port_kernel.h index bfc65586fc..7456f63573 100644 --- a/usr/src/uts/common/sys/port_kernel.h +++ b/usr/src/uts/common/sys/port_kernel.h @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -98,12 +98,29 @@ typedef struct port_source { int portsrc_cnt; /* # of associations */ void (*portsrc_close)(void *, int, pid_t, int); void *portsrc_closearg; /* callback arg */ + void *portsrc_data; /* Private data of source */ struct port_source *portsrc_next; struct port_source *portsrc_prev; } port_source_t; /* + * PORT_SOURCE_FILE cache structure. + */ +#define PORTFOP_HASHSIZE 256 /* cache space for fop events */ + +/* + * One cache for each port that uses PORT_SOURCE_FILE. + */ +typedef struct portfop_cache { + kmutex_t pfc_lock; /* lock to protect cache */ + kcondvar_t pfc_lclosecv; /* last close cv */ + int pfc_objcount; /* track how many file obj are hashed */ + struct portfop *pfc_hash[PORTFOP_HASHSIZE]; /* hash table */ +} portfop_cache_t; + +/* + * PORT_SOURCE_FD cache per port. * One cache for each port that uses PORT_SOURCE_FD. * pc_lock must be the first element of port_fdcache_t to keep it * synchronized with the offset of pc_lock in pollcache_t (see pollrelock()). @@ -147,6 +164,8 @@ void port_init_event(port_kevent_t *, uintptr_t, void *, int port_dup_event(port_kevent_t *, port_kevent_t **, int); int port_associate_fd(struct port *, int, uintptr_t, int, void *); int port_dissociate_fd(struct port *, uintptr_t); +int port_associate_fop(struct port *, int, uintptr_t, int, void *); +int port_dissociate_fop(struct port *, uintptr_t); /* misc functions */ void port_free_event_local(port_kevent_t *, int counter); |
