]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: remove get_active_super()
authorChristian Brauner <brauner@kernel.org>
Tue, 24 Oct 2023 13:01:12 +0000 (15:01 +0200)
committerChristian Brauner <brauner@kernel.org>
Sat, 18 Nov 2023 13:59:23 +0000 (14:59 +0100)
This function is now unused so remove it. One less function that uses
the global superblock list.

Link: https://lore.kernel.org/r/20231024-vfs-super-freeze-v2-6-599c19f4faac@kernel.org
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/super.c
include/linux/fs.h

index 8c943ab1f4240b3ee586fffc522aaefa97e2da03..b49a49d70450e50998ecbead095009b4a796e9d8 100644 (file)
@@ -1027,34 +1027,6 @@ void iterate_supers_type(struct file_system_type *type,
 
 EXPORT_SYMBOL(iterate_supers_type);
 
-/**
- * get_active_super - get an active reference to the superblock of a device
- * @bdev: device to get the superblock for
- *
- * Scans the superblock list and finds the superblock of the file system
- * mounted on the device given.  Returns the superblock with an active
- * reference or %NULL if none was found.
- */
-struct super_block *get_active_super(struct block_device *bdev)
-{
-       struct super_block *sb;
-
-       if (!bdev)
-               return NULL;
-
-       spin_lock(&sb_lock);
-       list_for_each_entry(sb, &super_blocks, s_list) {
-               if (sb->s_bdev == bdev) {
-                       if (!grab_super(sb))
-                               return NULL;
-                       super_unlock_excl(sb);
-                       return sb;
-               }
-       }
-       spin_unlock(&sb_lock);
-       return NULL;
-}
-
 struct super_block *user_get_super(dev_t dev, bool excl)
 {
        struct super_block *sb;
index 98b7a7a8c42e36cc140d14797cf8eb00f7c36f76..7dc6c1bf5f553954d4de08cae3aa3e05c138dec5 100644 (file)
@@ -3121,7 +3121,6 @@ extern int vfs_readlink(struct dentry *, char __user *, int);
 extern struct file_system_type *get_filesystem(struct file_system_type *fs);
 extern void put_filesystem(struct file_system_type *fs);
 extern struct file_system_type *get_fs_type(const char *name);
-extern struct super_block *get_active_super(struct block_device *bdev);
 extern void drop_super(struct super_block *sb);
 extern void drop_super_exclusive(struct super_block *sb);
 extern void iterate_supers(void (*)(struct super_block *, void *), void *);