• Prasanna Meda's avatar
    [PATCH] file_table:expand_files() code cleanup · 46c4ad2c
    Prasanna Meda authored
    expand_files() cleanup: Make expand_files() common code for
    fork.c:fork/copy_files(), open.c:open/get_unused_fd() and
    fcntl.c:dup/locate_fd().
    
    expand_files() does both expand_fd_array and expand_fd_set based on the
    need.  This is used in dup().  open() and fork() duplicates the work of
    expand files.  At all places we check for expanding fd array, we also check
    for expanding fdset.  There is no need of checking and calling them
    seperately.
    
    This change also moves the expand_files to file.c from fcntl.c, and makes
    the expand_fd_array and expand_fd_set local to that file.
    Signed-off-by: default avatarPrasanna Meda <pmeda@akamai.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    46c4ad2c
open.c 23.1 KB