@@ -117,7 +117,7 @@ void srcu_drive_gp(struct work_struct *wp)
117
117
struct srcu_struct * ssp ;
118
118
119
119
ssp = container_of (wp , struct srcu_struct , srcu_work );
120
- if (ssp -> srcu_gp_running || USHORT_CMP_GE (ssp -> srcu_idx , READ_ONCE (ssp -> srcu_idx_max )))
120
+ if (ssp -> srcu_gp_running || ULONG_CMP_GE (ssp -> srcu_idx , READ_ONCE (ssp -> srcu_idx_max )))
121
121
return ; /* Already running or nothing to do. */
122
122
123
123
/* Remove recently arrived callbacks and wait for readers. */
@@ -150,17 +150,17 @@ void srcu_drive_gp(struct work_struct *wp)
150
150
* straighten that out.
151
151
*/
152
152
WRITE_ONCE (ssp -> srcu_gp_running , false);
153
- if (USHORT_CMP_LT (ssp -> srcu_idx , READ_ONCE (ssp -> srcu_idx_max )))
153
+ if (ULONG_CMP_LT (ssp -> srcu_idx , READ_ONCE (ssp -> srcu_idx_max )))
154
154
schedule_work (& ssp -> srcu_work );
155
155
}
156
156
EXPORT_SYMBOL_GPL (srcu_drive_gp );
157
157
158
158
static void srcu_gp_start_if_needed (struct srcu_struct * ssp )
159
159
{
160
- unsigned short cookie ;
160
+ unsigned long cookie ;
161
161
162
162
cookie = get_state_synchronize_srcu (ssp );
163
- if (USHORT_CMP_GE (READ_ONCE (ssp -> srcu_idx_max ), cookie ))
163
+ if (ULONG_CMP_GE (READ_ONCE (ssp -> srcu_idx_max ), cookie ))
164
164
return ;
165
165
WRITE_ONCE (ssp -> srcu_idx_max , cookie );
166
166
if (!READ_ONCE (ssp -> srcu_gp_running )) {
@@ -215,7 +215,7 @@ unsigned long get_state_synchronize_srcu(struct srcu_struct *ssp)
215
215
barrier ();
216
216
ret = (READ_ONCE (ssp -> srcu_idx ) + 3 ) & ~0x1 ;
217
217
barrier ();
218
- return ret & USHRT_MAX ;
218
+ return ret ;
219
219
}
220
220
EXPORT_SYMBOL_GPL (get_state_synchronize_srcu );
221
221
@@ -240,10 +240,10 @@ EXPORT_SYMBOL_GPL(start_poll_synchronize_srcu);
240
240
*/
241
241
bool poll_state_synchronize_srcu (struct srcu_struct * ssp , unsigned long cookie )
242
242
{
243
- unsigned short cur_s = READ_ONCE (ssp -> srcu_idx );
243
+ unsigned long cur_s = READ_ONCE (ssp -> srcu_idx );
244
244
245
245
barrier ();
246
- return USHORT_CMP_GE (cur_s , cookie ) || USHORT_CMP_LT (cur_s , cookie - 3 );
246
+ return ULONG_CMP_GE (cur_s , cookie ) || ULONG_CMP_LT (cur_s , cookie - 3 );
247
247
}
248
248
EXPORT_SYMBOL_GPL (poll_state_synchronize_srcu );
249
249
0 commit comments