• Kirill Tkhai's avatar
    files: Kill struct file_desc_ops::post_open · a14eedc2
    Kirill Tkhai authored
    This make open fds asynchronous. Now we restore them in a poll-style.
    Every ->open callback operates like a poll. It returns 1, i.e. "call me again",
    if some events have not received yet, or 0, if restoring of a fle
    has finished.
    
    We iterate over list of file descriptors and look at its return value.
    If there were not progress in restoring of a fle, we sleep on task_st
    futex. As all events are sent together with changing task_st, we will
    be woken up, when there is a some new work for us.
    
    v6: Add a comment about open method return values
    
    v5: Clear FDS_EVENT every beginning of cycle.
        Use 0, -1 and 1 for successful return error and "again" request.
    
    v4: unix: 1)standalone sockets return ORV_AGAIN after first open
                to reopen fd by generic code
              2)do not call post_open_unix_sk() for !standalone sockets
        inet, epoll: return ORV_AGAIN after first open to reopen fd by generic code
        autofs: iterate used list instead of fds list
    Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    a14eedc2
sk-inet.c 18 KB