Print this page
document DKIOCFREE

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man7i/dkio.7i
          +++ new/usr/src/man/man7i/dkio.7i
↓ open down ↓ 9 lines elided ↑ open up ↑
  10   10  .\"
  11   11  .\" When distributing Covered Code, include this CDDL HEADER in each
  12   12  .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  13   13  .\" If applicable, add the following below this CDDL HEADER, with the
  14   14  .\" fields enclosed by brackets "[]" replaced with your own identifying
  15   15  .\" information: Portions Copyright [yyyy] [name of copyright owner]
  16   16  .\"
  17   17  .\"
  18   18  .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
  19   19  .\" Copyright 2016 Nexenta Systems, Inc.
  20      -.\" Copyright (c) 2017, Joyent, Inc.
       20 +.\" Copyright 2020 Joyent, Inc.
  21   21  .\"
  22      -.Dd October 23, 2017
       22 +.Dd February 14, 2020
  23   23  .Dt DKIO 7I
  24   24  .Os
  25   25  .Sh NAME
  26   26  .Nm dkio
  27   27  .Nd disk control operations
  28   28  .Sh SYNOPSIS
  29   29  .In sys/dkio.h
  30   30  .In sys/vtoc.h
  31   31  .Sh DESCRIPTION
  32   32  Disk drivers support a set of
↓ open down ↓ 653 lines elided ↑ open up ↑
 686  686                  do {
 687  687                          rval = ioctl(fildes, DKIODMR, dr);
 688  688                          if (rval != EINVAL) {
 689  689                                  /* Process data */
 690  690                          }
 691  691                  } while (rval != EINVAL || dr->vdr_flags &
 692  692                      (DKV_DMR_DONE | DKV_DMR_ERROR | DKV_DMR_SHORT)
 693  693          }
 694  694  }
 695  695  .Ed
      696 +.It Dv DKIOCFREE
      697 +.Pp
      698 +The argument is a pointer to a
      699 +.Vt dkioc_free_list_t
      700 +structure (described below).
      701 +The structure consists of a header followed by one or more
      702 +.Vt dkioc_free_list_ext_t
      703 +strctures (described below) that list the extents that the device should free.
      704 +.Bd -literal -offset 2n
      705 +typedef struct dkioc_free_list_ext_s {
      706 +        uint64_t                dfle_start;
      707 +        uint64_t                dfle_length;
      708 +} dkioc_free_list_ext_t;
      709 +
      710 +typedef struct dkioc_free_list_s {
      711 +        uint64_t                dfl_flags;
      712 +        uint64_t                dfl_num_exts;
      713 +        uint64_t                dfl_offset;
      714 +        dkioc_free_list_ext_t   dfl_exts[1];
      715 +} dkioc_free_list_t;
      716 +.Ed
      717 +.Pp
      718 +The
      719 +.Fa dfle_start ,
      720 +.Fa dfle_length ,
      721 +and
      722 +.Fa dfl_offset
      723 +fields are in units of bytes (not blocks).
      724 +.Pp
      725 +The values for
      726 +.Fa dfl_flags
      727 +are:
      728 +.Bl -tag -width Dv
      729 +.It Dv DF_WAIT_SYNC
      730 +Wait for the device to complete freeing the space before returning.
 696  731  .El
      732 +.Pp
      733 +The
      734 +.Fa dfl_num_exts
      735 +field indicates the number of
      736 +.Vt dkioc_free_list_ext_t
      737 +structures follow the
      738 +.Vt dkioc_free_list_t
      739 +structure (including the first entry in
      740 +.Fa dfl_exts ) .
      741 +There must be at least one
      742 +.Vt dkioc_free_list_ext_t
      743 +in the
      744 +.Xr ioctl 2
      745 +request (i.e\&.
      746 +.Fa dfl_num_exts
      747 +must be \(>= 1).
      748 +.Pp
      749 +The
      750 +.Fa dfl_offset
      751 +field is added to all of the values of
      752 +.Fa dfle_start
      753 +when processed by the device.
      754 +.Pp
      755 +The
      756 +.Fa dfl_exts
      757 +field contains the first extent to free, immediately followed by any
      758 +additional
      759 +.Vt dkioc_free_list_ext_t
      760 +structures if there are more than one extent to free.
      761 +.Pp
      762 +The
      763 +.Dv DFL_SZ(num_exts)
      764 +macro can be used to calculate the amount of memory required to hold
      765 +.Fa num_exts
      766 +extents.
      767 +.It Dv DKIOC_CANFREE
      768 +The argument is a pointer to an
      769 +.Vt int
      770 +that is populated by the
      771 +.Xr ioctl 2
      772 +request.
      773 +Upon a successful return, if a non-zero value has been set in the
      774 +.Vt int
      775 +parameter, it indicates that the device supports the
      776 +.Dv DKIOCFREE
      777 +.Xr ioctl 2 .
      778 +If the
      779 +.Vt int
      780 +parameter has been set to zero, the
      781 +.Dv DKIOCFREE
      782 +.Xr ioctl 2
      783 +is not supported by the device.
      784 +.El
 697  785  .Ss "RETURN VALUES"
 698  786  Upon successful completion, the value returned is
 699  787  .Sy 0 .
 700  788  Otherwise,
 701  789  .Sy -1
 702  790  is returned and
 703  791  .Va errno
 704  792  is set to indicate the error.
 705  793  .Ss "x86 Only"
 706  794  The following
↓ open down ↓ 161 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX