disksort man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]


       disksort - single direction elevator seek sort for buffers

       #include <sys/conf.h>
       #include <sys/ddi.h>
       #include <sys/sunddi.h>

       disksort(struct diskhd *dp, struct buf *bp);

       Solaris DDI specific (Solaris DDI).

	     A	pointer	 to  a	diskhd structure. A diskhd structure is essen‐
	     tially identical to head of a buffer structure (see buf(9S)). The
	     only defined items of interest for this structure are the av_forw
	     and av_back structure elements which are  used  to	 maintain  the
	     front and tail pointers of the forward linked I/O request queue.

	     A	pointer	 to  a	buffer	structure.  Typically  this is the I/O
	     request that the driver receives in  its  strategy	 routine  (see
	     strategy(9E)).  The  driver  is  responsible for initializing the
	     b_resid structure element to a meaningful sort key value prior to
	     calling disksort().

       The  function disksort() sorts a pointer to a buffer into a single for‐
       ward linked list headed by the av_forw element of the argument *dp.

       It uses a one-way elevator algorithm that sorts buffers into the	 queue
       in  ascending  order based upon a key value held in the argument buffer
       structure element b_resid.

       This value can either be the driver calculated cylinder number for  the
       I/O  request  described	by the buffer argument, or simply the absolute
       logical block for the I/O request, depending on how  fine  grained  the
       sort  is	 desired  to  be  or  how applicable either quantity is to the
       device in question.

       The head of the linked list is found by use of  the  av_forw  structure
       element	of  the	 argument *dp. The tail of the linked list is found by
       use of the av_back structure element of the argument *dp.  The  av_forw
       element	of the *bp argument is used by disksort() to maintain the for‐
       ward linkage. The value at the head of the  list	 presumably  indicates
       the currently active disk area.

       This function can be called from user, interrupt, or kernel context.

       strategy(9E), buf(9S)

       Writing Device Drivers

       The disksort() function does no locking. Therefore, any locking is com‐
       pletely the responsibility of the caller.

				 Jan 16, 2006			  DISKSORT(9F)

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net