diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-15 20:06:36 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 21:08:54 -0400 |
commit | 1983e781da2f7f77906f4ccc2c3dc279cd61d1ff (patch) | |
tree | abc4f323de02eba64f82ff9bc5706f93e25c33c1 /fs/file.c | |
parent | b9e02af0ae0783894abb576fbab45ec29aa8e7fc (diff) |
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.c | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -90,16 +90,8 @@ static void free_fdtable_rcu(struct rcu_head *rcu) | |||
90 | struct fdtable_defer *fddef; | 90 | struct fdtable_defer *fddef; |
91 | 91 | ||
92 | BUG_ON(!fdt); | 92 | BUG_ON(!fdt); |
93 | BUG_ON(fdt->max_fds <= NR_OPEN_DEFAULT); | ||
93 | 94 | ||
94 | if (fdt->max_fds <= NR_OPEN_DEFAULT) { | ||
95 | /* | ||
96 | * This fdtable is embedded in the files structure and that | ||
97 | * structure itself is getting destroyed. | ||
98 | */ | ||
99 | kmem_cache_free(files_cachep, | ||
100 | container_of(fdt, struct files_struct, fdtab)); | ||
101 | return; | ||
102 | } | ||
103 | if (!is_vmalloc_addr(fdt->fd) && !is_vmalloc_addr(fdt->open_fds)) { | 95 | if (!is_vmalloc_addr(fdt->fd) && !is_vmalloc_addr(fdt->open_fds)) { |
104 | kfree(fdt->fd); | 96 | kfree(fdt->fd); |
105 | kfree(fdt->open_fds); | 97 | kfree(fdt->open_fds); |
@@ -116,11 +108,6 @@ static void free_fdtable_rcu(struct rcu_head *rcu) | |||
116 | } | 108 | } |
117 | } | 109 | } |
118 | 110 | ||
119 | static inline void free_fdtable(struct fdtable *fdt) | ||
120 | { | ||
121 | call_rcu(&fdt->rcu, free_fdtable_rcu); | ||
122 | } | ||
123 | |||
124 | /* | 111 | /* |
125 | * Expand the fdset in the files_struct. Called with the files spinlock | 112 | * Expand the fdset in the files_struct. Called with the files spinlock |
126 | * held for write. | 113 | * held for write. |
@@ -234,7 +221,7 @@ static int expand_fdtable(struct files_struct *files, int nr) | |||
234 | copy_fdtable(new_fdt, cur_fdt); | 221 | copy_fdtable(new_fdt, cur_fdt); |
235 | rcu_assign_pointer(files->fdt, new_fdt); | 222 | rcu_assign_pointer(files->fdt, new_fdt); |
236 | if (cur_fdt->max_fds > NR_OPEN_DEFAULT) | 223 | if (cur_fdt->max_fds > NR_OPEN_DEFAULT) |
237 | free_fdtable(cur_fdt); | 224 | call_rcu(&cur_fdt->rcu, free_fdtable_rcu); |
238 | } else { | 225 | } else { |
239 | /* Somebody else expanded, so undo our attempt */ | 226 | /* Somebody else expanded, so undo our attempt */ |
240 | __free_fdtable(new_fdt); | 227 | __free_fdtable(new_fdt); |