diff options
Diffstat (limited to 'usr/src/uts/common/sys')
-rw-r--r-- | usr/src/uts/common/sys/fs/sdev_impl.h | 4 | ||||
-rw-r--r-- | usr/src/uts/common/sys/id_space.h | 4 | ||||
-rw-r--r-- | usr/src/uts/common/sys/lofi.h | 18 | ||||
-rw-r--r-- | usr/src/uts/common/sys/policy.h | 5 | ||||
-rw-r--r-- | usr/src/uts/common/sys/rctl.h | 6 | ||||
-rw-r--r-- | usr/src/uts/common/sys/vfs.h | 4 | ||||
-rw-r--r-- | usr/src/uts/common/sys/zone.h | 11 |
7 files changed, 30 insertions, 22 deletions
diff --git a/usr/src/uts/common/sys/fs/sdev_impl.h b/usr/src/uts/common/sys/fs/sdev_impl.h index 66e8562cfa..0a841e9d22 100644 --- a/usr/src/uts/common/sys/fs/sdev_impl.h +++ b/usr/src/uts/common/sys/fs/sdev_impl.h @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _SYS_SDEV_IMPL_H @@ -230,6 +229,7 @@ typedef enum { #define SDEV_ATTR_INVALID 0x0080 /* invalid node attributes, */ /* need update */ #define SDEV_SUBDIR 0x0100 /* match all subdirs under here */ +#define SDEV_ZONED 0x0200 /* zoned subdir */ /* sdev_lookup_flags */ #define SDEV_LOOKUP 0x0001 /* node creation in progress */ diff --git a/usr/src/uts/common/sys/id_space.h b/usr/src/uts/common/sys/id_space.h index 1f7762316f..d56fcceb5a 100644 --- a/usr/src/uts/common/sys/id_space.h +++ b/usr/src/uts/common/sys/id_space.h @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _ID_SPACE_H @@ -46,6 +45,7 @@ id_t id_alloc(id_space_t *); id_t id_alloc_nosleep(id_space_t *); id_t id_allocff(id_space_t *); id_t id_allocff_nosleep(id_space_t *); +id_t id_alloc_specific_nosleep(id_space_t *, id_t); void id_free(id_space_t *, id_t); #endif /* _KERNEL */ diff --git a/usr/src/uts/common/sys/lofi.h b/usr/src/uts/common/sys/lofi.h index 33db138112..8e385b6fe2 100644 --- a/usr/src/uts/common/sys/lofi.h +++ b/usr/src/uts/common/sys/lofi.h @@ -34,6 +34,7 @@ #include <sys/vnode.h> #include <sys/list.h> #include <sys/crypto/api.h> +#include <sys/zone.h> #ifdef __cplusplus extern "C" { @@ -176,15 +177,6 @@ struct lofi_comp_cache { uint64_t lc_index; /* segment index */ }; -/* - * We limit the maximum number of active lofi devices to 128, which seems very - * large. You can tune this by changing lofi_max_files in /etc/system. - * If you change it dynamically, which you probably shouldn't do, make sure - * to only _increase_ it. - */ -#define LOFI_MAX_FILES 128 -extern uint32_t lofi_max_files; - #define V_ISLOFIABLE(vtype) \ ((vtype == VREG) || (vtype == VBLK) || (vtype == VCHR)) @@ -219,9 +211,8 @@ struct crypto_meta { }; struct lofi_state { - char *ls_filename; /* filename to open */ - size_t ls_filename_sz; - struct vnode *ls_vp; /* open vnode */ + vnode_t *ls_vp; /* open real vnode */ + vnode_t *ls_stacked_vp; /* open vnode */ kmutex_t ls_vp_lock; /* protects ls_vp */ kcondvar_t ls_vp_cv; /* signal changes to ls_vp */ uint32_t ls_vp_iocount; /* # pending I/O requests */ @@ -238,6 +229,9 @@ struct lofi_state { struct dk_geom ls_dkg; struct vtoc ls_vtoc; struct dk_cinfo ls_ci; + zone_t *ls_zone; + list_node_t ls_list; /* all lofis */ + dev_t ls_dev; /* this node's dev_t */ /* the following fields are required for compression support */ int ls_comp_algorithm_index; /* idx into compress_table */ diff --git a/usr/src/uts/common/sys/policy.h b/usr/src/uts/common/sys/policy.h index 338ce404b1..bcd5ba2b4c 100644 --- a/usr/src/uts/common/sys/policy.h +++ b/usr/src/uts/common/sys/policy.h @@ -89,12 +89,13 @@ int secpolicy_cpc_cpu(const cred_t *); int secpolicy_dispadm(const cred_t *); int secpolicy_error_inject(const cred_t *); int secpolicy_excl_open(const cred_t *); -int secpolicy_fs_mount(cred_t *, vnode_t *, struct vfs *); -int secpolicy_fs_unmount(cred_t *, struct vfs *); +int secpolicy_fs_allowed_mount(const char *); int secpolicy_fs_config(const cred_t *, const struct vfs *); int secpolicy_fs_linkdir(const cred_t *, const struct vfs *); int secpolicy_fs_minfree(const cred_t *, const struct vfs *); +int secpolicy_fs_mount(cred_t *, vnode_t *, struct vfs *); int secpolicy_fs_quota(const cred_t *, const struct vfs *); +int secpolicy_fs_unmount(cred_t *, struct vfs *); int secpolicy_idmap(const cred_t *); int secpolicy_ip(const cred_t *, int, boolean_t); int secpolicy_ip_config(const cred_t *, boolean_t); diff --git a/usr/src/uts/common/sys/rctl.h b/usr/src/uts/common/sys/rctl.h index af81cd387b..c376ac2df7 100644 --- a/usr/src/uts/common/sys/rctl.h +++ b/usr/src/uts/common/sys/rctl.h @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _SYS_RCTL_H @@ -337,6 +336,9 @@ void rctl_decr_locked_mem(struct proc *, struct kproject *, rctl_qty_t, int rctl_incr_swap(struct proc *, struct zone *, size_t); void rctl_decr_swap(struct zone *, size_t); +int rctl_incr_lofi(struct proc *, struct zone *, size_t); +void rctl_decr_lofi(struct zone *, size_t); + struct kstat *rctl_kstat_create_zone(struct zone *, char *, uchar_t, uint_t, uchar_t); diff --git a/usr/src/uts/common/sys/vfs.h b/usr/src/uts/common/sys/vfs.h index bae4e5b87f..97e176fc1a 100644 --- a/usr/src/uts/common/sys/vfs.h +++ b/usr/src/uts/common/sys/vfs.h @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ @@ -439,6 +438,7 @@ enum { #define VSW_STATS 0x20 /* file system can collect stats */ #define VSW_XID 0x40 /* file system supports extended ids */ #define VSW_CANLOFI 0x80 /* file system supports lofi mounts */ +#define VSW_ZMOUNT 0x100 /* file system always allowed in a zone */ #define VSW_INSTALLED 0x8000 /* this vsw is associated with a file system */ diff --git a/usr/src/uts/common/sys/zone.h b/usr/src/uts/common/sys/zone.h index ead3f94774..5c61a6833e 100644 --- a/usr/src/uts/common/sys/zone.h +++ b/usr/src/uts/common/sys/zone.h @@ -96,10 +96,13 @@ extern "C" { #define ZONE_ATTR_SCHED_CLASS 13 #define ZONE_ATTR_FLAGS 14 #define ZONE_ATTR_HOSTID 15 +#define ZONE_ATTR_FS_ALLOWED 16 /* Start of the brand-specific attribute namespace */ #define ZONE_ATTR_BRAND_ATTRS 32768 +#define ZONE_FS_ALLOWED_MAX 1024 + #define ZONE_EVENT_CHANNEL "com.sun:zones:status" #define ZONE_EVENT_STATUS_CLASS "status" #define ZONE_EVENT_STATUS_SUBCLASS "change" @@ -379,6 +382,11 @@ typedef struct zone { rctl_qty_t zone_max_swap_ctl; /* current swap limit. */ /* Protected by */ /* zone_rctls->rcs_lock */ + kmutex_t zone_rctl_lock; /* protects zone_max_lofi */ + rctl_qty_t zone_max_lofi; /* lofi devs for zone */ + rctl_qty_t zone_max_lofi_ctl; /* current lofi limit. */ + /* Protected by */ + /* zone_rctls->rcs_lock */ list_t zone_zsd; /* list of Zone-Specific Data values */ kcondvar_t zone_cv; /* used to signal state changes */ struct proc *zone_zsched; /* Dummy kernel "zsched" process */ @@ -443,6 +451,8 @@ typedef struct zone { krwlock_t zone_mntfs_db_lock; struct klpd_reg *zone_pfexecd; + + char *zone_fs_allowed; } zone_t; /* @@ -664,6 +674,7 @@ extern int zone_walk(int (*)(zone_t *, void *), void *); extern rctl_hndl_t rc_zone_locked_mem; extern rctl_hndl_t rc_zone_max_swap; +extern rctl_hndl_t rc_zone_max_lofi; #endif /* _KERNEL */ |