diff options
| author | Eric Cheng <none@none> | 2008-12-04 18:16:10 -0800 |
|---|---|---|
| committer | Eric Cheng <none@none> | 2008-12-04 18:16:10 -0800 |
| commit | da14cebe459d3275048785f25bd869cb09b5307f (patch) | |
| tree | a394d2c61ec4d7591782a4a5db4e3a157c3ca89a /usr/src/uts/common/syscall/acctctl.c | |
| parent | 03361682bf38acf5bcc36ee83a0d6277731eee68 (diff) | |
| download | illumos-joyent-da14cebe459d3275048785f25bd869cb09b5307f.tar.gz | |
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
6498311 Crossbow - Network Virtualization and Resource Management
6402493 DLPI provider loopback behavior should be improved
6453165 move mac capabs definitions outside mac.h
6338667 Need ability to use NAT for non-global zones
6692884 several threads hung due to deadlock scenario between aggr and mac
6768302 dls: soft_ring_bind/unbind race can panic in thread_affinity_set with cpu_id == -1
6635849 race between lacp_xmit_sm() and aggr_m_stop() ends in panic
6742712 potential message double free in the aggr driver
6754299 a potential race between aggr_m_tx() and aggr_port_delete()
6485324 mi_data_lock recursively held when enabling promiscuous mode on an aggregation
6442559 Forwarding perf bottleneck due to mac_rx() calls
6505462 assertion failure after removing a port from a snooped aggregation
6716664 need to add src/dst IP address to soft ring fanout
--HG--
rename : usr/src/uts/common/io/dls/dls_soft_ring.c => usr/src/uts/common/io/mac/mac_soft_ring.c
rename : usr/src/uts/common/inet/ip/ip_cksum.c => usr/src/uts/common/os/ip_cksum.c
rename : usr/src/uts/common/inet/sctp_crc32.c => usr/src/uts/common/os/sctp_crc32.c
rename : usr/src/uts/common/sys/dls_soft_ring.h => usr/src/uts/common/sys/mac_soft_ring.h
Diffstat (limited to 'usr/src/uts/common/syscall/acctctl.c')
| -rw-r--r-- | usr/src/uts/common/syscall/acctctl.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/usr/src/uts/common/syscall/acctctl.c b/usr/src/uts/common/syscall/acctctl.c index 4fb322a211..ce325109be 100644 --- a/usr/src/uts/common/syscall/acctctl.c +++ b/usr/src/uts/common/syscall/acctctl.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/proc.h> #include <sys/systm.h> #include <sys/param.h> @@ -115,6 +113,7 @@ ac_file_in_use(vnode_t *vp) mutex_enter(&acg->ac_proc.ac_lock); mutex_enter(&acg->ac_task.ac_lock); mutex_enter(&acg->ac_flow.ac_lock); + mutex_enter(&acg->ac_net.ac_lock); } for (acg = list_head(&exacct_globals_list); !in_use && acg != NULL; @@ -125,7 +124,8 @@ ac_file_in_use(vnode_t *vp) */ if (vn_compare(acg->ac_proc.ac_vnode, vp) || vn_compare(acg->ac_task.ac_vnode, vp) || - vn_compare(acg->ac_flow.ac_vnode, vp)) + vn_compare(acg->ac_flow.ac_vnode, vp) || + vn_compare(acg->ac_net.ac_vnode, vp)) in_use = B_TRUE; } @@ -137,6 +137,7 @@ ac_file_in_use(vnode_t *vp) mutex_exit(&acg->ac_proc.ac_lock); mutex_exit(&acg->ac_task.ac_lock); mutex_exit(&acg->ac_flow.ac_lock); + mutex_exit(&acg->ac_net.ac_lock); } mutex_exit(&exacct_globals_list_lock); return (in_use); @@ -449,17 +450,21 @@ acctctl(int cmd, void *buf, size_t bufsz) info = &acg->ac_proc; maxres = AC_PROC_MAX_RES; break; + /* + * Flow/net accounting isn't configurable in non-global + * zones, but we have this field on a per-zone basis for future + * expansion as well as the ability to return default "unset" + * values for the various AC_*_GET queries. AC_*_SET commands + * fail with EPERM for AC_FLOW and AC_NET in non-global zones. + */ case AC_FLOW: - /* - * Flow accounting isn't currently configurable in non-global - * zones, but we have this field on a per-zone basis for future - * expansion as well as the ability to return default "unset" - * values for the various AC_*_GET queries. AC_*_SET commands - * fail with EPERM for AC_FLOW in non-global zones. - */ info = &acg->ac_flow; maxres = AC_FLOW_MAX_RES; break; + case AC_NET: + info = &acg->ac_net; + maxres = AC_NET_MAX_RES; + break; default: return (set_errno(EINVAL)); } @@ -468,7 +473,8 @@ acctctl(int cmd, void *buf, size_t bufsz) case AC_STATE_SET: if ((error = secpolicy_acct(CRED())) != 0) break; - if (mode == AC_FLOW && getzoneid() != GLOBAL_ZONEID) { + if ((mode == AC_FLOW || mode == AC_NET) && + getzoneid() != GLOBAL_ZONEID) { error = EPERM; break; } @@ -480,7 +486,8 @@ acctctl(int cmd, void *buf, size_t bufsz) case AC_FILE_SET: if ((error = secpolicy_acct(CRED())) != 0) break; - if (mode == AC_FLOW && getzoneid() != GLOBAL_ZONEID) { + if ((mode == AC_FLOW || mode == AC_NET) && + getzoneid() != GLOBAL_ZONEID) { error = EPERM; break; } @@ -492,7 +499,8 @@ acctctl(int cmd, void *buf, size_t bufsz) case AC_RES_SET: if ((error = secpolicy_acct(CRED())) != 0) break; - if (mode == AC_FLOW && getzoneid() != GLOBAL_ZONEID) { + if ((mode == AC_FLOW || mode == AC_NET) && + getzoneid() != GLOBAL_ZONEID) { error = EPERM; break; } @@ -580,6 +588,7 @@ exacct_zone_shutdown(zoneid_t zoneid, void *data) exacct_free_info(&acg->ac_proc); exacct_free_info(&acg->ac_task); exacct_free_info(&acg->ac_flow); + exacct_free_info(&acg->ac_net); } /* ARGSUSED */ @@ -595,6 +604,7 @@ exacct_zone_fini(zoneid_t zoneid, void *data) mutex_destroy(&acg->ac_proc.ac_lock); mutex_destroy(&acg->ac_task.ac_lock); mutex_destroy(&acg->ac_flow.ac_lock); + mutex_destroy(&acg->ac_net.ac_lock); kmem_free(acg, sizeof (*acg)); } |
