[lkml]   [2009]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 05/24] ceph: ref counted buffer
On Friday 04 December 2009, Sage Weil wrote:
> struct ceph_buffer is a simple ref-counted buffer. We transparently
> choose between kmalloc for small buffers and vmalloc for large ones.
> This is currently used only for allocating memory for xattr data.

Could you wrap parts of this refcounting logic around kref?
see #include <linux/kref.h> and lib/kref.c

It avoids a bug with memory areas for free and if anybody
optimizes or changes refcounting stuff, you get all changes for free :-)

Best Regards

Ingo Oeser

 \ /
  Last update: 2009-12-05 02:35    [W:0.096 / U:0.624 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site