public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@gmail.com>
To: Andi Kleen <ak@suse.de>
Cc: wim.coekaerts@oracle.com, mark.fasheh@oracle.com, akpm@osdl.org,
	linux-kernel@vger.kernel.org, suparna@in.ibm.com,
	viro@parcelfarce.linux.theplanet.co.uk,
	Pekka Enberg <penberg@cs.helsinki.fi>
Subject: Re: review of ocfs2
Date: Mon, 30 May 2005 14:46:31 +0300	[thread overview]
Message-ID: <84144f0205053004468dc9a1b@mail.gmail.com> (raw)
In-Reply-To: <20050530112101.GF15326@wotan.suse.de>

Hi,

On 5/30/05, Andi Kleen <ak@suse.de> wrote:
> +static int ocfs2_do_request_vote(ocfs_super *osb,
> +                                u64 blkno,
> +                                unsigned int generation,
> +                                enum ocfs2_vote_request type,
> +                                int orphaned_slot,
> +                                struct ocfs2_net_response_cb *callback)
> ...
> +       request = kmalloc(sizeof(*request), GFP_KERNEL);
> +       if (!request) {
> +               status = -ENOMEM;
> +               mlog_errno(status);
> +               goto bail;
> +       }
> +       memset(request, 0, sizeof(*request));
> 
> kcalloc

Actually, the latest preferred form for

       kcalloc(1, sizeof(*p), GFP_KERNEL)

is the following (as suggested by Al Viro):

	request = kmalloc(sizeof(*request), GFP_KERNEL);
	if (!request) {
		status = -ENOMEM;
		mlog_errno(status);
		goto bail;
	}
	*request = (ocfs2_vote_msg) { .md1.v_generic1 = htonl(priv) };
	hdr = &request->v_hdr;

	response_id = ocfs2_new_response_id(osb);

	*hdr = (ocfs2_msg_hdr) {
		.h_response_id = htonl(response_id);
		.h_request = htonl(type);
		.h_blkno = cpu_to_be64(blkno);
		.h_generation = htonl(generation);
		.h_node_num = htonl((unsigned int) osb->node_num)
	};

                   Pekka

  reply	other threads:[~2005-05-30 11:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-30 11:21 review of ocfs2 Andi Kleen
2005-05-30 11:46 ` Pekka Enberg [this message]
2005-05-31 22:20 ` Zach Brown
2005-06-01  0:53 ` Mark Fasheh

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=84144f0205053004468dc9a1b@mail.gmail.com \
    --to=penberg@gmail.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.fasheh@oracle.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=suparna@in.ibm.com \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=wim.coekaerts@oracle.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