summaryrefslogtreecommitdiff
path: root/fs/file.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-08-15 20:06:36 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-26 21:08:54 -0400
commit1983e781da2f7f77906f4ccc2c3dc279cd61d1ff (patch)
treeabc4f323de02eba64f82ff9bc5706f93e25c33c1 /fs/file.c
parentb9e02af0ae0783894abb576fbab45ec29aa8e7fc (diff)
downloadlwn-1983e781da2f7f77906f4ccc2c3dc279cd61d1ff.tar.gz
lwn-1983e781da2f7f77906f4ccc2c3dc279cd61d1ff.zip
trim free_fdtable_rcu()
embedded case isn't hit anymore Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/file.c')
-rw-r--r--fs/file.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/file.c b/fs/file.c
index 533fa5d56a5f..4ce4a0fcf320 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -90,16 +90,8 @@ static void free_fdtable_rcu(struct rcu_head *rcu)
struct fdtable_defer *fddef;
BUG_ON(!fdt);
+ BUG_ON(fdt->max_fds <= NR_OPEN_DEFAULT);
- if (fdt->max_fds <= NR_OPEN_DEFAULT) {
- /*
- * This fdtable is embedded in the files structure and that
- * structure itself is getting destroyed.
- */
- kmem_cache_free(files_cachep,
- container_of(fdt, struct files_struct, fdtab));
- return;
- }
if (!is_vmalloc_addr(fdt->fd) && !is_vmalloc_addr(fdt->open_fds)) {
kfree(fdt->fd);
kfree(fdt->open_fds);
@@ -116,11 +108,6 @@ static void free_fdtable_rcu(struct rcu_head *rcu)
}
}
-static inline void free_fdtable(struct fdtable *fdt)
-{
- call_rcu(&fdt->rcu, free_fdtable_rcu);
-}
-
/*
* Expand the fdset in the files_struct. Called with the files spinlock
* held for write.
@@ -234,7 +221,7 @@ static int expand_fdtable(struct files_struct *files, int nr)
copy_fdtable(new_fdt, cur_fdt);
rcu_assign_pointer(files->fdt, new_fdt);
if (cur_fdt->max_fds > NR_OPEN_DEFAULT)
- free_fdtable(cur_fdt);
+ call_rcu(&cur_fdt->rcu, free_fdtable_rcu);
} else {
/* Somebody else expanded, so undo our attempt */
__free_fdtable(new_fdt);