diff options
author | David Howells <dhowells@redhat.com> | 2017-07-04 12:25:16 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-07-06 03:27:09 -0400 |
commit | ee416bcdba9975065de571e09de1f7ebfde2156a (patch) | |
tree | 20aeec2addf524142ca334c6507c9f4d3a197fdd | |
parent | dd111b31e951c4ffb3a525b51b11d240118693c1 (diff) |
VFS: Make get_filesystem() return the affected filesystem
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>
-rw-r--r-- | fs/filesystems.c | 3 | ||||
-rw-r--r-- | include/linux/fs.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/fs/filesystems.c b/fs/filesystems.c index cac75547d35c..591e52d23ed4 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c | |||
@@ -33,9 +33,10 @@ static struct file_system_type *file_systems; | |||
33 | static DEFINE_RWLOCK(file_systems_lock); | 33 | static DEFINE_RWLOCK(file_systems_lock); |
34 | 34 | ||
35 | /* WARNING: This can be used only if we _already_ own a reference */ | 35 | /* WARNING: This can be used only if we _already_ own a reference */ |
36 | void get_filesystem(struct file_system_type *fs) | 36 | struct file_system_type *get_filesystem(struct file_system_type *fs) |
37 | { | 37 | { |
38 | __module_get(fs->owner); | 38 | __module_get(fs->owner); |
39 | return fs; | ||
39 | } | 40 | } |
40 | 41 | ||
41 | void put_filesystem(struct file_system_type *fs) | 42 | void put_filesystem(struct file_system_type *fs) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 803e5a9b2654..bc0c054894b9 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2956,7 +2956,7 @@ extern int generic_block_fiemap(struct inode *inode, | |||
2956 | struct fiemap_extent_info *fieinfo, u64 start, | 2956 | struct fiemap_extent_info *fieinfo, u64 start, |
2957 | u64 len, get_block_t *get_block); | 2957 | u64 len, get_block_t *get_block); |
2958 | 2958 | ||
2959 | extern void get_filesystem(struct file_system_type *fs); | 2959 | extern struct file_system_type *get_filesystem(struct file_system_type *fs); |
2960 | extern void put_filesystem(struct file_system_type *fs); | 2960 | extern void put_filesystem(struct file_system_type *fs); |
2961 | extern struct file_system_type *get_fs_type(const char *name); | 2961 | extern struct file_system_type *get_fs_type(const char *name); |
2962 | extern struct super_block *get_super(struct block_device *); | 2962 | extern struct super_block *get_super(struct block_device *); |