| .. | .. |
|---|
| 187 | 187 | |
|---|
| 188 | 188 | void (*callback)(struct dasd_ccw_req *, void *data); |
|---|
| 189 | 189 | void *callback_data; |
|---|
| 190 | + unsigned int proc_bytes; /* bytes for partial completion */ |
|---|
| 191 | + unsigned int trkcount; /* count formatted tracks */ |
|---|
| 190 | 192 | }; |
|---|
| 191 | 193 | |
|---|
| 192 | 194 | /* |
|---|
| .. | .. |
|---|
| 268 | 270 | struct module *owner; |
|---|
| 269 | 271 | char ebcname[8]; /* a name used for tagging and printks */ |
|---|
| 270 | 272 | char name[8]; /* a name used for tagging and printks */ |
|---|
| 271 | | - int max_blocks; /* maximum number of blocks to be chained */ |
|---|
| 272 | 273 | |
|---|
| 273 | 274 | struct list_head list; /* used for list of disciplines */ |
|---|
| 274 | 275 | |
|---|
| .. | .. |
|---|
| 297 | 298 | * e.g. verify that new path is compatible with the current |
|---|
| 298 | 299 | * configuration. |
|---|
| 299 | 300 | */ |
|---|
| 300 | | - int (*verify_path)(struct dasd_device *, __u8); |
|---|
| 301 | + int (*pe_handler)(struct dasd_device *, __u8); |
|---|
| 301 | 302 | |
|---|
| 302 | 303 | /* |
|---|
| 303 | 304 | * Last things to do when a device is set online, and first things |
|---|
| .. | .. |
|---|
| 307 | 308 | int (*online_to_ready) (struct dasd_device *); |
|---|
| 308 | 309 | int (*basic_to_known)(struct dasd_device *); |
|---|
| 309 | 310 | |
|---|
| 311 | + /* |
|---|
| 312 | + * Initialize block layer request queue. |
|---|
| 313 | + */ |
|---|
| 314 | + void (*setup_blk_queue)(struct dasd_block *); |
|---|
| 310 | 315 | /* (struct dasd_device *); |
|---|
| 311 | 316 | * Device operation functions. build_cp creates a ccw chain for |
|---|
| 312 | 317 | * a block device request, start_io starts the request and |
|---|
| .. | .. |
|---|
| 367 | 372 | void (*disable_hpf)(struct dasd_device *); |
|---|
| 368 | 373 | int (*hpf_enabled)(struct dasd_device *); |
|---|
| 369 | 374 | void (*reset_path)(struct dasd_device *, __u8); |
|---|
| 375 | + |
|---|
| 376 | + /* |
|---|
| 377 | + * Extent Space Efficient (ESE) relevant functions |
|---|
| 378 | + */ |
|---|
| 379 | + int (*is_ese)(struct dasd_device *); |
|---|
| 380 | + /* Capacity */ |
|---|
| 381 | + int (*space_allocated)(struct dasd_device *); |
|---|
| 382 | + int (*space_configured)(struct dasd_device *); |
|---|
| 383 | + int (*logical_capacity)(struct dasd_device *); |
|---|
| 384 | + int (*release_space)(struct dasd_device *, struct format_data_t *); |
|---|
| 385 | + /* Extent Pool */ |
|---|
| 386 | + int (*ext_pool_id)(struct dasd_device *); |
|---|
| 387 | + int (*ext_size)(struct dasd_device *); |
|---|
| 388 | + int (*ext_pool_cap_at_warnlevel)(struct dasd_device *); |
|---|
| 389 | + int (*ext_pool_warn_thrshld)(struct dasd_device *); |
|---|
| 390 | + int (*ext_pool_oos)(struct dasd_device *); |
|---|
| 391 | + int (*ext_pool_exhaust)(struct dasd_device *, struct dasd_ccw_req *); |
|---|
| 392 | + struct dasd_ccw_req *(*ese_format)(struct dasd_device *, |
|---|
| 393 | + struct dasd_ccw_req *, struct irb *); |
|---|
| 394 | + int (*ese_read)(struct dasd_ccw_req *, struct irb *); |
|---|
| 370 | 395 | }; |
|---|
| 371 | 396 | |
|---|
| 372 | 397 | extern struct dasd_discipline *dasd_diag_discipline_pointer; |
|---|
| .. | .. |
|---|
| 386 | 411 | #define DASD_EER_NOPATH 2 |
|---|
| 387 | 412 | #define DASD_EER_STATECHANGE 3 |
|---|
| 388 | 413 | #define DASD_EER_PPRCSUSPEND 4 |
|---|
| 414 | +#define DASD_EER_NOSPC 5 |
|---|
| 389 | 415 | |
|---|
| 390 | 416 | /* DASD path handling */ |
|---|
| 391 | 417 | |
|---|
| .. | .. |
|---|
| 451 | 477 | spinlock_t lock; |
|---|
| 452 | 478 | }; |
|---|
| 453 | 479 | |
|---|
| 480 | +struct dasd_format_entry { |
|---|
| 481 | + struct list_head list; |
|---|
| 482 | + sector_t track; |
|---|
| 483 | +}; |
|---|
| 484 | + |
|---|
| 454 | 485 | struct dasd_device { |
|---|
| 455 | 486 | /* Block device stuff. */ |
|---|
| 456 | 487 | struct dasd_block *block; |
|---|
| .. | .. |
|---|
| 482 | 513 | spinlock_t mem_lock; |
|---|
| 483 | 514 | void *ccw_mem; |
|---|
| 484 | 515 | void *erp_mem; |
|---|
| 516 | + void *ese_mem; |
|---|
| 485 | 517 | struct list_head ccw_chunks; |
|---|
| 486 | 518 | struct list_head erp_chunks; |
|---|
| 519 | + struct list_head ese_chunks; |
|---|
| 487 | 520 | |
|---|
| 488 | 521 | atomic_t tasklet_scheduled; |
|---|
| 489 | 522 | struct tasklet_struct tasklet; |
|---|
| .. | .. |
|---|
| 514 | 547 | struct dentry *debugfs_dentry; |
|---|
| 515 | 548 | struct dentry *hosts_dentry; |
|---|
| 516 | 549 | struct dasd_profile profile; |
|---|
| 550 | + struct dasd_format_entry format_entry; |
|---|
| 517 | 551 | }; |
|---|
| 518 | 552 | |
|---|
| 519 | 553 | struct dasd_block { |
|---|
| .. | .. |
|---|
| 539 | 573 | |
|---|
| 540 | 574 | struct dentry *debugfs_dentry; |
|---|
| 541 | 575 | struct dasd_profile profile; |
|---|
| 576 | + |
|---|
| 577 | + struct list_head format_list; |
|---|
| 578 | + spinlock_t format_lock; |
|---|
| 579 | + atomic_t trkcount; |
|---|
| 542 | 580 | }; |
|---|
| 543 | 581 | |
|---|
| 544 | 582 | struct dasd_attention_data { |
|---|
| .. | .. |
|---|
| 558 | 596 | #define DASD_STOPPED_SU 16 /* summary unit check handling */ |
|---|
| 559 | 597 | #define DASD_STOPPED_PM 32 /* pm state transition */ |
|---|
| 560 | 598 | #define DASD_UNRESUMED_PM 64 /* pm resume failed state */ |
|---|
| 599 | +#define DASD_STOPPED_NOSPC 128 /* no space left */ |
|---|
| 561 | 600 | |
|---|
| 562 | 601 | /* per device flags */ |
|---|
| 563 | 602 | #define DASD_FLAG_OFFLINE 3 /* device is in offline processing */ |
|---|
| .. | .. |
|---|
| 686 | 725 | return 0; |
|---|
| 687 | 726 | } |
|---|
| 688 | 727 | |
|---|
| 728 | +/* |
|---|
| 729 | + * return the callback data of the original request in case there are |
|---|
| 730 | + * ERP requests build on top of it |
|---|
| 731 | + */ |
|---|
| 732 | +static inline void *dasd_get_callback_data(struct dasd_ccw_req *cqr) |
|---|
| 733 | +{ |
|---|
| 734 | + while (cqr->refers) |
|---|
| 735 | + cqr = cqr->refers; |
|---|
| 736 | + |
|---|
| 737 | + return cqr->callback_data; |
|---|
| 738 | +} |
|---|
| 739 | + |
|---|
| 689 | 740 | /* externals in dasd.c */ |
|---|
| 690 | 741 | #define DASD_PROFILE_OFF 0 |
|---|
| 691 | 742 | #define DASD_PROFILE_ON 1 |
|---|
| .. | .. |
|---|
| 700 | 751 | |
|---|
| 701 | 752 | struct dasd_ccw_req * |
|---|
| 702 | 753 | dasd_smalloc_request(int, int, int, struct dasd_device *, struct dasd_ccw_req *); |
|---|
| 754 | +struct dasd_ccw_req *dasd_fmalloc_request(int, int, int, struct dasd_device *); |
|---|
| 703 | 755 | void dasd_sfree_request(struct dasd_ccw_req *, struct dasd_device *); |
|---|
| 756 | +void dasd_ffree_request(struct dasd_ccw_req *, struct dasd_device *); |
|---|
| 704 | 757 | void dasd_wakeup_cb(struct dasd_ccw_req *, void *); |
|---|
| 705 | 758 | |
|---|
| 706 | 759 | struct dasd_device *dasd_alloc_device(void); |
|---|
| .. | .. |
|---|
| 727 | 780 | int dasd_sleep_on(struct dasd_ccw_req *); |
|---|
| 728 | 781 | int dasd_sleep_on_queue(struct list_head *); |
|---|
| 729 | 782 | int dasd_sleep_on_immediatly(struct dasd_ccw_req *); |
|---|
| 783 | +int dasd_sleep_on_queue_interruptible(struct list_head *); |
|---|
| 730 | 784 | int dasd_sleep_on_interruptible(struct dasd_ccw_req *); |
|---|
| 731 | 785 | void dasd_device_set_timer(struct dasd_device *, int); |
|---|
| 732 | 786 | void dasd_device_clear_timer(struct dasd_device *); |
|---|
| .. | .. |
|---|
| 750 | 804 | enum uc_todo dasd_generic_uc_handler(struct ccw_device *, struct irb *); |
|---|
| 751 | 805 | void dasd_generic_path_event(struct ccw_device *, int *); |
|---|
| 752 | 806 | int dasd_generic_verify_path(struct dasd_device *, __u8); |
|---|
| 807 | +void dasd_generic_space_exhaust(struct dasd_device *, struct dasd_ccw_req *); |
|---|
| 808 | +void dasd_generic_space_avail(struct dasd_device *); |
|---|
| 753 | 809 | |
|---|
| 754 | 810 | int dasd_generic_read_dev_chars(struct dasd_device *, int, void *, int); |
|---|
| 755 | 811 | char *dasd_get_sense(struct irb *); |
|---|