diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-15 20:00:58 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 21:08:54 -0400 |
commit | b9e02af0ae0783894abb576fbab45ec29aa8e7fc (patch) | |
tree | 42e01d147784f8e8ae327c1dd4fb405d587cc4aa /fs/file.c | |
parent | 7cf4dc3c8dbfdfde163d4636f621cf99a1f63bfb (diff) |
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>
Diffstat (limited to 'fs/file.c')
-rw-r--r-- | fs/file.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -447,18 +447,14 @@ void put_files_struct(struct files_struct *files) | |||
447 | 447 | ||
448 | if (atomic_dec_and_test(&files->count)) { | 448 | if (atomic_dec_and_test(&files->count)) { |
449 | close_files(files); | 449 | close_files(files); |
450 | /* | 450 | /* not really needed, since nobody can see us */ |
451 | * Free the fd and fdset arrays if we expanded them. | ||
452 | * If the fdtable was embedded, pass files for freeing | ||
453 | * at the end of the RCU grace period. Otherwise, | ||
454 | * you can free files immediately. | ||
455 | */ | ||
456 | rcu_read_lock(); | 451 | rcu_read_lock(); |
457 | fdt = files_fdtable(files); | 452 | fdt = files_fdtable(files); |
458 | if (fdt != &files->fdtab) | ||
459 | kmem_cache_free(files_cachep, files); | ||
460 | free_fdtable(fdt); | ||
461 | rcu_read_unlock(); | 453 | rcu_read_unlock(); |
454 | /* free the arrays if they are not embedded */ | ||
455 | if (fdt != &files->fdtab) | ||
456 | __free_fdtable(fdt); | ||
457 | kmem_cache_free(files_cachep, files); | ||
462 | } | 458 | } |
463 | } | 459 | } |
464 | 460 | ||