Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Howells and committed by
Al Viro
ee416bcd dd111b31

+3 -2
+2 -1
fs/filesystems.c
··· 33 33 static DEFINE_RWLOCK(file_systems_lock); 34 34 35 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 38 __module_get(fs->owner); 39 + return fs; 39 40 } 40 41 41 42 void put_filesystem(struct file_system_type *fs)
+1 -1
include/linux/fs.h
··· 2956 2956 struct fiemap_extent_info *fieinfo, u64 start, 2957 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 2960 extern void put_filesystem(struct file_system_type *fs); 2961 2961 extern struct file_system_type *get_fs_type(const char *name); 2962 2962 extern struct super_block *get_super(struct block_device *);