hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/scripts/coccinelle/api/stream_open.cocci
....@@ -35,11 +35,11 @@
3535 // a function that blocks
3636 @ blocks @
3737 identifier block_f;
38
-identifier wait_event =~ "^wait_event_.*";
38
+identifier wait =~ "^wait_.*";
3939 @@
4040 block_f(...) {
4141 ... when exists
42
- wait_event(...)
42
+ wait(...)
4343 ... when exists
4444 }
4545
....@@ -49,12 +49,12 @@
4949 // XXX currently reader_blocks supports only direct and 1-level indirect cases.
5050 @ reader_blocks_direct @
5151 identifier stream_reader.readstream;
52
-identifier wait_event =~ "^wait_event_.*";
52
+identifier wait =~ "^wait_.*";
5353 @@
5454 readstream(...)
5555 {
5656 ... when exists
57
- wait_event(...)
57
+ wait(...)
5858 ... when exists
5959 }
6060
....@@ -134,6 +134,13 @@
134134 .llseek = no_llseek,
135135 };
136136
137
+@ has_noop_llseek @
138
+identifier fops0.fops;
139
+@@
140
+ struct file_operations fops = {
141
+ .llseek = noop_llseek,
142
+ };
143
+
137144 @ has_mmap @
138145 identifier fops0.fops;
139146 identifier mmap_f;
....@@ -180,7 +187,7 @@
180187 //
181188 // XXX for simplicity require no .{read/write}_iter and no .splice_{read/write} for now.
182189 // XXX maybe_steam.fops cannot be used in other rules - it gives "bad rule maybe_stream or bad variable fops".
183
-@ maybe_stream depends on (!has_llseek || has_no_llseek) && !has_mmap && !has_copy_file_range && !has_remap_file_range && !has_read_iter && !has_write_iter && !has_splice_read && !has_splice_write @
190
+@ maybe_stream depends on (!has_llseek || has_no_llseek || has_noop_llseek) && !has_mmap && !has_copy_file_range && !has_remap_file_range && !has_read_iter && !has_write_iter && !has_splice_read && !has_splice_write @
184191 identifier fops0.fops;
185192 @@
186193 struct file_operations fops = {