unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (NetBSD-2.0)
Page:
Section:
Apropos / Subsearch:
optional field

BUFQ(9)                  BSD Kernel Developer's Manual                 BUFQ(9)

NAME
     bufq, bufq_state, bufq_alloc, bufq_free, BUFQ_PUT, BUFQ_GET, BUFQ_PEEK --
     device buffer queues

SYNOPSIS
     #include <&lt;buf.h>&gt;

     void
     bufq_alloc(struct bufq_state *bufq, int flags);

     void
     bufq_free(struct bufq_state *bufq);

     void
     BUFQ_PUT(struct bufq_state *bufq, struct buf *bp);

     struct buf *
     BUFQ_GET(struct bufq_state *bufq);

     struct buf *
     BUFQ_PEEK(struct bufq_state *bufq);

DESCRIPTION
     The bufq subsystem is a set of operations for the management of device
     buffer queues.

     The primary data type for using the operations is the bufq_state struc-
     ture in buf.h:

     struct bufq_state {
             void (*bq_put)(struct bufq_state *, struct buf *);
             struct buf *(*bq_get)(struct bufq_state *, int);
             void *bq_private;
             int bq_flags;           /* Flags from bufq_alloc() */
     };

     Valid values for the flags argument are:

           BUFQ_SORT_RAWBLOCK  sort by b_rawblkno
           BUFQ_SORT_CYLINDER  sort by b_cylinder and then by b_rawblkno
           BUFQ_FCFS           queue strategy is first-come first-serve
           BUFQ_DISKSORT       queue strategy is min seek sort
           BUFQ_READ_PRIO      queue strategy is min seek sort for writes and
                               first-come first-serve for reads with read pri-
                               ority

FUNCTIONS
     bufq_alloc(bufq, flags)
              Initialize a bufq_state descriptor.  The argument flags controls
              the strategy and sort order.

     bufq_free(bufq)
              Destroy a bufq_state descriptor.

     BUFQ_PUT(bufq, bp)
              Put the buf bp in the queue.

     BUFQ_GET(bufq)
              Get the next buf from the queue and remove it from the queue.
              Returns NULL if the queue is empty.

     BUFQ_PEEK(bufq)
              Get the next buf from the queue without removal.  The next buf
              will remain the same until BUFQ_GET() is called.  Returns NULL
              if the queue is empty.

CODE REFERENCES
     The actual code implementing the device buffer queues can be found in the
     file sys/kern/subr_disk.c.

HISTORY
     The bufq subsystem appeared in NetBSD 2.0.

AUTHORS
     The bufq subsystem was written by Juergen Hannken-Illjes
     <hannkenATNetBSD.org>.

BSD                              July 16, 2002                             BSD