projects
/
cascardo
/
kernel
/
notes
/
.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
First bad bad pass.
[cascardo/kernel/notes/.git]
/
03.types
/
2.kref
/
text
1
struct data {
2
...
3
struct kref ref;
4
...
5
};
6
7
kref_init(&data->kref);
8
kref_get(&data->kref);
9
kref_put(&data->kref, data_release);
10
11
void data_release(struct kref *ref)
12
{
13
struct data *data = container_of(ref, struct data, ref);
14
kfree(data);
15
}
16
17
18
TODO: kobject e kset