Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs/pipe: set FMODE_NOWAIT in create_pipe_files()

Rather than have the caller set the FMODE_NOWAIT flags for both output
files, move it to create_pipe_files() where other f_mode flags are set
anyway with stream_open(). With that, both __do_pipe_flags() and
io_pipe() can remove the manual setting of the NOWAIT flags.

No intended functional changes, just a code cleanup.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/1f0473f8-69f3-4eb1-aa77-3334c6a71d24@kernel.dk
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Jens Axboe and committed by
Christian Brauner
dd765ba8 cd95e366

+5 -5
+5 -3
fs/pipe.c
··· 963 963 res[1] = f; 964 964 stream_open(inode, res[0]); 965 965 stream_open(inode, res[1]); 966 + 967 + /* pipe groks IOCB_NOWAIT */ 968 + res[0]->f_mode |= FMODE_NOWAIT; 969 + res[1]->f_mode |= FMODE_NOWAIT; 970 + 966 971 /* 967 972 * Disable permission and pre-content events, but enable legacy 968 973 * inotify events for legacy users. ··· 1002 997 audit_fd_pair(fdr, fdw); 1003 998 fd[0] = fdr; 1004 999 fd[1] = fdw; 1005 - /* pipe groks IOCB_NOWAIT */ 1006 - files[0]->f_mode |= FMODE_NOWAIT; 1007 - files[1]->f_mode |= FMODE_NOWAIT; 1008 1000 return 0; 1009 1001 1010 1002 err_fdr:
-2
io_uring/openclose.c
··· 416 416 ret = create_pipe_files(files, p->flags); 417 417 if (ret) 418 418 return ret; 419 - files[0]->f_mode |= FMODE_NOWAIT; 420 - files[1]->f_mode |= FMODE_NOWAIT; 421 419 422 420 if (!!p->file_slot) 423 421 ret = io_pipe_fixed(req, files, issue_flags);