diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2016-06-22 12:55:10 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2016-06-22 12:55:10 +0000 |
commit | 8bae72dc3f645da905eab5fe960867037f57bae0 (patch) | |
tree | 24dce03bc58aa36ef080558a440d351c2237d4db /usr/src/uts/common/sys | |
parent | 766f41d1d95d047e65ac4942d66037ce7f924027 (diff) | |
parent | 01aaaf328842760a1002109b299908a027e94cf8 (diff) | |
download | illumos-joyent-release-20160625.tar.gz |
[illumos-gate merge]release-20160625
commit 01aaaf328842760a1002109b299908a027e94cf8
7051 want id_space(9F) docs
commit c1de7575521deda5ee777b8054a9c5b12f15b1ee
7120 mDNS resync was not wsdiff safe
commit 9c05409f2b9301e686735887a9573454cceb0331
7069 i386_XARCH should include -m32
commit 406fc5100dac8d225a315a6def6be8d628f34e24
6602 lofi should support labeled devices
commit f3a07f941f1be263a48a040c059edbcb722cf436
4712 Prefer 'parsable' over 'parseable' in the manual pages
commit 1b2031a95889aea96be6af55dcf31a0d5ffdfed9
7050 Prefer 'subcommand' over 'sub-command' in the manual pages
commit 831b40b1c811223fd0b1131791a38e3ae5143377
7049 Prefer 'writable' over 'writeable' in the manual pages
commit a716f1a92056bc2e231e57ae2a20725ce606ea73
7047 Fix spelling mistakes in sections 9E, 9F and 9S
commit 95e15299a2c42b8014fa27631a6f3be2a93febc2
7048 Fix spelling mistakes in sections 7D, 7I, 7IPP, and 7P
commit df23565fe1d0b225f9f898c50dfafea6749b0b7f
7046 Fix spelling mistakes in section 5
commit c855112f85cf71e42f6381a66f3f86f98e2ed24e
7045 Fix spelling mistakes in section 4
commit 843c398e8904ed9d833d2af3103894f909fb4b52
7042 Fix spelling mistakes in library sections
commit 0db8de19c0e494758b68b702523a2b0eaffe3b2e
7044 Fix spelling mistakes in sections 1HAS and 2
commit df23d905b96680e56379c5a5ecb4b363f36b9e74
7041 Fix spelling mistakes in sections 1 and 1M
commit 71af3be340c57171837478555e2eb0d496318cfc
7040 Detect common spelling errors in manual pages
Conflicts:
usr/src/uts/common/fs/vfs.c
usr/src/man/man7d/cpuid.7d
usr/src/man/man5/privileges.5
usr/src/man/man3c/signalfd.3c
usr/src/cmd/lofiadm/main.c
Diffstat (limited to 'usr/src/uts/common/sys')
-rw-r--r-- | usr/src/uts/common/sys/cmlb.h | 18 | ||||
-rw-r--r-- | usr/src/uts/common/sys/cmlb_impl.h | 27 | ||||
-rw-r--r-- | usr/src/uts/common/sys/lofi.h | 41 | ||||
-rw-r--r-- | usr/src/uts/common/sys/vfs.h | 3 | ||||
-rw-r--r-- | usr/src/uts/common/sys/vtoc.h | 13 |
5 files changed, 70 insertions, 32 deletions
diff --git a/usr/src/uts/common/sys/cmlb.h b/usr/src/uts/common/sys/cmlb.h index 81e9c060f4..a1013c9fed 100644 --- a/usr/src/uts/common/sys/cmlb.h +++ b/usr/src/uts/common/sys/cmlb.h @@ -19,6 +19,7 @@ * CDDL HEADER END */ /* + * Copyright 2016 Toomas Soome <tsoome@me.com> * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -61,6 +62,7 @@ typedef struct tg_attribute { #define CMLB_OFF_BY_ONE 0x00000004 #define CMLB_FAKE_LABEL_ONE_PARTITION 0x00000008 #define CMLB_INTERNAL_MINOR_NODES 0x00000010 +#define CMLB_CREATE_P0_MINOR_NODE 0x00000020 /* bit definitions of flag passed to cmlb_validate */ #define CMLB_SILENT 0x00000001 @@ -80,6 +82,22 @@ typedef struct tg_attribute { #define TG_GETBLOCKSIZE 4 #define TG_GETATTR 5 +#if defined(_SUNOS_VTOC_8) + +#define CMLBUNIT_DFT_SHIFT 3 +/* This will support p0 node on sparc */ +#define CMLBUNIT_FORCE_P0_SHIFT (CMLBUNIT_DFT_SHIFT + 1) + +#elif defined(_SUNOS_VTOC_16) + +#define CMLBUNIT_DFT_SHIFT 6 +#define CMLBUNIT_FORCE_P0_SHIFT (CMLBUNIT_DFT_SHIFT) + +#else /* defined(_SUNOS_VTOC_16) */ + +#error "No VTOC format defined." + +#endif /* defined(_SUNOS_VTOC_8) */ /* * Ops vector including utility functions into target driver that cmlb uses. diff --git a/usr/src/uts/common/sys/cmlb_impl.h b/usr/src/uts/common/sys/cmlb_impl.h index 47ee3ab7bd..b64c4aa64b 100644 --- a/usr/src/uts/common/sys/cmlb_impl.h +++ b/usr/src/uts/common/sys/cmlb_impl.h @@ -20,6 +20,7 @@ */ /* + * Copyright 2016 Toomas Soome <tsoome@me.com> * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -42,7 +43,11 @@ extern "C" { #define FDISK_PARTS (FD_NUMPART + MAX_EXT_PARTS) #if defined(_SUNOS_VTOC_8) -#define NSDMAP NDKMAP +/* + * As lofi needs to support p0 on sparc in case of labeled virtual disks, + * define NDSMAP to support one extra entrie. + */ +#define NSDMAP (NDKMAP + 1) #elif defined(_SUNOS_VTOC_16) #define NSDMAP (NDKMAP + FDISK_PARTS + 1) #else @@ -51,11 +56,10 @@ extern "C" { #define MAXPART (NSDMAP + 1) #define WD_NODE 7 - +#define P0_RAW_DISK (NDKMAP) #if defined(__i386) || defined(__amd64) -#define P0_RAW_DISK (NDKMAP) #define FDISK_P1 (NDKMAP+1) #define FDISK_P2 (NDKMAP+2) #define FDISK_P3 (NDKMAP+3) @@ -82,21 +86,10 @@ extern "C" { #define ISCD(cl) (cl->cl_device_type == DTYPE_RODIRECT) #define ISHOTPLUGGABLE(cl) (cl->cl_is_hotpluggable) -#if defined(_SUNOS_VTOC_8) - -#define CMLBUNIT_SHIFT 3 -#define CMLBPART_MASK 7 - -#elif defined(_SUNOS_VTOC_16) - -#define CMLBUNIT_SHIFT 6 -#define CMLBPART_MASK 63 - -#else -#error "No VTOC format defined." -#endif +#define CMLBUNIT_SHIFT (CMLBUNIT_DFT_SHIFT) +#define CMLBPART_MASK ((1 << CMLBUNIT_SHIFT) - 1) -#define CMLBUNIT(dev) (getminor((dev)) >> CMLBUNIT_SHIFT) +#define CMLBUNIT(dev, shift) (getminor((dev)) >> (shift)) #define CMLBPART(dev) (getminor((dev)) & CMLBPART_MASK) /* diff --git a/usr/src/uts/common/sys/lofi.h b/usr/src/uts/common/sys/lofi.h index e4716c96af..f57388a098 100644 --- a/usr/src/uts/common/sys/lofi.h +++ b/usr/src/uts/common/sys/lofi.h @@ -23,6 +23,7 @@ * * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2016 Andrey Sokolov + * Copyright 2016 Toomas Soome <tsoome@me.com> */ #ifndef _SYS_LOFI_H @@ -31,12 +32,15 @@ #include <sys/types.h> #include <sys/time.h> #include <sys/taskq.h> -#include <sys/vtoc.h> #include <sys/dkio.h> #include <sys/vnode.h> #include <sys/list.h> #include <sys/crypto/api.h> #include <sys/zone.h> +#ifdef _KERNEL +#include <sys/cmlb.h> +#include <sys/open.h> +#endif /* _KERNEL */ #ifdef __cplusplus extern "C" { @@ -51,6 +55,8 @@ extern "C" { #define LOFI_DRIVER_NAME "lofi" #define LOFI_CTL_NODE "ctl" #define LOFI_CTL_NAME LOFI_DRIVER_NAME LOFI_CTL_NODE +#define LOFI_BLOCK_NODE "disk" +#define LOFI_CHAR_NODE LOFI_BLOCK_NODE ",raw" #define LOFI_BLOCK_NAME LOFI_DRIVER_NAME #define LOFI_CHAR_NAME "r" LOFI_DRIVER_NAME @@ -59,6 +65,20 @@ extern "C" { #define UNCOMPRESSED 0 #define MAXALGLEN 36 +#define LOFI_CMLB_SHIFT CMLBUNIT_FORCE_P0_SHIFT +#define LOFI_PART_MASK ((1 << LOFI_CMLB_SHIFT) - 1) +#define LOFI_PART_MAX (1 << LOFI_CMLB_SHIFT) +#define LOFI_PART(x) ((x) & LOFI_PART_MASK) + +/* + * The cmlb is using its own range of minor numbers for partitions, for + * unlabeled lofi devices, we need to use another range. + */ +/* unlabeled lofi device id to minor number. */ +#define LOFI_ID2MINOR(x) ((x) << LOFI_CMLB_SHIFT) +/* lofi id from minor number. */ +#define LOFI_MINOR2ID(x) ((x) >> LOFI_CMLB_SHIFT) + /* * * Use is: @@ -127,11 +147,13 @@ typedef enum iv_method { } iv_method_t; struct lofi_ioctl { - uint32_t li_minor; + uint32_t li_id; /* lofi ID */ boolean_t li_force; boolean_t li_cleanup; boolean_t li_readonly; + boolean_t li_labeled; char li_filename[MAXPATHLEN]; + char li_devpath[MAXPATHLEN]; /* the following fields are required for compression support */ char li_algorithm[MAXALGLEN]; @@ -230,10 +252,11 @@ struct lofi_state { kcondvar_t ls_vp_cv; /* signal changes to ls_vp */ uint32_t ls_vp_iocount; /* # pending I/O requests */ boolean_t ls_vp_closereq; /* force close requested */ + boolean_t ls_vp_ready; /* is vp ready for use? */ u_offset_t ls_vp_size; - uint32_t ls_blk_open; - uint32_t ls_chr_open; - uint32_t ls_lyr_open_count; + uint32_t ls_open_lyr[LOFI_PART_MAX]; /* open count */ + uint64_t ls_open_reg[OTYPCNT]; /* bitmask */ + uint64_t ls_open_excl; /* bitmask */ int ls_openflag; boolean_t ls_cleanup; /* cleanup on close */ boolean_t ls_readonly; @@ -241,12 +264,15 @@ struct lofi_state { kstat_t *ls_kstat; kmutex_t ls_kstat_lock; struct dk_geom ls_dkg; - struct vtoc ls_vtoc; - struct dk_cinfo ls_ci; zone_ref_t ls_zone; list_node_t ls_list; /* all lofis */ + dev_info_t *ls_dip; dev_t ls_dev; /* this node's dev_t */ + cmlb_handle_t ls_cmlbhandle; + uint32_t ls_lbshift; /* logical block shift */ + uint32_t ls_pbshift; /* physical block shift */ + /* the following fields are required for compression support */ int ls_comp_algorithm_index; /* idx into compress_table */ char ls_comp_algorithm[MAXALGLEN]; @@ -280,7 +306,6 @@ struct lofi_state { iv_method_t ls_iv_type; /* for iv derivation */ kmutex_t ls_crypto_lock; crypto_ctx_template_t ls_ctx_tmpl; - }; #endif /* _KERNEL */ diff --git a/usr/src/uts/common/sys/vfs.h b/usr/src/uts/common/sys/vfs.h index 38c1fded4a..fc6e22b3a2 100644 --- a/usr/src/uts/common/sys/vfs.h +++ b/usr/src/uts/common/sys/vfs.h @@ -21,6 +21,7 @@ /* * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright 2016 Toomas Soome <tsoome@me.com> */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ @@ -227,7 +228,7 @@ typedef struct vfs { struct vfs *vfs_zone_prev; /* prev VFS visible in zone */ struct fem_head *vfs_femhead; /* fs monitoring */ - minor_t vfs_lofi_minor; /* minor if lofi mount */ + uint32_t vfs_lofi_id; /* ID if lofi mount */ } vfs_t; #define vfs_featureset vfs_implp->vi_featureset diff --git a/usr/src/uts/common/sys/vtoc.h b/usr/src/uts/common/sys/vtoc.h index adaf7df5b9..2bfe68ba96 100644 --- a/usr/src/uts/common/sys/vtoc.h +++ b/usr/src/uts/common/sys/vtoc.h @@ -25,6 +25,7 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright 2016 Toomas Soome <tsoome@me.com> */ @@ -272,15 +273,15 @@ struct vtoc32 { #define vtoctovtoc32(v, v32) \ { \ int i; \ - v32.v_bootinfo[0] = v.v_bootinfo[0]; \ - v32.v_bootinfo[1] = v.v_bootinfo[1]; \ - v32.v_bootinfo[2] = v.v_bootinfo[2]; \ - v32.v_sanity = v.v_sanity; \ - v32.v_version = v.v_version; \ + v32.v_bootinfo[0] = (uint32_t)v.v_bootinfo[0]; \ + v32.v_bootinfo[1] = (uint32_t)v.v_bootinfo[1]; \ + v32.v_bootinfo[2] = (uint32_t)v.v_bootinfo[2]; \ + v32.v_sanity = (uint32_t)v.v_sanity; \ + v32.v_version = (uint32_t)v.v_version; \ bcopy(v.v_volume, v32.v_volume, LEN_DKL_VVOL); \ v32.v_sectorsz = v.v_sectorsz; \ v32.v_nparts = v.v_nparts; \ - v32.v_version = v.v_version; \ + v32.v_version = (uint32_t)v.v_version; \ for (i = 0; i < 10; i++) \ v32.v_reserved[i] = v.v_reserved[i]; \ for (i = 0; i < V_NUMPAR; i++) { \ |