]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r226676, r226678, r226700, r226705, r226706, r226707:
authormm <mm@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 5 Jan 2012 09:39:29 +0000 (09:39 +0000)
committermm <mm@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 5 Jan 2012 09:39:29 +0000 (09:39 +0000)
commitc09a2180bb7cdb1983f70b07d2f016e686f0456b
tree92f8433ec9fecbe49d8688506d75542fec941ff7
parentb96f3694cb4f38f374444c3e07027a74df5634f5
MFC r226676, r226678, r226700, r226705, r226706, r226707:

MFC r226676 (pjd):
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 r227768 (pjd):
Include <sys/zfs_vfsops.h> only when compiling kernel module.

MFC r226700 (pjd):
Don't forget to rename mounted snapshots of the file system being renamed.

MFC r226705 (pjd):
Extend r226676 to allow rename without unmount even for file systems with
non-legacy mountpoints. It is better to be able to rename such file systems and
let them be mounted in old places until next reboot than using live CD, etc. to
rename with remount.

This is implemented by adding -u option to 'zfs rename'. If file system's
mountpoint property is set to 'legacy' or 'none', there is no need to specify -u.

Update zfs(8) manual page to reflect this addition.

MFC r226706 (pjd):
Update copyright to include myself.

MFC r226707 (pjd):
- Use better naming now that we allow to rename any mounted file system (not
  only legacy).
- Update copyright to include myself.

Approved by: pjd

git-svn-id: svn://svn.freebsd.org/base/stable/8@229566 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
14 files changed:
cddl/contrib/opensolaris/cmd/zfs/zfs.8
cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c