aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-01-13 08:47:54 -0500
committerJens Axboe <jaxboe@fusionio.com>2011-01-13 08:47:54 -0500
commit81c5e2ae33c4b19e53966b427e33646bf6811830 (patch)
treea602a6dd100165c8948bfa713e6f0b422dcba5d8 /include
parent797a455d2c682476c3797dbfecf5bf84c1e3b9d3 (diff)
parentfcc57045d53edc35bcce456e60ac4aa802712934 (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.h4
-rw-r--r--include/linux/cdrom.h6
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/genhd.h20
-rw-r--r--include/scsi/scsi.h1
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
645extern int blk_register_queue(struct gendisk *disk); 645extern int blk_register_queue(struct gendisk *disk);
646extern void blk_unregister_queue(struct gendisk *disk); 646extern void blk_unregister_queue(struct gendisk *disk);
647extern void register_disk(struct gendisk *dev);
648extern void generic_make_request(struct bio *bio); 647extern void generic_make_request(struct bio *bio);
649extern void blk_rq_init(struct request_queue *q, struct request *rq); 648extern void blk_rq_init(struct request_queue *q, struct request *rq);
650extern void blk_put_request(struct request *); 649extern 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,
993extern void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode); 997extern void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode);
994extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev, 998extern 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);
1000extern unsigned int cdrom_check_events(struct cdrom_device_info *cdi,
1001 unsigned int clearing);
996extern int cdrom_media_changed(struct cdrom_device_info *); 1002extern int cdrom_media_changed(struct cdrom_device_info *);
997 1003
998extern int register_cdrom(struct cdrom_device_info *cdi); 1004extern 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
131enum {
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
152struct disk_events;
153
147struct gendisk { 154struct 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 */
397extern void add_disk(struct gendisk *disk); 407extern void add_disk(struct gendisk *disk);
398extern void del_gendisk(struct gendisk *gp); 408extern void del_gendisk(struct gendisk *gp);
399extern void unlink_gendisk(struct gendisk *gp);
400extern struct gendisk *get_gendisk(dev_t dev, int *partno); 409extern struct gendisk *get_gendisk(dev_t dev, int *partno);
401extern struct block_device *bdget_disk(struct gendisk *disk, int partno); 410extern 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
420extern void disk_block_events(struct gendisk *disk);
421extern void disk_unblock_events(struct gendisk *disk);
422extern void disk_check_events(struct gendisk *disk);
423extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask);
424
411/* drivers/char/random.c */ 425/* drivers/char/random.c */
412extern void add_disk_randomness(struct gendisk *disk); 426extern void add_disk_randomness(struct gendisk *disk);
413extern void rand_initialize_disk(struct gendisk *disk); 427extern 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