From: Ravikiran G Thirumalai <kiran@in.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>,
dipankar@in.ibm.com, viro@parcelfarce.linux.theplanet.co.uk
Subject: Re: [patchset] Lockfree fd lookup 1 of 5
Date: Mon, 2 Aug 2004 15:43:52 +0530 [thread overview]
Message-ID: <20040802101350.GC4385@vitalstatistix.in.ibm.com> (raw)
In-Reply-To: <20040802101053.GB4385@vitalstatistix.in.ibm.com>
Here's the first patch. This patch 'shrinks' struct kref by removing
the release pointer in the struct kref. GregKH has applied this to his tree
Thanks,
Kiran
D:
D: Signed-off-by: Ravikiran Thirumalai <kiran@in.ibm.com>
D:
D: kref-merged-2.6.7.patch:
D: This patch is the kref shrinkage patch which GregKH has agreed to include,
D: and has applied to his tree which he will push into mainline.
D:
diff -ruN -X dontdiff2 linux-2.6.7/include/linux/kref.h files_struct-kref-2.6.7/include/linux/kref.h
--- linux-2.6.7/include/linux/kref.h 2004-06-16 10:48:59.000000000 +0530
+++ files_struct-kref-2.6.7/include/linux/kref.h 2004-07-26 16:38:23.604361208 +0530
@@ -21,12 +21,11 @@
struct kref {
atomic_t refcount;
- void (*release)(struct kref *kref);
};
-void kref_init(struct kref *kref, void (*release)(struct kref *));
+void kref_init(struct kref *kref);
struct kref *kref_get(struct kref *kref);
-void kref_put(struct kref *kref);
+void kref_put(struct kref *kref, void (*release) (struct kref *kref));
#endif /* _KREF_H_ */
diff -ruN -X dontdiff2 linux-2.6.7/lib/kref.c files_struct-kref-2.6.7/lib/kref.c
--- linux-2.6.7/lib/kref.c 2004-06-16 10:50:26.000000000 +0530
+++ files_struct-kref-2.6.7/lib/kref.c 2004-07-26 16:52:11.617484080 +0530
@@ -19,15 +19,10 @@
/**
* kref_init - initialize object.
* @kref: object in question.
- * @release: pointer to a function that will clean up the object
- * when the last reference to the object is released.
- * This pointer is required.
*/
-void kref_init(struct kref *kref, void (*release)(struct kref *kref))
+void kref_init(struct kref *kref)
{
- WARN_ON(release == NULL);
atomic_set(&kref->refcount,1);
- kref->release = release;
}
/**
@@ -44,14 +39,18 @@
/**
* kref_put - decrement refcount for object.
* @kref: object.
+ * @release: pointer to the function that will clean up the object
+ * when the last reference to the object is released.
+ * This pointer is required.
*
- * Decrement the refcount, and if 0, call kref->release().
+ * Decrement the refcount, and if 0, call release().
*/
-void kref_put(struct kref *kref)
+void kref_put(struct kref *kref, void (*release) (struct kref *kref))
{
+ WARN_ON(release == NULL);
if (atomic_dec_and_test(&kref->refcount)) {
pr_debug("kref cleaning up\n");
- kref->release(kref);
+ release(kref);
}
}
next prev parent reply other threads:[~2004-08-02 10:16 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-02 10:10 [patchset] Lockfree fd lookup 0 " Ravikiran G Thirumalai
2004-08-02 10:13 ` Ravikiran G Thirumalai [this message]
2004-08-02 13:38 ` [patchset] Lockfree fd lookup 1 " Christoph Hellwig
2004-08-02 16:12 ` viro
2004-08-03 0:44 ` Greg KH
2004-08-02 10:16 ` [patchset] Lockfree fd lookup 2 " Ravikiran G Thirumalai
2004-08-03 0:43 ` Greg KH
2004-08-03 6:28 ` Ravikiran G Thirumalai
2004-08-03 6:44 ` Greg KH
2004-08-03 7:41 ` Ravikiran G Thirumalai
2004-08-02 10:18 ` [patchset] Lockfree fd lookup 0 " Ravikiran G Thirumalai
2004-08-02 10:20 ` [patchset] Lockfree fd lookup 4 " Ravikiran G Thirumalai
2004-08-02 10:23 ` [patchset] Lockfree fd lookup 5 " Ravikiran G Thirumalai
2004-08-02 16:56 ` [patchset] Lockfree fd lookup 0 " viro
2004-08-02 20:07 ` David S. Miller
2004-08-02 21:01 ` William Lee Irwin III
2004-08-02 23:15 ` David S. Miller
2004-08-03 2:04 ` William Lee Irwin III
2004-08-03 9:23 ` Ravikiran G Thirumalai
2004-08-03 9:35 ` Ravikiran G Thirumalai
2004-08-03 10:17 ` Dipankar Sarma
2004-08-03 10:06 ` viro
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=20040802101350.GC4385@vitalstatistix.in.ibm.com \
--to=kiran@in.ibm.com \
--cc=akpm@osdl.org \
--cc=dipankar@in.ibm.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
/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®