Subversion Repositories Kolibri OS

Rev

Rev 6936 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6936 Rev 7143
Line 317... Line 317...
317
	struct list_head *__next = READ_ONCE(__ptr->next); \
317
	struct list_head *__next = READ_ONCE(__ptr->next); \
318
	likely(__ptr != __next) ? list_entry_rcu(__next, type, member) : NULL; \
318
	likely(__ptr != __next) ? list_entry_rcu(__next, type, member) : NULL; \
319
})
319
})
Line 320... Line 320...
320
 
320
 
-
 
321
/**
-
 
322
 * list_next_or_null_rcu - get the first element from a list
-
 
323
 * @head:	the head for the list.
-
 
324
 * @ptr:        the list head to take the next element from.
-
 
325
 * @type:       the type of the struct this is embedded in.
-
 
326
 * @member:     the name of the list_head within the struct.
-
 
327
 *
-
 
328
 * Note that if the ptr is at the end of the list, NULL is returned.
-
 
329
 *
-
 
330
 * This primitive may safely run concurrently with the _rcu list-mutation
-
 
331
 * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
-
 
332
 */
-
 
333
#define list_next_or_null_rcu(head, ptr, type, member) \
-
 
334
({ \
-
 
335
	struct list_head *__head = (head); \
-
 
336
	struct list_head *__ptr = (ptr); \
-
 
337
	struct list_head *__next = READ_ONCE(__ptr->next); \
-
 
338
	likely(__next != __head) ? list_entry_rcu(__next, type, \
-
 
339
						  member) : NULL; \
-
 
340
})
-
 
341
 
321
/**
342
/**
322
 * list_for_each_entry_rcu	-	iterate over rcu list of given type
343
 * list_for_each_entry_rcu	-	iterate over rcu list of given type
323
 * @pos:	the type * to use as a loop cursor.
344
 * @pos:	the type * to use as a loop cursor.
324
 * @head:	the head for your list.
345
 * @head:	the head for your list.
325
 * @member:	the name of the list_head within the struct.
346
 * @member:	the name of the list_head within the struct.