mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 19:28:53 +03:00
linux/vfsops: remove zfs_mnt_t, pass directly
A cleanup of opportunity. Since we already are modifying the contents of zfs_mnt_t, we've broken any API guarantee, so we might as well go the rest of the way and get rid of it, and just pass the osname and/or the vfs_t directly. It seems like zfs_mnt_t was never really needed anyway; it was added in1c2555ef92(March 2017) to minimise the difference to illumos, but zfs_vfsops was made platform-specific anyway in7b4e27232d. We also remove setting SB_RDONLY on the caller's flags when failing a read-write remount on a read-only snapshot or pool. Since0f608aa6cathe caller's flags have been a pointer back to fc->sb_flags, which are discarded without further ceremony when the operation fails, so the change is unnecessary and we can simplify the call further. Sponsored-by: TrueNAS Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <rob.norris@truenas.com> Closes #18377
This commit is contained in:
@@ -880,13 +880,9 @@ zpl_get_tree(struct fs_context *fc)
|
||||
vfs->vfs_do_readonly = B_TRUE;
|
||||
}
|
||||
|
||||
zfs_mnt_t zm = {
|
||||
.mnt_osname = fc->source,
|
||||
.mnt_opts = vfs,
|
||||
};
|
||||
|
||||
fstrans_cookie_t cookie = spl_fstrans_mark();
|
||||
err = zfs_domount(sb, &zm, fc->sb_flags & SB_SILENT ? 1 : 0);
|
||||
err = zfs_domount(sb, fc->source, vfs,
|
||||
fc->sb_flags & SB_SILENT ? 1 : 0);
|
||||
spl_fstrans_unmark(cookie);
|
||||
|
||||
if (err) {
|
||||
@@ -921,12 +917,11 @@ zpl_get_tree(struct fs_context *fc)
|
||||
static int
|
||||
zpl_reconfigure(struct fs_context *fc)
|
||||
{
|
||||
zfs_mnt_t zm = { .mnt_osname = NULL, .mnt_opts = fc->fs_private };
|
||||
fstrans_cookie_t cookie;
|
||||
int error;
|
||||
|
||||
cookie = spl_fstrans_mark();
|
||||
error = -zfs_remount(fc->root->d_sb, &fc->sb_flags, &zm);
|
||||
error = -zfs_remount(fc->root->d_sb, fc->fs_private, fc->sb_flags);
|
||||
spl_fstrans_unmark(cookie);
|
||||
ASSERT3S(error, <=, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user