Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1282893

Re: linux-next: build failure after merge of the block tree

From Matias Bjørling <m@bjorling.me>
Newsgroups linux.kernel
Subject Re: linux-next: build failure after merge of the block tree
Date 2015-12-03 11:10 +0100
Message-ID <qByZP-3zg-5@gated-at.bofh.it> (permalink)
References (2 earlier) <qBmP1-47N-47@gated-at.bofh.it> <qBxAM-2vK-51@gated-at.bofh.it> <qBy3M-2WY-17@gated-at.bofh.it> <qByQa-3g4-19@gated-at.bofh.it> <qByQa-3g4-21@gated-at.bofh.it>
Organization Paletta

Show all headers | View raw



On 12/03/2015 10:57 AM, Christoph Hellwig wrote:
> On Thu, Dec 03, 2015 at 10:52:46AM +0100, Matias Bjørling wrote:
>> The identify geometry command and bad block commands are part of the admin
>> command set. Surely, as all these take a ns id, they can be moved and be
>> accessed naturally through the user queues.
>
> Nah, these admin commands should go through the admin queue - but
> having a request_queue as the argument to the callback just seems rather
> off if it's not the right one.  Why can't you just pass the 'struct nvm_dev'
> instead of the request_queue for these methods?
>

That'll work as well.

Similar to this?

diff --git i/drivers/lightnvm/core.c w/drivers/lightnvm/core.c
index 86ce887..4a8d1fe 100644
--- i/drivers/lightnvm/core.c
+++ w/drivers/lightnvm/core.c
@@ -74,7 +74,7 @@ EXPORT_SYMBOL(nvm_unregister_target);
  void *nvm_dev_dma_alloc(struct nvm_dev *dev, gfp_t mem_flags,
  							dma_addr_t *dma_handler)
  {
-	return dev->ops->dev_dma_alloc(dev->q, dev->ppalist_pool, mem_flags,
+	return dev->ops->dev_dma_alloc(dev, dev->ppalist_pool, mem_flags,
  								dma_handler);
  }
  EXPORT_SYMBOL(nvm_dev_dma_alloc);
@@ -246,7 +246,7 @@ static int nvm_init(struct nvm_dev *dev)
  	if (!dev->q || !dev->ops)
  		return ret;

-	if (dev->ops->identity(dev->q, &dev->identity)) {
+	if (dev->ops->identity(dev, &dev->identity)) {
  		pr_err("nvm: device could not be identified\n");
  		goto err;
  	}
@@ -326,8 +326,7 @@ int nvm_register(struct request_queue *q, char 
*disk_name,
  	}

  	if (dev->ops->max_phys_sect > 1) {
-		dev->ppalist_pool = dev->ops->create_dma_pool(dev->q,
-								"ppalist");
+		dev->ppalist_pool = dev->ops->create_dma_pool(dev, "ppalist");
  		if (!dev->ppalist_pool) {
  			pr_err("nvm: could not create ppa pool\n");
  			ret = -ENOMEM;
diff --git i/drivers/nvme/host/lightnvm.c w/drivers/nvme/host/lightnvm.c
index 762c9a7..15f2acb 100644
--- i/drivers/nvme/host/lightnvm.c
+++ w/drivers/nvme/host/lightnvm.c
@@ -271,9 +271,9 @@ static int init_grps(struct nvm_id *nvm_id, struct 
nvme_nvm_id *nvme_nvm_id)
  	return 0;
  }

-static int nvme_nvm_identity(struct request_queue *q, struct nvm_id 
*nvm_id)
+static int nvme_nvm_identity(struct nvm_dev *nvmdev, struct nvm_id *nvm_id)
  {
-	struct nvme_ns *ns = q->queuedata;
+	struct nvme_ns *ns = nvmdev->q->queuedata;
  	struct nvme_dev *dev = ns->dev;
  	struct nvme_nvm_id *nvme_nvm_id;
  	struct nvme_nvm_command c = {};
@@ -308,10 +308,10 @@ out:
  	return ret;
  }

-static int nvme_nvm_get_l2p_tbl(struct request_queue *q, u64 slba, u32 nlb,
+static int nvme_nvm_get_l2p_tbl(struct nvm_dev *nvmdev, u64 slba, u32 nlb,
  				nvm_l2p_update_fn *update_l2p, void *priv)
  {
-	struct nvme_ns *ns = q->queuedata;
+	struct nvme_ns *ns = nvmdev->q->queuedata;
  	struct nvme_dev *dev = ns->dev;
  	struct nvme_nvm_command c = {};
  	u32 len = queue_max_hw_sectors(dev->admin_q) << 9;
@@ -415,10 +415,10 @@ out:
  	return ret;
  }

-static int nvme_nvm_set_bb_tbl(struct request_queue *q, struct nvm_rq *rqd,
+static int nvme_nvm_set_bb_tbl(struct nvm_dev *nvmdev, struct nvm_rq *rqd,
  								int type)
  {
-	struct nvme_ns *ns = q->queuedata;
+	struct nvme_ns *ns = nvmdev->q->queuedata;
  	struct nvme_dev *dev = ns->dev;
  	struct nvme_nvm_command c = {};
  	int ret = 0;
@@ -463,8 +463,9 @@ static void nvme_nvm_end_io(struct request *rq, int 
error)
  	blk_mq_free_request(rq);
  }

-static int nvme_nvm_submit_io(struct request_queue *q, struct nvm_rq *rqd)
+static int nvme_nvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
  {
+	struct request_queue *q = dev->q;
  	struct nvme_ns *ns = q->queuedata;
  	struct request *rq;
  	struct bio *bio = rqd->bio;
@@ -502,8 +503,9 @@ static int nvme_nvm_submit_io(struct request_queue 
*q, struct nvm_rq *rqd)
  	return 0;
  }

-static int nvme_nvm_erase_block(struct request_queue *q, struct nvm_rq 
*rqd)
+static int nvme_nvm_erase_block(struct nvm_dev *dev, struct nvm_rq *rqd)
  {
+	struct request_queue *q = dev->q;
  	struct nvme_ns *ns = q->queuedata;
  	struct nvme_nvm_command c = {};

@@ -515,9 +517,9 @@ static int nvme_nvm_erase_block(struct request_queue 
*q, struct nvm_rq *rqd)
  	return nvme_submit_sync_cmd(q, (struct nvme_command *)&c, NULL, 0);
  }

-static void *nvme_nvm_create_dma_pool(struct request_queue *q, char *name)
+static void *nvme_nvm_create_dma_pool(struct nvm_dev *nvmdev, char *name)
  {
-	struct nvme_ns *ns = q->queuedata;
+	struct nvme_ns *ns = nvmdev->q->queuedata;
  	struct nvme_dev *dev = ns->dev;

  	return dma_pool_create(name, dev->dev, PAGE_SIZE, PAGE_SIZE, 0);
@@ -530,7 +532,7 @@ static void nvme_nvm_destroy_dma_pool(void *pool)
  	dma_pool_destroy(dma_pool);
  }

-static void *nvme_nvm_dev_dma_alloc(struct request_queue *q, void *pool,
+static void *nvme_nvm_dev_dma_alloc(struct nvm_dev *dev, void *pool,
  				    gfp_t mem_flags, dma_addr_t *dma_handler)
  {
  	return dma_pool_alloc(pool, mem_flags, dma_handler);
diff --git i/include/linux/lightnvm.h w/include/linux/lightnvm.h
index 935ef38..034117b 100644
--- i/include/linux/lightnvm.h
+++ w/include/linux/lightnvm.h
@@ -183,17 +183,17 @@ struct nvm_block;

  typedef int (nvm_l2p_update_fn)(u64, u32, __le64 *, void *);
  typedef int (nvm_bb_update_fn)(struct ppa_addr, int, u8 *, void *);
-typedef int (nvm_id_fn)(struct request_queue *, struct nvm_id *);
-typedef int (nvm_get_l2p_tbl_fn)(struct request_queue *, u64, u32,
+typedef int (nvm_id_fn)(struct nvm_dev *, struct nvm_id *);
+typedef int (nvm_get_l2p_tbl_fn)(struct nvm_dev *, u64, u32,
  				nvm_l2p_update_fn *, void *);
  typedef int (nvm_op_bb_tbl_fn)(struct nvm_dev *, struct ppa_addr, int,
  				nvm_bb_update_fn *, void *);
-typedef int (nvm_op_set_bb_fn)(struct request_queue *, struct nvm_rq *, 
int);
-typedef int (nvm_submit_io_fn)(struct request_queue *, struct nvm_rq *);
-typedef int (nvm_erase_blk_fn)(struct request_queue *, struct nvm_rq *);
-typedef void *(nvm_create_dma_pool_fn)(struct request_queue *, char *);
+typedef int (nvm_op_set_bb_fn)(struct nvm_dev *, struct nvm_rq *, int);
+typedef int (nvm_submit_io_fn)(struct nvm_dev *, struct nvm_rq *);
+typedef int (nvm_erase_blk_fn)(struct nvm_dev *, struct nvm_rq *);
+typedef void *(nvm_create_dma_pool_fn)(struct nvm_dev *, char *);
  typedef void (nvm_destroy_dma_pool_fn)(void *);
-typedef void *(nvm_dev_dma_alloc_fn)(struct request_queue *, void *, gfp_t,
+typedef void *(nvm_dev_dma_alloc_fn)(struct nvm_dev *, void *, gfp_t,
  								dma_addr_t *);
  typedef void (nvm_dev_dma_free_fn)(void *, void*, dma_addr_t);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

linux-next: build failure after merge of the block tree Mark Brown <broonie@kernel.org> - 2015-12-02 17:20 +0100
  Re: linux-next: build failure after merge of the block tree Christoph Hellwig <hch@lst.de> - 2015-12-02 17:50 +0100
    Re: linux-next: build failure after merge of the block tree Jens Axboe <axboe@kernel.dk> - 2015-12-02 22:10 +0100
      Re: linux-next: build failure after merge of the block tree Keith Busch <keith.busch@intel.com> - 2015-12-02 22:20 +0100
        Re: linux-next: build failure after merge of the block tree Jens Axboe <axboe@kernel.dk> - 2015-12-02 22:40 +0100
          Re: linux-next: build failure after merge of the block tree Christoph Hellwig <hch@lst.de> - 2015-12-03 08:40 +0100
      Re: linux-next: build failure after merge of the block tree Matias Bjørling <m@bjorling.me> - 2015-12-03 09:40 +0100
        Re: linux-next: build failure after merge of the block tree Christoph Hellwig <hch@lst.de> - 2015-12-03 10:10 +0100
          Re: linux-next: build failure after merge of the block tree Christoph Hellwig <hch@lst.de> - 2015-12-03 11:00 +0100
            Re: linux-next: build failure after merge of the block tree Matias Bjørling <m@bjorling.me> - 2015-12-03 11:10 +0100
              Re: linux-next: build failure after merge of the block tree Christoph Hellwig <hch@lst.de> - 2015-12-03 11:30 +0100
                Re: linux-next: build failure after merge of the block tree Matias Bjørling <m@bjorling.me> - 2015-12-03 12:10 +0100
                Re: linux-next: build failure after merge of the block tree Christoph Hellwig <hch@lst.de> - 2015-12-03 17:50 +0100
                Re: linux-next: build failure after merge of the block tree Matias Bjørling <m@bjorling.me> - 2015-12-04 13:20 +0100
          Re: linux-next: build failure after merge of the block tree Matias Bjørling <m@bjorling.me> - 2015-12-03 11:00 +0100

csiph-web