@@ -283,55 +283,56 @@ static inline bool blk_op_is_passthrough(blk_opf_t op)
283
283
}
284
284
285
285
/* flags set by the driver in queue_limits.features */
286
- enum {
287
- /* supports a volatile write cache */
288
- BLK_FEAT_WRITE_CACHE = (1u << 0 ),
286
+ typedef unsigned int __bitwise blk_features_t ;
289
287
290
- /* supports passing on the FUA bit */
291
- BLK_FEAT_FUA = (1u << 1 ),
288
+ /* supports a volatile write cache */
289
+ #define BLK_FEAT_WRITE_CACHE ((__force blk_features_t) (1u << 0))
292
290
293
- /* rotational device (hard drive or floppy) */
294
- BLK_FEAT_ROTATIONAL = (1u << 2 ),
291
+ /* supports passing on the FUA bit */
292
+ #define BLK_FEAT_FUA ((__force blk_features_t) (1u << 1))
295
293
296
- /* contributes to the random number pool */
297
- BLK_FEAT_ADD_RANDOM = (1u << 3 ),
294
+ /* rotational device (hard drive or floppy) */
295
+ #define BLK_FEAT_ROTATIONAL ((__force blk_features_t) (1u << 2))
298
296
299
- /* do disk/partitions IO accounting */
300
- BLK_FEAT_IO_STAT = (1u << 4 ),
297
+ /* contributes to the random number pool */
298
+ #define BLK_FEAT_ADD_RANDOM ((__force blk_features_t) (1u << 3))
301
299
302
- /* don't modify data until writeback is done */
303
- BLK_FEAT_STABLE_WRITES = (1u << 5 ),
300
+ /* do disk/partitions IO accounting */
301
+ #define BLK_FEAT_IO_STAT ((__force blk_features_t) (1u << 4))
304
302
305
- /* always completes in submit context */
306
- BLK_FEAT_SYNCHRONOUS = (1u << 6 ),
303
+ /* don't modify data until writeback is done */
304
+ #define BLK_FEAT_STABLE_WRITES ((__force blk_features_t) (1u << 5))
307
305
308
- /* supports REQ_NOWAIT */
309
- BLK_FEAT_NOWAIT = (1u << 7 ),
306
+ /* always completes in submit context */
307
+ #define BLK_FEAT_SYNCHRONOUS ((__force blk_features_t) (1u << 6))
310
308
311
- /* supports DAX */
312
- BLK_FEAT_DAX = (1u << 8 ),
309
+ /* supports REQ_NOWAIT */
310
+ #define BLK_FEAT_NOWAIT ((__force blk_features_t) (1u << 7))
313
311
314
- /* supports I/O polling */
315
- BLK_FEAT_POLL = (1u << 9 ),
312
+ /* supports DAX */
313
+ #define BLK_FEAT_DAX ((__force blk_features_t) (1u << 8))
316
314
317
- /* is a zoned device */
318
- BLK_FEAT_ZONED = (1u << 10 ),
315
+ /* supports I/O polling */
316
+ #define BLK_FEAT_POLL ((__force blk_features_t) (1u << 9))
319
317
320
- /* supports Zone Reset All */
321
- BLK_FEAT_ZONE_RESETALL = (1u << 11 ),
318
+ /* is a zoned device */
319
+ #define BLK_FEAT_ZONED ((__force blk_features_t) (1u << 10))
322
320
323
- /* supports PCI(e) p2p requests */
324
- BLK_FEAT_PCI_P2PDMA = (1u << 12 ),
321
+ /* supports Zone Reset All */
322
+ #define BLK_FEAT_ZONE_RESETALL ((__force blk_features_t) (1u << 11))
325
323
326
- /* skip this queue in blk_mq_(un)quiesce_tagset */
327
- BLK_FEAT_SKIP_TAGSET_QUIESCE = (1u << 13 ),
324
+ /* supports PCI(e) p2p requests */
325
+ #define BLK_FEAT_PCI_P2PDMA ((__force blk_features_t) (1u << 12))
328
326
329
- /* bounce all highmem pages */
330
- BLK_FEAT_BOUNCE_HIGH = (1u << 14 ),
327
+ /* skip this queue in blk_mq_(un)quiesce_tagset */
328
+ #define BLK_FEAT_SKIP_TAGSET_QUIESCE ((__force blk_features_t) (1u << 13))
331
329
332
- /* undocumented magic for bcache */
333
- BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE = (1u << 15 ),
334
- };
330
+ /* bounce all highmem pages */
331
+ #define BLK_FEAT_BOUNCE_HIGH ((__force blk_features_t)(1u << 14))
332
+
333
+ /* undocumented magic for bcache */
334
+ #define BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE \
335
+ ((__force blk_features_t)(1u << 15))
335
336
336
337
/*
337
338
* Flags automatically inherited when stacking limits.
@@ -342,17 +343,17 @@ enum {
342
343
BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE)
343
344
344
345
/* internal flags in queue_limits.flags */
345
- enum {
346
- /* do not send FLUSH/FUA commands despite advertising a write cache */
347
- BLK_FLAG_WRITE_CACHE_DISABLED = (1u << 0 ),
346
+ typedef unsigned int __bitwise blk_flags_t ;
348
347
349
- /* I/O topology is misaligned */
350
- BLK_FLAG_MISALIGNED = (1u << 1 ),
351
- };
348
+ /* do not send FLUSH/FUA commands despite advertising a write cache */
349
+ #define BLK_FLAG_WRITE_CACHE_DISABLED ((__force blk_flags_t)(1u << 0))
350
+
351
+ /* I/O topology is misaligned */
352
+ #define BLK_FLAG_MISALIGNED ((__force blk_flags_t)(1u << 1))
352
353
353
354
struct queue_limits {
354
- unsigned int features ;
355
- unsigned int flags ;
355
+ blk_features_t features ;
356
+ blk_flags_t flags ;
356
357
unsigned long seg_boundary_mask ;
357
358
unsigned long virt_boundary_mask ;
358
359
0 commit comments