making rq_init functionality available to modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alasdair,

This patch exports rq_init in block/ll_rw_blk.c to be usable by GPL modules.

The initialization of a block request structure as done by rq_init is a
useful feature for use whenever one wishes to utilize a pre-allocated block
request structure in order to avoid deadlock potential of allocating one via
get_request.

Another patch will make use of rq_init to initialize messages sent by the
EMC CLARiiON dm-multipath hardware handler.  Without this patch, I can
easily reproduce a deadlock caused by the EMC CLARiiON hardware handler
trying to allocate a write request structure from a target queue which is
over its write queue threshold.  With this patch, I have yet to reproduce
this problem.

This capability could instead be implemented by making rq_init an inline
function available in blkdev.h.  Not sure which is best.

Ed


*** block/ll_rw_blk.c.orig	Thu Aug  3 04:03:45 2006
--- block/ll_rw_blk.c	Thu Aug  3 04:53:07 2006
***************
*** 277,283 ****
  
  EXPORT_SYMBOL(blk_queue_make_request);
  
! static inline void rq_init(request_queue_t *q, struct request *rq)
  {
  	INIT_LIST_HEAD(&rq->queuelist);
  	INIT_LIST_HEAD(&rq->donelist);
--- 277,283 ----
  
  EXPORT_SYMBOL(blk_queue_make_request);
  
! void rq_init(request_queue_t *q, struct request *rq)
  {
  	INIT_LIST_HEAD(&rq->queuelist);
  	INIT_LIST_HEAD(&rq->donelist);
***************
*** 300,305 ****
--- 300,307 ----
  	rq->completion_data = NULL;
  }
  
+ EXPORT_SYMBOL_GPL(rq_init);
+ 
  /**
   * blk_queue_ordered - does this queue support ordered writes
   * @q:        the request queue


*** include/linux/blkdev.h.orig	Thu Aug  3 04:27:26 2006
--- include/linux/blkdev.h	Thu Aug  3 04:29:24 2006
***************
*** 112,117 ****
--- 112,119 ----
  struct request;
  typedef void (rq_end_io_fn)(struct request *, int);
  
+ void rq_init(request_queue_t *q, struct request *rq);
+ 
  struct request_list {
  	int count[2];
  	int starved[2];

--

dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux