From: Robert Love <rml@novell.com>
To: John McCutchan <ttb@tentacle.dhs.org>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: [patch] inotify: rename slab-related stuff
Date: Thu, 30 Sep 2004 18:53:36 -0400 [thread overview]
Message-ID: <1096584816.4203.98.camel@betsy.boston.ximian.com> (raw)
In-Reply-To: <1096410792.4365.3.camel@vertex>
[-- Attachment #1: Type: text/plain, Size: 695 bytes --]
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
[-- Attachment #2: inotify-rename-slab-stuff-1.patch --]
[-- Type: text/x-patch, Size: 2469 bytes --]
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);
next prev parent reply other threads:[~2004-09-30 22:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-28 22:33 [RFC][PATCH] inotify 0.11.0 [WITH PATCH!] John McCutchan
2004-09-30 19:01 ` [patch] inotify: locking Robert Love
2004-09-30 19:17 ` Robert Love
2004-09-30 21:36 ` [patch] inotify: ioctl makeover Robert Love
2004-09-30 22:25 ` [patch] inotify: make user visible types portable Robert Love
2004-09-30 22:30 ` Robert Love
2004-10-02 9:21 ` David Woodhouse
2004-09-30 22:57 ` Paul Jackson
2004-10-01 5:35 ` Robert Love
2004-10-01 6:44 ` Paul Jackson
2004-10-01 7:39 ` Robert Love
2004-10-01 15:40 ` Paul Jackson
2004-10-01 15:47 ` Robert Love
2004-10-01 16:13 ` Paul Jackson
2004-10-01 16:31 ` Chris Friesen
2004-10-01 18:00 ` Paul Jackson
2004-09-30 22:43 ` [patch] inotify: rename inotify_watcher Robert Love
2004-09-30 22:44 ` Robert Love
2004-09-30 22:53 ` Robert Love [this message]
2004-10-01 17:46 ` [patch] inotify: misc changes Robert Love
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1096584816.4203.98.camel@betsy.boston.ximian.com \
--to=rml@novell.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ttb@tentacle.dhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®