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
58 * Little endian machines
64 * Multi-endian machines
71 * include asm/byteorder.h
72 * include/linux/byteorder/generic.h
80 * All those with suffix p - use a pointer
81 * All those with suffix s - change in situ
87 * include linux/list.h
89 * Embed a struct list\\_head in your structure
90 * Use a struct list\\_head pointer to iterate
94 * INIT\\_LIST\\_HEAD - receives a pointer to the embedded list head
98 * list\\_add - receives a pointer to the element and a head
100 * list\\_del - receives only the pointer to the element
105 * list\\_entry(entry, type, member); -- uses container\\_of
106 * list\\_first\\_entry(head, type, member);
110 * list\\_for\\_each(lhptr, head);
111 * list\\_for\\_each\\_entry(iptr, head, member)
112 * list\\_for\\_each\\_safe(lhptr, head);
118 * include linux/types.h
119 * include linux/bitops.h
124 * All atomic, prefix \\_ to use non-atomic
128 * test\\_and\\_set\\_bit
129 * test\\_and\\_clear\\_bit
130 * test\\_and\\_change\\_bit
135 * find\\_first\\_zero\\_bit
138 * find\\_next\\_zero\\_bit
139 * for\\_each\\_set\\_bit