Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44903
b: refs/heads/master
c: 01b2d93
h: refs/heads/master
i:
  44901: 82ed65f
  44899: 70e3789
  44895: 5096344
v: v3
  • Loading branch information
Vadim Lobanov authored and Linus Torvalds committed Dec 22, 2006
1 parent bf08854 commit 734aa9e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31fccf7fe4097e62f038bdfe8f4f68ecaea8ebe7
refs/heads/master: 01b2d93ca4c495f056471189ac6c4e6ac4cbbccb
2 changes: 1 addition & 1 deletion trunk/fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,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)
call_rcu(&cur_fdt->rcu, free_fdtable_rcu);
free_fdtable(cur_fdt);
} else {
/* Somebody else expanded, so undo our attempt */
free_fdarr(new_fdt);
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ extern int expand_files(struct files_struct *, int nr);
extern void free_fdtable_rcu(struct rcu_head *rcu);
extern void __init files_defer_init(void);

static inline void free_fdtable(struct fdtable *fdt)
{
call_rcu(&fdt->rcu, free_fdtable_rcu);
}

static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
{
struct file * file = NULL;
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ void fastcall put_files_struct(struct files_struct *files)
fdt = files_fdtable(files);
if (fdt != &files->fdtab)
kmem_cache_free(files_cachep, files);
call_rcu(&fdt->rcu, free_fdtable_rcu);
free_fdtable(fdt);
}
}

Expand Down

0 comments on commit 734aa9e

Please sign in to comment.