Lines Matching +full:wait +full:- +full:on +full:- +full:read
1 // SPDX-License-Identifier: GPL-2.0
4 // Search for stream-like files that are using nonseekable_open and convert
5 // them to stream_open. A stream-like file is a file that does not use ppos in
6 // its read and write. Rationale for the conversion is to avoid deadlock in
7 // between read and write.
11 virtual explain // explain decisions in the patch (SPFLAGS="-D explain")
13 // stream-like reader & writer - ones that do not depend on f_pos.
38 identifier wait =~ "^wait_.*";
42 wait(...)
48 // XXX wait_* can be called not directly from current function (e.g. func -> f -> g -> wait())
49 // XXX currently reader_blocks supports only direct and 1-level indirect cases.
52 identifier wait =~ "^wait_.*";
57 wait(...)
72 @ reader_blocks depends on reader_blocks_direct || reader_blocks_1 @
80 // file_operations + whether they have _any_ .read, .write, .llseek ... at all.
95 .read = read_f,
184 // file_operations that is candidate for stream_open conversion - it does not
187 // XXX for simplicity require no .{read/write}_iter and no .splice_{read/write} for now.
188 // XXX maybe_steam.fops cannot be used in other rules - it gives "bad rule maybe_stream or bad vari…
189 @ maybe_stream depends on (!has_llseek || has_no_llseek || has_noop_llseek) && !has_mmap && !has_co…
196 // ---- conversions ----
198 // XXX .open = nonseekable_open -> .open = stream_open
199 // XXX .open = func -> openfunc -> nonseekable_open
201 // read & write
203 // if both are used in the same file_operations together with an opener -
205 @ fops_rw depends on maybe_stream @
212 .read = readstream,
216 @ report_rw depends on report @
226 @ script:python depends on report && reader_blocks @
231 …"ERROR: %s: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix." % (fops…
233 @ script:python depends on report && !reader_blocks @
238 …"WARNING: %s: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream…
241 @ explain_rw_deadlocked depends on explain && reader_blocks @
246 - nonseekable_open
247 + nonseekable_open /* read & write (was deadlock) */
252 @ explain_rw_nodeadlock depends on explain && !reader_blocks @
257 - nonseekable_open
258 + nonseekable_open /* read & write (no direct deadlock) */
262 @ patch_rw depends on patch @
267 - nonseekable_open
273 // read, but not write
274 @ fops_r depends on maybe_stream && !has_write @
280 .read = readstream,
283 @ report_r depends on report @
293 @ script:python depends on report @
298 …"WARNING: %s: .read() has stream semantic; safe to change nonseekable_open -> stream_open." % (fop…
300 @ explain_r depends on explain @
305 - nonseekable_open
306 + nonseekable_open /* read only */
310 @ patch_r depends on patch @
315 - nonseekable_open
321 // write, but not read
322 @ fops_w depends on maybe_stream && !has_read @
331 @ report_w depends on report @
341 @ script:python depends on report @
346 …"WARNING: %s: .write() has stream semantic; safe to change nonseekable_open -> stream_open." % (fo…
348 @ explain_w depends on explain @
353 - nonseekable_open
358 @ patch_w depends on patch @
363 - nonseekable_open
369 // no read, no write - don't change anything