mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Remove code for zfs remap
The "zfs remap" command was disabled by
6e91a72fe3, 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 <tcaputi@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #8944
This commit is contained in:
committed by
Brian Behlendorf
parent
53864800f6
commit
59ec30a329
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1562,22 +1562,6 @@ def lzc_promote(name):
|
||||
errors.lzc_promote_translate_error(ret, 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):
|
||||
'''
|
||||
|
||||
@@ -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 *);
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user