Compare changes

Choose any two refs to compare.

+6 -1
+6 -1
include/linux/closure.h
··· 172 bool closure_wait(struct closure_waitlist *list, struct closure *cl); 173 void __closure_sync(struct closure *cl); 174 175 /** 176 * closure_sync - sleep until a closure a closure has nothing left to wait on 177 * ··· 180 */ 181 static inline void closure_sync(struct closure *cl) 182 { 183 - if ((atomic_read(&cl->remaining) & CLOSURE_REMAINING_MASK) != 1) 184 __closure_sync(cl); 185 } 186
··· 172 bool closure_wait(struct closure_waitlist *list, struct closure *cl); 173 void __closure_sync(struct closure *cl); 174 175 + static inline unsigned closure_nr_remaining(struct closure *cl) 176 + { 177 + return atomic_read(&cl->remaining) & CLOSURE_REMAINING_MASK; 178 + } 179 + 180 /** 181 * closure_sync - sleep until a closure a closure has nothing left to wait on 182 * ··· 185 */ 186 static inline void closure_sync(struct closure *cl) 187 { 188 + if (closure_nr_remaining(cl) != 1) 189 __closure_sync(cl); 190 } 191