@@ -364,16 +364,14 @@ static void dup_variable_bug(efi_char16_t *str16, efi_guid_t *vendor_guid,
364364 * efivar_init - build the initial list of EFI variables
365365 * @func: callback function to invoke for every variable
366366 * @data: function-specific data to pass to @func
367- * @head: initialised head of variable list
368367 *
369368 * Get every EFI variable from the firmware and invoke @func. @func
370- * should call efivar_entry_add() to build the list of variables .
369+ * should populate the initial dentry and inode tree .
371370 *
372371 * Returns 0 on success, or a kernel error code on failure.
373372 */
374- int efivar_init (int (* func )(efi_char16_t * , efi_guid_t , unsigned long , void * ,
375- struct list_head * ),
376- void * data , struct list_head * head )
373+ int efivar_init (int (* func )(efi_char16_t * , efi_guid_t , unsigned long , void * ),
374+ void * data )
377375{
378376 unsigned long variable_name_size = 512 ;
379377 efi_char16_t * variable_name ;
@@ -424,7 +422,7 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *,
424422 status = EFI_NOT_FOUND ;
425423 } else {
426424 err = func (variable_name , vendor_guid ,
427- variable_name_size , data , head );
425+ variable_name_size , data );
428426 if (err )
429427 status = EFI_NOT_FOUND ;
430428 }
@@ -456,42 +454,12 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *,
456454}
457455
458456/**
459- * efivar_entry_add - add entry to variable list
460- * @entry: entry to add to list
461- * @head: list head
462- *
463- * Returns 0 on success, or a kernel error code on failure.
464- */
465- int efivar_entry_add (struct efivar_entry * entry , struct list_head * head )
466- {
467- int err ;
468-
469- err = efivar_lock ();
470- if (err )
471- return err ;
472- list_add (& entry -> list , head );
473- efivar_unlock ();
474-
475- return 0 ;
476- }
477-
478- /**
479- * __efivar_entry_add - add entry to variable list
480- * @entry: entry to add to list
481- * @head: list head
482- */
483- void __efivar_entry_add (struct efivar_entry * entry , struct list_head * head )
484- {
485- list_add (& entry -> list , head );
486- }
487-
488- /**
489- * efivar_entry_delete - delete variable and remove entry from list
457+ * efivar_entry_delete - delete variable
490458 * @entry: entry containing variable to delete
491459 *
492- * Delete the variable from the firmware and remove @entry from the
493- * variable list. It is the caller's responsibility to free @entry
494- * once we return.
460+ * Delete the variable from the firmware. It is the caller's
461+ * responsibility to free @entry (by deleting the dentry/inode) once
462+ * we return.
495463 *
496464 * Returns 0 on success, -EINTR if we can't grab the semaphore,
497465 * converted EFI status code if set_variable() fails.
@@ -605,7 +573,7 @@ int efivar_entry_get(struct efivar_entry *entry, u32 *attributes,
605573 * get_variable() fail.
606574 *
607575 * If the EFI variable does not exist when calling set_variable()
608- * (EFI_NOT_FOUND), @entry is removed from the variable list .
576+ * (EFI_NOT_FOUND).
609577 */
610578int efivar_entry_set_get_size (struct efivar_entry * entry , u32 attributes ,
611579 unsigned long * size , void * data , bool * set )
@@ -621,9 +589,8 @@ int efivar_entry_set_get_size(struct efivar_entry *entry, u32 attributes,
621589 return - EINVAL ;
622590
623591 /*
624- * The lock here protects the get_variable call, the conditional
625- * set_variable call, and removal of the variable from the efivars
626- * list (in the case of an authenticated delete).
592+ * The lock here protects the get_variable call and the
593+ * conditional set_variable call
627594 */
628595 err = efivar_lock ();
629596 if (err )
@@ -661,37 +628,3 @@ int efivar_entry_set_get_size(struct efivar_entry *entry, u32 attributes,
661628 return err ;
662629
663630}
664-
665- /**
666- * efivar_entry_iter - iterate over variable list
667- * @func: callback function
668- * @head: head of variable list
669- * @data: function-specific data to pass to callback
670- *
671- * Iterate over the list of EFI variables and call @func with every
672- * entry on the list. It is safe for @func to remove entries in the
673- * list via efivar_entry_delete() while iterating.
674- *
675- * Some notes for the callback function:
676- * - a non-zero return value indicates an error and terminates the loop
677- * - @func is called from atomic context
678- */
679- int efivar_entry_iter (int (* func )(struct efivar_entry * , void * ),
680- struct list_head * head , void * data )
681- {
682- struct efivar_entry * entry , * n ;
683- int err = 0 ;
684-
685- err = efivar_lock ();
686- if (err )
687- return err ;
688-
689- list_for_each_entry_safe (entry , n , head , list ) {
690- err = func (entry , data );
691- if (err )
692- break ;
693- }
694- efivar_unlock ();
695-
696- return err ;
697- }
0 commit comments