diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2011-01-13 08:47:54 -0500 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-01-13 08:47:54 -0500 |
commit | 81c5e2ae33c4b19e53966b427e33646bf6811830 (patch) | |
tree | a602a6dd100165c8948bfa713e6f0b422dcba5d8 /include | |
parent | 797a455d2c682476c3797dbfecf5bf84c1e3b9d3 (diff) | |
parent | fcc57045d53edc35bcce456e60ac4aa802712934 (diff) |
Merge branch 'for-2.6.38/event-handling' into for-2.6.38/core
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blkdev.h | 4 | ||||
-rw-r--r-- | include/linux/cdrom.h | 6 | ||||
-rw-r--r-- | include/linux/fs.h | 1 | ||||
-rw-r--r-- | include/linux/genhd.h | 20 | ||||
-rw-r--r-- | include/scsi/scsi.h | 1 |
5 files changed, 28 insertions, 4 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 482a7fd48831..5730043eb15a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -644,7 +644,6 @@ static inline void rq_flush_dcache_pages(struct request *rq) | |||
644 | 644 | ||
645 | extern int blk_register_queue(struct gendisk *disk); | 645 | extern int blk_register_queue(struct gendisk *disk); |
646 | extern void blk_unregister_queue(struct gendisk *disk); | 646 | extern void blk_unregister_queue(struct gendisk *disk); |
647 | extern void register_disk(struct gendisk *dev); | ||
648 | extern void generic_make_request(struct bio *bio); | 647 | extern void generic_make_request(struct bio *bio); |
649 | extern void blk_rq_init(struct request_queue *q, struct request *rq); | 648 | extern void blk_rq_init(struct request_queue *q, struct request *rq); |
650 | extern void blk_put_request(struct request *); | 649 | extern void blk_put_request(struct request *); |
@@ -1253,6 +1252,9 @@ struct block_device_operations { | |||
1253 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | 1252 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
1254 | int (*direct_access) (struct block_device *, sector_t, | 1253 | int (*direct_access) (struct block_device *, sector_t, |
1255 | void **, unsigned long *); | 1254 | void **, unsigned long *); |
1255 | unsigned int (*check_events) (struct gendisk *disk, | ||
1256 | unsigned int clearing); | ||
1257 | /* ->media_changed() is DEPRECATED, use ->check_events() instead */ | ||
1256 | int (*media_changed) (struct gendisk *); | 1258 | int (*media_changed) (struct gendisk *); |
1257 | void (*unlock_native_capacity) (struct gendisk *); | 1259 | void (*unlock_native_capacity) (struct gendisk *); |
1258 | int (*revalidate_disk) (struct gendisk *); | 1260 | int (*revalidate_disk) (struct gendisk *); |
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index 78e904796622..35eae4b67503 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
@@ -946,6 +946,8 @@ struct cdrom_device_info { | |||
946 | /* device-related storage */ | 946 | /* device-related storage */ |
947 | unsigned int options : 30; /* options flags */ | 947 | unsigned int options : 30; /* options flags */ |
948 | unsigned mc_flags : 2; /* media change buffer flags */ | 948 | unsigned mc_flags : 2; /* media change buffer flags */ |
949 | unsigned int vfs_events; /* cached events for vfs path */ | ||
950 | unsigned int ioctl_events; /* cached events for ioctl path */ | ||
949 | int use_count; /* number of times device opened */ | 951 | int use_count; /* number of times device opened */ |
950 | char name[20]; /* name of the device type */ | 952 | char name[20]; /* name of the device type */ |
951 | /* per-device flags */ | 953 | /* per-device flags */ |
@@ -965,6 +967,8 @@ struct cdrom_device_ops { | |||
965 | int (*open) (struct cdrom_device_info *, int); | 967 | int (*open) (struct cdrom_device_info *, int); |
966 | void (*release) (struct cdrom_device_info *); | 968 | void (*release) (struct cdrom_device_info *); |
967 | int (*drive_status) (struct cdrom_device_info *, int); | 969 | int (*drive_status) (struct cdrom_device_info *, int); |
970 | unsigned int (*check_events) (struct cdrom_device_info *cdi, | ||
971 | unsigned int clearing, int slot); | ||
968 | int (*media_changed) (struct cdrom_device_info *, int); | 972 | int (*media_changed) (struct cdrom_device_info *, int); |
969 | int (*tray_move) (struct cdrom_device_info *, int); | 973 | int (*tray_move) (struct cdrom_device_info *, int); |
970 | int (*lock_door) (struct cdrom_device_info *, int); | 974 | int (*lock_door) (struct cdrom_device_info *, int); |
@@ -993,6 +997,8 @@ extern int cdrom_open(struct cdrom_device_info *cdi, struct block_device *bdev, | |||
993 | extern void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode); | 997 | extern void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode); |
994 | extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev, | 998 | extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev, |
995 | fmode_t mode, unsigned int cmd, unsigned long arg); | 999 | fmode_t mode, unsigned int cmd, unsigned long arg); |
1000 | extern unsigned int cdrom_check_events(struct cdrom_device_info *cdi, | ||
1001 | unsigned int clearing); | ||
996 | extern int cdrom_media_changed(struct cdrom_device_info *); | 1002 | extern int cdrom_media_changed(struct cdrom_device_info *); |
997 | 1003 | ||
998 | extern int register_cdrom(struct cdrom_device_info *cdi); | 1004 | extern int register_cdrom(struct cdrom_device_info *cdi); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index f48501563917..997d22efdef0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -662,6 +662,7 @@ struct block_device { | |||
662 | void * bd_claiming; | 662 | void * bd_claiming; |
663 | void * bd_holder; | 663 | void * bd_holder; |
664 | int bd_holders; | 664 | int bd_holders; |
665 | bool bd_write_holder; | ||
665 | #ifdef CONFIG_SYSFS | 666 | #ifdef CONFIG_SYSFS |
666 | struct gendisk * bd_holder_disk; /* for sysfs slave linkng */ | 667 | struct gendisk * bd_holder_disk; /* for sysfs slave linkng */ |
667 | #endif | 668 | #endif |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 2d0468145967..c0d5f6945c1e 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -128,6 +128,11 @@ struct hd_struct { | |||
128 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ | 128 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ |
129 | #define GENHD_FL_NATIVE_CAPACITY 128 | 129 | #define GENHD_FL_NATIVE_CAPACITY 128 |
130 | 130 | ||
131 | enum { | ||
132 | DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ | ||
133 | DISK_EVENT_EJECT_REQUEST = 1 << 1, /* eject requested */ | ||
134 | }; | ||
135 | |||
131 | #define BLK_SCSI_MAX_CMDS (256) | 136 | #define BLK_SCSI_MAX_CMDS (256) |
132 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | 137 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) |
133 | 138 | ||
@@ -144,6 +149,8 @@ struct disk_part_tbl { | |||
144 | struct hd_struct __rcu *part[]; | 149 | struct hd_struct __rcu *part[]; |
145 | }; | 150 | }; |
146 | 151 | ||
152 | struct disk_events; | ||
153 | |||
147 | struct gendisk { | 154 | struct gendisk { |
148 | /* major, first_minor and minors are input parameters only, | 155 | /* major, first_minor and minors are input parameters only, |
149 | * don't use directly. Use disk_devt() and disk_max_parts(). | 156 | * don't use directly. Use disk_devt() and disk_max_parts(). |
@@ -155,6 +162,10 @@ struct gendisk { | |||
155 | 162 | ||
156 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ | 163 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
157 | char *(*devnode)(struct gendisk *gd, mode_t *mode); | 164 | char *(*devnode)(struct gendisk *gd, mode_t *mode); |
165 | |||
166 | unsigned int events; /* supported events */ | ||
167 | unsigned int async_events; /* async events, subset of all */ | ||
168 | |||
158 | /* Array of pointers to partitions indexed by partno. | 169 | /* Array of pointers to partitions indexed by partno. |
159 | * Protected with matching bdev lock but stat and other | 170 | * Protected with matching bdev lock but stat and other |
160 | * non-critical accesses use RCU. Always access through | 171 | * non-critical accesses use RCU. Always access through |
@@ -172,9 +183,8 @@ struct gendisk { | |||
172 | struct kobject *slave_dir; | 183 | struct kobject *slave_dir; |
173 | 184 | ||
174 | struct timer_rand_state *random; | 185 | struct timer_rand_state *random; |
175 | |||
176 | atomic_t sync_io; /* RAID */ | 186 | atomic_t sync_io; /* RAID */ |
177 | struct work_struct async_notify; | 187 | struct disk_events *ev; |
178 | #ifdef CONFIG_BLK_DEV_INTEGRITY | 188 | #ifdef CONFIG_BLK_DEV_INTEGRITY |
179 | struct blk_integrity *integrity; | 189 | struct blk_integrity *integrity; |
180 | #endif | 190 | #endif |
@@ -396,7 +406,6 @@ extern void part_round_stats(int cpu, struct hd_struct *part); | |||
396 | /* block/genhd.c */ | 406 | /* block/genhd.c */ |
397 | extern void add_disk(struct gendisk *disk); | 407 | extern void add_disk(struct gendisk *disk); |
398 | extern void del_gendisk(struct gendisk *gp); | 408 | extern void del_gendisk(struct gendisk *gp); |
399 | extern void unlink_gendisk(struct gendisk *gp); | ||
400 | extern struct gendisk *get_gendisk(dev_t dev, int *partno); | 409 | extern struct gendisk *get_gendisk(dev_t dev, int *partno); |
401 | extern struct block_device *bdget_disk(struct gendisk *disk, int partno); | 410 | extern struct block_device *bdget_disk(struct gendisk *disk, int partno); |
402 | 411 | ||
@@ -408,6 +417,11 @@ static inline int get_disk_ro(struct gendisk *disk) | |||
408 | return disk->part0.policy; | 417 | return disk->part0.policy; |
409 | } | 418 | } |
410 | 419 | ||
420 | extern void disk_block_events(struct gendisk *disk); | ||
421 | extern void disk_unblock_events(struct gendisk *disk); | ||
422 | extern void disk_check_events(struct gendisk *disk); | ||
423 | extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); | ||
424 | |||
411 | /* drivers/char/random.c */ | 425 | /* drivers/char/random.c */ |
412 | extern void add_disk_randomness(struct gendisk *disk); | 426 | extern void add_disk_randomness(struct gendisk *disk); |
413 | extern void rand_initialize_disk(struct gendisk *disk); | 427 | extern void rand_initialize_disk(struct gendisk *disk); |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 216af8538cc9..86758618d4f8 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -104,6 +104,7 @@ struct scsi_cmnd; | |||
104 | #define UNMAP 0x42 | 104 | #define UNMAP 0x42 |
105 | #define READ_TOC 0x43 | 105 | #define READ_TOC 0x43 |
106 | #define READ_HEADER 0x44 | 106 | #define READ_HEADER 0x44 |
107 | #define GET_EVENT_STATUS_NOTIFICATION 0x4a | ||
107 | #define LOG_SELECT 0x4c | 108 | #define LOG_SELECT 0x4c |
108 | #define LOG_SENSE 0x4d | 109 | #define LOG_SENSE 0x4d |
109 | #define XDWRITEREAD_10 0x53 | 110 | #define XDWRITEREAD_10 0x53 |