Repository navigation
Commit fe0f726
committed
kernfs: combine ino/id lookup functions into kernfs_find_and_get_node_by_id()
kernfs_find_and_get_node_by_ino() looks the kernfs_node matching the
specified ino. On top of that, kernfs_get_node_by_id() and
kernfs_fh_get_inode() implement full ID matching by testing the rest
of ID.
On surface, confusingly, the two are slightly different in that the
latter uses 0 gen as wildcard while the former doesn't - does it mean
that the latter can't uniquely identify inodes w/ 0 gen? In practice,
this is a distinction without a difference because generation number
starts at 1. There are no actual IDs with 0 gen, so it can always
safely used as wildcard.
Let's simplify the code by renaming kernfs_find_and_get_node_by_ino()
to kernfs_find_and_get_node_by_id(), moving all lookup logics into it,
and removing now unnecessary kernfs_get_node_by_id().
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 67c0496 commit fe0f726
5 files changed
Lines changed: 18 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
699 | | - | |
| 699 | + | |
700 | 700 | | |
701 | | - | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
702 | 705 | | |
703 | 706 | | |
704 | 707 | | |
705 | 708 | | |
706 | | - | |
707 | | - | |
| 709 | + | |
| 710 | + | |
708 | 711 | | |
709 | 712 | | |
| 713 | + | |
| 714 | + | |
710 | 715 | | |
711 | 716 | | |
712 | 717 | | |
713 | 718 | | |
714 | 719 | | |
715 | 720 | | |
716 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
717 | 726 | | |
718 | 727 | | |
719 | 728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | 112 | | |
115 | 113 | | |
116 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | 56 | | |
75 | 57 | | |
76 | 58 | | |
| |||
81 | 63 | | |
82 | 64 | | |
83 | 65 | | |
84 | | - | |
| 66 | + | |
| 67 | + | |
85 | 68 | | |
86 | 69 | | |
87 | 70 | | |
88 | 71 | | |
89 | 72 | | |
90 | 73 | | |
91 | 74 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 75 | | |
98 | 76 | | |
99 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
| 396 | + | |
| 397 | + | |
397 | 398 | | |
398 | 399 | | |
399 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5790 | 5790 | | |
5791 | 5791 | | |
5792 | 5792 | | |
5793 | | - | |
| 5793 | + | |
5794 | 5794 | | |
5795 | 5795 | | |
5796 | 5796 | | |
| |||
0 commit comments