freebsd-nq/module/zfs
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
..
arc.c Cleanup ZFS debug infrastructure 2012-02-02 11:24:30 -08:00
bplist.c
bpobj.c
dbuf.c Illumos #764: panic in zfs:dbuf_sync_list 2011-08-01 12:09:11 -07:00
ddt_zap.c Fix stack ddt_zap_lookup() 2011-05-31 12:17:27 -07:00
ddt.c Fix stack ddt_class_contains() 2011-05-31 12:17:27 -07:00
dmu_diff.c
dmu_object.c
dmu_objset.c Merge branch 'zpl' 2011-02-18 09:31:25 -08:00
dmu_send.c Illumos #755: dmu_recv_stream builds incomplete guid_to_ds_map 2011-10-18 11:18:14 -07:00
dmu_traverse.c Revert "Fix stack traverse_visitbp()" 2011-05-31 12:17:27 -07:00
dmu_tx.c
dmu_zfetch.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dmu.c
dnode_sync.c
dnode.c Improve meta data performance 2011-11-03 10:19:21 -07:00
dsl_dataset.c Illumos #1092: zfs refratio property 2011-08-01 12:09:11 -07:00
dsl_deadlist.c
dsl_deleg.c
dsl_dir.c
dsl_pool.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dsl_prop.c Fix enum compiler warning 2011-02-23 12:52:51 -08:00
dsl_scan.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dsl_synctask.c
fm.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
gzip.c
lzjb.c
Makefile.in Implemented NFS export_operations. 2011-04-29 12:36:13 -07:00
metaslab.c Illumos #1051: zfs should handle imbalanced luns 2011-08-01 12:09:11 -07:00
refcount.c
rrwlock.c
sa.c Implement SA based xattrs 2011-11-28 15:45:51 -08:00
sha256.c
spa_boot.c
spa_config.c
spa_errlog.c
spa_history.c
spa_misc.c Cleanup ZFS debug infrastructure 2012-02-02 11:24:30 -08:00
spa.c Reduce number of zio free threads 2012-01-17 08:54:00 -08:00
space_map.c
txg.c Illumos #1313: Integer overflow in txg_delay() 2011-08-01 12:09:43 -07:00
uberblock.c
unique.c
vdev_cache.c Illumos #175: zfs vdev cache consumes excessive memory 2011-08-01 12:09:11 -07:00
vdev_disk.c Linux 2.6.37 compat, WRITE_FLUSH_FUA 2011-06-17 14:37:26 -07:00
vdev_file.c
vdev_label.c
vdev_mirror.c
vdev_missing.c
vdev_queue.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
vdev_raidz.c
vdev_root.c
vdev.c Allow setting bootfs on any pool 2012-01-17 13:49:07 -08:00
zap_leaf.c
zap_micro.c Export symbols for the full ZAP API 2011-09-27 16:12:36 -07:00
zap.c
zfs_acl.c Linux compat 2.6.39: mount_nodev() 2011-07-01 13:36:39 -07:00
zfs_byteswap.c
zfs_debug.c Cleanup ZFS debug infrastructure 2012-02-02 11:24:30 -08:00
zfs_dir.c Allow multiple values per directory entry 2012-02-02 11:22:08 -08:00
zfs_fm.c
zfs_fuid.c Drop HAVE_XVATTR macros 2011-03-02 11:44:34 -08:00
zfs_ioctl.c Cleanup ZFS debug infrastructure 2012-02-02 11:24:30 -08:00
zfs_log.c Drop HAVE_XVATTR macros 2011-03-02 11:44:34 -08:00
zfs_onexit.c
zfs_replay.c Use Linux ATTR_ versions 2011-03-03 11:29:15 -08:00
zfs_rlock.c Range lock performance improvements 2011-03-08 12:44:06 -08:00
zfs_sa.c Export symbol zfs_attr_table 2012-01-27 09:23:36 -08:00
zfs_vfsops.c Linux 3.1 compat, super_block->s_shrink 2012-01-11 11:46:02 -08:00
zfs_vnops.c Check permissions in zfs_space(). 2012-02-09 15:20:37 -08:00
zfs_znode.c Linux 3.1 compat, super_block->s_shrink 2012-01-11 11:46:02 -08:00
zil.c Illumos #883: ZIL reuse during remount corruption 2011-08-01 12:09:11 -07:00
zio_checksum.c
zio_compress.c
zio_inject.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
zio.c Illumos #734: Use taskq_dispatch_ent() interface 2011-12-14 09:19:30 -08:00
zle.c
zpl_export.c Linux compat 2.6.39: mount_nodev() 2011-07-01 13:36:39 -07:00
zpl_file.c Support the fallocate() file operation. 2012-02-09 16:19:32 -08:00
zpl_inode.c Support the fallocate() file operation. 2012-02-09 16:19:32 -08:00
zpl_super.c Linux 3.3 compat, sops->show_options() 2012-02-03 10:02:01 -08:00
zpl_xattr.c Apply the ZoL coding standard to zpl_xattr.c 2012-01-12 15:12:03 -08:00
zrlock.c
zvol.c Add support for DISCARD to ZVOLs. 2012-02-09 16:19:38 -08:00