6 * include/linux/kernel.h
22 * Documentation/kref.txt
27 * kref\\_init - struct kref pointer
28 * kref\\_get - struct kref pointer
29 * kref\\_put - struct kref pointer and release function
33 * Embed struct kref into your own structure
34 * Do not forget to call kref\\_init when initializing your structure
35 * Pass a release function as parameter to kref\\_put, where you release your
37 * Follow the rules for calling kref\\_get and kref\\_put
41 * Must increment count if passing a non-temporary copy
42 * May increment count without a lock if already has a valid pointer
43 * Must decrement when done with the pointer
44 * If code never tries to get a ref without a valid pointer, may be done without
46 * Must serialize getting a ref without a valid pointer with putting a ref
50 * include linux/types.h
51 * sXX, where XX is 8, 16, 32 or 64
56 # Little endian and Big endian
59 * Little endian machines
64 * Multi-endian machines
69 * include asm/byteorder.h
70 * include/linux/byteorder/generic.h
78 * All those with suffix p - use a pointer
79 * All those with suffix s - change in situ
85 * include linux/list.h
87 * Embed a struct list\\_head in your structure
88 * Use a struct list\\_head pointer to iterate
92 * INIT\\_LIST\\_HEAD - receives a pointer to the embedded list head
96 * list\\_add - receives a pointer to the element and a head
98 * list\\_del - receives only the pointer to the element
103 * list\\_entry(entry, type, member); -- uses container\\_of
104 * list\\_first\\_entry(head, type, member);
108 * list\\_for\\_each(lhptr, head);
109 * list\\_for\\_each\\_entry(iptr, head, member)
110 * list\\_for\\_each\\_safe(lhptr, head);
116 * include linux/types.h
117 * include linux/bitops.h
122 * All atomic, prefix \\_ to use non-atomic
126 * test\\_and\\_set\\_bit
127 * test\\_and\\_clear\\_bit
128 * test\\_and\\_change\\_bit
133 * find\\_first\\_zero\\_bit
136 * find\\_next\\_zero\\_bit
137 * for\\_each\\_set\\_bit