• Home
  • Raw
  • Download

Lines Matching refs:pblk

126 	struct pblk *pblk;  member
133 struct pblk *pblk; member
433 struct pblk *pblk; member
592 struct pblk { struct
702 struct pblk *pblk; argument
711 #define pblk_err(pblk, fmt, ...) \ argument
712 pr_err("pblk %s: " fmt, pblk->disk->disk_name, ##__VA_ARGS__)
713 #define pblk_info(pblk, fmt, ...) \ argument
714 pr_info("pblk %s: " fmt, pblk->disk->disk_name, ##__VA_ARGS__)
715 #define pblk_warn(pblk, fmt, ...) \ argument
716 pr_warn("pblk %s: " fmt, pblk->disk->disk_name, ##__VA_ARGS__)
717 #define pblk_debug(pblk, fmt, ...) \ argument
718 pr_debug("pblk %s: " fmt, pblk->disk->disk_name, ##__VA_ARGS__)
764 struct nvm_rq *pblk_alloc_rqd(struct pblk *pblk, int type);
765 void pblk_free_rqd(struct pblk *pblk, struct nvm_rq *rqd, int type);
766 int pblk_alloc_rqd_meta(struct pblk *pblk, struct nvm_rq *rqd);
767 void pblk_free_rqd_meta(struct pblk *pblk, struct nvm_rq *rqd);
768 void pblk_set_sec_per_write(struct pblk *pblk, int sec_per_write);
769 int pblk_setup_w_rec_rq(struct pblk *pblk, struct nvm_rq *rqd,
771 void pblk_discard(struct pblk *pblk, struct bio *bio);
772 struct nvm_chk_meta *pblk_get_chunk_meta(struct pblk *pblk);
773 struct nvm_chk_meta *pblk_chunk_get_off(struct pblk *pblk,
776 void pblk_log_write_err(struct pblk *pblk, struct nvm_rq *rqd);
777 void pblk_log_read_err(struct pblk *pblk, struct nvm_rq *rqd);
778 int pblk_submit_io(struct pblk *pblk, struct nvm_rq *rqd, void *buf);
779 int pblk_submit_io_sync(struct pblk *pblk, struct nvm_rq *rqd, void *buf);
780 int pblk_submit_meta_io(struct pblk *pblk, struct pblk_line *meta_line);
781 void pblk_check_chunk_state_update(struct pblk *pblk, struct nvm_rq *rqd);
782 struct pblk_line *pblk_line_get(struct pblk *pblk);
783 struct pblk_line *pblk_line_get_first_data(struct pblk *pblk);
784 struct pblk_line *pblk_line_replace_data(struct pblk *pblk);
785 void pblk_ppa_to_line_put(struct pblk *pblk, struct ppa_addr ppa);
786 void pblk_rq_to_line_put(struct pblk *pblk, struct nvm_rq *rqd);
787 int pblk_line_recov_alloc(struct pblk *pblk, struct pblk_line *line);
788 void pblk_line_recov_close(struct pblk *pblk, struct pblk_line *line);
789 struct pblk_line *pblk_line_get_data(struct pblk *pblk);
790 struct pblk_line *pblk_line_get_erase(struct pblk *pblk);
791 int pblk_line_erase(struct pblk *pblk, struct pblk_line *line);
794 void pblk_line_close_meta(struct pblk *pblk, struct pblk_line *line);
795 void pblk_line_close(struct pblk *pblk, struct pblk_line *line);
797 void pblk_pipeline_stop(struct pblk *pblk);
798 void __pblk_pipeline_stop(struct pblk *pblk);
799 void __pblk_pipeline_flush(struct pblk *pblk);
800 void pblk_gen_run_ws(struct pblk *pblk, struct pblk_line *line, void *priv,
803 u64 pblk_line_smeta_start(struct pblk *pblk, struct pblk_line *line);
804 int pblk_line_smeta_read(struct pblk *pblk, struct pblk_line *line);
805 int pblk_line_emeta_read(struct pblk *pblk, struct pblk_line *line,
807 int pblk_blk_erase_async(struct pblk *pblk, struct ppa_addr erase_ppa);
810 struct list_head *pblk_line_gc_list(struct pblk *pblk, struct pblk_line *line);
811 u64 pblk_lookup_page(struct pblk *pblk, struct pblk_line *line);
812 void pblk_dealloc_page(struct pblk *pblk, struct pblk_line *line, int nr_secs);
813 u64 pblk_alloc_page(struct pblk *pblk, struct pblk_line *line, int nr_secs);
814 u64 __pblk_alloc_page(struct pblk *pblk, struct pblk_line *line, int nr_secs);
815 int pblk_calc_secs(struct pblk *pblk, unsigned long secs_avail,
817 void pblk_down_rq(struct pblk *pblk, struct ppa_addr ppa,
819 void pblk_down_chunk(struct pblk *pblk, struct ppa_addr ppa);
820 void pblk_up_chunk(struct pblk *pblk, struct ppa_addr ppa);
821 void pblk_up_rq(struct pblk *pblk, unsigned long *lun_bitmap);
822 int pblk_bio_add_pages(struct pblk *pblk, struct bio *bio, gfp_t flags,
824 void pblk_bio_free_pages(struct pblk *pblk, struct bio *bio, int off,
826 void pblk_map_invalidate(struct pblk *pblk, struct ppa_addr ppa);
827 void __pblk_map_invalidate(struct pblk *pblk, struct pblk_line *line,
829 void pblk_update_map(struct pblk *pblk, sector_t lba, struct ppa_addr ppa);
830 void pblk_update_map_cache(struct pblk *pblk, sector_t lba,
832 void pblk_update_map_dev(struct pblk *pblk, sector_t lba,
834 int pblk_update_map_gc(struct pblk *pblk, sector_t lba, struct ppa_addr ppa,
836 void pblk_lookup_l2p_rand(struct pblk *pblk, struct ppa_addr *ppas,
838 int pblk_lookup_l2p_seq(struct pblk *pblk, struct ppa_addr *ppas,
840 void *pblk_get_meta_for_writes(struct pblk *pblk, struct nvm_rq *rqd);
841 void pblk_get_packed_meta(struct pblk *pblk, struct nvm_rq *rqd);
846 void pblk_write_to_cache(struct pblk *pblk, struct bio *bio,
848 int pblk_write_gc_to_cache(struct pblk *pblk, struct pblk_gc_rq *gc_rq);
853 int pblk_map_erase_rq(struct pblk *pblk, struct nvm_rq *rqd,
856 int pblk_map_rq(struct pblk *pblk, struct nvm_rq *rqd, unsigned int sentry,
865 void pblk_write_should_kick(struct pblk *pblk);
866 void pblk_write_kick(struct pblk *pblk);
872 void pblk_submit_read(struct pblk *pblk, struct bio *bio);
873 int pblk_submit_read_gc(struct pblk *pblk, struct pblk_gc_rq *gc_rq);
877 struct pblk_line *pblk_recov_l2p(struct pblk *pblk);
878 int pblk_recov_pad(struct pblk *pblk);
879 int pblk_recov_check_emeta(struct pblk *pblk, struct line_emeta *emeta);
888 int pblk_gc_init(struct pblk *pblk);
889 void pblk_gc_exit(struct pblk *pblk, bool graceful);
890 void pblk_gc_should_start(struct pblk *pblk);
891 void pblk_gc_should_stop(struct pblk *pblk);
892 void pblk_gc_should_kick(struct pblk *pblk);
893 void pblk_gc_free_full_lines(struct pblk *pblk);
894 void pblk_gc_sysfs_state_show(struct pblk *pblk, int *gc_enabled,
896 int pblk_gc_sysfs_force(struct pblk *pblk, int force);
897 void pblk_put_line_back(struct pblk *pblk, struct pblk_line *line);
945 static inline void *emeta_to_lbas(struct pblk *pblk, struct line_emeta *emeta) in emeta_to_lbas() argument
947 return ((void *)emeta + pblk->lm.emeta_len[1]); in emeta_to_lbas()
950 static inline void *emeta_to_vsc(struct pblk *pblk, struct line_emeta *emeta) in emeta_to_vsc() argument
952 return (emeta_to_lbas(pblk, emeta) + pblk->lm.emeta_len[2]); in emeta_to_vsc()
965 static inline struct pblk_line *pblk_ppa_to_line(struct pblk *pblk, in pblk_ppa_to_line() argument
968 return &pblk->lines[pblk_ppa_to_line_id(p)]; in pblk_ppa_to_line()
976 static inline struct ppa_addr addr_to_gen_ppa(struct pblk *pblk, u64 paddr, in addr_to_gen_ppa() argument
979 struct nvm_tgt_dev *dev = pblk->dev; in addr_to_gen_ppa()
984 struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->addrf; in addr_to_gen_ppa()
994 struct pblk_addrf *uaddrf = &pblk->uaddrf; in addr_to_gen_ppa()
1016 static inline struct nvm_chk_meta *pblk_dev_ppa_to_chunk(struct pblk *pblk, in pblk_dev_ppa_to_chunk() argument
1019 struct nvm_tgt_dev *dev = pblk->dev; in pblk_dev_ppa_to_chunk()
1021 struct pblk_line *line = pblk_ppa_to_line(pblk, p); in pblk_dev_ppa_to_chunk()
1027 static inline u64 pblk_dev_ppa_to_chunk_addr(struct pblk *pblk, in pblk_dev_ppa_to_chunk_addr() argument
1030 struct nvm_tgt_dev *dev = pblk->dev; in pblk_dev_ppa_to_chunk_addr()
1032 return dev_to_chunk_addr(dev->parent, &pblk->addrf, p); in pblk_dev_ppa_to_chunk_addr()
1035 static inline u64 pblk_dev_ppa_to_line_addr(struct pblk *pblk, in pblk_dev_ppa_to_line_addr() argument
1038 struct nvm_tgt_dev *dev = pblk->dev; in pblk_dev_ppa_to_line_addr()
1043 struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->addrf; in pblk_dev_ppa_to_line_addr()
1051 struct pblk_addrf *uaddrf = &pblk->uaddrf; in pblk_dev_ppa_to_line_addr()
1066 static inline struct ppa_addr pblk_ppa32_to_ppa64(struct pblk *pblk, u32 ppa32) in pblk_ppa32_to_ppa64() argument
1068 struct nvm_tgt_dev *dev = pblk->dev; in pblk_ppa32_to_ppa64()
1070 return nvm_ppa32_to_ppa64(dev->parent, &pblk->addrf, ppa32); in pblk_ppa32_to_ppa64()
1073 static inline u32 pblk_ppa64_to_ppa32(struct pblk *pblk, struct ppa_addr ppa64) in pblk_ppa64_to_ppa32() argument
1075 struct nvm_tgt_dev *dev = pblk->dev; in pblk_ppa64_to_ppa32()
1077 return nvm_ppa64_to_ppa32(dev->parent, &pblk->addrf, ppa64); in pblk_ppa64_to_ppa32()
1080 static inline struct ppa_addr pblk_trans_map_get(struct pblk *pblk, in pblk_trans_map_get() argument
1085 if (pblk->addrf_len < 32) { in pblk_trans_map_get()
1086 u32 *map = (u32 *)pblk->trans_map; in pblk_trans_map_get()
1088 ppa = pblk_ppa32_to_ppa64(pblk, map[lba]); in pblk_trans_map_get()
1090 struct ppa_addr *map = (struct ppa_addr *)pblk->trans_map; in pblk_trans_map_get()
1098 static inline void pblk_trans_map_set(struct pblk *pblk, sector_t lba, in pblk_trans_map_set() argument
1101 if (pblk->addrf_len < 32) { in pblk_trans_map_set()
1102 u32 *map = (u32 *)pblk->trans_map; in pblk_trans_map_set()
1104 map[lba] = pblk_ppa64_to_ppa32(pblk, ppa); in pblk_trans_map_set()
1106 u64 *map = (u64 *)pblk->trans_map; in pblk_trans_map_set()
1147 static inline u32 pblk_calc_meta_header_crc(struct pblk *pblk, in pblk_calc_meta_header_crc() argument
1158 static inline u32 pblk_calc_smeta_crc(struct pblk *pblk, in pblk_calc_smeta_crc() argument
1161 struct pblk_line_meta *lm = &pblk->lm; in pblk_calc_smeta_crc()
1172 static inline u32 pblk_calc_emeta_crc(struct pblk *pblk, in pblk_calc_emeta_crc() argument
1175 struct pblk_line_meta *lm = &pblk->lm; in pblk_calc_emeta_crc()
1186 static inline int pblk_io_aligned(struct pblk *pblk, int nr_secs) in pblk_io_aligned() argument
1188 return !(nr_secs % pblk->min_write_pgs); in pblk_io_aligned()
1192 static inline void print_ppa(struct pblk *pblk, struct ppa_addr *p, in print_ppa() argument
1195 struct nvm_geo *geo = &pblk->dev->geo; in print_ppa()
1198 pblk_err(pblk, "ppa: (%s: %x) cache line: %llu\n", in print_ppa()
1201 pblk_err(pblk, "ppa: (%s: %x):ch:%d,lun:%d,blk:%d,pg:%d,pl:%d,sec:%d\n", in print_ppa()
1206 pblk_err(pblk, "ppa: (%s: %x):ch:%d,lun:%d,chk:%d,sec:%d\n", in print_ppa()
1212 static inline void pblk_print_failed_rqd(struct pblk *pblk, struct nvm_rq *rqd, in pblk_print_failed_rqd() argument
1218 print_ppa(pblk, &rqd->ppa_addr, "rqd", error); in pblk_print_failed_rqd()
1224 print_ppa(pblk, &rqd->ppa_list[bit], "rqd", error); in pblk_print_failed_rqd()
1227 pblk_err(pblk, "error:%d, ppa_status:%llx\n", error, rqd->ppa_status); in pblk_print_failed_rqd()
1265 static inline int pblk_check_io(struct pblk *pblk, struct nvm_rq *rqd) in pblk_check_io() argument
1267 struct nvm_tgt_dev *dev = pblk->dev; in pblk_check_io()
1280 line = pblk_ppa_to_line(pblk, ppa_list[i]); in pblk_check_io()
1284 pblk_err(pblk, "bad ppa: line:%d,state:%d\n", in pblk_check_io()
1298 static inline int pblk_boundary_paddr_checks(struct pblk *pblk, u64 paddr) in pblk_boundary_paddr_checks() argument
1300 struct pblk_line_meta *lm = &pblk->lm; in pblk_boundary_paddr_checks()
1323 static inline char *pblk_disk_name(struct pblk *pblk) in pblk_disk_name() argument
1325 struct gendisk *disk = pblk->disk; in pblk_disk_name()
1330 static inline unsigned int pblk_get_min_chks(struct pblk *pblk) in pblk_get_min_chks() argument
1332 struct pblk_line_meta *lm = &pblk->lm; in pblk_get_min_chks()
1337 return DIV_ROUND_UP(100, pblk->op) * lm->blk_per_line; in pblk_get_min_chks()
1340 static inline struct pblk_sec_meta *pblk_get_meta(struct pblk *pblk, in pblk_get_meta() argument
1344 max_t(int, sizeof(struct pblk_sec_meta), pblk->oob_meta_size) in pblk_get_meta()
1348 static inline int pblk_dma_meta_size(struct pblk *pblk) in pblk_dma_meta_size() argument
1350 return max_t(int, sizeof(struct pblk_sec_meta), pblk->oob_meta_size) in pblk_dma_meta_size()
1354 static inline int pblk_is_oob_meta_supported(struct pblk *pblk) in pblk_is_oob_meta_supported() argument
1356 return pblk->oob_meta_size >= sizeof(struct pblk_sec_meta); in pblk_is_oob_meta_supported()