]> err.no Git - linux-2.6/commit
[PATCH] fdtable: Remove the free_files field
authorVadim Lobanov <vlobanov@speakeasy.net>
Sun, 10 Dec 2006 10:21:17 +0000 (02:21 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Sun, 10 Dec 2006 17:57:22 +0000 (09:57 -0800)
commit4fd45812cbe875a620c86a096a5d46c742694b7e
tree8d2c99caa718da6cda87229076adf708494ff251
parentbbea9f69668a3d0cf9feba15a724cd02896f8675
[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>
fs/file.c
include/linux/file.h
include/linux/init_task.h
kernel/exit.c
kernel/fork.c