Lines Matching +full:wait +full:- +full:on +full:- +full:write
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.
111 .write = write_f,
185 // file_operations that is candidate for stream_open conversion - it does not
188 // XXX for simplicity require no .{read/write}_iter and no .splice_{read/write} for now.
189 // XXX maybe_steam.fops cannot be used in other rules - it gives "bad rule maybe_stream or bad vari…
190 @ maybe_stream depends on (!has_llseek || has_no_llseek || has_noop_llseek) && !has_mmap && !has_co…
197 // ---- conversions ----
199 // XXX .open = nonseekable_open -> .open = stream_open
200 // XXX .open = func -> openfunc -> nonseekable_open
202 // read & write
204 // if both are used in the same file_operations together with an opener -
206 @ fops_rw depends on maybe_stream @
214 .write = writestream,
217 @ report_rw depends on report @
227 @ script:python depends on report && reader_blocks @
232 …"ERROR: %s: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix." % (fops…
234 @ script:python depends on report && !reader_blocks @
239 …"WARNING: %s: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream…
242 @ explain_rw_deadlocked depends on explain && reader_blocks @
247 - nonseekable_open
248 + nonseekable_open /* read & write (was deadlock) */
253 @ explain_rw_nodeadlock depends on explain && !reader_blocks @
258 - nonseekable_open
259 + nonseekable_open /* read & write (no direct deadlock) */
263 @ patch_rw depends on patch @
268 - nonseekable_open
274 // read, but not write
275 @ fops_r depends on maybe_stream && !has_write @
284 @ report_r depends on report @
294 @ script:python depends on report @
299 …"WARNING: %s: .read() has stream semantic; safe to change nonseekable_open -> stream_open." % (fop…
301 @ explain_r depends on explain @
306 - nonseekable_open
311 @ patch_r depends on patch @
316 - nonseekable_open
322 // write, but not read
323 @ fops_w depends on maybe_stream && !has_read @
329 .write = writestream,
332 @ report_w depends on report @
342 @ script:python depends on report @
347 …"WARNING: %s: .write() has stream semantic; safe to change nonseekable_open -> stream_open." % (fo…
349 @ explain_w depends on explain @
354 - nonseekable_open
355 + nonseekable_open /* write only */
359 @ patch_w depends on patch @
364 - nonseekable_open
370 // no read, no write - don't change anything