@@ -283,55 +283,56 @@ static inline bool blk_op_is_passthrough(blk_opf_t op)
283283}
284284
285285/* 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 ;
289287
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))
292290
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))
295293
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))
298296
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))
301299
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))
304302
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))
307305
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))
310308
311- /* supports DAX */
312- BLK_FEAT_DAX = (1u << 8 ),
309+ /* supports REQ_NOWAIT */
310+ #define BLK_FEAT_NOWAIT ((__force blk_features_t) (1u << 7))
313311
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))
316314
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))
319317
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))
322320
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))
325323
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))
328326
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))
331329
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))
335336
336337/*
337338 * Flags automatically inherited when stacking limits.
@@ -342,17 +343,17 @@ enum {
342343 BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE)
343344
344345/* 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 ;
348347
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))
352353
353354struct queue_limits {
354- unsigned int features ;
355- unsigned int flags ;
355+ blk_features_t features ;
356+ blk_flags_t flags ;
356357 unsigned long seg_boundary_mask ;
357358 unsigned long virt_boundary_mask ;
358359
0 commit comments