~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/ioprio.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/uapi/linux/ioprio.h (Version linux-6.12-rc7) and /include/uapi/linux/ioprio.h (Version linux-5.4.284)


** Warning: Cannot open xref database.

  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux      1 
  2 #ifndef _UAPI_LINUX_IOPRIO_H                      
  3 #define _UAPI_LINUX_IOPRIO_H                      
  4                                                   
  5 #include <linux/stddef.h>                         
  6 #include <linux/types.h>                          
  7                                                   
  8 /*                                                
  9  * Gives us 8 prio classes with 13-bits of dat    
 10  */                                               
 11 #define IOPRIO_CLASS_SHIFT      13                
 12 #define IOPRIO_NR_CLASSES       8                 
 13 #define IOPRIO_CLASS_MASK       (IOPRIO_NR_CLA    
 14 #define IOPRIO_PRIO_MASK        ((1UL << IOPRI    
 15                                                   
 16 #define IOPRIO_PRIO_CLASS(ioprio)       \         
 17         (((ioprio) >> IOPRIO_CLASS_SHIFT) & IO    
 18 #define IOPRIO_PRIO_DATA(ioprio)        ((iopr    
 19                                                   
 20 /*                                                
 21  * These are the io priority classes as implem    
 22  * schedulers. RT is the realtime class, it al    
 23  * ATA disks supporting NCQ IO priority, RT cl    
 24  * high priority NCQ commands. BE is the best-    
 25  * default for any process. IDLE is the idle s    
 26  * served when no one else is using the disk.     
 27  */                                               
 28 enum {                                            
 29         IOPRIO_CLASS_NONE       = 0,              
 30         IOPRIO_CLASS_RT         = 1,              
 31         IOPRIO_CLASS_BE         = 2,              
 32         IOPRIO_CLASS_IDLE       = 3,              
 33                                                   
 34         /* Special class to indicate an invali    
 35         IOPRIO_CLASS_INVALID    = 7,              
 36 };                                                
 37                                                   
 38 /*                                                
 39  * The RT and BE priority classes both support    
 40  * can be specified using the lower 3-bits of     
 41  */                                               
 42 #define IOPRIO_LEVEL_NR_BITS            3         
 43 #define IOPRIO_NR_LEVELS                (1 <<     
 44 #define IOPRIO_LEVEL_MASK               (IOPRI    
 45 #define IOPRIO_PRIO_LEVEL(ioprio)       ((iopr    
 46                                                   
 47 #define IOPRIO_BE_NR                    IOPRIO    
 48                                                   
 49 /*                                                
 50  * Possible values for the "which" argument of    
 51  * ioprio_set() system calls (see "man ioprio_    
 52  */                                               
 53 enum {                                            
 54         IOPRIO_WHO_PROCESS = 1,                   
 55         IOPRIO_WHO_PGRP,                          
 56         IOPRIO_WHO_USER,                          
 57 };                                                
 58                                                   
 59 /*                                                
 60  * Fallback BE class priority level.              
 61  */                                               
 62 #define IOPRIO_NORM     4                         
 63 #define IOPRIO_BE_NORM  IOPRIO_NORM               
 64                                                   
 65 /*                                                
 66  * The 10 bits between the priority class and     
 67  * optionally define I/O hints for any combina    
 68  * level. Depending on the kernel configuratio    
 69  * the target I/O device being used, hints can    
 70  * without affecting the I/O scheduling orderi    
 71  * class and level.                               
 72  */                                               
 73 #define IOPRIO_HINT_SHIFT               IOPRIO    
 74 #define IOPRIO_HINT_NR_BITS             10        
 75 #define IOPRIO_NR_HINTS                 (1 <<     
 76 #define IOPRIO_HINT_MASK                (IOPRI    
 77 #define IOPRIO_PRIO_HINT(ioprio)        \         
 78         (((ioprio) >> IOPRIO_HINT_SHIFT) & IOP    
 79                                                   
 80 /*                                                
 81  * I/O hints.                                     
 82  */                                               
 83 enum {                                            
 84         /* No hint */                             
 85         IOPRIO_HINT_NONE = 0,                     
 86                                                   
 87         /*                                        
 88          * Device command duration limits: ind    
 89          * duration limit for the commands tha    
 90          * These will currently only be effect    
 91          * support the command duration limits    
 92          * enabled, then the commands issued t    
 93          * one of these hints set will have th    
 94          * set to the value of the hint.          
 95          */                                       
 96         IOPRIO_HINT_DEV_DURATION_LIMIT_1 = 1,     
 97         IOPRIO_HINT_DEV_DURATION_LIMIT_2 = 2,     
 98         IOPRIO_HINT_DEV_DURATION_LIMIT_3 = 3,     
 99         IOPRIO_HINT_DEV_DURATION_LIMIT_4 = 4,     
100         IOPRIO_HINT_DEV_DURATION_LIMIT_5 = 5,     
101         IOPRIO_HINT_DEV_DURATION_LIMIT_6 = 6,     
102         IOPRIO_HINT_DEV_DURATION_LIMIT_7 = 7,     
103 };                                                
104                                                   
105 #define IOPRIO_BAD_VALUE(val, max) ((val) < 0     
106                                                   
107 /*                                                
108  * Return an I/O priority value based on a cla    
109  */                                               
110 static __always_inline __u16 ioprio_value(int     
111                                           int     
112 {                                                 
113         if (IOPRIO_BAD_VALUE(prioclass, IOPRIO    
114             IOPRIO_BAD_VALUE(priolevel, IOPRIO    
115             IOPRIO_BAD_VALUE(priohint, IOPRIO_    
116                 return IOPRIO_CLASS_INVALID <<    
117                                                   
118         return (prioclass << IOPRIO_CLASS_SHIF    
119                 (priohint << IOPRIO_HINT_SHIFT    
120 }                                                 
121                                                   
122 #define IOPRIO_PRIO_VALUE(prioclass, priolevel    
123         ioprio_value(prioclass, priolevel, IOP    
124 #define IOPRIO_PRIO_VALUE_HINT(prioclass, prio    
125         ioprio_value(prioclass, priolevel, pri    
126                                                   
127 #endif /* _UAPI_LINUX_IOPRIO_H */                 
128                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php