Hi,
On 5/30/05, Andi Kleen <[email protected]> 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]