diff options
author | Vadim Lobanov <vlobanov@speakeasy.net> | 2006-12-10 05:21:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-10 12:57:22 -0500 |
commit | 4fd45812cbe875a620c86a096a5d46c742694b7e (patch) | |
tree | 8d2c99caa718da6cda87229076adf708494ff251 /include/linux/file.h | |
parent | bbea9f69668a3d0cf9feba15a724cd02896f8675 (diff) |
[PATCH] fdtable: Remove the free_files field
An fdtable can either be embedded inside a files_struct or standalone (after
being expanded). When an fdtable is being discarded after all RCU references
to it have expired, we must either free it directly, in the standalone case,
or free the files_struct it is contained within, in the embedded case.
Currently the free_files field controls this behavior, but we can get rid of
it entirely, as all the necessary information is already recorded. We can
distinguish embedded and standalone fdtables using max_fds, and if it is
embedded we can divine the relevant files_struct using container_of().
Signed-off-by: Vadim Lobanov <vlobanov@speakeasy.net>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/file.h')
-rw-r--r-- | include/linux/file.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/file.h b/include/linux/file.h index 02be4012225b..319118f275b0 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -32,7 +32,6 @@ struct fdtable { | |||
32 | fd_set *close_on_exec; | 32 | fd_set *close_on_exec; |
33 | fd_set *open_fds; | 33 | fd_set *open_fds; |
34 | struct rcu_head rcu; | 34 | struct rcu_head rcu; |
35 | struct files_struct *free_files; | ||
36 | struct fdtable *next; | 35 | struct fdtable *next; |
37 | }; | 36 | }; |
38 | 37 | ||
@@ -84,7 +83,7 @@ extern fd_set *alloc_fdset(int); | |||
84 | extern void free_fdset(fd_set *, int); | 83 | extern void free_fdset(fd_set *, int); |
85 | 84 | ||
86 | extern int expand_files(struct files_struct *, int nr); | 85 | extern int expand_files(struct files_struct *, int nr); |
87 | extern void free_fdtable(struct fdtable *fdt); | 86 | extern void free_fdtable_rcu(struct rcu_head *rcu); |
88 | extern void __init files_defer_init(void); | 87 | extern void __init files_defer_init(void); |
89 | 88 | ||
90 | static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) | 89 | static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) |