diff options
Diffstat (limited to 'include/linux/blkdev.h')
| -rw-r--r-- | include/linux/blkdev.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 78feda9bbae2..2fdb4a451b49 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -361,6 +361,12 @@ struct request_queue { | |||
| 361 | */ | 361 | */ |
| 362 | struct kobject kobj; | 362 | struct kobject kobj; |
| 363 | 363 | ||
| 364 | #ifdef CONFIG_PM_RUNTIME | ||
| 365 | struct device *dev; | ||
| 366 | int rpm_status; | ||
| 367 | unsigned int nr_pending; | ||
| 368 | #endif | ||
| 369 | |||
| 364 | /* | 370 | /* |
| 365 | * queue settings | 371 | * queue settings |
| 366 | */ | 372 | */ |
| @@ -838,7 +844,7 @@ static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q, | |||
| 838 | unsigned int cmd_flags) | 844 | unsigned int cmd_flags) |
| 839 | { | 845 | { |
| 840 | if (unlikely(cmd_flags & REQ_DISCARD)) | 846 | if (unlikely(cmd_flags & REQ_DISCARD)) |
| 841 | return q->limits.max_discard_sectors; | 847 | return min(q->limits.max_discard_sectors, UINT_MAX >> 9); |
| 842 | 848 | ||
| 843 | if (unlikely(cmd_flags & REQ_WRITE_SAME)) | 849 | if (unlikely(cmd_flags & REQ_WRITE_SAME)) |
| 844 | return q->limits.max_write_same_sectors; | 850 | return q->limits.max_write_same_sectors; |
| @@ -961,6 +967,27 @@ struct request_queue *blk_alloc_queue_node(gfp_t, int); | |||
| 961 | extern void blk_put_queue(struct request_queue *); | 967 | extern void blk_put_queue(struct request_queue *); |
| 962 | 968 | ||
| 963 | /* | 969 | /* |
| 970 | * block layer runtime pm functions | ||
| 971 | */ | ||
| 972 | #ifdef CONFIG_PM_RUNTIME | ||
| 973 | extern void blk_pm_runtime_init(struct request_queue *q, struct device *dev); | ||
| 974 | extern int blk_pre_runtime_suspend(struct request_queue *q); | ||
| 975 | extern void blk_post_runtime_suspend(struct request_queue *q, int err); | ||
| 976 | extern void blk_pre_runtime_resume(struct request_queue *q); | ||
| 977 | extern void blk_post_runtime_resume(struct request_queue *q, int err); | ||
| 978 | #else | ||
| 979 | static inline void blk_pm_runtime_init(struct request_queue *q, | ||
| 980 | struct device *dev) {} | ||
| 981 | static inline int blk_pre_runtime_suspend(struct request_queue *q) | ||
| 982 | { | ||
| 983 | return -ENOSYS; | ||
| 984 | } | ||
| 985 | static inline void blk_post_runtime_suspend(struct request_queue *q, int err) {} | ||
| 986 | static inline void blk_pre_runtime_resume(struct request_queue *q) {} | ||
| 987 | static inline void blk_post_runtime_resume(struct request_queue *q, int err) {} | ||
| 988 | #endif | ||
| 989 | |||
| 990 | /* | ||
| 964 | * blk_plug permits building a queue of related requests by holding the I/O | 991 | * blk_plug permits building a queue of related requests by holding the I/O |
| 965 | * fragments for a short period. This allows merging of sequential requests | 992 | * fragments for a short period. This allows merging of sequential requests |
| 966 | * into single larger request. As the requests are moved from a per-task list to | 993 | * into single larger request. As the requests are moved from a per-task list to |
| @@ -1484,7 +1511,7 @@ static inline bool blk_integrity_is_initialized(struct gendisk *g) | |||
| 1484 | 1511 | ||
| 1485 | struct block_device_operations { | 1512 | struct block_device_operations { |
| 1486 | int (*open) (struct block_device *, fmode_t); | 1513 | int (*open) (struct block_device *, fmode_t); |
| 1487 | int (*release) (struct gendisk *, fmode_t); | 1514 | void (*release) (struct gendisk *, fmode_t); |
| 1488 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | 1515 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
| 1489 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | 1516 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
| 1490 | int (*direct_access) (struct block_device *, sector_t, | 1517 | int (*direct_access) (struct block_device *, sector_t, |
