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 in
1c2555ef92 (March 2017) to minimise the difference to illumos, but
zfs_vfsops was made platform-specific anyway in 7b4e27232d.

We also remove setting SB_RDONLY on the caller's flags when failing a
read-write remount on a read-only snapshot or pool. Since 0f608aa6ca
the 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:
Rob Norris
2026-03-26 14:19:05 +11:00
committed by Tony Hutter
parent a8942fdb89
commit fc285caa84
3 changed files with 11 additions and 27 deletions
+3 -7
View File
@@ -74,11 +74,6 @@ typedef struct vfs {
kmutex_t vfs_mntpt_lock;
} vfs_t;
typedef struct zfs_mnt {
const char *mnt_osname; /* Objset name */
vfs_t *mnt_opts; /* Parsed options */
} zfs_mnt_t;
struct zfsvfs {
vfs_t *z_vfs; /* generic fs struct */
struct super_block *z_sb; /* generic super_block */
@@ -250,10 +245,11 @@ extern vfs_t *zfsvfs_vfs_alloc(void);
extern void zfsvfs_vfs_free(vfs_t *vfsp);
extern boolean_t zfs_is_readonly(zfsvfs_t *zfsvfs);
extern int zfs_domount(struct super_block *sb, zfs_mnt_t *zm, int silent);
extern int zfs_domount(struct super_block *sb, const char *osname,
vfs_t *mntopts, int silent);
extern void zfs_preumount(struct super_block *sb);
extern int zfs_umount(struct super_block *sb);
extern int zfs_remount(struct super_block *sb, int *flags, zfs_mnt_t *zm);
extern int zfs_remount(struct super_block *sb, vfs_t *mntopts, int flags);
extern int zfs_statvfs(struct inode *ip, struct kstatfs *statp);
extern int zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp);
extern int zfs_prune(struct super_block *sb, unsigned long nr_to_scan,