Commit 8fd3395
Al Viro
get rid of ...lookup...fdget_rcu() family
Once upon a time, predecessors of those used to do file lookup
without bumping a refcount, provided that caller held rcu_read_lock()
across the lookup and whatever it wanted to read from the struct
file found. When struct file allocation switched to SLAB_TYPESAFE_BY_RCU,
that stopped being feasible and these primitives started to bump the
file refcount for lookup result, requiring the caller to call fput()
afterwards.
But that turned them pointless - e.g.
rcu_read_lock();
file = lookup_fdget_rcu(fd);
rcu_read_unlock();
is equivalent to
file = fget_raw(fd);
and all callers of lookup_fdget_rcu() are of that form. Similarly,
task_lookup_fdget_rcu() calls can be replaced with calling fget_task().
task_lookup_next_fdget_rcu() doesn't have direct counterparts, but
its callers would be happier if we replaced it with an analogue that
deals with RCU internally.
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>1 parent 8cf0b93 commit 8fd3395
9 files changed
Lines changed: 14 additions & 62 deletions
File tree
- arch/powerpc/platforms/cell/spufs
- fs
- gfs2
- notify/dnotify
- proc
- include/linux
- kernel
- bpf
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
79 | 77 | | |
80 | 78 | | |
81 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
| 1040 | + | |
1063 | 1041 | | |
1064 | 1042 | | |
1065 | 1043 | | |
| |||
1069 | 1047 | | |
1070 | 1048 | | |
1071 | 1049 | | |
| 1050 | + | |
1072 | 1051 | | |
1073 | 1052 | | |
1074 | 1053 | | |
1075 | 1054 | | |
1076 | 1055 | | |
| 1056 | + | |
1077 | 1057 | | |
1078 | 1058 | | |
1079 | 1059 | | |
1080 | 1060 | | |
1081 | 1061 | | |
1082 | | - | |
| 1062 | + | |
1083 | 1063 | | |
1084 | 1064 | | |
1085 | 1065 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
2768 | 2767 | | |
2769 | 2768 | | |
2770 | 2769 | | |
2771 | | - | |
2772 | 2770 | | |
2773 | | - | |
2774 | | - | |
2775 | | - | |
| 2771 | + | |
2776 | 2772 | | |
2777 | 2773 | | |
2778 | 2774 | | |
2779 | 2775 | | |
2780 | 2776 | | |
2781 | | - | |
2782 | | - | |
| 2777 | + | |
2783 | 2778 | | |
2784 | 2779 | | |
2785 | | - | |
2786 | 2780 | | |
2787 | | - | |
2788 | 2781 | | |
2789 | | - | |
2790 | 2782 | | |
2791 | 2783 | | |
2792 | 2784 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
347 | 346 | | |
348 | 347 | | |
349 | 348 | | |
350 | | - | |
351 | | - | |
352 | | - | |
| 349 | + | |
353 | 350 | | |
354 | 351 | | |
355 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 119 | + | |
122 | 120 | | |
123 | 121 | | |
124 | 122 | | |
| |||
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
261 | | - | |
262 | 259 | | |
263 | 260 | | |
264 | 261 | | |
265 | 262 | | |
266 | 263 | | |
267 | 264 | | |
268 | | - | |
| 265 | + | |
269 | 266 | | |
270 | 267 | | |
271 | 268 | | |
272 | 269 | | |
273 | | - | |
274 | 270 | | |
275 | 271 | | |
276 | 272 | | |
277 | 273 | | |
278 | 274 | | |
279 | 275 | | |
280 | 276 | | |
281 | | - | |
| 277 | + | |
282 | 278 | | |
283 | | - | |
284 | 279 | | |
285 | | - | |
286 | 280 | | |
287 | 281 | | |
288 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 95 | | |
100 | 96 | | |
101 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
286 | 285 | | |
287 | 286 | | |
288 | 287 | | |
289 | | - | |
290 | | - | |
| 288 | + | |
291 | 289 | | |
292 | 290 | | |
293 | 291 | | |
294 | | - | |
295 | 292 | | |
296 | 293 | | |
297 | 294 | | |
298 | 295 | | |
299 | | - | |
300 | 296 | | |
301 | 297 | | |
302 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 66 | + | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
| |||
0 commit comments