Commit 1de94b5
committed
eventfs: Shortcut eventfs_iterate() by skipping entries already read
As the ei->entries array is fixed for the duration of the eventfs_inode,
it can be used to skip over already read entries in eventfs_iterate().
That is, if ctx->pos is greater than zero, there's no reason in doing the
loop across the ei->entries array for the entries less than ctx->pos.
Instead, start the lookup of the entries at the current ctx->pos.
Link: https://lore.kernel.org/all/CAHk-=wiKwDUDv3+jCsv-uacDcHDVTYsXtBR9=6sGM5mqX+DhOg@mail.gmail.com/
Link: https://lore.kernel.org/linux-trace-kernel/20240104220048.494956957@goodmis.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent 704f960 commit 1de94b5
1 file changed
Lines changed: 10 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
749 | | - | |
750 | | - | |
751 | 749 | | |
752 | 750 | | |
753 | 751 | | |
754 | 752 | | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
| 753 | + | |
762 | 754 | | |
763 | | - | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
764 | 758 | | |
765 | 759 | | |
766 | 760 | | |
| |||
769 | 763 | | |
770 | 764 | | |
771 | 765 | | |
772 | | - | |
| 766 | + | |
773 | 767 | | |
774 | 768 | | |
775 | 769 | | |
| |||
778 | 772 | | |
779 | 773 | | |
780 | 774 | | |
781 | | - | |
| 775 | + | |
782 | 776 | | |
783 | 777 | | |
784 | 778 | | |
785 | 779 | | |
786 | | - | |
| 780 | + | |
787 | 781 | | |
788 | 782 | | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
789 | 786 | | |
790 | 787 | | |
791 | 788 | | |
| |||
0 commit comments