aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/file.c2
-rw-r--r--include/linux/file.h5
-rw-r--r--kernel/exit.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/fs/file.c b/fs/file.c
index 857fa49e984c..c5575de01113 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -206,7 +206,7 @@ static int expand_fdtable(struct files_struct *files, int nr)
206 copy_fdtable(new_fdt, cur_fdt); 206 copy_fdtable(new_fdt, cur_fdt);
207 rcu_assign_pointer(files->fdt, new_fdt); 207 rcu_assign_pointer(files->fdt, new_fdt);
208 if (cur_fdt->max_fds > NR_OPEN_DEFAULT) 208 if (cur_fdt->max_fds > NR_OPEN_DEFAULT)
209 call_rcu(&cur_fdt->rcu, free_fdtable_rcu); 209 free_fdtable(cur_fdt);
210 } else { 210 } else {
211 /* Somebody else expanded, so undo our attempt */ 211 /* Somebody else expanded, so undo our attempt */
212 free_fdarr(new_fdt); 212 free_fdarr(new_fdt);
diff --git a/include/linux/file.h b/include/linux/file.h
index edca361f2ab4..a59001e9ea58 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -80,6 +80,11 @@ extern int expand_files(struct files_struct *, int nr);
80extern void free_fdtable_rcu(struct rcu_head *rcu); 80extern void free_fdtable_rcu(struct rcu_head *rcu);
81extern void __init files_defer_init(void); 81extern void __init files_defer_init(void);
82 82
83static inline void free_fdtable(struct fdtable *fdt)
84{
85 call_rcu(&fdt->rcu, free_fdtable_rcu);
86}
87
83static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) 88static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
84{ 89{
85 struct file * file = NULL; 90 struct file * file = NULL;
diff --git a/kernel/exit.c b/kernel/exit.c
index 122fadb972fc..85917c2bf065 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -468,7 +468,7 @@ void fastcall put_files_struct(struct files_struct *files)
468 fdt = files_fdtable(files); 468 fdt = files_fdtable(files);
469 if (fdt != &files->fdtab) 469 if (fdt != &files->fdtab)
470 kmem_cache_free(files_cachep, files); 470 kmem_cache_free(files_cachep, files);
471 call_rcu(&fdt->rcu, free_fdtable_rcu); 471 free_fdtable(fdt);
472 } 472 }
473} 473}
474 474