All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin McCabe <cmccabe@alumni.cmu.edu>
To: Sage Weil <sage@newdream.net>
Cc: ceph-devel@vger.kernel.org
Subject: Re: librados compound operations
Date: Mon, 28 Mar 2011 18:29:30 -0700	[thread overview]
Message-ID: <AANLkTin9P9UMSmKPmVwMCSBjPMQ6zGKVamzUbQaPmkVJ@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1103281539580.17288@cobra.newdream.net>

On Mon, Mar 28, 2011 at 3:46 PM, Sage Weil <sage@newdream.net> wrote:
> Below is a patch that wraps the internal Objecter compound ObjectOperation
> so that we can send compound operations to the OSDs via librados.
>
> The internal ObjectOperationImpl ends up being unnecessary; I just cast it
> to the internal type directly.
>
> One weird thing I noticed is with the constructor.  In Rados:: did
>
> +    static ObjectOperation *operation_create();
>
> and the user then deletes it when they're done (after using it for one or
> more calls to operate() or aio_operate()).  Is that the the approach we
> want?  Because right above that in the header is
>
>     int ioctx_create(const char *name, IoCtx &pioctx);
>

I second TV's argument that returning a detailed error code is better
than returning NULL or not-NULL.

I also don't like calling conventions that always use dynamic memory
allocation. Even on a shiny new 16-core system, there is still a
global mutex around new()/free(). I also like putting stuff on the
stack and using RAII. (I haven't looked at this new code enough to see
whether RAII makes sense here though.)

If we do go with the new/free based approach, I guess we need another
function to call free() on it, because the library user might be using
a different libc.

cheers,
Colin
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-03-29  1:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 22:46 librados compound operations Sage Weil
2011-03-28 23:41 ` Tommi Virtanen
2011-03-28 23:53   ` Sage Weil
2011-03-29  1:29 ` Colin McCabe [this message]
2011-03-29 16:27   ` Sage Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTin9P9UMSmKPmVwMCSBjPMQ6zGKVamzUbQaPmkVJ@mail.gmail.com \
    --to=cmccabe@alumni.cmu.edu \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@newdream.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.