Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1638956

[PATCH 04/14] VFS: Make get_filesystem() return the affected filesystem

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 04/14] VFS: Make get_filesystem() return the affected filesystem
Date 2017-05-10 18:30 +0200
Message-ID <tFCEX-2YC-33@gated-at.bofh.it> (permalink)
References <tFCvf-2Uw-1@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


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>
---

 fs/filesystems.c   |    3 ++-
 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;
 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)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 30e5c14bd743..45ac992133fc 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2953,7 +2953,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 *);

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCH 00/14] VFS: Introduce superblock configuration context David Howells <dhowells@redhat.com> - 2017-05-10 18:20 +0200
  [PATCH 01/14] Provide a function to create a NUL-terminated string  from unterminated data David Howells <dhowells@redhat.com> - 2017-05-10 18:20 +0200
  [PATCH 07/14] Implement fsopen() to prepare for a mount David Howells <dhowells@redhat.com> - 2017-05-10 18:30 +0200
    Re: [PATCH 07/14] Implement fsopen() to prepare for a mount Sargun Dhillon <sargun@sargun.me> - 2017-05-11 00:10 +0200
      Re: [PATCH 07/14] Implement fsopen() to prepare for a mount David Howells <dhowells@redhat.com> - 2017-05-11 16:40 +0200
    Re: [PATCH 07/14] Implement fsopen() to prepare for a mount Jeff Layton <jlayton@redhat.com> - 2017-05-11 16:40 +0200
  [PATCH 08/14] Implement fsmount() to effect a pre-configured mount David Howells <dhowells@redhat.com> - 2017-05-10 18:30 +0200
  [PATCH 11/14] proc: Add superblock config support to procfs David Howells <dhowells@redhat.com> - 2017-05-10 18:30 +0200
  [PATCH 13/14] Support legacy filesystems David Howells <dhowells@redhat.com> - 2017-05-10 18:30 +0200
  [PATCH 03/14] VFS: Make get_mnt_ns() return the namespace David Howells <dhowells@redhat.com> - 2017-05-10 18:30 +0200
  [PATCH 05/14] VFS: Provide empty name qstr David Howells <dhowells@redhat.com> - 2017-05-10 18:30 +0200
  [PATCH 02/14] Clean up whitespace in fs/namespace.c David Howells <dhowells@redhat.com> - 2017-05-10 18:30 +0200
  [PATCH 10/14] procfs: Move proc_fill_super() to fs/proc/root.c David Howells <dhowells@redhat.com> - 2017-05-10 18:30 +0200
  [PATCH 09/14] Sample program for driving fsopen/fsmount David Howells <dhowells@redhat.com> - 2017-05-10 18:30 +0200
  [PATCH 04/14] VFS: Make get_filesystem() return the affected  filesystem David Howells <dhowells@redhat.com> - 2017-05-10 18:30 +0200
  Re: [PATCH 06/14] VFS: Introduce a superblock configuration context Al Viro <viro@ZenIV.linux.org.uk> - 2017-05-11 09:30 +0200
  Re: [PATCH 14/14] Add commands to create or update a superblock Al Viro <viro@ZenIV.linux.org.uk> - 2017-05-11 09:40 +0200
    Re: [PATCH 14/14] Add commands to create or update a superblock Miklos Szeredi <mszeredi@redhat.com> - 2017-05-11 10:20 +0200

csiph-web