VFS: Make get_filesystem() return the affected filesystem
authorDavid Howells <dhowells@redhat.com>
Tue, 4 Jul 2017 16:25:16 +0000 (17:25 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 6 Jul 2017 07:27:09 +0000 (03:27 -0400)
Make get_filesystem() return a pointer to the filesystem on which it just
got a ref.

Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/filesystems.c
include/linux/fs.h

index cac75547d35ccb163a6ce0e94c786c1fd150e5db..591e52d23ed4d22f4e11b840d5ac8975faaeb575 100644 (file)
@@ -33,9 +33,10 @@ static struct file_system_type *file_systems;
 static DEFINE_RWLOCK(file_systems_lock);
 
 /* WARNING: This can be used only if we _already_ own a reference */
-void get_filesystem(struct file_system_type *fs)
+struct file_system_type *get_filesystem(struct file_system_type *fs)
 {
        __module_get(fs->owner);
+       return fs;
 }
 
 void put_filesystem(struct file_system_type *fs)
index 803e5a9b265422d2c2034678331b6d4dd353d1de..bc0c054894b9e10b983cd56e658d541c778f3993 100644 (file)
@@ -2956,7 +2956,7 @@ extern int generic_block_fiemap(struct inode *inode,
                                struct fiemap_extent_info *fieinfo, u64 start,
                                u64 len, get_block_t *get_block);
 
-extern void get_filesystem(struct file_system_type *fs);
+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_super(struct block_device *);