akaros/scripts/spatch/kref.cocci
<<
>>
Prefs
   1@  @
   2type kref;
   3identifier f;
   4expression E;
   5@@
   6-f->ref = E
   7+kref_init(&f->ref, fake_release, E)
   8
   9@  @
  10expression E;
  11@@
  12-incref(E)
  13+kref_get(&E->ref, 1)
  14
  15@  @
  16expression E;
  17@@
  18-decref(E)
  19+kref_put(&E->ref)
  20