Merge patch series "fs: Remove old mount API helpers"

Pedro Falcato <pfalcato@suse.de> says:

This patchset contains a very small cleanup, where we remove mount_nodev
(unused since 6.15) and mount_bdev (unused since f2fs converted their
mount API usage, still in -next). While we're at it, we also get to
removing some stale mount API docs.

* patches from https://lore.kernel.org/20250723132156.225410-1-pfalcato@suse.de:
  docs/vfs: Remove mentions to the old mount API helpers
  fs: Remove mount_bdev
  fs: Remove mount_nodev

Link: https://lore.kernel.org/20250723132156.225410-1-pfalcato@suse.de
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Christian Brauner
2025-07-31 13:20:12 +02:00
3 changed files with 2 additions and 94 deletions

View File

@@ -209,31 +209,8 @@ method fills in is the "s_op" field. This is a pointer to a "struct
super_operations" which describes the next level of the filesystem
implementation.
Usually, a filesystem uses one of the generic mount() implementations
and provides a fill_super() callback instead. The generic variants are:
``mount_bdev``
mount a filesystem residing on a block device
``mount_nodev``
mount a filesystem that is not backed by a device
``mount_single``
mount a filesystem which shares the instance between all mounts
A fill_super() callback implementation has the following arguments:
``struct super_block *sb``
the superblock structure. The callback must initialize this
properly.
``void *data``
arbitrary mount options, usually comes as an ASCII string (see
"Mount Options" section)
``int silent``
whether or not to be silent on error
For more information on mounting (and the new mount API), see
Documentation/filesystems/mount_api.rst.
The Superblock Object
=====================

View File

@@ -1716,49 +1716,6 @@ int get_tree_bdev(struct fs_context *fc,
}
EXPORT_SYMBOL(get_tree_bdev);
static int test_bdev_super(struct super_block *s, void *data)
{
return !(s->s_iflags & SB_I_RETIRED) && s->s_dev == *(dev_t *)data;
}
struct dentry *mount_bdev(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data,
int (*fill_super)(struct super_block *, void *, int))
{
struct super_block *s;
int error;
dev_t dev;
error = lookup_bdev(dev_name, &dev);
if (error)
return ERR_PTR(error);
flags |= SB_NOSEC;
s = sget(fs_type, test_bdev_super, set_bdev_super, flags, &dev);
if (IS_ERR(s))
return ERR_CAST(s);
if (s->s_root) {
if ((flags ^ s->s_flags) & SB_RDONLY) {
deactivate_locked_super(s);
return ERR_PTR(-EBUSY);
}
} else {
error = setup_bdev_super(s, flags, NULL);
if (!error)
error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
if (error) {
deactivate_locked_super(s);
return ERR_PTR(error);
}
s->s_flags |= SB_ACTIVE;
}
return dget(s->s_root);
}
EXPORT_SYMBOL(mount_bdev);
void kill_block_super(struct super_block *sb)
{
struct block_device *bdev = sb->s_bdev;
@@ -1773,26 +1730,6 @@ void kill_block_super(struct super_block *sb)
EXPORT_SYMBOL(kill_block_super);
#endif
struct dentry *mount_nodev(struct file_system_type *fs_type,
int flags, void *data,
int (*fill_super)(struct super_block *, void *, int))
{
int error;
struct super_block *s = sget(fs_type, NULL, set_anon_super, flags, NULL);
if (IS_ERR(s))
return ERR_CAST(s);
error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
if (error) {
deactivate_locked_super(s);
return ERR_PTR(error);
}
s->s_flags |= SB_ACTIVE;
return dget(s->s_root);
}
EXPORT_SYMBOL(mount_nodev);
/**
* vfs_get_tree - Get the mountable root
* @fc: The superblock configuration context.

View File

@@ -2713,12 +2713,6 @@ static inline bool is_mgtime(const struct inode *inode)
return inode->i_opflags & IOP_MGTIME;
}
extern struct dentry *mount_bdev(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data,
int (*fill_super)(struct super_block *, void *, int));
extern struct dentry *mount_nodev(struct file_system_type *fs_type,
int flags, void *data,
int (*fill_super)(struct super_block *, void *, int));
extern struct dentry *mount_subtree(struct vfsmount *mnt, const char *path);
void retire_super(struct super_block *sb);
void generic_shutdown_super(struct super_block *sb);