freebsd-dev/include/sys
Etienne Dechamps 30930fba21 Add support for DISCARD to ZVOLs.
DISCARD (REQ_DISCARD, BLKDISCARD) is useful for thin provisioning.
It allows ZVOL clients to discard (unmap, trim) block ranges from
a ZVOL, thus optimizing disk space usage by allowing a ZVOL to
shrink instead of just grow.

We can't use zfs_space() or zfs_freesp() here, since these functions
only work on regular files, not volumes. Fortunately we can use the
low-level function dmu_free_long_range() which does exactly what we
want.

Currently the discard operation is not added to the log. That's not
a big deal since losing discard requests cannot result in data
corruption. It would however result in disk space usage higher than
it should be. Thus adding log support to zvol_discard() is probably
a good idea for a future improvement.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2012-02-09 16:19:38 -08:00
..
fm Add support for DISCARD to ZVOLs. 2012-02-09 16:19:38 -08:00
fs Add support for DISCARD to ZVOLs. 2012-02-09 16:19:38 -08:00
arc.h Linux 3.1 compat, super_block->s_shrink 2012-01-11 11:46:02 -08:00
avl_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
avl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
bplist.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
bpobj.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dbuf.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
ddt.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dmu_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dmu_objset.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dmu_traverse.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dmu_tx.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dmu_zfetch.h Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dmu.h Illumos #755: dmu_recv_stream builds incomplete guid_to_ds_map 2011-10-18 11:18:14 -07:00
dnode.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dsl_dataset.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dsl_deadlist.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dsl_deleg.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dsl_dir.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dsl_pool.h Prototype/structure update for Linux 2011-02-10 09:27:21 -08:00
dsl_prop.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dsl_scan.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
dsl_synctask.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
efi_partition.h Make libefi-created GPT compatible with gptfdisk 2011-09-26 09:44:43 -07:00
Makefile.am Add the release component to headers 2012-01-18 12:19:47 -08:00
Makefile.in Add support for DISCARD to ZVOLs. 2012-02-09 16:19:38 -08:00
metaslab_impl.h Illumos #1051: zfs should handle imbalanced luns 2011-08-01 12:09:11 -07:00
metaslab.h Illumos #1051: zfs should handle imbalanced luns 2011-08-01 12:09:11 -07:00
nvpair_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
nvpair.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
refcount.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
rrwlock.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
sa_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
sa.h Implement SA based xattrs 2011-11-28 15:45:51 -08:00
spa_boot.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
spa_impl.h Illumos #1051: zfs should handle imbalanced luns 2011-08-01 12:09:11 -07:00
spa.h Illumos #1051: zfs should handle imbalanced luns 2011-08-01 12:09:11 -07:00
space_map.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
txg_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
txg.h Add API to wait for pending commit callbacks 2011-02-16 11:20:06 -08:00
u8_textprep_data.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
u8_textprep.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
uberblock_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
uberblock.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
uio_impl.h Add basic uio support 2011-02-10 09:21:43 -08:00
unique.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
uuid.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
vdev_disk.h Linux 2.6.x compat, blkdev_compat.h 2011-02-23 12:29:38 -08:00
vdev_file.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
vdev_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
vdev.h Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
xvattr.h Add xvattr support 2011-03-02 11:43:50 -08:00
zap_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zap_leaf.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zap.h Export symbols for the full ZAP API 2011-09-27 16:12:36 -07:00
zfs_acl.h Add xvattr support 2011-03-02 11:43:50 -08:00
zfs_context.h Cleanup ZFS debug infrastructure 2012-02-02 11:24:30 -08:00
zfs_debug.h Cleanup ZFS debug infrastructure 2012-02-02 11:24:30 -08:00
zfs_dir.h Prototype/structure update for Linux 2011-02-10 09:27:21 -08:00
zfs_fuid.h Prototype/structure update for Linux 2011-02-10 09:27:21 -08:00
zfs_ioctl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zfs_onexit.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zfs_rlock.h Range lock performance improvements 2011-03-08 12:44:06 -08:00
zfs_sa.h Implement SA based xattrs 2011-11-28 15:45:51 -08:00
zfs_stat.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zfs_vfsops.h Increase link count limit to 2^31-1 2012-01-13 11:43:59 -08:00
zfs_vnops.h Cleanup mmap(2) writes 2011-08-02 10:34:55 -07:00
zfs_znode.h Implement SA based xattrs 2011-11-28 15:45:51 -08:00
zil_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zil.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zio_checksum.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zio_compress.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zio_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zio.h Illumos #734: Use taskq_dispatch_ent() interface 2011-12-14 09:19:30 -08:00
zpl.h Support the fallocate() file operation. 2012-02-09 16:19:32 -08:00
zrlock.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
zvol.h Linux 2.6.x compat, blkdev_compat.h 2011-02-23 12:29:38 -08:00