[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    [patch] inotify: rename slab-related stuff
From:       Robert Love <rml () novell ! com>
Date:       2004-09-30 22:53:36
Message-ID: 1096584816.4203.98.camel () betsy ! boston ! ximian ! com
[Download RAW message or body]

Hey, John.

Following patch renames some slab-related stuff.

First rename the "kevent_cache" variable to "event_cachep".  The name
"kevent" sounds too close to the kernel event layer, which is going in.
And the 'p' suffix is the standard for slab cache variables.  No idea
why.

Second rename the "watcher_cache" variable to "watch_cachep" as the
thing is now a watch object, not a watcher.  Also, same thing with the
'p'.

We do not have to worry about namespace, since the variables are local
to the file.

Finally, give the slab caches more descriptive user-visible names:
"inotify_watch_cache" and "inotify_event_cache".

Patch is on top of 0.11.0 and my past indiscretions.

	Robert Love


["inotify-rename-slab-stuff-1.patch" (inotify-rename-slab-stuff-1.patch)]

rename slab-related things

Signed-Off-By: Robert Love <rml@novell.com>

 drivers/char/inotify.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff -urN linux-inotify/drivers/char/inotify.c linux/drivers/char/inotify.c
--- linux-inotify/drivers/char/inotify.c	2004-09-30 18:44:21.131858232 -0400
+++ linux/drivers/char/inotify.c	2004-09-30 18:48:10.334014208 -0400
@@ -46,8 +46,8 @@
 #define MAX_INOTIFY_QUEUED_EVENTS 256	/* max events queued on the dev*/
 
 static atomic_t watcher_count;
-static kmem_cache_t *watcher_cache;
-static kmem_cache_t *kevent_cache;
+static kmem_cache_t *watch_cachep;
+static kmem_cache_t *event_cachep;
 
 /* For debugging */
 static int inotify_debug_flags;
@@ -139,7 +139,7 @@
 {
 	struct inotify_kernel_event *kevent;
 
-	kevent = kmem_cache_alloc(kevent_cache, GFP_ATOMIC);
+	kevent = kmem_cache_alloc(event_cachep, GFP_ATOMIC);
 	if (!kevent) {
 		iprintk(INOTIFY_DEBUG_ALLOC,
 			"failed to alloc kevent (%d,%d)\n", wd, mask);
@@ -181,7 +181,7 @@
 	kevent->event.mask = 0;
 
 	iprintk(INOTIFY_DEBUG_ALLOC, "free'd kevent %p\n", kevent);
-	kmem_cache_free(kevent_cache, kevent);
+	kmem_cache_free(event_cachep, kevent);
 }
 
 #define inotify_dev_has_events(dev) (!list_empty(&dev->events))
@@ -321,7 +321,7 @@
 {
 	struct inotify_watch *watcher;
 
-	watcher = kmem_cache_alloc(watcher_cache, GFP_KERNEL);
+	watcher = kmem_cache_alloc(watch_cachep, GFP_KERNEL);
 	if (!watcher) {
 		iprintk(INOTIFY_DEBUG_ALLOC,
 			"failed to allocate watcher (%p,%d)\n", inode, mask);
@@ -344,7 +344,7 @@
 		iprintk(INOTIFY_DEBUG_ERRORS,
 			"Could not get wd for watcher %p\n", watcher);
 		iprintk(INOTIFY_DEBUG_ALLOC, "free'd watcher %p\n", watcher);
-		kmem_cache_free(watcher_cache, watcher);
+		kmem_cache_free(watch_cachep, watcher);
 		return NULL;
 	}
 
@@ -361,7 +361,7 @@
 {
 	inotify_dev_put_wd(dev, watcher->wd);
 	iprintk(INOTIFY_DEBUG_ALLOC, "free'd watcher %p\n", watcher);
-	kmem_cache_free(watcher_cache, watcher);
+	kmem_cache_free(watch_cachep, watcher);
 }
 
 /*
@@ -975,11 +975,11 @@
 
 	inotify_debug_flags = INOTIFY_DEBUG_NONE;
 
-	watcher_cache = kmem_cache_create("watcher_cache",
+	watch_cachep = kmem_cache_create("inotify_watch_cache",
 			sizeof(struct inotify_watch), 0, SLAB_PANIC,
 			NULL, NULL);
 
-	kevent_cache = kmem_cache_create("kevent_cache",
+	event_cachep = kmem_cache_create("inotify_event_cache",
 			sizeof(struct inotify_kernel_event), 0,
 			SLAB_PANIC, NULL, NULL);
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic