Skip to contentSkip to conversation

quota: make some code static

PATCH New Adrian Bunk 1 participant 1 message Jan 8, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 quota: make some code static

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(-)
include/linux/slab.h renamed from include/linux/slab.h.old +0 -1
@@ -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;
fs/dquot.c renamed from fs/dquot.c.old +4 -4
@@ -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;
fs/quota.c renamed from fs/quota.c.old +1 -1
@@ -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];