diff options
author | pjd <pjd@FreeBSD.org> | 2011-10-24 00:38:09 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-10-24 00:38:09 +0000 |
commit | abdbea665980cd149a350baa8450b4fc59a80b9e (patch) | |
tree | db90d18a179398559a19672e801a29f12acd49a4 /cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h | |
parent | 26b45aef71d0af57c82518de4e87288d5c515180 (diff) | |
download | FreeBSD-src-abdbea665980cd149a350baa8450b4fc59a80b9e.zip FreeBSD-src-abdbea665980cd149a350baa8450b4fc59a80b9e.tar.gz |
Allow to rename file systems without remounting if it is possible.
It is possible for file systems with 'mountpoint' preperty set to 'legacy'
or 'none' - we don't have to change mount directory for them.
Currently such file systems are unmounted on rename and not even mounted back.
This introduces layering violation, as we need to update 'f_mntfromname'
field in statfs structure related to mountpoint (for the dataset we are
renaming and all its children).
In my opinion it is worth it, as it allow to update FreeBSD in even cleaner
way - in ZFS-only configuration root file system is ZFS file system with
'mountpoint' property set to 'legacy'. If root dataset is named system/rootfs,
we can snapshot it (system/rootfs@upgrade), clone it (system/oldrootfs),
update FreeBSD and if it doesn't boot we can boot back from system/oldrootfs
and rename it back to system/rootfs while it is mounted as /. Before it was
not possible, because unmounting / was not possible.
MFC after: 2 weeks
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h index 9d1ecb7..db4aca7 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h @@ -158,7 +158,13 @@ int zprop_expand_list(libzfs_handle_t *hdl, zprop_list_t **plp, * on each change node regardless of whether or not it is currently * mounted. */ -#define CL_GATHER_MOUNT_ALWAYS 1 +#define CL_GATHER_MOUNT_ALWAYS 0x01 +/* + * Use this changelist_gather() flag to prevent unmounting of legacy + * file systems. Useful when renaming legacy file systems, where there is + * no need to unmount them. + */ +#define CL_GATHER_KEEP_LEGACY 0x02 typedef struct prop_changelist prop_changelist_t; |