]> git.hungrycats.org Git - linux/commitdiff
[PATCH] dm: add static and __init qualifiers
authorAndrew Morton <akpm@osdl.org>
Sat, 29 May 2004 03:57:30 +0000 (20:57 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 29 May 2004 03:57:30 +0000 (20:57 -0700)
From: Kevin Corry <kevcorry@us.ibm.com>

DM: Add static and __init qualifiers. [Dave Olien]

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/dm-ioctl.c
drivers/md/dm-target.c
drivers/md/dm.c
drivers/md/dm.h

index ebfa4321f2ed02e0b489ca8a36746e1053e4b7fe..0d508c016c7bfbadbae7d6098657038706514a1f 100644 (file)
@@ -46,7 +46,7 @@ struct vers_iter {
 static struct list_head _name_buckets[NUM_BUCKETS];
 static struct list_head _uuid_buckets[NUM_BUCKETS];
 
-void dm_hash_remove_all(void);
+static void dm_hash_remove_all(void);
 
 /*
  * Guards access to both hash tables.
@@ -61,7 +61,7 @@ static void init_buckets(struct list_head *buckets)
                INIT_LIST_HEAD(buckets + i);
 }
 
-int dm_hash_init(void)
+static int dm_hash_init(void)
 {
        init_buckets(_name_buckets);
        init_buckets(_uuid_buckets);
@@ -69,7 +69,7 @@ int dm_hash_init(void)
        return 0;
 }
 
-void dm_hash_exit(void)
+static void dm_hash_exit(void)
 {
        dm_hash_remove_all();
        devfs_remove(DM_DIR);
@@ -195,7 +195,7 @@ static int unregister_with_devfs(struct hash_cell *hc)
  * The kdev_t and uuid of a device can never change once it is
  * initially inserted.
  */
-int dm_hash_insert(const char *name, const char *uuid, struct mapped_device *md)
+static int dm_hash_insert(const char *name, const char *uuid, struct mapped_device *md)
 {
        struct hash_cell *cell;
 
@@ -234,7 +234,7 @@ int dm_hash_insert(const char *name, const char *uuid, struct mapped_device *md)
        return -EBUSY;
 }
 
-void __hash_remove(struct hash_cell *hc)
+static void __hash_remove(struct hash_cell *hc)
 {
        /* remove from the dev hash */
        list_del(&hc->uuid_list);
@@ -246,7 +246,7 @@ void __hash_remove(struct hash_cell *hc)
        free_cell(hc);
 }
 
-void dm_hash_remove_all(void)
+static void dm_hash_remove_all(void)
 {
        int i;
        struct hash_cell *hc;
@@ -262,7 +262,7 @@ void dm_hash_remove_all(void)
        up_write(&_hash_lock);
 }
 
-int dm_hash_rename(const char *old, const char *new)
+static int dm_hash_rename(const char *old, const char *new)
 {
        char *new_name, *old_name;
        struct hash_cell *hc;
index 7a9122d704570c2950270bcac4b93a2b2f936fe1..2f67b4d68b39cf80467b44686692460e28b23903 100644 (file)
@@ -7,6 +7,7 @@
 #include "dm.h"
 
 #include <linux/module.h>
+#include <linux/init.h>
 #include <linux/kmod.h>
 #include <linux/bio.h>
 #include <linux/slab.h>
@@ -181,7 +182,7 @@ static struct target_type error_target = {
        .map  = io_err_map,
 };
 
-int dm_target_init(void)
+int __init dm_target_init(void)
 {
        return dm_register_target(&error_target);
 }
index c2d115fcf4f3dd67ffa8388fde379c6861ff4d67..03381e0036073f7daf4586a2ae71363f5da43944 100644 (file)
@@ -93,7 +93,7 @@ struct mapped_device {
 static kmem_cache_t *_io_cache;
 static kmem_cache_t *_tio_cache;
 
-static __init int local_init(void)
+static int __init local_init(void)
 {
        int r;
 
@@ -663,6 +663,8 @@ static int next_free_minor(unsigned int *minor)
        return r;
 }
 
+static struct block_device_operations dm_blk_dops;
+
 /*
  * Allocate and initialise a blank device with a given minor.
  */
@@ -1077,7 +1079,7 @@ int dm_suspended(struct mapped_device *md)
        return test_bit(DMF_SUSPENDED, &md->flags);
 }
 
-struct block_device_operations dm_blk_dops = {
+static struct block_device_operations dm_blk_dops = {
        .open = dm_blk_open,
        .release = dm_blk_close,
        .owner = THIS_MODULE
index 93dd264b1630c66af39fd45e5c0bff2840c6626f..b4b915fbdf3ce1cd51ab48e6b2fdd60f425a62c0 100644 (file)
@@ -31,8 +31,6 @@
 
 #define SECTOR_SHIFT 9
 
-extern struct block_device_operations dm_blk_dops;
-
 /*
  * List of devices that a metadevice uses and should open/close.
  */