• Jens Axboe's avatar
    userfaultfd: convert to ->read_iter() · 40f45fe8
    Jens Axboe authored
    Rather than use the older style ->read() hook, use ->read_iter() so that
    userfaultfd can support both O_NONBLOCK and IOCB_NOWAIT for non-blocking
    read attempts.
    
    Split the fd setup into two parts, so that userfaultfd can mark the file
    mode with FMODE_NOWAIT before installing it into the process table. With
    that, we can also defer grabbing the mm until we know the rest will
    succeed, as the fd isn't visible before then.
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    40f45fe8
userfaultfd.c 58.9 KB