'\" t .\" Title: kfifo_alloc .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: FIFO Buffer .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "KFIFO_ALLOC" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "FIFO Buffer" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" kfifo_alloc \- dynamically allocates a new fifo buffer .SH "SYNOPSIS" .HP \w'kfifo_alloc('u .BI "kfifo_alloc(" "fifo" ", " "size" ", " "gfp_mask" ");" .SH "ARGUMENTS" .PP \fIfifo\fR .RS 4 pointer to the fifo .RE .PP \fIsize\fR .RS 4 the number of elements in the fifo, this must be a power of 2 .RE .PP \fIgfp_mask\fR .RS 4 get_free_pages mask, passed to \fBkmalloc\fR .RE .SH "DESCRIPTION" .PP This macro dynamically allocates a new fifo buffer\&. .PP The numer of elements will be rounded\-up to a power of 2\&. The fifo will be release with \fBkfifo_free\fR\&. Return 0 if no error, otherwise an error code\&. .SH "COPYRIGHT" .br