lkml.org 
[lkml]   [2006]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC][PATCH 1/5] Virtualization/containers: startup
    From
    Date
    On Fri, 2006-02-03 at 19:58 +0300, Kirill Korotaev wrote:

    > +static inline vps_t get_vps(vps_t vps)
    > +{
    > + atomic_inc(&vps->refcnt);
    > + return vps;
    > +}
    > +
    > +static inline void put_vps(vps_t vps)
    > +{
    > + atomic_dec(&vps->refcnt);
    > +}

    I'm not too sure about the refcounting here .. you never destroy the
    object ? Also, why introduce your own refcounting mecanism instead of
    using existing ones ? You could probably use at least a kref to get a
    nice refcount + destructor instead of home made atomics based. Maybe
    some higher level structure if you think it makes sense (not too sure
    what this virtualization stuff is about so I can't comment on what data
    structure is appropriate here).

    Cheers,
    Ben.


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-02-06 02:01    [W:2.450 / U:0.104 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site