[2.6 patch] quota: make some code static

From: Adrian Bunk
Date: Sat Jan 08 2005 - 17:33:16 EST


The patch below makes some needlessly global code static.

The most interesting part is that dquot_cachep can become static, since
it isn't used outside of dquot.c .


diffstat output:
fs/dquot.c | 8 ++++----
fs/quota.c | 2 +-
include/linux/slab.h | 1 -
3 files changed, 5 insertions(+), 6 deletions(-)


Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>

--- linux-2.6.10-mm2-full/include/linux/slab.h.old 2005-01-08 17:18:39.000000000 +0100
+++ linux-2.6.10-mm2-full/include/linux/slab.h 2005-01-08 17:18:45.000000000 +0100
@@ -118,7 +118,6 @@
extern kmem_cache_t *names_cachep;
extern kmem_cache_t *files_cachep;
extern kmem_cache_t *filp_cachep;
-extern kmem_cache_t *dquot_cachep;
extern kmem_cache_t *fs_cachep;
extern kmem_cache_t *signal_cachep;
extern kmem_cache_t *sighand_cachep;
--- linux-2.6.10-mm2-full/fs/dquot.c.old 2005-01-08 17:17:28.000000000 +0100
+++ linux-2.6.10-mm2-full/fs/dquot.c 2005-01-08 17:18:29.000000000 +0100
@@ -128,6 +128,9 @@
static struct quota_format_type *quota_formats; /* List of registered formats */
static struct quota_module_name module_names[] = INIT_QUOTA_MODULE_NAMES;

+/* SLAB cache for dquot structures */
+static kmem_cache_t *dquot_cachep;
+
int register_quota_format(struct quota_format_type *fmt)
{
spin_lock(&dq_list_lock);
@@ -199,7 +202,7 @@

static LIST_HEAD(inuse_list);
static LIST_HEAD(free_dquots);
-unsigned int dq_hash_bits, dq_hash_mask;
+static unsigned int dq_hash_bits, dq_hash_mask;
static struct hlist_head *dquot_hash;

struct dqstats dqstats;
@@ -1781,9 +1784,6 @@
{ .ctl_name = 0 },
};

-/* SLAB cache for dquot structures */
-kmem_cache_t *dquot_cachep;
-
static int __init dquot_init(void)
{
int i;
--- linux-2.6.10-mm2-full/fs/quota.c.old 2005-01-08 17:19:08.000000000 +0100
+++ linux-2.6.10-mm2-full/fs/quota.c 2005-01-08 17:19:17.000000000 +0100
@@ -136,7 +136,7 @@
return NULL;
}

-void quota_sync_sb(struct super_block *sb, int type)
+static void quota_sync_sb(struct super_block *sb, int type)
{
int cnt;
struct inode *discard[MAXQUOTAS];

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