From 01b2d93ca4c495f056471189ac6c4e6ac4cbbccb Mon Sep 17 00:00:00 2001 From: Vadim Lobanov Date: Fri, 22 Dec 2006 01:10:43 -0800 Subject: [PATCH] fdtable: Provide free_fdtable() wrapper Christoph Hellwig has expressed concerns that the recent fdtable changes expose the details of the RCU methodology used to release no-longer-used fdtable structures to the rest of the kernel. The trivial patch below addresses these concerns by introducing the appropriate free_fdtable() calls, which simply wrap the release RCU usage. Since free_fdtable() is a one-liner, it makes sense to promote it to an inline helper. Signed-off-by: Vadim Lobanov Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/file.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux/file.h') 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); 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; -- cgit v1.2.3-59-g8ed1b