mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
don't bother with call_rcu() in put_files_struct()
At that point nobody can see us anyway; everything that looks at files_fdtable(files) is separated from the guts of put_files_struct(files) - either since files is current->files or because we fetched it under task_lock() and hadn't dropped that yet, or because we'd bumped files->count while holding task_lock()... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
7cf4dc3c8d
commit
b9e02af0ae
1 changed files with 5 additions and 9 deletions
14
fs/file.c
14
fs/file.c
|
@ -447,18 +447,14 @@ void put_files_struct(struct files_struct *files)
|
|||
|
||||
if (atomic_dec_and_test(&files->count)) {
|
||||
close_files(files);
|
||||
/*
|
||||
* Free the fd and fdset arrays if we expanded them.
|
||||
* If the fdtable was embedded, pass files for freeing
|
||||
* at the end of the RCU grace period. Otherwise,
|
||||
* you can free files immediately.
|
||||
*/
|
||||
/* not really needed, since nobody can see us */
|
||||
rcu_read_lock();
|
||||
fdt = files_fdtable(files);
|
||||
if (fdt != &files->fdtab)
|
||||
kmem_cache_free(files_cachep, files);
|
||||
free_fdtable(fdt);
|
||||
rcu_read_unlock();
|
||||
/* free the arrays if they are not embedded */
|
||||
if (fdt != &files->fdtab)
|
||||
__free_fdtable(fdt);
|
||||
kmem_cache_free(files_cachep, files);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue