freebsd-dev/module/zfs
Brian Behlendorf 278bee9319 Linux 3.18 compat: Snapshot auto-mounting
Re-factor the .zfs/snapshot auto-mouting code to take in to account
changes made to the upstream kernels.  And to lay the groundwork for
enabling access to .zfs snapshots via NFS clients.  This patch makes
the following core improvements.

* All actively auto-mounted snapshots are now tracked in two global
trees which are indexed by snapshot name and objset id respectively.
This allows for fast lookups of any auto-mounted snapshot regardless
without needing access to the parent dataset.

* Snapshot entries are added to the tree in zfsctl_snapshot_mount().
However, they are now removed from the tree in the context of the
unmount process.  This eliminates the need complicated error logic
in zfsctl_snapshot_unmount() to handle unmount failures.

* References are now taken on the snapshot entries in the tree to
ensure they always remain valid while a task is outstanding.

* The MNT_SHRINKABLE flag is set on the snapshot vfsmount_t right
after the auto-mount succeeds.  This allows to kernel to unmount
idle auto-mounted snapshots if needed removing the need for the
zfsctl_unmount_snapshots() function.

* Snapshots in active use will not be automatically unmounted.  As
long as at least one dentry is revalidated every zfs_expire_snapshot/2
seconds the auto-unmount expiration timer will be extended.

* Commit torvalds/linux@bafc9b7 caused snapshots auto-mounted by ZFS
to be immediately unmounted when the dentry was revalidated.  This
was a consequence of ZFS invaliding all snapdir dentries to ensure that
negative dentries didn't mask new snapshots.  This patch modifies the
behavior such that only negative dentries are invalidated.  This solves
the issue and may result in a performance improvement.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3589
Closes #3344
Closes #3295
Closes #3257
Closes #3243
Closes #3030
Closes #2841
2015-08-31 13:54:39 -07:00
..
arc.c Update arc_memory_throttle() to check pageout 2015-07-30 11:52:12 -07:00
blkptr.c Illumos 4757, 4913 2014-08-01 14:28:05 -07:00
bplist.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
bpobj.c Illumos 5810 - zdb should print details of bpobj 2015-05-11 15:10:24 -07:00
bptree.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
dbuf_stats.c Illumos 5497 - lock contention on arcs_mtx 2015-06-11 10:27:25 -07:00
dbuf.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
ddt_zap.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
ddt.c Handle zap_lookup() failure in ddt_object_load() 2015-08-19 14:32:50 -07:00
dmu_diff.c Illumos 5369 - arc flags should be an enum 2015-06-11 10:27:25 -07:00
dmu_object.c Illumos 3693 - restore_object uses at least two transactions to restore an object 2014-10-21 15:26:50 -07:00
dmu_objset.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
dmu_send.c Illumos 5946, 5945 2015-07-06 09:31:30 -07:00
dmu_traverse.c Wait interruptibly in prefetch thread 2015-06-16 16:18:11 -07:00
dmu_tx.c Illumos 5911 - ZFS "hangs" while deleting file 2015-07-06 09:31:42 -07:00
dmu_zfetch.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
dmu.c Linux 4.1 compat: loop device on ZFS 2015-08-24 10:17:06 -07:00
dnode_sync.c Illumos 5911 - ZFS "hangs" while deleting file 2015-07-06 09:31:42 -07:00
dnode.c Illumos 5911 - ZFS "hangs" while deleting file 2015-07-06 09:31:42 -07:00
dsl_bookmark.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_dataset.c Allow recovery from corrupted snapshot maps 2015-08-28 11:56:32 -07:00
dsl_deadlist.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
dsl_deleg.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_destroy.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
dsl_dir.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_pool.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
dsl_prop.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_scan.c Illumos 5347 - idle pool may run itself out of space 2015-07-14 10:35:21 -07:00
dsl_synctask.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_userhold.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
fm.c zfsdev_getminor() should check for invalid file handles 2015-06-22 17:02:13 -07:00
gzip.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
lz4.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
lzjb.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
Makefile.in Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
metaslab.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
multilist.c Illumos 5497 - lock contention on arcs_mtx 2015-06-11 10:27:25 -07:00
range_tree.c Illumos 5163 - arc should reap range_seg_cache 2015-06-25 08:58:16 -07:00
refcount.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
rrwlock.c Illumos 5008 - lock contention (rrw_exit) while running a read only load 2015-07-06 09:34:13 -07:00
sa.c Illumos 5562 - ZFS sa_handle's violate kmem invariants, debug kernels panic on boot 2015-05-11 15:10:57 -07:00
sha256.c
spa_boot.c
spa_config.c Linux 4.2 compat: vfs_rename() 2015-08-19 16:04:33 -07:00
spa_errlog.c Illumos 4914 - zfs on-disk bookmark structure should be named *_phys_t 2014-08-06 14:48:41 -07:00
spa_history.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
spa_misc.c Update all default taskq settings 2015-06-25 08:58:16 -07:00
spa_stats.c Illumos 5369 - arc flags should be an enum 2015-06-11 10:27:25 -07:00
spa.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
space_map.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
space_reftree.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
trace.c Illumos 5497 - lock contention on arcs_mtx 2015-06-11 10:27:25 -07:00
txg.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
uberblock.c Illumos 5347 - idle pool may run itself out of space 2015-07-14 10:35:21 -07:00
unique.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
vdev_cache.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
vdev_disk.c Linux 4.2 compat: remove bio->bi_cnt access 2015-07-17 09:16:08 -07:00
vdev_file.c Update all default taskq settings 2015-06-25 08:58:16 -07:00
vdev_label.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
vdev_mirror.c Illumos #5244 - zio pipeline callers should explicitly invoke next stage 2015-04-30 15:07:47 -07:00
vdev_missing.c Illumos #5244 - zio pipeline callers should explicitly invoke next stage 2015-04-30 15:07:47 -07:00
vdev_queue.c Fix small typo 2015-08-30 10:10:16 -07:00
vdev_raidz.c Illumos #5244 - zio pipeline callers should explicitly invoke next stage 2015-04-30 15:07:47 -07:00
vdev_root.c Illumos #3598 2013-10-31 14:58:04 -07:00
vdev.c Remove unused variable in vdev_add_child() 2015-06-11 10:22:38 -07:00
zap_leaf.c Illumos 5314 - Remove "dbuf phys" db->db_data pointer aliases in ZFS 2015-04-28 16:25:20 -07:00
zap_micro.c Add parenthesis to the ternary operator 2015-08-19 11:28:41 -07:00
zap.c Illumos 3654,3656 2015-05-04 09:41:09 -07:00
zfeature_common.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
zfeature.c Use cached feature info in spa_add_feature_stats() 2015-03-05 14:11:10 -08:00
zfs_acl.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
zfs_byteswap.c
zfs_ctldir.c Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
zfs_debug.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
zfs_dir.c Revert "Revert "Revert "Fix unlink/xattr deadlock""" 2014-08-11 16:12:36 -07:00
zfs_fm.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
zfs_fuid.c Illumos #3522 2013-10-30 14:51:27 -07:00
zfs_ioctl.c Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
zfs_log.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
zfs_onexit.c zfsdev_getminor() should check for invalid file handles 2015-06-22 17:02:13 -07:00
zfs_replay.c Linux AIO Support 2014-09-05 15:11:43 -07:00
zfs_rlock.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
zfs_sa.c Illumos 5056 - ZFS deadlock on db_mtx and dn_holds 2015-04-28 16:25:34 -07:00
zfs_vfsops.c Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
zfs_vnops.c Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
zfs_znode.c Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
zil.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
zio_checksum.c Illumos 4757, 4913 2014-08-01 14:28:05 -07:00
zio_compress.c Illumos 5661 - ZFS: "compression = on" should use lz4 if feature is enabled 2015-07-10 12:11:45 -07:00
zio_inject.c Illumos 5497 - lock contention on arcs_mtx 2015-06-11 10:27:25 -07:00
zio.c Illumos 5369 - arc flags should be an enum 2015-06-11 10:27:25 -07:00
zle.c
zpl_ctldir.c Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
zpl_export.c zfsctl: No need to sync ctldir inodes 2015-08-31 13:54:39 -07:00
zpl_file.c Linux 4.1 compat: loop device on ZFS 2015-08-24 10:17:06 -07:00
zpl_inode.c Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
zpl_super.c Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
zpl_xattr.c Mark additional functions as PF_FSTRANS 2015-04-17 09:35:24 -07:00
zrlock.c Illumos 5812 - assertion failed in zrl_tryenter(): zr_owner==NULL 2015-04-30 14:43:40 -07:00
zvol.c Clear QUEUE_FLAG_ADD_RANDOM on zvols 2015-08-30 10:11:57 -07:00