Lines Matching refs:you
2 krefs allow you to add reference counters to your objects. If you
4 you don't have refcounts, your code is almost certainly broken. If
5 you want refcounts, krefs are the way to go.
20 You must initialize the kref after you allocate it. To do this, call
32 Once you have an initialized kref, you must follow the following
35 1) If you make a non-temporary copy of a pointer, especially if
36 it can be passed to another thread of execution, you must
39 If you already have a valid pointer to a kref-ed structure (the
40 refcount cannot go to zero) you may do this without a lock.
42 2) When you are done with a pointer, you must call kref_put():
55 For example, if you allocate some data and then pass it to another
116 Don't assume you know what you are doing and use the above construct.
117 First of all, you may not know what you are doing. Second, you may
118 know what you are doing (there are some situations where locking is
123 There are some situations where you can optimize the gets and puts.
124 For instance, if you are done with an object and enqueuing it for
140 instance, you have a list of items that are each kref-ed, and you wish
142 and kref_get() it. That violates rule 3 because you are not already
181 The kref_put() return value is useful if you do not want to hold the
182 lock during the whole release operation. Say you didn't want to call
202 This is really more useful if you have to call other routines as part
253 return value. If you are sure (by already having a valid pointer) that