[PATCH] change {get,put}_filesystem prototypes to static inlines

From: Chris Wedgwood
Date: Wed Oct 20 2004 - 05:07:13 EST


Al,

Any objections/comments to something like this?



Remove unneeded get_fs_type prototype. Move get_filesystem and
put_filesystem to fs.h and make them static inline.

Signed-off-by: cw@xxxxxxxx


fs/filesystems.c | 11 -----------
fs/super.c | 5 -----
include/linux/fs.h | 12 ++++++++++++
3 files changed, 12 insertions(+), 16 deletions(-)


===== fs/filesystems.c 1.19 vs edited =====
--- 1.19/fs/filesystems.c 2004-10-18 22:26:38 -07:00
+++ edited/fs/filesystems.c 2004-10-20 02:40:35 -07:00
@@ -30,17 +30,6 @@
static struct file_system_type *file_systems;
static rwlock_t file_systems_lock = RW_LOCK_UNLOCKED;

-/* WARNING: This can be used only if we _already_ own a reference */
-void get_filesystem(struct file_system_type *fs)
-{
- __module_get(fs->owner);
-}
-
-void put_filesystem(struct file_system_type *fs)
-{
- module_put(fs->owner);
-}
-
static struct file_system_type **find_filesystem(const char *name)
{
struct file_system_type **p;
===== fs/super.c 1.125 vs edited =====
--- 1.125/fs/super.c 2004-10-19 08:00:43 -07:00
+++ edited/fs/super.c 2004-10-20 02:40:32 -07:00
@@ -39,11 +39,6 @@
#include <linux/kobject.h>
#include <asm/uaccess.h>

-
-void get_filesystem(struct file_system_type *fs);
-void put_filesystem(struct file_system_type *fs);
-struct file_system_type *get_fs_type(const char *name);
-
LIST_HEAD(super_blocks);
spinlock_t sb_lock = SPIN_LOCK_UNLOCKED;

===== include/linux/fs.h 1.352 vs edited =====
x--- 1.352/include/linux/fs.h 2004-10-19 02:40:29 -07:00
+++ edited/include/linux/fs.h 2004-10-20 02:40:35 -07:00
@@ -7,6 +7,7 @@
*/

#include <linux/config.h>
+#include <linux/module.h>
#include <linux/linkage.h>
#include <linux/limits.h>
#include <linux/wait.h>
@@ -1537,6 +1538,17 @@
extern int vfs_stat(char __user *, struct kstat *);
extern int vfs_lstat(char __user *, struct kstat *);
extern int vfs_fstat(unsigned int, struct kstat *);
+
+/* WARNING: This can be used only if we _already_ own a reference */
+static inline void get_filesystem(struct file_system_type *fs)
+{
+ __module_get(fs->owner);
+}
+
+static inline void put_filesystem(struct file_system_type *fs)
+{
+ module_put(fs->owner);
+}

extern struct file_system_type *get_fs_type(const char *name);
extern struct super_block *get_super(struct block_device *);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/