Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 375036
b: refs/heads/master
c: 13c3b0f
h: refs/heads/master
v: v3
  • Loading branch information
Vishal Verma authored and Matthew Wilcox committed Mar 27, 2013
1 parent fa9a6d8 commit a2ded79
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 56 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 729dd1bd802acb973eec9c73ccb87d3143c13937
refs/heads/master: 13c3b0fcc8e33ba49f252378f6e7290b146042af
55 changes: 0 additions & 55 deletions trunk/drivers/block/nvme-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#define SQ_SIZE(depth) (depth * sizeof(struct nvme_command))
#define CQ_SIZE(depth) (depth * sizeof(struct nvme_completion))
#define NVME_MINORS 64
#define NVME_IO_TIMEOUT (5 * HZ)
#define ADMIN_TIMEOUT (60 * HZ)

static int nvme_major;
Expand All @@ -59,44 +58,6 @@ static DEFINE_SPINLOCK(dev_list_lock);
static LIST_HEAD(dev_list);
static struct task_struct *nvme_thread;

/*
* Represents an NVM Express device. Each nvme_dev is a PCI function.
*/
struct nvme_dev {
struct list_head node;
struct nvme_queue **queues;
u32 __iomem *dbs;
struct pci_dev *pci_dev;
struct dma_pool *prp_page_pool;
struct dma_pool *prp_small_pool;
int instance;
int queue_count;
int db_stride;
u32 ctrl_config;
struct msix_entry *entry;
struct nvme_bar __iomem *bar;
struct list_head namespaces;
char serial[20];
char model[40];
char firmware_rev[8];
u32 max_hw_sectors;
u16 oncs;
};

/*
* An NVM Express namespace is equivalent to a SCSI LUN
*/
struct nvme_ns {
struct list_head list;

struct nvme_dev *dev;
struct request_queue *queue;
struct gendisk *disk;

int ns_id;
int lba_shift;
};

/*
* An NVM Express queue. Each device has at least two (one for admin
* commands and one for I/O commands).
Expand Down Expand Up @@ -295,22 +256,6 @@ static int nvme_submit_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd)
return 0;
}

/*
* The nvme_iod describes the data in an I/O, including the list of PRP
* entries. You can't see it in this data structure because C doesn't let
* me express that. Use nvme_alloc_iod to ensure there's enough space
* allocated to store the PRP list.
*/
struct nvme_iod {
void *private; /* For the use of the submitter of the I/O */
int npages; /* In the PRP list. 0 means small pool in use */
int offset; /* Of PRP list */
int nents; /* Used in scatterlist */
int length; /* Of data, in bytes */
dma_addr_t first_dma;
struct scatterlist sg[0];
};

static __le64 **iod_list(struct nvme_iod *iod)
{
return ((void *)iod) + iod->offset;
Expand Down
60 changes: 60 additions & 0 deletions trunk/include/linux/nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -493,4 +493,64 @@ struct nvme_admin_cmd {
#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)

#ifdef __KERNEL__
#include <linux/pci.h>

#define NVME_IO_TIMEOUT (5 * HZ)

/*
* Represents an NVM Express device. Each nvme_dev is a PCI function.
*/
struct nvme_dev {
struct list_head node;
struct nvme_queue **queues;
u32 __iomem *dbs;
struct pci_dev *pci_dev;
struct dma_pool *prp_page_pool;
struct dma_pool *prp_small_pool;
int instance;
int queue_count;
int db_stride;
u32 ctrl_config;
struct msix_entry *entry;
struct nvme_bar __iomem *bar;
struct list_head namespaces;
char serial[20];
char model[40];
char firmware_rev[8];
u32 max_hw_sectors;
u16 oncs;
};

/*
* An NVM Express namespace is equivalent to a SCSI LUN
*/
struct nvme_ns {
struct list_head list;

struct nvme_dev *dev;
struct request_queue *queue;
struct gendisk *disk;

int ns_id;
int lba_shift;
};

/*
* The nvme_iod describes the data in an I/O, including the list of PRP
* entries. You can't see it in this data structure because C doesn't let
* me express that. Use nvme_alloc_iod to ensure there's enough space
* allocated to store the PRP list.
*/
struct nvme_iod {
void *private; /* For the use of the submitter of the I/O */
int npages; /* In the PRP list. 0 means small pool in use */
int offset; /* Of PRP list */
int nents; /* Used in scatterlist */
int length; /* Of data, in bytes */
dma_addr_t first_dma;
struct scatterlist sg[0];
};
#endif

#endif /* _LINUX_NVME_H */

0 comments on commit a2ded79

Please sign in to comment.