Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

liveupdate: luo_file: Use private list

Switch LUO to use the private list iterators.

Link: https://lkml.kernel.org/r/20251218155752.3045808-4-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Alexander Graf <graf@amazon.com>
Cc: David Gow <davidgow@google.com>
Cc: David Matlack <dmatlack@google.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kees Cook <kees@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Cc: Samiullah Khawaja <skhawaja@google.com>
Cc: Tamir Duberstein <tamird@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Pasha Tatashin and committed by
Andrew Morton
6845645e 66bd8501

+4 -10
+4 -3
kernel/liveupdate/luo_file.c
··· 104 104 #include <linux/io.h> 105 105 #include <linux/kexec_handover.h> 106 106 #include <linux/kho/abi/luo.h> 107 + #include <linux/list_private.h> 107 108 #include <linux/liveupdate.h> 108 109 #include <linux/module.h> 109 110 #include <linux/sizes.h> ··· 274 273 goto err_fput; 275 274 276 275 err = -ENOENT; 277 - luo_list_for_each_private(fh, &luo_file_handler_list, list) { 276 + list_private_for_each_entry(fh, &luo_file_handler_list, list) { 278 277 if (fh->ops->can_preserve(fh, file)) { 279 278 err = 0; 280 279 break; ··· 761 760 bool handler_found = false; 762 761 struct luo_file *luo_file; 763 762 764 - luo_list_for_each_private(fh, &luo_file_handler_list, list) { 763 + list_private_for_each_entry(fh, &luo_file_handler_list, list) { 765 764 if (!strcmp(fh->compatible, file_ser[i].compatible)) { 766 765 handler_found = true; 767 766 break; ··· 836 835 return -EBUSY; 837 836 838 837 /* Check for duplicate compatible strings */ 839 - luo_list_for_each_private(fh_iter, &luo_file_handler_list, list) { 838 + list_private_for_each_entry(fh_iter, &luo_file_handler_list, list) { 840 839 if (!strcmp(fh_iter->compatible, fh->compatible)) { 841 840 pr_err("File handler registration failed: Compatible string '%s' already registered.\n", 842 841 fh->compatible);
-7
kernel/liveupdate/luo_internal.h
··· 40 40 */ 41 41 #define luo_restore_fail(__fmt, ...) panic(__fmt, ##__VA_ARGS__) 42 42 43 - /* Mimics list_for_each_entry() but for private list head entries */ 44 - #define luo_list_for_each_private(pos, head, member) \ 45 - for (struct list_head *__iter = (head)->next; \ 46 - __iter != (head) && \ 47 - ({ pos = container_of(__iter, typeof(*(pos)), member); 1; }); \ 48 - __iter = __iter->next) 49 - 50 43 /** 51 44 * struct luo_file_set - A set of files that belong to the same sessions. 52 45 * @files_list: An ordered list of files associated with this session, it is