nd.h (08e6b3c6e3a054f566367740c94b8c1d18e52056) | nd.h (ddcf35d397976421a4ec1d0d00fbcc027a8cb034) |
---|---|
1/* 2 * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of version 2 of the GNU General Public License as 6 * published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, but --- 343 unchanged lines hidden (view full) --- 352void nvdimm_drvdata_release(struct kref *kref); 353void put_ndd(struct nvdimm_drvdata *ndd); 354int nd_label_reserve_dpa(struct nvdimm_drvdata *ndd); 355void nvdimm_free_dpa(struct nvdimm_drvdata *ndd, struct resource *res); 356struct resource *nvdimm_allocate_dpa(struct nvdimm_drvdata *ndd, 357 struct nd_label_id *label_id, resource_size_t start, 358 resource_size_t n); 359resource_size_t nvdimm_namespace_capacity(struct nd_namespace_common *ndns); | 1/* 2 * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of version 2 of the GNU General Public License as 6 * published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, but --- 343 unchanged lines hidden (view full) --- 352void nvdimm_drvdata_release(struct kref *kref); 353void put_ndd(struct nvdimm_drvdata *ndd); 354int nd_label_reserve_dpa(struct nvdimm_drvdata *ndd); 355void nvdimm_free_dpa(struct nvdimm_drvdata *ndd, struct resource *res); 356struct resource *nvdimm_allocate_dpa(struct nvdimm_drvdata *ndd, 357 struct nd_label_id *label_id, resource_size_t start, 358 resource_size_t n); 359resource_size_t nvdimm_namespace_capacity(struct nd_namespace_common *ndns); |
360bool nvdimm_namespace_locked(struct nd_namespace_common *ndns); | |
361struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev); 362int nvdimm_namespace_attach_btt(struct nd_namespace_common *ndns); 363int nvdimm_namespace_detach_btt(struct nd_btt *nd_btt); 364const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns, 365 char *name); 366unsigned int pmem_sector_size(struct nd_namespace_common *ndns); 367void nvdimm_badblocks_populate(struct nd_region *nd_region, 368 struct badblocks *bb, const struct resource *res); --- 23 unchanged lines hidden (view full) --- 392static inline bool nd_iostat_start(struct bio *bio, unsigned long *start) 393{ 394 struct gendisk *disk = bio->bi_disk; 395 396 if (!blk_queue_io_stat(disk->queue)) 397 return false; 398 399 *start = jiffies; | 360struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev); 361int nvdimm_namespace_attach_btt(struct nd_namespace_common *ndns); 362int nvdimm_namespace_detach_btt(struct nd_btt *nd_btt); 363const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns, 364 char *name); 365unsigned int pmem_sector_size(struct nd_namespace_common *ndns); 366void nvdimm_badblocks_populate(struct nd_region *nd_region, 367 struct badblocks *bb, const struct resource *res); --- 23 unchanged lines hidden (view full) --- 391static inline bool nd_iostat_start(struct bio *bio, unsigned long *start) 392{ 393 struct gendisk *disk = bio->bi_disk; 394 395 if (!blk_queue_io_stat(disk->queue)) 396 return false; 397 398 *start = jiffies; |
400 generic_start_io_acct(disk->queue, bio_data_dir(bio), 401 bio_sectors(bio), &disk->part0); | 399 generic_start_io_acct(disk->queue, bio_op(bio), bio_sectors(bio), 400 &disk->part0); |
402 return true; 403} 404static inline void nd_iostat_end(struct bio *bio, unsigned long start) 405{ 406 struct gendisk *disk = bio->bi_disk; 407 | 401 return true; 402} 403static inline void nd_iostat_end(struct bio *bio, unsigned long start) 404{ 405 struct gendisk *disk = bio->bi_disk; 406 |
408 generic_end_io_acct(disk->queue, bio_data_dir(bio), &disk->part0, 409 start); | 407 generic_end_io_acct(disk->queue, bio_op(bio), &disk->part0, start); |
410} 411static inline bool is_bad_pmem(struct badblocks *bb, sector_t sector, 412 unsigned int len) 413{ 414 if (bb->count) { 415 sector_t first_bad; 416 int num_bad; 417 418 return !!badblocks_check(bb, sector, len / 512, &first_bad, 419 &num_bad); 420 } 421 422 return false; 423} 424resource_size_t nd_namespace_blk_validate(struct nd_namespace_blk *nsblk); 425const u8 *nd_dev_to_uuid(struct device *dev); 426bool pmem_should_map_pages(struct device *dev); 427#endif /* __ND_H__ */ | 408} 409static inline bool is_bad_pmem(struct badblocks *bb, sector_t sector, 410 unsigned int len) 411{ 412 if (bb->count) { 413 sector_t first_bad; 414 int num_bad; 415 416 return !!badblocks_check(bb, sector, len / 512, &first_bad, 417 &num_bad); 418 } 419 420 return false; 421} 422resource_size_t nd_namespace_blk_validate(struct nd_namespace_blk *nsblk); 423const u8 *nd_dev_to_uuid(struct device *dev); 424bool pmem_should_map_pages(struct device *dev); 425#endif /* __ND_H__ */ |