[PATCH 7/67] aufs module initialization and module-global

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: hooanon05
Date: Friday, May 16, 2008 - 7:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

	initial commit
	aufs module initialization and module-global

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
 fs/aufs/module.h |   78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 78 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/module.h b/fs/aufs/module.h
new file mode 100644
index 0000000..cccee38
--- /dev/null
+++ b/fs/aufs/module.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * module initialization and module-global
+ *
+ * $Id: module.h,v 1.2 2008/04/21 01:33:00 sfjro Exp $
+ */
+
+#ifndef __AUFS_MODULE_H__
+#define __AUFS_MODULE_H__
+
+#ifdef __KERNEL__
+
+//#include <linux/slab.h>
+
+/* ---------------------------------------------------------------------- */
+
+/* module parameters */
+extern short aufs_nwkq;
+extern int sysaufs_brs;
+
+/* ---------------------------------------------------------------------- */
+
+extern char au_esc_chars[];
+extern int au_dir_roflags;
+
+/* kmem cache */
+enum {
+	AuCache_DINFO,
+	AuCache_ICNTNR,
+	AuCache_FINFO,
+	AuCache_VDIR,
+	AuCache_DEHSTR,
+#ifdef CONFIG_AUFS_HINOTIFY
+	AuCache_HINOTIFY,
+#endif
+	AuCache_Last
+};
+
+extern struct kmem_cache *au_cachep[];
+
+#define AuCacheArgs(type, sz)	(type), (sz), 0, SLAB_RECLAIM_ACCOUNT, NULL
+#define AuCacheX(type, extra) \
+	kmem_cache_create(AuCacheArgs(#type, sizeof(struct type) + extra))
+#define AuCache(type)		AuCacheX(type, 0)
+
+/* ---------------------------------------------------------------------- */
+
+#define AuCacheFuncs(name, index) \
+static inline void *au_cache_alloc_##name(void) \
+{ return kmem_cache_alloc(au_cachep[index], GFP_KERNEL); } \
+static inline void au_cache_free_##name(void *p) \
+{ kmem_cache_free(au_cachep[index], p); }
+
+AuCacheFuncs(dinfo, AuCache_DINFO);
+AuCacheFuncs(icntnr, AuCache_ICNTNR);
+AuCacheFuncs(finfo, AuCache_FINFO);
+AuCacheFuncs(vdir, AuCache_VDIR);
+AuCacheFuncs(dehstr, AuCache_DEHSTR);
+
+#endif /* __KERNEL__ */
+#endif /* __AUFS_MODULE_H__ */
-- 
1.4.4.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/67] aufs document, hooanon05, (Fri May 16, 7:32 am)
[PATCH 2/67] aufs manual, hooanon05, (Fri May 16, 7:32 am)
[PATCH 3/67] aufs global header file, hooanon05, (Fri May 16, 7:32 am)
[PATCH 4/67] aufs configuration, hooanon05, (Fri May 16, 7:32 am)
[PATCH 5/67] aufs Makefile, hooanon05, (Fri May 16, 7:32 am)
[PATCH 6/67] aufs main header file, hooanon05, (Fri May 16, 7:32 am)
[PATCH 7/67] aufs module initialization and module-global, hooanon05, (Fri May 16, 7:32 am)
[PATCH 9/67] aufs super_block operations, hooanon05, (Fri May 16, 7:32 am)
[PATCH 10/67] aufs mount and super_block operations, hooanon05, (Fri May 16, 7:32 am)
[PATCH 11/67] aufs superblock private data, hooanon05, (Fri May 16, 7:32 am)
[PATCH 13/67] aufs branch management, hooanon05, (Fri May 16, 7:32 am)
[PATCH 20/67] aufs mount options/flags, header, hooanon05, (Fri May 16, 7:32 am)
[PATCH 21/67] aufs mount options/flags, source, hooanon05, (Fri May 16, 7:32 am)
[PATCH 24/67] aufs sub-VFS, header, hooanon05, (Fri May 16, 7:32 am)
[PATCH 25/67] aufs sub-VFS, source, hooanon05, (Fri May 16, 7:32 am)
[PATCH 26/67] aufs sub-dcache, header, hooanon05, (Fri May 16, 7:32 am)
[PATCH 27/67] aufs sub-dcache, source, hooanon05, (Fri May 16, 7:32 am)
[PATCH 28/67] aufs copy-up/down functions, hooanon05, (Fri May 16, 7:32 am)
[PATCH 32/67] aufs pseudo-link, hooanon05, (Fri May 16, 7:32 am)
[PATCH 36/67] aufs dentry private data, hooanon05, (Fri May 16, 7:32 am)
[PATCH 37/67] aufs file operations, hooanon05, (Fri May 16, 7:32 am)
[PATCH 39/67] aufs file private data, hooanon05, (Fri May 16, 7:32 am)
[PATCH 40/67] aufs file and vm operations, hooanon05, (Fri May 16, 7:32 am)
[PATCH 41/67] aufs directory operations, header, hooanon05, (Fri May 16, 7:32 am)
[PATCH 42/67] aufs directory operations, source, hooanon05, (Fri May 16, 7:32 am)
[PATCH 43/67] aufs virtual or vertical directory, hooanon05, (Fri May 16, 7:32 am)
[PATCH 44/67] aufs inode operations, hooanon05, (Fri May 16, 7:32 am)
[PATCH 45/67] aufs inode functions, hooanon05, (Fri May 16, 7:32 am)
[PATCH 46/67] aufs inode private data, hooanon05, (Fri May 16, 7:33 am)
[PATCH 48/67] aufs inode operations (add entry), hooanon05, (Fri May 16, 7:33 am)
[PATCH 49/67] aufs inode operations (del entry), hooanon05, (Fri May 16, 7:33 am)
[PATCH 50/67] aufs inode operation (rename entry), hooanon05, (Fri May 16, 7:33 am)
[PATCH 52/67] aufs inotify handler, hooanon05, (Fri May 16, 7:33 am)
[PATCH 55/67] aufs export via nfs, hooanon05, (Fri May 16, 7:33 am)
[PATCH 57/67] aufs sysfs interface, hooanon05, (Fri May 16, 7:33 am)
[PATCH 58/67] aufs misc functions, header, hooanon05, (Fri May 16, 7:33 am)
[PATCH 59/67] aufs misc functions, source, hooanon05, (Fri May 16, 7:33 am)
[PATCH 60/67] aufs debug print functions, header, hooanon05, (Fri May 16, 7:33 am)
[PATCH 61/67] aufs debug print functions, source, hooanon05, (Fri May 16, 7:33 am)
[PATCH 62/67] aufs magic sysrq handler, hooanon05, (Fri May 16, 7:33 am)
[PATCH 63/67] aufs mount helper, hooanon05, (Fri May 16, 7:33 am)
[PATCH 64/67] aufs pseudo-link helper, hooanon05, (Fri May 16, 7:33 am)
[PATCH 65/67] aufs pseudo-link helper for symlink, hooanon05, (Fri May 16, 7:33 am)
[PATCH 66/67] aufs umount helper, hooanon05, (Fri May 16, 7:33 am)
[PATCH 67/67] merge aufs, hooanon05, (Fri May 16, 7:33 am)
Re: [PATCH 1/67] aufs document, Dave Quigley, (Fri May 16, 7:59 am)
Re: [PATCH 4/67] aufs configuration, Jan Engelhardt, (Fri May 16, 8:28 am)
Re: [PATCH 1/67] aufs document, Jan Engelhardt, (Fri May 16, 8:32 am)
Re: [PATCH 6/67] aufs main header file, Jan Engelhardt, (Fri May 16, 8:33 am)
Re: [PATCH 1/67] aufs document , hooanon05, (Fri May 16, 8:45 am)
Re: [PATCH 1/67] aufs document, Dave Quigley, (Fri May 16, 9:09 am)
Re: [PATCH 5/67] aufs Makefile, Sam Ravnborg, (Fri May 16, 10:25 am)
Re: [PATCH 1/67] aufs document, Josef 'Jeff' Sipek, (Fri May 16, 2:07 pm)
Re: [PATCH 1/67] aufs document , hooanon05, (Fri May 16, 7:06 pm)
Re: [PATCH 4/67] aufs configuration , hooanon05, (Sun May 18, 7:23 pm)
Re: [PATCH 1/67] aufs document , hooanon05, (Sun May 18, 7:25 pm)
Re: [PATCH 5/67] aufs Makefile , hooanon05, (Sun May 18, 7:27 pm)