Messages in this thread | | | Date | Mon, 30 May 2005 14:46:31 +0300 | From | Pekka Enberg <> | Subject | Re: review of ocfs2 |
| |
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 - 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/
| |