• O
    change close_files() to use rcu_dereference_raw(files->fdt) · ce08b62d
    Oleg Nesterov 提交于
    put_files_struct() and close_files() do rcu_read_lock() to make
    rcu_dereference_check_fdtable() happy.
    
    This looks a bit ugly, files_fdtable() just reads the pointer,
    we can simply use rcu_dereference_raw() to avoid the warning.
    
    The patch also changes close_files() to return fdt, this avoids
    another rcu_read_lock()/files_fdtable() in put_files_struct().
    
    I think close_files() needs more cleanups:
    
    	- we do not need xchg() exactly because we are the last
    	  user of this files_struct
    
    	- "if (file)" should be turned into WARN_ON(!file)
    Signed-off-by: NOleg Nesterov <oleg@redhat.com>
    Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
    ce08b62d
file.c 21.8 KB