Conversion macros and krefs.
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sun, 16 May 2010 16:50:52 +0000 (13:50 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sun, 16 May 2010 16:50:52 +0000 (13:50 -0300)
03types/types [new file with mode: 0644]

diff --git a/03types/types b/03types/types
new file mode 100644 (file)
index 0000000..3102753
--- /dev/null
@@ -0,0 +1,56 @@
+%Data Types
+%Thadeu Cascardo
+
+# Macros
+
+* include/linux/kernel.h
+* ARRAY\\_SIZE
+* FIELD\\_SIZEOF
+* ALIGN
+* PTR\\_ALIGN
+* IS\\_ALIGNED
+
+# More macros
+
+* container\\_of
+* offsetof
+
+# krefs
+
+Reference:
+
+* Documentation/kref.txt
+
+# API
+
+* struct kref
+* kref\\_init - struct kref pointer
+* kref\\_get - struct kref pointer
+* kref\\_put - struct kref pointer and release function
+
+# Usage
+
+* Embed struct kref into your own structure
+* Do not forget to call kref\\_init when initializing your structure
+* Pass a release function as parameter to kref\\_put, where you release your
+  structure
+* Follow the rules for calling kref\\_get and kref\\_put
+
+# Rules
+
+* Must increment count if passing a non-temporary copy
+* May increment count without a lock if already has a valid pointer
+* Must decrement when done with the pointer
+* If code never tries to get a ref without a valid pointer, may be done without
+  a lock
+* Must serialize getting a ref without a valid pointer with putting a ref
+
+# Endianness
+
+# Lists
+
+# Bitmaps
+
+# Trees and hashes
+
+# Other data types