diff options
author | Matthew Ahrens <[email protected]> | 2019-06-24 16:44:01 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-06-24 16:44:01 -0700 |
commit | 59ec30a3290d865b98e3805df6c82b6b4f88aab0 (patch) | |
tree | 4c29fb392d0bb53531756f0b3a931ba38c1493e9 /contrib | |
parent | 53864800f60b843b8212514428530adfa155211b (diff) |
Remove code for zfs remap
The "zfs remap" command was disabled by
6e91a72fe3ff8bb282490773bd687632f3e8c79d, because it has little utility
and introduced some tricky bugs. This commit removes the code for it,
the associated ZFS_IOC_REMAP ioctl, and tests.
Note that the ioctl and property will remain, but have no functionality.
This allows older software to fail gracefully if it attempts to use
these, and avoids a backwards incompatibility that would be introduced if
we renumbered the later ioctls/props.
Reviewed-by: Tom Caputi <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matthew Ahrens <[email protected]>
Closes #8944
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/pyzfs/libzfs_core/__init__.py | 2 | ||||
-rw-r--r-- | contrib/pyzfs/libzfs_core/_error_translation.py | 12 | ||||
-rw-r--r-- | contrib/pyzfs/libzfs_core/_libzfs_core.py | 16 | ||||
-rw-r--r-- | contrib/pyzfs/libzfs_core/bindings/libzfs_core.py | 1 | ||||
-rw-r--r-- | contrib/pyzfs/libzfs_core/test/test_libzfs_core.py | 25 |
5 files changed, 0 insertions, 56 deletions
diff --git a/contrib/pyzfs/libzfs_core/__init__.py b/contrib/pyzfs/libzfs_core/__init__.py index a195b05f5..78e96738e 100644 --- a/contrib/pyzfs/libzfs_core/__init__.py +++ b/contrib/pyzfs/libzfs_core/__init__.py @@ -73,7 +73,6 @@ from ._libzfs_core import ( lzc_receive_with_cmdprops, lzc_receive_with_header, lzc_release, - lzc_remap, lzc_reopen, lzc_rollback, lzc_rollback_to, @@ -129,7 +128,6 @@ __all__ = [ 'lzc_receive_with_cmdprops', 'lzc_receive_with_header', 'lzc_release', - 'lzc_remap', 'lzc_reopen', 'lzc_rollback', 'lzc_rollback_to', diff --git a/contrib/pyzfs/libzfs_core/_error_translation.py b/contrib/pyzfs/libzfs_core/_error_translation.py index b888fd725..cf52ac918 100644 --- a/contrib/pyzfs/libzfs_core/_error_translation.py +++ b/contrib/pyzfs/libzfs_core/_error_translation.py @@ -550,18 +550,6 @@ def lzc_channel_program_translate_error(ret, name, error): raise _generic_exception(ret, name, "Failed to execute channel program") -def lzc_remap_translate_error(ret, name): - if ret == 0: - return - if ret == errno.ENOENT: - raise lzc_exc.DatasetNotFound(name) - if ret == errno.EINVAL: - _validate_fs_name(name) - if ret == errno.ENOTSUP: - return lzc_exc.FeatureNotSupported(name) - raise _generic_exception(ret, name, "Failed to remap dataset") - - def lzc_pool_checkpoint_translate_error(ret, name, discard=False): if ret == 0: return diff --git a/contrib/pyzfs/libzfs_core/_libzfs_core.py b/contrib/pyzfs/libzfs_core/_libzfs_core.py index 5c8a1f5e6..5a4843943 100644 --- a/contrib/pyzfs/libzfs_core/_libzfs_core.py +++ b/contrib/pyzfs/libzfs_core/_libzfs_core.py @@ -1563,22 +1563,6 @@ def lzc_promote(name): @_uncommitted() -def lzc_remap(name): - ''' - Remaps the ZFS dataset. - - :param bytes name: the name of the dataset to remap. - :raises NameInvalid: if the dataset name is invalid. - :raises NameTooLong: if the dataset name is too long. - :raises DatasetNotFound: if the dataset does not exist. - :raises FeatureNotSupported: if the pool containing the dataset does not - have the *obsolete_counts* feature enabled. - ''' - ret = _lib.lzc_remap(name) - errors.lzc_remap_translate_error(ret, name) - - -@_uncommitted() def lzc_pool_checkpoint(name): ''' Creates a checkpoint for the specified pool. diff --git a/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py b/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py index ce2d9d62c..1b46a0891 100644 --- a/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py +++ b/contrib/pyzfs/libzfs_core/bindings/libzfs_core.py @@ -127,7 +127,6 @@ CDEF = """ int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **); int lzc_sync(const char *, nvlist_t *, nvlist_t **); int lzc_unload_key(const char *); - int lzc_remap(const char *); int lzc_pool_checkpoint(const char *); int lzc_pool_checkpoint_discard(const char *); int lzc_rename(const char *, const char *); diff --git a/contrib/pyzfs/libzfs_core/test/test_libzfs_core.py b/contrib/pyzfs/libzfs_core/test/test_libzfs_core.py index 25f20a4ae..18306f88e 100644 --- a/contrib/pyzfs/libzfs_core/test/test_libzfs_core.py +++ b/contrib/pyzfs/libzfs_core/test/test_libzfs_core.py @@ -3632,31 +3632,6 @@ zfs.sync.snapshot('""" + pool + b"""@zcp') with self.assertRaises(lzc_exc.EncryptionKeyNotLoaded): lzc.lzc_unload_key(fs) - def test_remap_missing_fs(self): - name = b"nonexistent" - - with self.assertRaises(lzc_exc.DatasetNotFound): - lzc.lzc_remap(name) - - def test_remap_invalid_fs(self): - ds = ZFSTest.pool.makeName(b"fs1") - snap = ds + b"@snap1" - - lzc.lzc_snapshot([snap]) - with self.assertRaises(lzc_exc.NameInvalid): - lzc.lzc_remap(snap) - - def test_remap_too_long_fs_name(self): - name = ZFSTest.pool.makeTooLongName() - - with self.assertRaises(lzc_exc.NameTooLong): - lzc.lzc_remap(name) - - def test_remap(self): - name = ZFSTest.pool.makeName(b"fs1") - - lzc.lzc_remap(name) - def test_checkpoint(self): pool = ZFSTest.pool.getRoot().getName() |