]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-3.16/core' into for-3.16/drivers
authorJens Axboe <axboe@fb.com>
Wed, 28 May 2014 15:50:26 +0000 (09:50 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 28 May 2014 15:50:26 +0000 (09:50 -0600)
mtip32xx uses blk_mq_alloc_reserved_request(), so pull in the
core changes so we have a properly merged end result.

Signed-off-by: Jens Axboe <axboe@fb.com>
1  2 
drivers/block/mtip32xx/mtip32xx.c
drivers/block/null_blk.c
drivers/block/skd_main.c
include/linux/blkdev.h

index ae331ab4a451588d62967264491a15125a8777e7,59c5abe32f06f055e939e5290e56055d66bd4c05..ea323e91903b30d9535767d3265f13c0e9746d56
@@@ -174,17 -173,44 +174,17 @@@ static bool mtip_check_surprise_removal
        return false; /* device present */
  }
  
 -/*
 - * Obtain an empty command slot.
 - *
 - * This function needs to be reentrant since it could be called
 - * at the same time on multiple CPUs. The allocation of the
 - * command slot must be atomic.
 - *
 - * @port Pointer to the port data structure.
 - *
 - * return value
 - *    >= 0    Index of command slot obtained.
 - *    -1      No command slots available.
 - */
 -static int get_slot(struct mtip_port *port)
 +static struct mtip_cmd *mtip_get_int_command(struct driver_data *dd)
  {
 -      int slot, i;
 -      unsigned int num_command_slots = port->dd->slot_groups * 32;
 +      struct request *rq;
  
-       rq = blk_mq_alloc_reserved_request(dd->queue, 0, __GFP_WAIT);
 -      /*
 -       * Try 10 times, because there is a small race here.
 -       *  that's ok, because it's still cheaper than a lock.
 -       *
 -       * Race: Since this section is not protected by lock, same bit
 -       * could be chosen by different process contexts running in
 -       * different processor. So instead of costly lock, we are going
 -       * with loop.
 -       */
 -      for (i = 0; i < 10; i++) {
 -              slot = find_next_zero_bit(port->allocated,
 -                                       num_command_slots, 1);
 -              if ((slot < num_command_slots) &&
 -                  (!test_and_set_bit(slot, port->allocated)))
 -                      return slot;
 -      }
 -      dev_warn(&port->dd->pdev->dev, "Failed to get a tag.\n");
++      rq = blk_mq_alloc_request(dd->queue, 0, __GFP_WAIT, true);
 +      return blk_mq_rq_to_pdu(rq);
 +}
  
 -      mtip_check_surprise_removal(port->dd->pdev);
 -      return -1;
 +static void mtip_put_int_command(struct driver_data *dd, struct mtip_cmd *cmd)
 +{
 +      blk_put_request(blk_mq_rq_from_pdu(cmd));
  }
  
  /*
Simple merge
Simple merge
Simple merge