@@ -223,7 +223,7 @@ static void blk_mq_rq_ctx_init(struct request_queue *q, struct blk_mq_ctx *ctx,
rq->end_io = NULL;
rq->end_io_data = NULL;
rq->next_rq = NULL;
-#if CONFIG_BLK_DEV_NVM
+#ifdef CONFIG_BLK_DEV_NVM
rq->phys_sector = 0;
#endif
@@ -294,9 +294,9 @@ extern void blk_nvm_unregister(struct request_queue *);
extern int blk_nvm_init_sysfs(struct device *);
extern void blk_nvm_remove_sysfs(struct device *);
#else
-static void blk_nvm_unregister(struct request_queue *q) { }
-static int blk_nvm_init_sysfs(struct device *) { return 0; }
-static void blk_nvm_remove_sysfs(struct device *) { }
+static inline void blk_nvm_unregister(struct request_queue *q) { }
+static inline int blk_nvm_init_sysfs(struct device *dev) { return 0; }
+static inline void blk_nvm_remove_sysfs(struct device *dev) { }
#endif /* CONFIG_BLK_DEV_NVM */
#endif /* BLK_INTERNAL_H */
@@ -209,7 +209,7 @@ struct request {
/* for bidi */
struct request *next_rq;
-#if CONFIG_BLK_DEV_NVM
+#ifdef CONFIG_BLK_DEV_NVM
sector_t phys_sector;
#endif
};
@@ -914,11 +914,6 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
return blk_rq_cur_bytes(rq) >> 9;
}
-static inline sector_t blk_rq_phys_pos(const struct request *rq)
-{
- return rq->phys_sector;
-}
-
static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q,
unsigned int cmd_flags)
{
@@ -1780,35 +1775,32 @@ static inline struct nvm_dev *blk_nvm_get_dev(struct request_queue *q)
return q->nvm;
}
#else
+struct nvm_dev;
struct nvm_dev_ops;
struct nvm_lun;
struct nvm_block;
struct nvm_target_type;
-struct nvm_target_type *nvm_find_target_type(const char *)
+static inline struct nvm_target_type *nvm_find_target_type(const char *name)
{
return NULL;
}
-int nvm_register_target(struct nvm_target_type *tt) { return -EINVAL; }
-void nvm_unregister_target(struct nvm_target_type *tt) {}
-static inline int blk_nvm_register(struct request_queue *,
- struct nvm_dev_ops *)
+static inline int nvm_register_target(struct nvm_target_type *tt) { return -EINVAL; }
+static inline void nvm_unregister_target(struct nvm_target_type *tt) {}
+static inline int blk_nvm_register(struct request_queue *q,
+ struct nvm_dev_ops *ops)
{
return -EINVAL;
}
-static inline struct nvm_block *blk_nvm_get_blk(struct nvm_lun *, int)
+static inline struct nvm_block *blk_nvm_get_blk(struct nvm_lun *lun, int is_gc)
{
return NULL;
}
-static inline void blk_nvm_put_blk(struct nvm_block *) {}
-static inline int blk_nvm_erase_blk(struct nvm_dev *, struct nvm_block *)
+static inline void blk_nvm_put_blk(struct nvm_block *block) {}
+static inline int blk_nvm_erase_blk(struct nvm_dev *dev, struct nvm_block *blok)
{
return -EINVAL;
}
-static inline int blk_nvm_get_dev(struct request_queue *)
-{
- return NULL;
-}
static inline sector_t blk_nvm_alloc_addr(struct nvm_block *block)
{
return 0;