diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-04 20:22:14 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-04 20:22:14 -0400 |
| commit | 3d0a8d10cfb4cc3d1877c29a866ee7d8a46aa2fa (patch) | |
| tree | 11a85044d1472f5972ae47ce10a2f446ad981e9f /include | |
| parent | b4fdcb02f1e39c27058a885905bd0277370ba441 (diff) | |
| parent | a0eda62552eba4e1f92d5354bb65c68fb6b45f87 (diff) | |
Merge branch 'for-3.2/drivers' of git://git.kernel.dk/linux-block
* 'for-3.2/drivers' of git://git.kernel.dk/linux-block: (30 commits)
virtio-blk: use ida to allocate disk index
hpsa: add small delay when using PCI Power Management to reset for kump
cciss: add small delay when using PCI Power Management to reset for kump
xen/blkback: Fix two races in the handling of barrier requests.
xen/blkback: Check for proper operation.
xen/blkback: Fix the inhibition to map pages when discarding sector ranges.
xen/blkback: Report VBD_WSECT (wr_sect) properly.
xen/blkback: Support 'feature-barrier' aka old-style BARRIER requests.
xen-blkfront: plug device number leak in xlblk_init() error path
xen-blkfront: If no barrier or flush is supported, use invalid operation.
xen-blkback: use kzalloc() in favor of kmalloc()+memset()
xen-blkback: fixed indentation and comments
xen-blkfront: fix a deadlock while handling discard response
xen-blkfront: Handle discard requests.
xen-blkback: Implement discard requests ('feature-discard')
xen-blkfront: add BLKIF_OP_DISCARD and discard request struct
drivers/block/loop.c: remove unnecessary bdev argument from loop_clr_fd()
drivers/block/loop.c: emit uevent on auto release
drivers/block/cpqarray.c: use pci_dev->revision
loop: always allow userspace partitions and optionally support automatic scanning
...
Fic up trivial header file includsion conflict in drivers/block/loop.c
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/genhd.h | 6 | ||||
| -rw-r--r-- | include/linux/loop.h | 1 | ||||
| -rw-r--r-- | include/xen/interface/io/blkif.h | 36 |
3 files changed, 41 insertions, 2 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 6957350e122f..9de31bc98c88 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -131,6 +131,7 @@ struct hd_struct { | |||
| 131 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ | 131 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ |
| 132 | #define GENHD_FL_NATIVE_CAPACITY 128 | 132 | #define GENHD_FL_NATIVE_CAPACITY 128 |
| 133 | #define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 256 | 133 | #define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 256 |
| 134 | #define GENHD_FL_NO_PART_SCAN 512 | ||
| 134 | 135 | ||
| 135 | enum { | 136 | enum { |
| 136 | DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ | 137 | DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ |
| @@ -238,9 +239,10 @@ static inline int disk_max_parts(struct gendisk *disk) | |||
| 238 | return disk->minors; | 239 | return disk->minors; |
| 239 | } | 240 | } |
| 240 | 241 | ||
| 241 | static inline bool disk_partitionable(struct gendisk *disk) | 242 | static inline bool disk_part_scan_enabled(struct gendisk *disk) |
| 242 | { | 243 | { |
| 243 | return disk_max_parts(disk) > 1; | 244 | return disk_max_parts(disk) > 1 && |
| 245 | !(disk->flags & GENHD_FL_NO_PART_SCAN); | ||
| 244 | } | 246 | } |
| 245 | 247 | ||
| 246 | static inline dev_t disk_devt(struct gendisk *disk) | 248 | static inline dev_t disk_devt(struct gendisk *disk) |
diff --git a/include/linux/loop.h b/include/linux/loop.h index a06880689115..11a41a8f08eb 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
| @@ -74,6 +74,7 @@ struct loop_device { | |||
| 74 | enum { | 74 | enum { |
| 75 | LO_FLAGS_READ_ONLY = 1, | 75 | LO_FLAGS_READ_ONLY = 1, |
| 76 | LO_FLAGS_AUTOCLEAR = 4, | 76 | LO_FLAGS_AUTOCLEAR = 4, |
| 77 | LO_FLAGS_PARTSCAN = 8, | ||
| 77 | }; | 78 | }; |
| 78 | 79 | ||
| 79 | #include <asm/posix_types.h> /* for __kernel_old_dev_t */ | 80 | #include <asm/posix_types.h> /* for __kernel_old_dev_t */ |
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index 3d5d6db864fe..9324488f23f0 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h | |||
| @@ -57,6 +57,36 @@ typedef uint64_t blkif_sector_t; | |||
| 57 | * "feature-flush-cache" node! | 57 | * "feature-flush-cache" node! |
| 58 | */ | 58 | */ |
| 59 | #define BLKIF_OP_FLUSH_DISKCACHE 3 | 59 | #define BLKIF_OP_FLUSH_DISKCACHE 3 |
| 60 | |||
| 61 | /* | ||
| 62 | * Recognised only if "feature-discard" is present in backend xenbus info. | ||
| 63 | * The "feature-discard" node contains a boolean indicating whether trim | ||
| 64 | * (ATA) or unmap (SCSI) - conviently called discard requests are likely | ||
| 65 | * to succeed or fail. Either way, a discard request | ||
| 66 | * may fail at any time with BLKIF_RSP_EOPNOTSUPP if it is unsupported by | ||
| 67 | * the underlying block-device hardware. The boolean simply indicates whether | ||
| 68 | * or not it is worthwhile for the frontend to attempt discard requests. | ||
| 69 | * If a backend does not recognise BLKIF_OP_DISCARD, it should *not* | ||
| 70 | * create the "feature-discard" node! | ||
| 71 | * | ||
| 72 | * Discard operation is a request for the underlying block device to mark | ||
| 73 | * extents to be erased. However, discard does not guarantee that the blocks | ||
| 74 | * will be erased from the device - it is just a hint to the device | ||
| 75 | * controller that these blocks are no longer in use. What the device | ||
| 76 | * controller does with that information is left to the controller. | ||
| 77 | * Discard operations are passed with sector_number as the | ||
| 78 | * sector index to begin discard operations at and nr_sectors as the number of | ||
| 79 | * sectors to be discarded. The specified sectors should be discarded if the | ||
| 80 | * underlying block device supports trim (ATA) or unmap (SCSI) operations, | ||
| 81 | * or a BLKIF_RSP_EOPNOTSUPP should be returned. | ||
| 82 | * More information about trim/unmap operations at: | ||
| 83 | * http://t13.org/Documents/UploadedDocuments/docs2008/ | ||
| 84 | * e07154r6-Data_Set_Management_Proposal_for_ATA-ACS2.doc | ||
| 85 | * http://www.seagate.com/staticfiles/support/disc/manuals/ | ||
| 86 | * Interface%20manuals/100293068c.pdf | ||
| 87 | */ | ||
| 88 | #define BLKIF_OP_DISCARD 5 | ||
| 89 | |||
| 60 | /* | 90 | /* |
| 61 | * Maximum scatter/gather segments per request. | 91 | * Maximum scatter/gather segments per request. |
| 62 | * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. | 92 | * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. |
| @@ -74,6 +104,11 @@ struct blkif_request_rw { | |||
| 74 | } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; | 104 | } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; |
| 75 | }; | 105 | }; |
| 76 | 106 | ||
| 107 | struct blkif_request_discard { | ||
| 108 | blkif_sector_t sector_number; | ||
| 109 | uint64_t nr_sectors; | ||
| 110 | }; | ||
| 111 | |||
| 77 | struct blkif_request { | 112 | struct blkif_request { |
| 78 | uint8_t operation; /* BLKIF_OP_??? */ | 113 | uint8_t operation; /* BLKIF_OP_??? */ |
| 79 | uint8_t nr_segments; /* number of segments */ | 114 | uint8_t nr_segments; /* number of segments */ |
| @@ -81,6 +116,7 @@ struct blkif_request { | |||
| 81 | uint64_t id; /* private guest value, echoed in resp */ | 116 | uint64_t id; /* private guest value, echoed in resp */ |
| 82 | union { | 117 | union { |
| 83 | struct blkif_request_rw rw; | 118 | struct blkif_request_rw rw; |
| 119 | struct blkif_request_discard discard; | ||
| 84 | } u; | 120 | } u; |
| 85 | }; | 121 | }; |
| 86 | 122 | ||
