@@ -107,11 +107,11 @@ extern nodemask_t _unused_nodemask_arg_;
107
107
*/
108
108
#define nodemask_pr_args (maskp ) __nodemask_pr_numnodes(maskp), \
109
109
__nodemask_pr_bits(maskp)
110
- static inline unsigned int __nodemask_pr_numnodes (const nodemask_t * m )
110
+ static __always_inline unsigned int __nodemask_pr_numnodes (const nodemask_t * m )
111
111
{
112
112
return m ? MAX_NUMNODES : 0 ;
113
113
}
114
- static inline const unsigned long * __nodemask_pr_bits (const nodemask_t * m )
114
+ static __always_inline const unsigned long * __nodemask_pr_bits (const nodemask_t * m )
115
115
{
116
116
return m ? m -> bits : NULL ;
117
117
}
@@ -132,19 +132,19 @@ static __always_inline void __node_set(int node, volatile nodemask_t *dstp)
132
132
}
133
133
134
134
#define node_clear (node , dst ) __node_clear((node), &(dst))
135
- static inline void __node_clear (int node , volatile nodemask_t * dstp )
135
+ static __always_inline void __node_clear (int node , volatile nodemask_t * dstp )
136
136
{
137
137
clear_bit (node , dstp -> bits );
138
138
}
139
139
140
140
#define nodes_setall (dst ) __nodes_setall(&(dst), MAX_NUMNODES)
141
- static inline void __nodes_setall (nodemask_t * dstp , unsigned int nbits )
141
+ static __always_inline void __nodes_setall (nodemask_t * dstp , unsigned int nbits )
142
142
{
143
143
bitmap_fill (dstp -> bits , nbits );
144
144
}
145
145
146
146
#define nodes_clear (dst ) __nodes_clear(&(dst), MAX_NUMNODES)
147
- static inline void __nodes_clear (nodemask_t * dstp , unsigned int nbits )
147
+ static __always_inline void __nodes_clear (nodemask_t * dstp , unsigned int nbits )
148
148
{
149
149
bitmap_zero (dstp -> bits , nbits );
150
150
}
@@ -154,104 +154,104 @@ static inline void __nodes_clear(nodemask_t *dstp, unsigned int nbits)
154
154
155
155
#define node_test_and_set (node , nodemask ) \
156
156
__node_test_and_set((node), &(nodemask))
157
- static inline bool __node_test_and_set (int node , nodemask_t * addr )
157
+ static __always_inline bool __node_test_and_set (int node , nodemask_t * addr )
158
158
{
159
159
return test_and_set_bit (node , addr -> bits );
160
160
}
161
161
162
162
#define nodes_and (dst , src1 , src2 ) \
163
163
__nodes_and(&(dst), &(src1), &(src2), MAX_NUMNODES)
164
- static inline void __nodes_and (nodemask_t * dstp , const nodemask_t * src1p ,
164
+ static __always_inline void __nodes_and (nodemask_t * dstp , const nodemask_t * src1p ,
165
165
const nodemask_t * src2p , unsigned int nbits )
166
166
{
167
167
bitmap_and (dstp -> bits , src1p -> bits , src2p -> bits , nbits );
168
168
}
169
169
170
170
#define nodes_or (dst , src1 , src2 ) \
171
171
__nodes_or(&(dst), &(src1), &(src2), MAX_NUMNODES)
172
- static inline void __nodes_or (nodemask_t * dstp , const nodemask_t * src1p ,
172
+ static __always_inline void __nodes_or (nodemask_t * dstp , const nodemask_t * src1p ,
173
173
const nodemask_t * src2p , unsigned int nbits )
174
174
{
175
175
bitmap_or (dstp -> bits , src1p -> bits , src2p -> bits , nbits );
176
176
}
177
177
178
178
#define nodes_xor (dst , src1 , src2 ) \
179
179
__nodes_xor(&(dst), &(src1), &(src2), MAX_NUMNODES)
180
- static inline void __nodes_xor (nodemask_t * dstp , const nodemask_t * src1p ,
180
+ static __always_inline void __nodes_xor (nodemask_t * dstp , const nodemask_t * src1p ,
181
181
const nodemask_t * src2p , unsigned int nbits )
182
182
{
183
183
bitmap_xor (dstp -> bits , src1p -> bits , src2p -> bits , nbits );
184
184
}
185
185
186
186
#define nodes_andnot (dst , src1 , src2 ) \
187
187
__nodes_andnot(&(dst), &(src1), &(src2), MAX_NUMNODES)
188
- static inline void __nodes_andnot (nodemask_t * dstp , const nodemask_t * src1p ,
188
+ static __always_inline void __nodes_andnot (nodemask_t * dstp , const nodemask_t * src1p ,
189
189
const nodemask_t * src2p , unsigned int nbits )
190
190
{
191
191
bitmap_andnot (dstp -> bits , src1p -> bits , src2p -> bits , nbits );
192
192
}
193
193
194
194
#define nodes_complement (dst , src ) \
195
195
__nodes_complement(&(dst), &(src), MAX_NUMNODES)
196
- static inline void __nodes_complement (nodemask_t * dstp ,
196
+ static __always_inline void __nodes_complement (nodemask_t * dstp ,
197
197
const nodemask_t * srcp , unsigned int nbits )
198
198
{
199
199
bitmap_complement (dstp -> bits , srcp -> bits , nbits );
200
200
}
201
201
202
202
#define nodes_equal (src1 , src2 ) \
203
203
__nodes_equal(&(src1), &(src2), MAX_NUMNODES)
204
- static inline bool __nodes_equal (const nodemask_t * src1p ,
204
+ static __always_inline bool __nodes_equal (const nodemask_t * src1p ,
205
205
const nodemask_t * src2p , unsigned int nbits )
206
206
{
207
207
return bitmap_equal (src1p -> bits , src2p -> bits , nbits );
208
208
}
209
209
210
210
#define nodes_intersects (src1 , src2 ) \
211
211
__nodes_intersects(&(src1), &(src2), MAX_NUMNODES)
212
- static inline bool __nodes_intersects (const nodemask_t * src1p ,
212
+ static __always_inline bool __nodes_intersects (const nodemask_t * src1p ,
213
213
const nodemask_t * src2p , unsigned int nbits )
214
214
{
215
215
return bitmap_intersects (src1p -> bits , src2p -> bits , nbits );
216
216
}
217
217
218
218
#define nodes_subset (src1 , src2 ) \
219
219
__nodes_subset(&(src1), &(src2), MAX_NUMNODES)
220
- static inline bool __nodes_subset (const nodemask_t * src1p ,
220
+ static __always_inline bool __nodes_subset (const nodemask_t * src1p ,
221
221
const nodemask_t * src2p , unsigned int nbits )
222
222
{
223
223
return bitmap_subset (src1p -> bits , src2p -> bits , nbits );
224
224
}
225
225
226
226
#define nodes_empty (src ) __nodes_empty(&(src), MAX_NUMNODES)
227
- static inline bool __nodes_empty (const nodemask_t * srcp , unsigned int nbits )
227
+ static __always_inline bool __nodes_empty (const nodemask_t * srcp , unsigned int nbits )
228
228
{
229
229
return bitmap_empty (srcp -> bits , nbits );
230
230
}
231
231
232
232
#define nodes_full (nodemask ) __nodes_full(&(nodemask), MAX_NUMNODES)
233
- static inline bool __nodes_full (const nodemask_t * srcp , unsigned int nbits )
233
+ static __always_inline bool __nodes_full (const nodemask_t * srcp , unsigned int nbits )
234
234
{
235
235
return bitmap_full (srcp -> bits , nbits );
236
236
}
237
237
238
238
#define nodes_weight (nodemask ) __nodes_weight(&(nodemask), MAX_NUMNODES)
239
- static inline int __nodes_weight (const nodemask_t * srcp , unsigned int nbits )
239
+ static __always_inline int __nodes_weight (const nodemask_t * srcp , unsigned int nbits )
240
240
{
241
241
return bitmap_weight (srcp -> bits , nbits );
242
242
}
243
243
244
244
#define nodes_shift_right (dst , src , n ) \
245
245
__nodes_shift_right(&(dst), &(src), (n), MAX_NUMNODES)
246
- static inline void __nodes_shift_right (nodemask_t * dstp ,
246
+ static __always_inline void __nodes_shift_right (nodemask_t * dstp ,
247
247
const nodemask_t * srcp , int n , int nbits )
248
248
{
249
249
bitmap_shift_right (dstp -> bits , srcp -> bits , n , nbits );
250
250
}
251
251
252
252
#define nodes_shift_left (dst , src , n ) \
253
253
__nodes_shift_left(&(dst), &(src), (n), MAX_NUMNODES)
254
- static inline void __nodes_shift_left (nodemask_t * dstp ,
254
+ static __always_inline void __nodes_shift_left (nodemask_t * dstp ,
255
255
const nodemask_t * srcp , int n , int nbits )
256
256
{
257
257
bitmap_shift_left (dstp -> bits , srcp -> bits , n , nbits );
@@ -261,13 +261,13 @@ static inline void __nodes_shift_left(nodemask_t *dstp,
261
261
> MAX_NUMNODES, then the silly min_ts could be dropped. */
262
262
263
263
#define first_node (src ) __first_node(&(src))
264
- static inline unsigned int __first_node (const nodemask_t * srcp )
264
+ static __always_inline unsigned int __first_node (const nodemask_t * srcp )
265
265
{
266
266
return min_t (unsigned int , MAX_NUMNODES , find_first_bit (srcp -> bits , MAX_NUMNODES ));
267
267
}
268
268
269
269
#define next_node (n , src ) __next_node((n), &(src))
270
- static inline unsigned int __next_node (int n , const nodemask_t * srcp )
270
+ static __always_inline unsigned int __next_node (int n , const nodemask_t * srcp )
271
271
{
272
272
return min_t (unsigned int , MAX_NUMNODES , find_next_bit (srcp -> bits , MAX_NUMNODES , n + 1 ));
273
273
}
@@ -277,7 +277,7 @@ static inline unsigned int __next_node(int n, const nodemask_t *srcp)
277
277
* the first node in src if needed. Returns MAX_NUMNODES if src is empty.
278
278
*/
279
279
#define next_node_in (n , src ) __next_node_in((n), &(src))
280
- static inline unsigned int __next_node_in (int node , const nodemask_t * srcp )
280
+ static __always_inline unsigned int __next_node_in (int node , const nodemask_t * srcp )
281
281
{
282
282
unsigned int ret = __next_node (node , srcp );
283
283
@@ -286,7 +286,7 @@ static inline unsigned int __next_node_in(int node, const nodemask_t *srcp)
286
286
return ret ;
287
287
}
288
288
289
- static inline void init_nodemask_of_node (nodemask_t * mask , int node )
289
+ static __always_inline void init_nodemask_of_node (nodemask_t * mask , int node )
290
290
{
291
291
nodes_clear (* mask );
292
292
node_set (node , * mask );
@@ -304,7 +304,7 @@ static inline void init_nodemask_of_node(nodemask_t *mask, int node)
304
304
})
305
305
306
306
#define first_unset_node (mask ) __first_unset_node(&(mask))
307
- static inline unsigned int __first_unset_node (const nodemask_t * maskp )
307
+ static __always_inline unsigned int __first_unset_node (const nodemask_t * maskp )
308
308
{
309
309
return min_t (unsigned int , MAX_NUMNODES ,
310
310
find_first_zero_bit (maskp -> bits , MAX_NUMNODES ));
@@ -338,45 +338,45 @@ static inline unsigned int __first_unset_node(const nodemask_t *maskp)
338
338
339
339
#define nodemask_parse_user (ubuf , ulen , dst ) \
340
340
__nodemask_parse_user((ubuf), (ulen), &(dst), MAX_NUMNODES)
341
- static inline int __nodemask_parse_user (const char __user * buf , int len ,
341
+ static __always_inline int __nodemask_parse_user (const char __user * buf , int len ,
342
342
nodemask_t * dstp , int nbits )
343
343
{
344
344
return bitmap_parse_user (buf , len , dstp -> bits , nbits );
345
345
}
346
346
347
347
#define nodelist_parse (buf , dst ) __nodelist_parse((buf), &(dst), MAX_NUMNODES)
348
- static inline int __nodelist_parse (const char * buf , nodemask_t * dstp , int nbits )
348
+ static __always_inline int __nodelist_parse (const char * buf , nodemask_t * dstp , int nbits )
349
349
{
350
350
return bitmap_parselist (buf , dstp -> bits , nbits );
351
351
}
352
352
353
353
#define node_remap (oldbit , old , new ) \
354
354
__node_remap((oldbit), &(old), &(new), MAX_NUMNODES)
355
- static inline int __node_remap (int oldbit ,
355
+ static __always_inline int __node_remap (int oldbit ,
356
356
const nodemask_t * oldp , const nodemask_t * newp , int nbits )
357
357
{
358
358
return bitmap_bitremap (oldbit , oldp -> bits , newp -> bits , nbits );
359
359
}
360
360
361
361
#define nodes_remap (dst , src , old , new ) \
362
362
__nodes_remap(&(dst), &(src), &(old), &(new), MAX_NUMNODES)
363
- static inline void __nodes_remap (nodemask_t * dstp , const nodemask_t * srcp ,
363
+ static __always_inline void __nodes_remap (nodemask_t * dstp , const nodemask_t * srcp ,
364
364
const nodemask_t * oldp , const nodemask_t * newp , int nbits )
365
365
{
366
366
bitmap_remap (dstp -> bits , srcp -> bits , oldp -> bits , newp -> bits , nbits );
367
367
}
368
368
369
369
#define nodes_onto (dst , orig , relmap ) \
370
370
__nodes_onto(&(dst), &(orig), &(relmap), MAX_NUMNODES)
371
- static inline void __nodes_onto (nodemask_t * dstp , const nodemask_t * origp ,
371
+ static __always_inline void __nodes_onto (nodemask_t * dstp , const nodemask_t * origp ,
372
372
const nodemask_t * relmapp , int nbits )
373
373
{
374
374
bitmap_onto (dstp -> bits , origp -> bits , relmapp -> bits , nbits );
375
375
}
376
376
377
377
#define nodes_fold (dst , orig , sz ) \
378
378
__nodes_fold(&(dst), &(orig), sz, MAX_NUMNODES)
379
- static inline void __nodes_fold (nodemask_t * dstp , const nodemask_t * origp ,
379
+ static __always_inline void __nodes_fold (nodemask_t * dstp , const nodemask_t * origp ,
380
380
int sz , int nbits )
381
381
{
382
382
bitmap_fold (dstp -> bits , origp -> bits , sz , nbits );
@@ -418,22 +418,22 @@ enum node_states {
418
418
extern nodemask_t node_states [NR_NODE_STATES ];
419
419
420
420
#if MAX_NUMNODES > 1
421
- static inline int node_state (int node , enum node_states state )
421
+ static __always_inline int node_state (int node , enum node_states state )
422
422
{
423
423
return node_isset (node , node_states [state ]);
424
424
}
425
425
426
- static inline void node_set_state (int node , enum node_states state )
426
+ static __always_inline void node_set_state (int node , enum node_states state )
427
427
{
428
428
__node_set (node , & node_states [state ]);
429
429
}
430
430
431
- static inline void node_clear_state (int node , enum node_states state )
431
+ static __always_inline void node_clear_state (int node , enum node_states state )
432
432
{
433
433
__node_clear (node , & node_states [state ]);
434
434
}
435
435
436
- static inline int num_node_state (enum node_states state )
436
+ static __always_inline int num_node_state (enum node_states state )
437
437
{
438
438
return nodes_weight (node_states [state ]);
439
439
}
@@ -443,46 +443,46 @@ static inline int num_node_state(enum node_states state)
443
443
444
444
#define first_online_node first_node(node_states[N_ONLINE])
445
445
#define first_memory_node first_node(node_states[N_MEMORY])
446
- static inline unsigned int next_online_node (int nid )
446
+ static __always_inline unsigned int next_online_node (int nid )
447
447
{
448
448
return next_node (nid , node_states [N_ONLINE ]);
449
449
}
450
- static inline unsigned int next_memory_node (int nid )
450
+ static __always_inline unsigned int next_memory_node (int nid )
451
451
{
452
452
return next_node (nid , node_states [N_MEMORY ]);
453
453
}
454
454
455
455
extern unsigned int nr_node_ids ;
456
456
extern unsigned int nr_online_nodes ;
457
457
458
- static inline void node_set_online (int nid )
458
+ static __always_inline void node_set_online (int nid )
459
459
{
460
460
node_set_state (nid , N_ONLINE );
461
461
nr_online_nodes = num_node_state (N_ONLINE );
462
462
}
463
463
464
- static inline void node_set_offline (int nid )
464
+ static __always_inline void node_set_offline (int nid )
465
465
{
466
466
node_clear_state (nid , N_ONLINE );
467
467
nr_online_nodes = num_node_state (N_ONLINE );
468
468
}
469
469
470
470
#else
471
471
472
- static inline int node_state (int node , enum node_states state )
472
+ static __always_inline int node_state (int node , enum node_states state )
473
473
{
474
474
return node == 0 ;
475
475
}
476
476
477
- static inline void node_set_state (int node , enum node_states state )
477
+ static __always_inline void node_set_state (int node , enum node_states state )
478
478
{
479
479
}
480
480
481
- static inline void node_clear_state (int node , enum node_states state )
481
+ static __always_inline void node_clear_state (int node , enum node_states state )
482
482
{
483
483
}
484
484
485
- static inline int num_node_state (enum node_states state )
485
+ static __always_inline int num_node_state (enum node_states state )
486
486
{
487
487
return 1 ;
488
488
}
@@ -502,7 +502,7 @@ static inline int num_node_state(enum node_states state)
502
502
503
503
#endif
504
504
505
- static inline int node_random (const nodemask_t * maskp )
505
+ static __always_inline int node_random (const nodemask_t * maskp )
506
506
{
507
507
#if defined(CONFIG_NUMA ) && (MAX_NUMNODES > 1 )
508
508
int w , bit ;
0 commit comments