X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Ffile.h;h=a59001e9ea58bb2cd91c999d6b0f9dba6ac06f7e;hb=ac98695d6c1508b724f246f38ce57fb4e3cec356;hp=9f7c2513866f4d1a857398711f09864239b7162c;hpb=55d8ca4f8094246da6e71889a4e04bfafaa78b10;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/file.h b/include/linux/file.h index 9f7c2513866..a59001e9ea5 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -26,19 +26,12 @@ struct embedded_fd_set { unsigned long fds_bits[1]; }; -/* - * More than this number of fds: we use a separately allocated fd_set - */ -#define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set)) - struct fdtable { unsigned int max_fds; - int max_fdset; struct file ** fd; /* current fd array */ fd_set *close_on_exec; fd_set *open_fds; struct rcu_head rcu; - struct files_struct *free_files; struct fdtable *next; }; @@ -64,6 +57,8 @@ struct files_struct { #define files_fdtable(files) (rcu_dereference((files)->fdt)) +extern struct kmem_cache *filp_cachep; + extern void FASTCALL(__fput(struct file *)); extern void FASTCALL(fput(struct file *)); @@ -81,16 +76,15 @@ extern int get_unused_fd(void); extern void FASTCALL(put_unused_fd(unsigned int fd)); struct kmem_cache; -extern struct file ** alloc_fd_array(int); -extern void free_fd_array(struct file **, int); - -extern fd_set *alloc_fdset(int); -extern void free_fdset(fd_set *, int); - extern int expand_files(struct files_struct *, int nr); -extern void free_fdtable(struct fdtable *fdt); +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; @@ -112,5 +106,8 @@ struct task_struct; struct files_struct *get_files_struct(struct task_struct *); void FASTCALL(put_files_struct(struct files_struct *fs)); +void reset_files_struct(struct task_struct *, struct files_struct *); + +extern struct kmem_cache *files_cachep; #endif /* __LINUX_FILE_H */