mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
[PATCH] files: break up files struct
In order for the RCU to work, the file table array, sets and their sizes must be updated atomically. Instead of ensuring this through too many memory barriers, we put the arrays and their sizes in a separate structure. This patch takes the first step of putting the file table elements in a separate structure fdtable that is embedded withing files_struct. It also changes all the users to refer to the file table using files_fdtable() macro. Subsequent applciation of RCU becomes easier after this. Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com> Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
c0dfb29051
commit
badf16621c
17 changed files with 211 additions and 124 deletions
|
@ -3,16 +3,21 @@
|
|||
|
||||
#include <linux/file.h>
|
||||
|
||||
#define INIT_FILES \
|
||||
{ \
|
||||
.count = ATOMIC_INIT(1), \
|
||||
.file_lock = SPIN_LOCK_UNLOCKED, \
|
||||
#define INIT_FDTABLE \
|
||||
{ \
|
||||
.max_fds = NR_OPEN_DEFAULT, \
|
||||
.max_fdset = __FD_SETSIZE, \
|
||||
.next_fd = 0, \
|
||||
.fd = &init_files.fd_array[0], \
|
||||
.close_on_exec = &init_files.close_on_exec_init, \
|
||||
.open_fds = &init_files.open_fds_init, \
|
||||
}
|
||||
|
||||
#define INIT_FILES \
|
||||
{ \
|
||||
.count = ATOMIC_INIT(1), \
|
||||
.file_lock = SPIN_LOCK_UNLOCKED, \
|
||||
.fdtab = INIT_FDTABLE, \
|
||||
.close_on_exec_init = { { 0, } }, \
|
||||
.open_fds_init = { { 0, } }, \
|
||||
.fd_array = { NULL, } \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue