.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "KREF_PUT" "9" "09 October 2005" "" ""
.SH NAME
kref_put \- decrement refcount for object.
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
int kref_put (struct kref * \fIkref\fB, void (*\fIrelease\fB)
struct kref *kref);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIkref\fB\fR
object.
.TP
\fB\fIrelease\fB\fR
pointer to the function that will clean up the object when the
last reference to the object is released.
This pointer is required, and it is not acceptable to pass kfree
in as this function.
.SH "DESCRIPTION"
.PP
Decrement the refcount, and if 0, call \fBrelease\fR\&.
Return 1 if the object was removed, otherwise return 0. Beware, if this
function returns 0, you still can not count on the kref from remaining in
memory. Only use the return value if you want to see if the kref is now
gone, not present.