cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 4/5] dlm: add recovery callbacks
Date: Mon, 19 Dec 2011 12:59:34 -0500	[thread overview]
Message-ID: <20111219175934.GC24652@redhat.com> (raw)
In-Reply-To: <1324298217.2723.31.camel@menhir>

On Mon, Dec 19, 2011 at 12:36:57PM +0000, Steven Whitehouse wrote:
> > +	struct dlm_lockspace_ops ls_ops;
>                     ^^^^^^^^^^ I'd suggest just keeping a pointer to
> this, see below.


> > +static int new_lockspace(const char *name, const char *cluster, uint32_t flags,
> > +			 int lvblen, struct dlm_lockspace_ops *ops,
>                                        ^^^^ this should be const


> > +	if (ops)
> > +		memcpy(&ls->ls_ops, ops, sizeof(struct dlm_lockspace_ops));
> > +
> Why not just keep a pointer to the ops? There is no need to copy them.
> 
> Also - since the ops are specific to a user of the lockspace, this
> implies that it is no longer possible to have multiple openers of the
> same lockspace on the same node. I think that needs documenting
> somewhere at least. The other possibility would be to introduce a
> structure to represent a "user of a lockspace" I suppose... 

> > +int dlm_new_lockspace(const char *name, const char *cluster, uint32_t flags,
> > +		      int lvblen, struct dlm_lockspace_ops *ops,
>                                     ^^^^ likewise this can also be const

> Please don't mix the callback arg and the functions in the same
> structure. The functions will be identical for all filesystems, where as
> the callback arg will be unique to each filesystem, so it would be
> better to just add an extra cb_arg to the new lockspace function.

I'll change all those, thanks



  reply	other threads:[~2011-12-19 17:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-16 22:03 [Cluster-devel] [PATCH 4/5] dlm: add recovery callbacks David Teigland
2011-12-19 12:36 ` Steven Whitehouse
2011-12-19 17:59   ` David Teigland [this message]
2011-12-19 16:43 ` Bob Peterson
  -- strict thread matches above, loose matches on Subject: below --
2012-01-05 16:46 David Teigland

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=20111219175934.GC24652@redhat.com \
    --to=teigland@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).