1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*
  13  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  14  */
  15 
  16 
  17 /*
  18  * ZFS Class of Storage is:
  19  *
  20  * 1. descriptor that combines user and system defined properties to control
  21  * ZFS IO pipeline stages and, effectively, propagate user data and/or
  22  * associated metadata to/from stable storage differently - on a per CoS basis
  23  *
  24  * 2. mechanism to match user data with a specific class (or classes) of disks
  25  * within the heterogeneous storage volume when placing the data
  26  *
  27  * The following COS attributes are supported:
  28  *  - min/max active to control queue depths of the I/O classes
  29  *  - preferred_read - weight for biasing reads (e.g. if vdev is a side
  30  *    of a mirror)
  31  *  - unmap_freed - whether to unmap unused space (e.g. TRIM)
  32  */
  33 
  34 
  35 #ifndef _SYS_COS_IMPL_H
  36 #define _SYS_COS_IMPL_H
  37 
  38 #include <sys/cos.h>
  39 #include <sys/zio.h>
  40 
  41 #ifdef  __cplusplus
  42 extern "C" {
  43 #endif
  44 
  45 /*
  46  * in core cos structure
  47  */
  48 struct cos {
  49         spa_t           *cos_spa;
  50         /* properties follow */
  51         uint64_t        cos_guid;
  52         uint64_t        cos_min_active[ZIO_PRIORITY_NUM_QUEUEABLE];
  53         uint64_t        cos_max_active[ZIO_PRIORITY_NUM_QUEUEABLE];
  54         uint64_t        cos_preferred_read;
  55         /* user defined name */
  56         char            cos_name[MAXCOSNAMELEN];
  57         /* modified with atomic ops */
  58         uint64_t        cos_refcnt;
  59         list_node_t     cos_list_node;
  60 };
  61 
  62 #ifdef  __cplusplus
  63 }
  64 #endif
  65 
  66 #endif  /* _SYS_COS_IMPL_H */